@micjanic/recursive-grid 1.0.4 → 1.0.6

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.
@@ -1,4 +1,4 @@
1
- (function(xa,Ri){typeof exports=="object"&&typeof module<"u"?module.exports=Ri():typeof define=="function"&&define.amd?define(Ri):(xa=typeof globalThis<"u"?globalThis:xa||self,xa["@micjanic/recursive-grid"]=Ri())})(this,(function(){"use strict";var m5=Object.defineProperty;var y5=(xa,Ri,hr)=>Ri in xa?m5(xa,Ri,{enumerable:!0,configurable:!0,writable:!0,value:hr}):xa[Ri]=hr;var tu=(xa,Ri,hr)=>y5(xa,typeof Ri!="symbol"?Ri+"":Ri,hr);var MC,DC;function xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ri={exports:{}},hr={};/**
1
+ (function(_,I){typeof exports=="object"&&typeof module<"u"?module.exports=I(require("react"),require("@pixi/react"),require("pixi.js"),require("react-dom")):typeof define=="function"&&define.amd?define(["react","@pixi/react","pixi.js","react-dom"],I):(_=typeof globalThis<"u"?globalThis:_||self,_["@micjanic/recursive-grid"]=I(_.React,_.PIXIReact,_.PIXI,_.ReactDOM))})(this,(function(_,I,V,Qr){"use strict";var xs=Object.defineProperty;var As=(_,I,V)=>I in _?xs(_,I,{enumerable:!0,configurable:!0,writable:!0,value:V}):_[I]=V;var ee=(_,I,V)=>As(_,typeof I!="symbol"?I+"":I,V);function Yr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Tt=Yr(_);var Ie={exports:{}},de={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,35 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var rx;function mA(){if(rx)return hr;rx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(a,r,u){var h=null;if(u!==void 0&&(h=""+u),r.key!==void 0&&(h=""+r.key),"key"in r){u={};for(var f in r)f!=="key"&&(u[f]=r[f])}else u=r;return r=u.ref,{$$typeof:n,type:a,key:h,ref:r!==void 0?r:null,props:u}}return hr.Fragment=e,hr.jsx=t,hr.jsxs=t,hr}var kf={},Qm={exports:{}},$e={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var lx;function yA(){if(lx)return $e;lx=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),T=Symbol.iterator;function E(O){return O===null||typeof O!="object"?null:(O=T&&O[T]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},U=Object.assign,M={};function G(O,k,_e){this.props=O,this.context=k,this.refs=M,this.updater=_e||A}G.prototype.isReactComponent={},G.prototype.setState=function(O,k){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,k,"setState")},G.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function P(){}P.prototype=G.prototype;function w(O,k,_e){this.props=O,this.context=k,this.refs=M,this.updater=_e||A}var z=w.prototype=new P;z.constructor=w,U(z,G.prototype),z.isPureReactComponent=!0;var ne=Array.isArray;function ie(){}var Z={H:null,A:null,T:null,S:null},Te=Object.prototype.hasOwnProperty;function me(O,k,_e){var ye=_e.ref;return{$$typeof:n,type:O,key:k,ref:ye!==void 0?ye:null,props:_e}}function fe(O,k){return me(O.type,k,O.props)}function le(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function Ce(O){var k={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(_e){return k[_e]})}var ae=/\/+/g;function je(O,k){return typeof O=="object"&&O!==null&&O.key!=null?Ce(""+O.key):k.toString(36)}function Rt(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(ie,ie):(O.status="pending",O.then(function(k){O.status==="pending"&&(O.status="fulfilled",O.value=k)},function(k){O.status==="pending"&&(O.status="rejected",O.reason=k)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function V(O,k,_e,ye,Ue){var Xe=typeof O;(Xe==="undefined"||Xe==="boolean")&&(O=null);var Be=!1;if(O===null)Be=!0;else switch(Xe){case"bigint":case"string":case"number":Be=!0;break;case"object":switch(O.$$typeof){case n:case e:Be=!0;break;case v:return Be=O._init,V(Be(O._payload),k,_e,ye,Ue)}}if(Be)return Ue=Ue(O),Be=ye===""?"."+je(O,0):ye,ne(Ue)?(_e="",Be!=null&&(_e=Be.replace(ae,"$&/")+"/"),V(Ue,k,_e,"",function(Rn){return Rn})):Ue!=null&&(le(Ue)&&(Ue=fe(Ue,_e+(Ue.key==null||O&&O.key===Ue.key?"":(""+Ue.key).replace(ae,"$&/")+"/")+Be)),k.push(Ue)),1;Be=0;var At=ye===""?".":ye+":";if(ne(O))for(var St=0;St<O.length;St++)ye=O[St],Xe=At+je(ye,St),Be+=V(ye,k,_e,Xe,Ue);else if(St=E(O),typeof St=="function")for(O=St.call(O),St=0;!(ye=O.next()).done;)ye=ye.value,Xe=At+je(ye,St++),Be+=V(ye,k,_e,Xe,Ue);else if(Xe==="object"){if(typeof O.then=="function")return V(Rt(O),k,_e,ye,Ue);throw k=String(O),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return Be}function W(O,k,_e){if(O==null)return O;var ye=[],Ue=0;return V(O,ye,"","",function(Xe){return k.call(_e,Xe,Ue++)}),ye}function de(O){if(O._status===-1){var k=O._result;k=k(),k.then(function(_e){(O._status===0||O._status===-1)&&(O._status=1,O._result=_e)},function(_e){(O._status===0||O._status===-1)&&(O._status=2,O._result=_e)}),O._status===-1&&(O._status=0,O._result=k)}if(O._status===1)return O._result.default;throw O._result}var oe=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},Re={map:W,forEach:function(O,k,_e){W(O,function(){k.apply(this,arguments)},_e)},count:function(O){var k=0;return W(O,function(){k++}),k},toArray:function(O){return W(O,function(k){return k})||[]},only:function(O){if(!le(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return $e.Activity=S,$e.Children=Re,$e.Component=G,$e.Fragment=t,$e.Profiler=r,$e.PureComponent=w,$e.StrictMode=a,$e.Suspense=m,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,$e.__COMPILER_RUNTIME={__proto__:null,c:function(O){return Z.H.useMemoCache(O)}},$e.cache=function(O){return function(){return O.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(O,k,_e){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ye=U({},O.props),Ue=O.key;if(k!=null)for(Xe in k.key!==void 0&&(Ue=""+k.key),k)!Te.call(k,Xe)||Xe==="key"||Xe==="__self"||Xe==="__source"||Xe==="ref"&&k.ref===void 0||(ye[Xe]=k[Xe]);var Xe=arguments.length-2;if(Xe===1)ye.children=_e;else if(1<Xe){for(var Be=Array(Xe),At=0;At<Xe;At++)Be[At]=arguments[At+2];ye.children=Be}return me(O.type,Ue,ye)},$e.createContext=function(O){return O={$$typeof:h,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:u,_context:O},O},$e.createElement=function(O,k,_e){var ye,Ue={},Xe=null;if(k!=null)for(ye in k.key!==void 0&&(Xe=""+k.key),k)Te.call(k,ye)&&ye!=="key"&&ye!=="__self"&&ye!=="__source"&&(Ue[ye]=k[ye]);var Be=arguments.length-2;if(Be===1)Ue.children=_e;else if(1<Be){for(var At=Array(Be),St=0;St<Be;St++)At[St]=arguments[St+2];Ue.children=At}if(O&&O.defaultProps)for(ye in Be=O.defaultProps,Be)Ue[ye]===void 0&&(Ue[ye]=Be[ye]);return me(O,Xe,Ue)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(O){return{$$typeof:f,render:O}},$e.isValidElement=le,$e.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:de}},$e.memo=function(O,k){return{$$typeof:y,type:O,compare:k===void 0?null:k}},$e.startTransition=function(O){var k=Z.T,_e={};Z.T=_e;try{var ye=O(),Ue=Z.S;Ue!==null&&Ue(_e,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&ye.then(ie,oe)}catch(Xe){oe(Xe)}finally{k!==null&&_e.types!==null&&(k.types=_e.types),Z.T=k}},$e.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},$e.use=function(O){return Z.H.use(O)},$e.useActionState=function(O,k,_e){return Z.H.useActionState(O,k,_e)},$e.useCallback=function(O,k){return Z.H.useCallback(O,k)},$e.useContext=function(O){return Z.H.useContext(O)},$e.useDebugValue=function(){},$e.useDeferredValue=function(O,k){return Z.H.useDeferredValue(O,k)},$e.useEffect=function(O,k){return Z.H.useEffect(O,k)},$e.useEffectEvent=function(O){return Z.H.useEffectEvent(O)},$e.useId=function(){return Z.H.useId()},$e.useImperativeHandle=function(O,k,_e){return Z.H.useImperativeHandle(O,k,_e)},$e.useInsertionEffect=function(O,k){return Z.H.useInsertionEffect(O,k)},$e.useLayoutEffect=function(O,k){return Z.H.useLayoutEffect(O,k)},$e.useMemo=function(O,k){return Z.H.useMemo(O,k)},$e.useOptimistic=function(O,k){return Z.H.useOptimistic(O,k)},$e.useReducer=function(O,k,_e){return Z.H.useReducer(O,k,_e)},$e.useRef=function(O){return Z.H.useRef(O)},$e.useState=function(O){return Z.H.useState(O)},$e.useSyncExternalStore=function(O,k,_e){return Z.H.useSyncExternalStore(O,k,_e)},$e.useTransition=function(){return Z.H.useTransition()},$e.version="19.2.0",$e}var If={exports:{}};/**
18
- * @license React
19
- * react.development.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */If.exports;var ox;function gA(){return ox||(ox=1,(function(n,e){process.env.NODE_ENV!=="production"&&(function(){function t(D,X){Object.defineProperty(u.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",X[0],X[1])}})}function a(D){return D===null||typeof D!="object"?null:(D=hn&&D[hn]||D["@@iterator"],typeof D=="function"?D:null)}function r(D,X){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var ce=D+"."+X;Jn[ce]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",X,D),Jn[ce]=!0)}function u(D,X,ce){this.props=D,this.context=X,this.refs=Za,this.updater=ce||$n}function h(){}function f(D,X,ce){this.props=D,this.context=X,this.refs=Za,this.updater=ce||$n}function m(){}function y(D){return""+D}function v(D){try{y(D);var X=!1}catch{X=!0}if(X){X=console;var ce=X.error,xe=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ce.call(X,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",xe),y(D)}}function S(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===fl?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case O:return"Fragment";case _e:return"Profiler";case k:return"StrictMode";case Be:return"Suspense";case At:return"SuspenseList";case Oi:return"Activity"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case Re:return"Portal";case Ue:return D.displayName||"Context";case ye:return(D._context.displayName||"Context")+".Consumer";case Xe:var X=D.render;return D=D.displayName,D||(D=X.displayName||X.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case St:return X=D.displayName||null,X!==null?X:S(D.type)||"Memo";case Rn:X=D._payload,D=D._init;try{return S(D(X))}catch{}}return null}function T(D){if(D===O)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===Rn)return"<...>";try{var X=S(D);return X?"<"+X+">":"<...>"}catch{return"<...>"}}function E(){var D=Ye.A;return D===null?null:D.getOwner()}function A(){return Error("react-stack-top-frame")}function U(D){if(yt.call(D,"key")){var X=Object.getOwnPropertyDescriptor(D,"key").get;if(X&&X.isReactWarning)return!1}return D.key!==void 0}function M(D,X){function ce(){so||(so=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",X))}ce.isReactWarning=!0,Object.defineProperty(D,"key",{get:ce,configurable:!0})}function G(){var D=S(this.type);return Wa[D]||(Wa[D]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),D=this.props.ref,D!==void 0?D:null}function P(D,X,ce,xe,Oe,Le){var qe=ce.ref;return D={$$typeof:oe,type:D,key:X,props:ce,_owner:xe},(qe!==void 0?qe:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:G}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Oe}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Le}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function w(D,X){return X=P(D.type,X,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(X._store.validated=D._store.validated),X}function z(D){ne(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===Rn&&(D._payload.status==="fulfilled"?ne(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function ne(D){return typeof D=="object"&&D!==null&&D.$$typeof===oe}function ie(D){var X={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ce){return X[ce]})}function Z(D,X){return typeof D=="object"&&D!==null&&D.key!=null?(v(D.key),ie(""+D.key)):X.toString(36)}function Te(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(m,m):(D.status="pending",D.then(function(X){D.status==="pending"&&(D.status="fulfilled",D.value=X)},function(X){D.status==="pending"&&(D.status="rejected",D.reason=X)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function me(D,X,ce,xe,Oe){var Le=typeof D;(Le==="undefined"||Le==="boolean")&&(D=null);var qe=!1;if(D===null)qe=!0;else switch(Le){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(D.$$typeof){case oe:case Re:qe=!0;break;case Rn:return qe=D._init,me(qe(D._payload),X,ce,xe,Oe)}}if(qe){qe=D,Oe=Oe(qe);var ft=xe===""?"."+Z(qe,0):xe;return yr(Oe)?(ce="",ft!=null&&(ce=ft.replace(yu,"$&/")+"/"),me(Oe,X,ce,"",function(An){return An})):Oe!=null&&(ne(Oe)&&(Oe.key!=null&&(qe&&qe.key===Oe.key||v(Oe.key)),ce=w(Oe,ce+(Oe.key==null||qe&&qe.key===Oe.key?"":(""+Oe.key).replace(yu,"$&/")+"/")+ft),xe!==""&&qe!=null&&ne(qe)&&qe.key==null&&qe._store&&!qe._store.validated&&(ce._store.validated=2),Oe=ce),X.push(Oe)),1}if(qe=0,ft=xe===""?".":xe+":",yr(D))for(var We=0;We<D.length;We++)xe=D[We],Le=ft+Z(xe,We),qe+=me(xe,X,ce,Le,Oe);else if(We=a(D),typeof We=="function")for(We===D.entries&&(gr||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),gr=!0),D=We.call(D),We=0;!(xe=D.next()).done;)xe=xe.value,Le=ft+Z(xe,We++),qe+=me(xe,X,ce,Le,Oe);else if(Le==="object"){if(typeof D.then=="function")return me(Te(D),X,ce,xe,Oe);throw X=String(D),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return qe}function fe(D,X,ce){if(D==null)return D;var xe=[],Oe=0;return me(D,xe,"","",function(Le){return X.call(ce,Le,Oe++)}),xe}function le(D){if(D._status===-1){var X=D._ioInfo;X!=null&&(X.start=X.end=performance.now()),X=D._result;var ce=X();if(ce.then(function(Oe){if(D._status===0||D._status===-1){D._status=1,D._result=Oe;var Le=D._ioInfo;Le!=null&&(Le.end=performance.now()),ce.status===void 0&&(ce.status="fulfilled",ce.value=Oe)}},function(Oe){if(D._status===0||D._status===-1){D._status=2,D._result=Oe;var Le=D._ioInfo;Le!=null&&(Le.end=performance.now()),ce.status===void 0&&(ce.status="rejected",ce.reason=Oe)}}),X=D._ioInfo,X!=null){X.value=ce;var xe=ce.displayName;typeof xe=="string"&&(X.name=xe)}D._status===-1&&(D._status=0,D._result=ce)}if(D._status===1)return X=D._result,X===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
26
-
27
- Your code should look like:
28
- const MyComponent = lazy(() => import('./MyComponent'))
29
-
30
- Did you accidentally put curly braces around the import?`,X),"default"in X||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
31
-
32
- Your code should look like:
33
- const MyComponent = lazy(() => import('./MyComponent'))`,X),X.default;throw D._result}function Ce(){var D=Ye.H;return D===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
34
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
35
- 2. You might be breaking the Rules of Hooks
36
- 3. You might have more than one copy of React in the same app
37
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),D}function ae(){Ye.asyncTransitions--}function je(D){if(Vs===null)try{var X=("require"+Math.random()).slice(0,7);Vs=(n&&n[X]).call(n,"timers").setImmediate}catch{Vs=function(xe){la===!1&&(la=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var Oe=new MessageChannel;Oe.port1.onmessage=xe,Oe.port2.postMessage(void 0)}}return Vs(D)}function Rt(D){return 1<D.length&&typeof AggregateError=="function"?new AggregateError(D):D[0]}function V(D,X){X!==fi-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),fi=X}function W(D,X,ce){var xe=Ye.actQueue;if(xe!==null)if(xe.length!==0)try{de(xe),je(function(){return W(D,X,ce)});return}catch(Oe){Ye.thrownErrors.push(Oe)}else Ye.actQueue=null;0<Ye.thrownErrors.length?(xe=Rt(Ye.thrownErrors),Ye.thrownErrors.length=0,ce(xe)):X(D)}function de(D){if(!pi){pi=!0;var X=0;try{for(;X<D.length;X++){var ce=D[X];do{Ye.didUsePromise=!1;var xe=ce(!1);if(xe!==null){if(Ye.didUsePromise){D[X]=ce,D.splice(0,X);return}ce=xe}else break}while(!0)}D.length=0}catch(Oe){D.splice(0,X+1),Ye.thrownErrors.push(Oe)}finally{pi=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var oe=Symbol.for("react.transitional.element"),Re=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),_e=Symbol.for("react.profiler"),ye=Symbol.for("react.consumer"),Ue=Symbol.for("react.context"),Xe=Symbol.for("react.forward_ref"),Be=Symbol.for("react.suspense"),At=Symbol.for("react.suspense_list"),St=Symbol.for("react.memo"),Rn=Symbol.for("react.lazy"),Oi=Symbol.for("react.activity"),hn=Symbol.iterator,Jn={},$n={isMounted:function(){return!1},enqueueForceUpdate:function(D){r(D,"forceUpdate")},enqueueReplaceState:function(D){r(D,"replaceState")},enqueueSetState:function(D){r(D,"setState")}},ei=Object.assign,Za={};Object.freeze(Za),u.prototype.isReactComponent={},u.prototype.setState=function(D,X){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,X,"setState")},u.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};var jt={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Ni in jt)jt.hasOwnProperty(Ni)&&t(Ni,jt[Ni]);h.prototype=u.prototype,jt=f.prototype=new h,jt.constructor=f,ei(jt,u.prototype),jt.isPureReactComponent=!0;var yr=Array.isArray,fl=Symbol.for("react.client.reference"),Ye={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},yt=Object.prototype.hasOwnProperty,Yc=console.createTask?console.createTask:function(){return null};jt={react_stack_bottom_frame:function(D){return D()}};var so,Hs,Wa={},Xc=jt.react_stack_bottom_frame.bind(jt,A)(),ro=Yc(T(A)),gr=!1,yu=/\/+/g,ti=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},la=!1,Vs=null,fi=0,di=!1,pi=!1,Xi=typeof queueMicrotask=="function"?function(D){queueMicrotask(function(){return queueMicrotask(D)})}:je;jt=Object.freeze({__proto__:null,c:function(D){return Ce().useMemoCache(D)}});var Ni={map:fe,forEach:function(D,X,ce){fe(D,function(){X.apply(this,arguments)},ce)},count:function(D){var X=0;return fe(D,function(){X++}),X},toArray:function(D){return fe(D,function(X){return X})||[]},only:function(D){if(!ne(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};e.Activity=Oi,e.Children=Ni,e.Component=u,e.Fragment=O,e.Profiler=_e,e.PureComponent=f,e.StrictMode=k,e.Suspense=Be,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ye,e.__COMPILER_RUNTIME=jt,e.act=function(D){var X=Ye.actQueue,ce=fi;fi++;var xe=Ye.actQueue=X!==null?X:[],Oe=!1;try{var Le=D()}catch(We){Ye.thrownErrors.push(We)}if(0<Ye.thrownErrors.length)throw V(X,ce),D=Rt(Ye.thrownErrors),Ye.thrownErrors.length=0,D;if(Le!==null&&typeof Le=="object"&&typeof Le.then=="function"){var qe=Le;return Xi(function(){Oe||di||(di=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(We,An){Oe=!0,qe.then(function(Gi){if(V(X,ce),ce===0){try{de(xe),je(function(){return W(Gi,We,An)})}catch(_r){Ye.thrownErrors.push(_r)}if(0<Ye.thrownErrors.length){var lo=Rt(Ye.thrownErrors);Ye.thrownErrors.length=0,An(lo)}}else We(Gi)},function(Gi){V(X,ce),0<Ye.thrownErrors.length&&(Gi=Rt(Ye.thrownErrors),Ye.thrownErrors.length=0),An(Gi)})}}}var ft=Le;if(V(X,ce),ce===0&&(de(xe),xe.length!==0&&Xi(function(){Oe||di||(di=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Ye.actQueue=null),0<Ye.thrownErrors.length)throw D=Rt(Ye.thrownErrors),Ye.thrownErrors.length=0,D;return{then:function(We,An){Oe=!0,ce===0?(Ye.actQueue=xe,je(function(){return W(ft,We,An)})):We(ft)}}},e.cache=function(D){return function(){return D.apply(null,arguments)}},e.cacheSignal=function(){return null},e.captureOwnerStack=function(){var D=Ye.getCurrentStack;return D===null?null:D()},e.cloneElement=function(D,X,ce){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var xe=ei({},D.props),Oe=D.key,Le=D._owner;if(X!=null){var qe;e:{if(yt.call(X,"ref")&&(qe=Object.getOwnPropertyDescriptor(X,"ref").get)&&qe.isReactWarning){qe=!1;break e}qe=X.ref!==void 0}qe&&(Le=E()),U(X)&&(v(X.key),Oe=""+X.key);for(ft in X)!yt.call(X,ft)||ft==="key"||ft==="__self"||ft==="__source"||ft==="ref"&&X.ref===void 0||(xe[ft]=X[ft])}var ft=arguments.length-2;if(ft===1)xe.children=ce;else if(1<ft){qe=Array(ft);for(var We=0;We<ft;We++)qe[We]=arguments[We+2];xe.children=qe}for(xe=P(D.type,Oe,xe,Le,D._debugStack,D._debugTask),Oe=2;Oe<arguments.length;Oe++)z(arguments[Oe]);return xe},e.createContext=function(D){return D={$$typeof:Ue,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:ye,_context:D},D._currentRenderer=null,D._currentRenderer2=null,D},e.createElement=function(D,X,ce){for(var xe=2;xe<arguments.length;xe++)z(arguments[xe]);xe={};var Oe=null;if(X!=null)for(We in Hs||!("__self"in X)||"key"in X||(Hs=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),U(X)&&(v(X.key),Oe=""+X.key),X)yt.call(X,We)&&We!=="key"&&We!=="__self"&&We!=="__source"&&(xe[We]=X[We]);var Le=arguments.length-2;if(Le===1)xe.children=ce;else if(1<Le){for(var qe=Array(Le),ft=0;ft<Le;ft++)qe[ft]=arguments[ft+2];Object.freeze&&Object.freeze(qe),xe.children=qe}if(D&&D.defaultProps)for(We in Le=D.defaultProps,Le)xe[We]===void 0&&(xe[We]=Le[We]);Oe&&M(xe,typeof D=="function"?D.displayName||D.name||"Unknown":D);var We=1e4>Ye.recentlyCreatedOwnerStacks++;return P(D,Oe,xe,E(),We?Error("react-stack-top-frame"):Xc,We?Yc(T(D)):ro)},e.createRef=function(){var D={current:null};return Object.seal(D),D},e.forwardRef=function(D){D!=null&&D.$$typeof===St?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof D!="function"?console.error("forwardRef requires a render function but was given %s.",D===null?"null":typeof D):D.length!==0&&D.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",D.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),D!=null&&D.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var X={$$typeof:Xe,render:D},ce;return Object.defineProperty(X,"displayName",{enumerable:!1,configurable:!0,get:function(){return ce},set:function(xe){ce=xe,D.name||D.displayName||(Object.defineProperty(D,"name",{value:xe}),D.displayName=xe)}}),X},e.isValidElement=ne,e.lazy=function(D){D={_status:-1,_result:D};var X={$$typeof:Rn,_payload:D,_init:le},ce={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return D._ioInfo=ce,X._debugInfo=[{awaited:ce}],X},e.memo=function(D,X){D==null&&console.error("memo: The first argument must be a component. Instead received: %s",D===null?"null":typeof D),X={$$typeof:St,type:D,compare:X===void 0?null:X};var ce;return Object.defineProperty(X,"displayName",{enumerable:!1,configurable:!0,get:function(){return ce},set:function(xe){ce=xe,D.name||D.displayName||(Object.defineProperty(D,"name",{value:xe}),D.displayName=xe)}}),X},e.startTransition=function(D){var X=Ye.T,ce={};ce._updatedFibers=new Set,Ye.T=ce;try{var xe=D(),Oe=Ye.S;Oe!==null&&Oe(ce,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&(Ye.asyncTransitions++,xe.then(ae,ae),xe.then(m,ti))}catch(Le){ti(Le)}finally{X===null&&ce._updatedFibers&&(D=ce._updatedFibers.size,ce._updatedFibers.clear(),10<D&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),X!==null&&ce.types!==null&&(X.types!==null&&X.types!==ce.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),X.types=ce.types),Ye.T=X}},e.unstable_useCacheRefresh=function(){return Ce().useCacheRefresh()},e.use=function(D){return Ce().use(D)},e.useActionState=function(D,X,ce){return Ce().useActionState(D,X,ce)},e.useCallback=function(D,X){return Ce().useCallback(D,X)},e.useContext=function(D){var X=Ce();return D.$$typeof===ye&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),X.useContext(D)},e.useDebugValue=function(D,X){return Ce().useDebugValue(D,X)},e.useDeferredValue=function(D,X){return Ce().useDeferredValue(D,X)},e.useEffect=function(D,X){return D==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Ce().useEffect(D,X)},e.useEffectEvent=function(D){return Ce().useEffectEvent(D)},e.useId=function(){return Ce().useId()},e.useImperativeHandle=function(D,X,ce){return Ce().useImperativeHandle(D,X,ce)},e.useInsertionEffect=function(D,X){return D==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Ce().useInsertionEffect(D,X)},e.useLayoutEffect=function(D,X){return D==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),Ce().useLayoutEffect(D,X)},e.useMemo=function(D,X){return Ce().useMemo(D,X)},e.useOptimistic=function(D,X){return Ce().useOptimistic(D,X)},e.useReducer=function(D,X,ce){return Ce().useReducer(D,X,ce)},e.useRef=function(D){return Ce().useRef(D)},e.useState=function(D){return Ce().useState(D)},e.useSyncExternalStore=function(D,X,ce){return Ce().useSyncExternalStore(D,X,ce)},e.useTransition=function(){return Ce().useTransition()},e.version="19.2.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(If,If.exports)),If.exports}var ux;function bc(){return ux||(ux=1,process.env.NODE_ENV==="production"?Qm.exports=yA():Qm.exports=gA()),Qm.exports}/**
9
+ */var kt;function Wr(){if(kt)return de;kt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:e,type:n,key:a,ref:s!==void 0?s:null,props:i}}return de.Fragment=t,de.jsx=r,de.jsxs=r,de}var fe={};/**
38
10
  * @license React
39
11
  * react-jsx-runtime.development.js
40
12
  *
@@ -42,1544 +14,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
42
14
  *
43
15
  * This source code is licensed under the MIT license found in the
44
16
  * LICENSE file in the root directory of this source tree.
45
- */var cx;function _A(){return cx||(cx=1,process.env.NODE_ENV!=="production"&&(function(){function n(O){if(O==null)return null;if(typeof O=="function")return O.$$typeof===le?null:O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case M:return"Fragment";case P:return"Profiler";case G:return"StrictMode";case ie:return"Suspense";case Z:return"SuspenseList";case fe:return"Activity"}if(typeof O=="object")switch(typeof O.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),O.$$typeof){case U:return"Portal";case z:return O.displayName||"Context";case w:return(O._context.displayName||"Context")+".Consumer";case ne:var k=O.render;return O=O.displayName,O||(O=k.displayName||k.name||"",O=O!==""?"ForwardRef("+O+")":"ForwardRef"),O;case Te:return k=O.displayName||null,k!==null?k:n(O.type)||"Memo";case me:k=O._payload,O=O._init;try{return n(O(k))}catch{}}return null}function e(O){return""+O}function t(O){try{e(O);var k=!1}catch{k=!0}if(k){k=console;var _e=k.error,ye=typeof Symbol=="function"&&Symbol.toStringTag&&O[Symbol.toStringTag]||O.constructor.name||"Object";return _e.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ye),e(O)}}function a(O){if(O===M)return"<>";if(typeof O=="object"&&O!==null&&O.$$typeof===me)return"<...>";try{var k=n(O);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function r(){var O=Ce.A;return O===null?null:O.getOwner()}function u(){return Error("react-stack-top-frame")}function h(O){if(ae.call(O,"key")){var k=Object.getOwnPropertyDescriptor(O,"key").get;if(k&&k.isReactWarning)return!1}return O.key!==void 0}function f(O,k){function _e(){V||(V=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}_e.isReactWarning=!0,Object.defineProperty(O,"key",{get:_e,configurable:!0})}function m(){var O=n(this.type);return W[O]||(W[O]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),O=this.props.ref,O!==void 0?O:null}function y(O,k,_e,ye,Ue,Xe){var Be=_e.ref;return O={$$typeof:A,type:O,key:k,props:_e,_owner:ye},(Be!==void 0?Be:null)!==null?Object.defineProperty(O,"ref",{enumerable:!1,get:m}):Object.defineProperty(O,"ref",{enumerable:!1,value:null}),O._store={},Object.defineProperty(O._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(O,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(O,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.defineProperty(O,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Xe}),Object.freeze&&(Object.freeze(O.props),Object.freeze(O)),O}function v(O,k,_e,ye,Ue,Xe){var Be=k.children;if(Be!==void 0)if(ye)if(je(Be)){for(ye=0;ye<Be.length;ye++)S(Be[ye]);Object.freeze&&Object.freeze(Be)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(Be);if(ae.call(k,"key")){Be=n(O);var At=Object.keys(k).filter(function(Rn){return Rn!=="key"});ye=0<At.length?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}",Re[Be+ye]||(At=0<At.length?"{"+At.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ct;function Br(){return Ct||(Ct=1,process.env.NODE_ENV!=="production"&&(function(){function e(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===$?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case P:return"Profiler";case g:return"StrictMode";case B:return"Suspense";case F:return"SuspenseList";case ne:return"Activity"}if(typeof o=="object")switch(typeof o.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),o.$$typeof){case v:return"Portal";case R:return o.displayName||"Context";case y:return(o._context.displayName||"Context")+".Consumer";case E:var x=o.render;return o=o.displayName,o||(o=x.displayName||x.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case le:return x=o.displayName||null,x!==null?x:e(o.type)||"Memo";case O:x=o._payload,o=o._init;try{return e(o(x))}catch{}}return null}function t(o){return""+o}function r(o){try{t(o);var x=!1}catch{x=!0}if(x){x=console;var T=x.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&o[Symbol.toStringTag]||o.constructor.name||"Object";return T.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),t(o)}}function n(o){if(o===S)return"<>";if(typeof o=="object"&&o!==null&&o.$$typeof===O)return"<...>";try{var x=e(o);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var o=Y.A;return o===null?null:o.getOwner()}function i(){return Error("react-stack-top-frame")}function a(o){if(H.call(o,"key")){var x=Object.getOwnPropertyDescriptor(o,"key").get;if(x&&x.isReactWarning)return!1}return o.key!==void 0}function u(o,x){function T(){$r||($r=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}T.isReactWarning=!0,Object.defineProperty(o,"key",{get:T,configurable:!0})}function d(){var o=e(this.type);return Dr[o]||(Dr[o]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),o=this.props.ref,o!==void 0?o:null}function l(o,x,T,k,We,Rt){var C=T.ref;return o={$$typeof:b,type:o,key:x,props:T,_owner:k},(C!==void 0?C:null)!==null?Object.defineProperty(o,"ref",{enumerable:!1,get:d}):Object.defineProperty(o,"ref",{enumerable:!1,value:null}),o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(o,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(o,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:We}),Object.defineProperty(o,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Rt}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o}function m(o,x,T,k,We,Rt){var C=x.children;if(C!==void 0)if(k)if(xt(C)){for(k=0;k<C.length;k++)f(C[k]);Object.freeze&&Object.freeze(C)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(C);if(H.call(x,"key")){C=e(o);var ce=Object.keys(x).filter(function(Ps){return Ps!=="key"});k=0<ce.length?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}",Mr[C+k]||(ce=0<ce.length?"{"+ce.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
46
18
  let props = %s;
47
19
  <%s {...props} />
48
20
  React keys must be passed directly to JSX without using spread:
49
21
  let props = %s;
50
- <%s key={someKey} {...props} />`,ye,Be,At,Be),Re[Be+ye]=!0)}if(Be=null,_e!==void 0&&(t(_e),Be=""+_e),h(k)&&(t(k.key),Be=""+k.key),"key"in k){_e={};for(var St in k)St!=="key"&&(_e[St]=k[St])}else _e=k;return Be&&f(_e,typeof O=="function"?O.displayName||O.name||"Unknown":O),y(O,Be,_e,r(),Ue,Xe)}function S(O){T(O)?O._store&&(O._store.validated=1):typeof O=="object"&&O!==null&&O.$$typeof===me&&(O._payload.status==="fulfilled"?T(O._payload.value)&&O._payload.value._store&&(O._payload.value._store.validated=1):O._store&&(O._store.validated=1))}function T(O){return typeof O=="object"&&O!==null&&O.$$typeof===A}var E=bc(),A=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),z=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),me=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),le=Symbol.for("react.client.reference"),Ce=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,je=Array.isArray,Rt=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(O){return O()}};var V,W={},de=E.react_stack_bottom_frame.bind(E,u)(),oe=Rt(a(u)),Re={};kf.Fragment=M,kf.jsx=function(O,k,_e){var ye=1e4>Ce.recentlyCreatedOwnerStacks++;return v(O,k,_e,!1,ye?Error("react-stack-top-frame"):de,ye?Rt(a(O)):oe)},kf.jsxs=function(O,k,_e){var ye=1e4>Ce.recentlyCreatedOwnerStacks++;return v(O,k,_e,!0,ye?Error("react-stack-top-frame"):de,ye?Rt(a(O)):oe)}})()),kf}var hx;function vA(){return hx||(hx=1,process.env.NODE_ENV==="production"?Ri.exports=mA():Ri.exports=_A()),Ri.exports}var Ai=vA(),Ve=bc();function fx(n,e,t){if(!n)return;if(t(n)===!0)return n;let a=n.child;for(;a;){const r=fx(a,e,t);if(r)return r;a=a.sibling}}function dx(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const v_=dx(Ve.createContext(null));let px=class extends Ve.Component{render(){return Ve.createElement(v_.Provider,{value:this._reactInternals},this.props.children)}};function bA(){const n=Ve.useContext(v_);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=Ve.useId();return Ve.useMemo(()=>{for(const t of[n,n==null?void 0:n.alternate]){if(!t)continue;const a=fx(t,!1,r=>{let u=r.memoizedState;for(;u;){if(u.memoizedState===e)return!0;u=u.next}});if(a)return a}},[n,e])}const xA=Symbol.for("react.context"),SA=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===xA;function TA(){const n=bA(),[e]=Ve.useState(()=>new Map);e.clear();let t=n;for(;t;){const a=t.type;SA(a)&&a!==v_&&!e.has(a)&&e.set(a,Ve.use(dx(a))),t=t.return}return e}function EA(){const n=TA();return Ve.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>a=>Ve.createElement(e,null,Ve.createElement(t.Provider,{...a,value:n.get(t)})),e=>Ve.createElement(px,{...e})),[n])}var Q=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(Q||{});const b_=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},Zm=(n,e)=>b_(n).priority??e,Ie={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(b_).forEach(e=>{e.type.forEach(t=>{var a,r;return(r=(a=this._removeHandlers)[t])==null?void 0:r.call(a,e)})}),this},add(...n){return n.map(b_).forEach(e=>{e.type.forEach(t=>{var u,h;const a=this._addHandlers,r=this._queue;a[t]?(h=a[t])==null||h.call(a,e):(r[t]=r[t]||[],(u=r[t])==null||u.push(e))})}),this},handle(n,e,t){var h;const a=this._addHandlers,r=this._removeHandlers;if(a[n]||r[n])throw new Error(`Extension type ${n} already has a handler`);a[n]=e,r[n]=t;const u=this._queue;return u[n]&&((h=u[n])==null||h.forEach(f=>e(f)),delete u[n]),this},handleByMap(n,e){return this.handle(n,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(n,e,t=-1){return this.handle(n,a=>{e.findIndex(u=>u.name===a.name)>=0||(e.push({name:a.name,value:a.ref}),e.sort((u,h)=>Zm(h.value,t)-Zm(u.value,t)))},a=>{const r=e.findIndex(u=>u.name===a.name);r!==-1&&e.splice(r,1)})},handleByList(n,e,t=-1){return this.handle(n,a=>{e.includes(a.ref)||(e.push(a.ref),e.sort((r,u)=>Zm(u,t)-Zm(r,t)))},a=>{const r=e.indexOf(a.ref);r!==-1&&e.splice(r,1)})},mixin(n,...e){for(const t of e)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(t))}},CA={extension:{type:Q.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(()=>ZG)}},RA={extension:{type:Q.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>WG)}};class Mi{constructor(e,t,a){this._x=t||0,this._y=a||0,this._observer=e}clone(e){return new Mi(e??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.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(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var x_={exports:{}},mx;function AA(){return mx||(mx=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(t=!1));function r(m,y,v){this.fn=m,this.context=y,this.once=v||!1}function u(m,y,v,S,T){if(typeof v!="function")throw new TypeError("The listener must be a function");var E=new r(v,S||m,T),A=t?t+y:y;return m._events[A]?m._events[A].fn?m._events[A]=[m._events[A],E]:m._events[A].push(E):(m._events[A]=E,m._eventsCount++),m}function h(m,y){--m._eventsCount===0?m._events=new a:delete m._events[y]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var y=[],v,S;if(this._eventsCount===0)return y;for(S in v=this._events)e.call(v,S)&&y.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(v)):y},f.prototype.listeners=function(y){var v=t?t+y:y,S=this._events[v];if(!S)return[];if(S.fn)return[S.fn];for(var T=0,E=S.length,A=new Array(E);T<E;T++)A[T]=S[T].fn;return A},f.prototype.listenerCount=function(y){var v=t?t+y:y,S=this._events[v];return S?S.fn?1:S.length:0},f.prototype.emit=function(y,v,S,T,E,A){var U=t?t+y:y;if(!this._events[U])return!1;var M=this._events[U],G=arguments.length,P,w;if(M.fn){switch(M.once&&this.removeListener(y,M.fn,void 0,!0),G){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,v),!0;case 3:return M.fn.call(M.context,v,S),!0;case 4:return M.fn.call(M.context,v,S,T),!0;case 5:return M.fn.call(M.context,v,S,T,E),!0;case 6:return M.fn.call(M.context,v,S,T,E,A),!0}for(w=1,P=new Array(G-1);w<G;w++)P[w-1]=arguments[w];M.fn.apply(M.context,P)}else{var z=M.length,ne;for(w=0;w<z;w++)switch(M[w].once&&this.removeListener(y,M[w].fn,void 0,!0),G){case 1:M[w].fn.call(M[w].context);break;case 2:M[w].fn.call(M[w].context,v);break;case 3:M[w].fn.call(M[w].context,v,S);break;case 4:M[w].fn.call(M[w].context,v,S,T);break;default:if(!P)for(ne=1,P=new Array(G-1);ne<G;ne++)P[ne-1]=arguments[ne];M[w].fn.apply(M[w].context,P)}}return!0},f.prototype.on=function(y,v,S){return u(this,y,v,S,!1)},f.prototype.once=function(y,v,S){return u(this,y,v,S,!0)},f.prototype.removeListener=function(y,v,S,T){var E=t?t+y:y;if(!this._events[E])return this;if(!v)return h(this,E),this;var A=this._events[E];if(A.fn)A.fn===v&&(!T||A.once)&&(!S||A.context===S)&&h(this,E);else{for(var U=0,M=[],G=A.length;U<G;U++)(A[U].fn!==v||T&&!A[U].once||S&&A[U].context!==S)&&M.push(A[U]);M.length?this._events[E]=M.length===1?M[0]:M:h(this,E)}return this},f.prototype.removeAllListeners=function(y){var v;return y?(v=t?t+y:y,this._events[v]&&h(this,v)):(this._events=new a,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=t,f.EventEmitter=f,n.exports=f})(x_)),x_.exports}var MA=AA();const Sa=xa(MA),DA=Math.PI*2,UA=180/Math.PI,BA=Math.PI/180;class kt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new kt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return S_.x=0,S_.y=0,S_}}const S_=new kt;class ze{constructor(e=1,t=0,a=0,r=1,u=0,h=0){this.array=null,this.a=e,this.b=t,this.c=a,this.d=r,this.tx=u,this.ty=h}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,a,r,u,h){return this.a=e,this.b=t,this.c=a,this.d=r,this.tx=u,this.ty=h,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const a=t||this.array;return e?(a[0]=this.a,a[1]=this.b,a[2]=0,a[3]=this.c,a[4]=this.d,a[5]=0,a[6]=this.tx,a[7]=this.ty,a[8]=1):(a[0]=this.a,a[1]=this.c,a[2]=this.tx,a[3]=this.b,a[4]=this.d,a[5]=this.ty,a[6]=0,a[7]=0,a[8]=1),a}apply(e,t){t=t||new kt;const a=e.x,r=e.y;return t.x=this.a*a+this.c*r+this.tx,t.y=this.b*a+this.d*r+this.ty,t}applyInverse(e,t){t=t||new kt;const a=this.a,r=this.b,u=this.c,h=this.d,f=this.tx,m=this.ty,y=1/(a*h+u*-r),v=e.x,S=e.y;return t.x=h*y*v+-u*y*S+(m*u-f*h)*y,t.y=a*y*S+-r*y*v+(-m*a+f*r)*y,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),a=Math.sin(e),r=this.a,u=this.c,h=this.tx;return this.a=r*t-this.b*a,this.b=r*a+this.b*t,this.c=u*t-this.d*a,this.d=u*a+this.d*t,this.tx=h*t-this.ty*a,this.ty=h*a+this.ty*t,this}append(e){const t=this.a,a=this.b,r=this.c,u=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*a+e.b*u,this.c=e.c*t+e.d*r,this.d=e.c*a+e.d*u,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*a+e.ty*u+this.ty,this}appendFrom(e,t){const a=e.a,r=e.b,u=e.c,h=e.d,f=e.tx,m=e.ty,y=t.a,v=t.b,S=t.c,T=t.d;return this.a=a*y+r*S,this.b=a*v+r*T,this.c=u*y+h*S,this.d=u*v+h*T,this.tx=f*y+m*S+t.tx,this.ty=f*v+m*T+t.ty,this}setTransform(e,t,a,r,u,h,f,m,y){return this.a=Math.cos(f+y)*u,this.b=Math.sin(f+y)*u,this.c=-Math.sin(f-m)*h,this.d=Math.cos(f-m)*h,this.tx=e-(a*this.a+r*this.c),this.ty=t-(a*this.b+r*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const a=this.a,r=this.c;this.a=a*e.a+this.b*e.c,this.b=a*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,a=this.b,r=this.c,u=this.d,h=e.pivot,f=-Math.atan2(-r,u),m=Math.atan2(a,t),y=Math.abs(f+m);return y<1e-5||Math.abs(DA-y)<1e-5?(e.rotation=m,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=f,e.skew.y=m),e.scale.x=Math.sqrt(t*t+a*a),e.scale.y=Math.sqrt(r*r+u*u),e.position.x=this.tx+(h.x*t+h.y*r),e.position.y=this.ty+(h.x*a+h.y*u),e}invert(){const e=this.a,t=this.b,a=this.c,r=this.d,u=this.tx,h=e*r-t*a;return this.a=r/h,this.b=-t/h,this.c=-a/h,this.d=e/h,this.tx=(a*this.ty-r*u)/h,this.ty=-(e*this.ty-t*u)/h,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 e=new ze;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.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 NA.identity()}static get shared(){return OA.identity()}}const OA=new ze,NA=new ze,nu=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],iu=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],au=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],su=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],T_=[],yx=[],Wm=Math.sign;function GA(){for(let n=0;n<16;n++){const e=[];T_.push(e);for(let t=0;t<16;t++){const a=Wm(nu[n]*nu[t]+au[n]*iu[t]),r=Wm(iu[n]*nu[t]+su[n]*iu[t]),u=Wm(nu[n]*au[t]+au[n]*su[t]),h=Wm(iu[n]*au[t]+su[n]*su[t]);for(let f=0;f<16;f++)if(nu[f]===a&&iu[f]===r&&au[f]===u&&su[f]===h){e.push(f);break}}}for(let n=0;n<16;n++){const e=new ze;e.set(nu[n],iu[n],au[n],su[n],0,0),yx.push(e)}}GA();const Lt={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:n=>nu[n],uY:n=>iu[n],vX:n=>au[n],vY:n=>su[n],inv:n=>n&8?n&15:-n&7,add:(n,e)=>T_[n][e],sub:(n,e)=>T_[n][Lt.inv(e)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,e)=>Math.abs(n)*2<=Math.abs(e)?e>=0?Lt.S:Lt.N:Math.abs(e)*2<=Math.abs(n)?n>0?Lt.E:Lt.W:e>0?n>0?Lt.SE:Lt.SW:n>0?Lt.NE:Lt.NW,matrixAppendRotationInv:(n,e,t=0,a=0)=>{const r=yx[Lt.inv(e)];r.tx=t,r.ty=a,n.append(r)},transformRectCoords:(n,e,t,a)=>{const{x:r,y:u,width:h,height:f}=n,{x:m,y,width:v,height:S}=e;return t===Lt.E?(a.set(r+m,u+y,h,f),a):t===Lt.S?a.set(v-u-f+m,r+y,f,h):t===Lt.W?a.set(v-r-h+m,S-u-f+y,h,f):t===Lt.N?a.set(u+m,S-r-h+y,f,h):a.set(r+m,u+y,h,f)}},Jm=[new kt,new kt,new kt,new kt];class Pt{constructor(e=0,t=0,a=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(a),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 Pt(0,0,0,0)}clone(){return new Pt(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,a,r=.5){const{width:u,height:h}=this;if(u<=0||h<=0)return!1;const f=this.x,m=this.y,y=a*(1-r),v=a-y,S=f-y,T=f+u+y,E=m-y,A=m+h+y,U=f+v,M=f+u-v,G=m+v,P=m+h-v;return e>=S&&e<=T&&t>=E&&t<=A&&!(e>U&&e<M&&t>G&&t<P)}intersects(e,t){if(!t){const Te=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=Te)return!1;const fe=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>fe}const a=this.left,r=this.right,u=this.top,h=this.bottom;if(r<=a||h<=u)return!1;const f=Jm[0].set(e.left,e.top),m=Jm[1].set(e.left,e.bottom),y=Jm[2].set(e.right,e.top),v=Jm[3].set(e.right,e.bottom);if(y.x<=f.x||m.y<=f.y)return!1;const S=Math.sign(t.a*t.d-t.b*t.c);if(S===0||(t.apply(f,f),t.apply(m,m),t.apply(y,y),t.apply(v,v),Math.max(f.x,m.x,y.x,v.x)<=a||Math.min(f.x,m.x,y.x,v.x)>=r||Math.max(f.y,m.y,y.y,v.y)<=u||Math.min(f.y,m.y,y.y,v.y)>=h))return!1;const T=S*(m.y-f.y),E=S*(f.x-m.x),A=T*a+E*u,U=T*r+E*u,M=T*a+E*h,G=T*r+E*h;if(Math.max(A,U,M,G)<=T*f.x+E*f.y||Math.min(A,U,M,G)>=T*v.x+E*v.y)return!1;const P=S*(f.y-y.y),w=S*(y.x-f.x),z=P*a+w*u,ne=P*r+w*u,ie=P*a+w*h,Z=P*r+w*h;return!(Math.max(z,ne,ie,Z)<=P*f.x+w*f.y||Math.min(z,ne,ie,Z)>=P*v.x+w*v.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),a=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),u=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(a-t,0),this.y=r,this.height=Math.max(u-r,0),this}ceil(e=1,t=.001){const a=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=a-this.x,this.height=r-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){const t=Math.min(this.x,e.x),a=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),u=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=a-t,this.y=r,this.height=u-r,this}getBounds(e){return e||(e=new Pt),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const t=e.x,a=e.y,r=e.x+e.width,u=e.y+e.height;return t>=this.x&&t<this.x+this.width&&a>=this.y&&a<this.y+this.height&&r>=this.x&&r<this.x+this.width&&u>=this.y&&u<this.y+this.height}set(e,t,a,r){return this.x=e,this.y=t,this.width=a,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const E_={default:-1};function It(n="default"){return E_[n]===void 0&&(E_[n]=-1),++E_[n]}const gx=new Set,Mt="8.0.0",PA="8.3.4",xc={quiet:!1,noColor:!1},it=(n,e,t=3)=>{if(xc.quiet||gx.has(e))return;let a=new Error().stack;const r=`${e}
51
- Deprecated since v${n}`,u=typeof console.groupCollapsed=="function"&&!xc.noColor;typeof a>"u"?console.warn("PixiJS Deprecation Warning: ",r):(a=a.split(`
52
- `).splice(t).join(`
53
- `),u?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(a),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(a))),gx.add(e)};Object.defineProperties(it,{quiet:{get:()=>xc.quiet,set:n=>{xc.quiet=n},enumerable:!0,configurable:!1},noColor:{get:()=>xc.noColor,set:n=>{xc.noColor=n},enumerable:!0,configurable:!1}});const _x=()=>{};function Sc(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function vx(n){return!(n&n-1)&&!!n}function bx(n){const e={};for(const t in n)n[t]!==void 0&&(e[t]=n[t]);return e}const xx=Object.create(null);function wA(n){const e=xx[n];return e===void 0&&(xx[n]=It("resource")),e}const Sx=class qR extends Sa{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...qR.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){it(Mt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=wA(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Sx.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Kl=Sx;const Tx=class FR extends Sa{constructor(e={}){super(),this.options=e,this.uid=It("textureSource"),this._resourceType="textureSource",this._resourceId=It("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...FR.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.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=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new Kl(bx(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var t,a;this.style!==e&&((t=this._style)==null||t.off("change",this._onStyleChange,this),this._style=e,(a=this._style)==null||a.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=It("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,a){a||(a=this._resolution),e||(e=this.width),t||(t=this.height);const r=Math.round(e*a),u=Math.round(t*a);return this.width=r/a,this.height=u/a,this._resolution=a,this.pixelWidth===r&&this.pixelHeight===u?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=u,this.emit("resize",this),this._resourceId=It("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=vx(this.pixelWidth)&&vx(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};Tx.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let wn=Tx;class C_ extends wn{constructor(e){const t=e.resource||new Float32Array(e.width*e.height*4);let a=e.format;a||(t instanceof Float32Array?a="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?a="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?a="rgba16uint":(t instanceof Int8Array,a="bgra8unorm")),super({...e,resource:t,format:a}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}C_.extension=Q.TextureSource;const Ex=new ze;class Cx{constructor(e,t){this.mapCoord=new ze,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var t;this.texture!==e&&((t=this._texture)==null||t.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,t){t===void 0&&(t=e);const a=this.mapCoord;for(let r=0;r<e.length;r+=2){const u=e[r],h=e[r+1];t[r]=u*a.a+h*a.c+a.tx,t[r+1]=u*a.b+h*a.d+a.ty}return t}update(){const e=this._texture;this._updateID++;const t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);const a=e.orig,r=e.trim;r&&(Ex.set(a.width/r.width,0,0,a.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(Ex));const u=e.source,h=this.uClampFrame,f=this.clampMargin/u._resolution,m=this.clampOffset/u._resolution;return h[0]=(e.frame.x+f+m)/u.width,h[1]=(e.frame.y+f+m)/u.height,h[2]=(e.frame.x+e.frame.width-f+m)/u.width,h[3]=(e.frame.y+e.frame.height-f+m)/u.height,this.uClampOffset[0]=this.clampOffset/u.pixelWidth,this.uClampOffset[1]=this.clampOffset/u.pixelHeight,this.isSimple=e.frame.width===u.width&&e.frame.height===u.height&&e.rotate===0,!0}}class He extends Sa{constructor({source:e,label:t,frame:a,orig:r,trim:u,defaultAnchor:h,defaultBorders:f,rotate:m,dynamic:y}={}){if(super(),this.uid=It("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Pt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=(e==null?void 0:e.source)??new wn,this.noFrame=!a,a)this.frame.copyFrom(a);else{const{width:v,height:S}=this._source;this.frame.width=v,this.frame.height=S}this.orig=r||this.frame,this.trim=u,this.rotate=m??0,this.defaultAnchor=h,this.defaultBorders=f,this.destroyed=!1,this.dynamic=y||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Cx(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:t}=this,{width:a,height:r}=this._source,u=t.x/a,h=t.y/r,f=t.width/a,m=t.height/r;let y=this.rotate;if(y){const v=f/2,S=m/2,T=u+v,E=h+S;y=Lt.add(y,Lt.NW),e.x0=T+v*Lt.uX(y),e.y0=E+S*Lt.uY(y),y=Lt.add(y,2),e.x1=T+v*Lt.uX(y),e.y1=E+S*Lt.uY(y),y=Lt.add(y,2),e.x2=T+v*Lt.uX(y),e.y2=E+S*Lt.uY(y),y=Lt.add(y,2),e.x3=T+v*Lt.uX(y),e.y3=E+S*Lt.uY(y)}else e.x0=u,e.y0=h,e.x1=u+f,e.y1=h,e.x2=u+f,e.y2=h+m,e.x3=u,e.y3=h+m}destroy(e=!1){this._source&&e&&(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 it(Mt,"Texture.baseTexture is now Texture.source"),this._source}}He.EMPTY=new He({label:"EMPTY",source:new wn({label:"EMPTY"})}),He.EMPTY.destroy=_x,He.WHITE=new He({source:new C_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),He.WHITE.destroy=_x;function Rx(n,e,t){const{width:a,height:r}=t.orig,u=t.trim;if(u){const h=u.width,f=u.height;n.minX=u.x-e._x*a,n.maxX=n.minX+h,n.minY=u.y-e._y*r,n.maxY=n.minY+f}else n.minX=-e._x*a,n.maxX=n.minX+a,n.minY=-e._y*r,n.maxY=n.minY+r}const Ax=new ze;class ci{constructor(e=1/0,t=1/0,a=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ax,this.minX=e,this.minY=t,this.maxX=a,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Pt);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ax,this}set(e,t,a,r){this.minX=e,this.minY=t,this.maxX=a,this.maxY=r}addFrame(e,t,a,r,u){u||(u=this.matrix);const h=u.a,f=u.b,m=u.c,y=u.d,v=u.tx,S=u.ty;let T=this.minX,E=this.minY,A=this.maxX,U=this.maxY,M=h*e+m*t+v,G=f*e+y*t+S;M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>U&&(U=G),M=h*a+m*t+v,G=f*a+y*t+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>U&&(U=G),M=h*e+m*r+v,G=f*e+y*r+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>U&&(U=G),M=h*a+m*r+v,G=f*a+y*r+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>U&&(U=G),this.minX=T,this.minY=E,this.maxX=A,this.maxY=U}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const t=this.minX,a=this.minY,r=this.maxX,u=this.maxY,{a:h,b:f,c:m,d:y,tx:v,ty:S}=e;let T=h*t+m*a+v,E=f*t+y*a+S;this.minX=T,this.minY=E,this.maxX=T,this.maxY=E,T=h*r+m*a+v,E=f*r+y*a+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY,T=h*t+m*u+v,E=f*t+y*u+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY,T=h*r+m*u+v,E=f*r+y*u+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,a,r){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<a&&(this.minY=a),this.maxY>r&&(this.maxY=r),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,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 ci(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){const t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){const t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}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(e,t,a,r){let u=this.minX,h=this.minY,f=this.maxX,m=this.maxY;r||(r=this.matrix);const y=r.a,v=r.b,S=r.c,T=r.d,E=r.tx,A=r.ty;for(let U=t;U<a;U+=2){const M=e[U],G=e[U+1],P=y*M+S*G+E,w=v*M+T*G+A;u=P<u?P:u,h=w<h?w:h,f=P>f?P:f,m=w>m?w:m}this.minX=u,this.minY=h,this.maxX=f,this.maxY=m}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var zA={grad:.9,turn:360,rad:360/(2*Math.PI)},Wr=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},Wn=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t+0},Fa=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n>e?n:e},Mx=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},Dx=function(n){return{r:Fa(n.r,0,255),g:Fa(n.g,0,255),b:Fa(n.b,0,255),a:Fa(n.a)}},R_=function(n){return{r:Wn(n.r),g:Wn(n.g),b:Wn(n.b),a:Wn(n.a,3)}},HA=/^#([0-9a-f]{3,8})$/i,$m=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},Ux=function(n){var e=n.r,t=n.g,a=n.b,r=n.a,u=Math.max(e,t,a),h=u-Math.min(e,t,a),f=h?u===e?(t-a)/h:u===t?2+(a-e)/h:4+(e-t)/h:0;return{h:60*(f<0?f+6:f),s:u?h/u*100:0,v:u/255*100,a:r}},Bx=function(n){var e=n.h,t=n.s,a=n.v,r=n.a;e=e/360*6,t/=100,a/=100;var u=Math.floor(e),h=a*(1-t),f=a*(1-(e-u)*t),m=a*(1-(1-e+u)*t),y=u%6;return{r:255*[a,f,h,h,m,a][y],g:255*[m,a,a,f,h,h][y],b:255*[h,h,m,a,a,f][y],a:r}},Ox=function(n){return{h:Mx(n.h),s:Fa(n.s,0,100),l:Fa(n.l,0,100),a:Fa(n.a)}},Nx=function(n){return{h:Wn(n.h),s:Wn(n.s),l:Wn(n.l),a:Wn(n.a,3)}},Gx=function(n){return Bx((t=(e=n).s,{h:e.h,s:(t*=((a=e.l)<50?a:100-a)/100)>0?2*t/(a+t)*100:0,v:a+t,a:e.a}));var e,t,a},Kf=function(n){return{h:(e=Ux(n)).h,s:(r=(200-(t=e.s))*(a=e.v)/100)>0&&r<200?t*a/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,t,a,r},VA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,LA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,YA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A_={string:[[function(n){var e=HA.exec(n);return e?(n=e[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Wn(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?Wn(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var e=jA.exec(n)||YA.exec(n);return e?e[2]!==e[4]||e[4]!==e[6]?null:Dx({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(n){var e=VA.exec(n)||LA.exec(n);if(!e)return null;var t,a,r=Ox({h:(t=e[1],a=e[2],a===void 0&&(a="deg"),Number(t)*(zA[a]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Gx(r)},"hsl"]],object:[[function(n){var e=n.r,t=n.g,a=n.b,r=n.a,u=r===void 0?1:r;return Wr(e)&&Wr(t)&&Wr(a)?Dx({r:Number(e),g:Number(t),b:Number(a),a:Number(u)}):null},"rgb"],[function(n){var e=n.h,t=n.s,a=n.l,r=n.a,u=r===void 0?1:r;if(!Wr(e)||!Wr(t)||!Wr(a))return null;var h=Ox({h:Number(e),s:Number(t),l:Number(a),a:Number(u)});return Gx(h)},"hsl"],[function(n){var e=n.h,t=n.s,a=n.v,r=n.a,u=r===void 0?1:r;if(!Wr(e)||!Wr(t)||!Wr(a))return null;var h=(function(f){return{h:Mx(f.h),s:Fa(f.s,0,100),v:Fa(f.v,0,100),a:Fa(f.a)}})({h:Number(e),s:Number(t),v:Number(a),a:Number(u)});return Bx(h)},"hsv"]]},Px=function(n,e){for(var t=0;t<e.length;t++){var a=e[t][0](n);if(a)return[a,e[t][1]]}return[null,void 0]},XA=function(n){return typeof n=="string"?Px(n.trim(),A_.string):typeof n=="object"&&n!==null?Px(n,A_.object):[null,void 0]},M_=function(n,e){var t=Kf(n);return{h:t.h,s:Fa(t.s+100*e,0,100),l:t.l,a:t.a}},D_=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},wx=function(n,e){var t=Kf(n);return{h:t.h,s:t.s,l:Fa(t.l+100*e,0,100),a:t.a}},U_=(function(){function n(e){this.parsed=XA(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return Wn(D_(this.rgba),2)},n.prototype.isDark=function(){return D_(this.rgba)<.5},n.prototype.isLight=function(){return D_(this.rgba)>=.5},n.prototype.toHex=function(){return e=R_(this.rgba),t=e.r,a=e.g,r=e.b,h=(u=e.a)<1?$m(Wn(255*u)):"","#"+$m(t)+$m(a)+$m(r)+h;var e,t,a,r,u,h},n.prototype.toRgb=function(){return R_(this.rgba)},n.prototype.toRgbString=function(){return e=R_(this.rgba),t=e.r,a=e.g,r=e.b,(u=e.a)<1?"rgba("+t+", "+a+", "+r+", "+u+")":"rgb("+t+", "+a+", "+r+")";var e,t,a,r,u},n.prototype.toHsl=function(){return Nx(Kf(this.rgba))},n.prototype.toHslString=function(){return e=Nx(Kf(this.rgba)),t=e.h,a=e.s,r=e.l,(u=e.a)<1?"hsla("+t+", "+a+"%, "+r+"%, "+u+")":"hsl("+t+", "+a+"%, "+r+"%)";var e,t,a,r,u},n.prototype.toHsv=function(){return e=Ux(this.rgba),{h:Wn(e.h),s:Wn(e.s),v:Wn(e.v),a:Wn(e.a,3)};var e},n.prototype.invert=function(){return fr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},n.prototype.saturate=function(e){return e===void 0&&(e=.1),fr(M_(this.rgba,e))},n.prototype.desaturate=function(e){return e===void 0&&(e=.1),fr(M_(this.rgba,-e))},n.prototype.grayscale=function(){return fr(M_(this.rgba,-1))},n.prototype.lighten=function(e){return e===void 0&&(e=.1),fr(wx(this.rgba,e))},n.prototype.darken=function(e){return e===void 0&&(e=.1),fr(wx(this.rgba,-e))},n.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},n.prototype.alpha=function(e){return typeof e=="number"?fr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Wn(this.rgba.a,3);var t},n.prototype.hue=function(e){var t=Kf(this.rgba);return typeof e=="number"?fr({h:e,s:t.s,l:t.l,a:t.a}):Wn(t.h)},n.prototype.isEqual=function(e){return this.toHex()===fr(e).toHex()},n})(),fr=function(n){return n instanceof U_?n:new U_(n)},zx=[],qA=function(n){n.forEach(function(e){zx.indexOf(e)<0&&(e(U_,A_),zx.push(e))})};function FA(n,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},a={};for(var r in t)a[t[r]]=r;var u={};n.prototype.toName=function(h){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var f,m,y=a[this.toHex()];if(y)return y;if(h!=null&&h.closest){var v=this.toRgb(),S=1/0,T="black";if(!u.length)for(var E in t)u[E]=new n(t[E]).toRgb();for(var A in t){var U=(f=v,m=u[A],Math.pow(f.r-m.r,2)+Math.pow(f.g-m.g,2)+Math.pow(f.b-m.b,2));U<S&&(S=U,T=A)}return T}},e.string.push([function(h){var f=h.toLowerCase(),m=f==="transparent"?"#0000":t[f];return m?new n(m).toRgb():null},"name"])}qA([FA]);const Tc=class Im{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}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(e){return this.value=e,this}set value(e){if(e instanceof Im)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){const a=typeof e;if(a!==typeof t)return!1;if(a==="number"||a==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((u,h)=>u===t[h]);if(e!==null&&t!==null){const u=Object.keys(e),h=Object.keys(t);return u.length!==h.length?!1:u.every(f=>e[f]===t[f])}return e===t}toRgba(){const[e,t,a,r]=this._components;return{r:e,g:t,b:a,a:r}}toRgb(){const[e,t,a]=this._components;return{r:e,g:t,b:a}}toRgbaString(){const[e,t,a]=this.toUint8RgbArray();return`rgba(${e},${t},${a},${this.alpha})`}toUint8RgbArray(e){const[t,a,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(a*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[t,a,r,u]=this._components;return e[0]=t,e[1]=a,e[2]=r,e[3]=u,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[t,a,r]=this._components;return e[0]=t,e[1]=a,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,t,a]=this.toUint8RgbArray();return(a<<16)+(t<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,a,r,u]=Im._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=a,this._components[2]*=r,this._components[3]*=u,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let a=this._int>>16&255,r=this._int>>8&255,u=this._int&255;return t&&(a=a*e+.5|0,r=r*e+.5|0,u=u*e+.5|0),(e*255<<24)+(a<<16)+(r<<8)+u}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,a,r,u;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const h=e;t=(h>>16&255)/255,a=(h>>8&255)/255,r=(h&255)/255,u=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,a,r,u=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,a,r,u=255]=e,t/=255,a/=255,r/=255,u/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const f=Im.HEX_PATTERN.exec(e);f&&(e=`#${f[2]}`)}const h=fr(e);h.isValid()&&({r:t,g:a,b:r,a:u}=h.rgba,t/=255,a/=255,r/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=a,this._components[2]=r,this._components[3]=u,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,t,a]=this._components;this._int=(e*255<<16)+(t*255<<8)+(a*255|0)}_clamp(e,t=0,a=1){return typeof e=="number"?Math.min(Math.max(e,t),a):(e.forEach((r,u)=>{e[u]=Math.min(Math.max(r,t),a)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof Im||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};Tc.shared=new Tc,Tc._temp=new Tc,Tc.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Zt=Tc;const kA={cullArea:null,cullable:!1,cullableChildren:!0};let B_=0;const Hx=500;function rt(...n){B_!==Hx&&(B_++,B_===Hx?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...n))}const Ec={_registeredResources:new Set,register(n){this._registeredResources.add(n)},unregister(n){this._registeredResources.delete(n)},release(){this._registeredResources.forEach(n=>n.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(n){return this._registeredResources.has(n)},reset(){this._registeredResources.clear()}};class IA{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var a;let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,(a=t.init)==null||a.call(t,e),t}return(e){var t;(t=e.reset)==null||t.call(e),this._pool[this._index++]=e}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 e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class KA{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new IA(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(t=>{const a=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[a]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const Cn=new KA;Ec.register(Cn);const QA={get isCachedAsTexture(){var n;return!!((n=this.renderGroup)!=null&&n.isCachedAsTexture)},cacheAsTexture(n){typeof n=="boolean"&&n===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(n===!0?{}:n))},updateCacheTexture(){var n;(n=this.renderGroup)==null||n.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(n){it("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(n)}};function Vx(n,e,t){const a=n.length;let r;if(e>=a||t===0)return;t=e+t>a?a-e:t;const u=a-t;for(r=e;r<u;++r)n[r]=n[r+t];n.length=u}const ZA={allowChildren:!0,removeChildren(n=0,e){var u;const t=e??this.children.length,a=t-n,r=[];if(a>0&&a<=t){for(let f=t-1;f>=n;f--){const m=this.children[f];m&&(r.push(m),m.parent=null)}Vx(this.children,n,t);const h=this.renderGroup||this.parentRenderGroup;h&&h.removeChildren(r);for(let f=0;f<r.length;++f){const m=r[f];(u=m.parentRenderLayer)==null||u.detach(m),this.emit("childRemoved",m,this,f),r[f].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(a===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(n){const e=this.getChildAt(n);return this.removeChild(e)},getChildAt(n){if(n<0||n>=this.children.length)throw new Error(`getChildAt: Index (${n}) does not exist.`);return this.children[n]},setChildIndex(n,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(n),this.addChildAt(n,e)},getChildIndex(n){const e=this.children.indexOf(n);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(n,e){this.allowChildren||it(Mt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:t}=this;if(e<0||e>t.length)throw new Error(`${n}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(n.parent){const r=n.parent.children.indexOf(n);if(n.parent===this&&r===e)return n;r!==-1&&n.parent.children.splice(r,1)}e===t.length?t.push(n):t.splice(e,0,n),n.parent=this,n.didChange=!0,n._updateFlags=15;const a=this.renderGroup||this.parentRenderGroup;return a&&a.addChild(n),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",n,this,e),n.emit("added",this),n},swapChildren(n,e){if(n===e)return;const t=this.getChildIndex(n),a=this.getChildIndex(e);this.children[t]=e,this.children[a]=n;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var n;(n=this.parent)==null||n.removeChild(this)},reparentChild(...n){return n.length===1?this.reparentChildAt(n[0],this.children.length):(n.forEach(e=>this.reparentChildAt(e,this.children.length)),n[0])},reparentChildAt(n,e){if(n.parent===this)return this.setChildIndex(n,e),n;const t=n.worldTransform.clone();n.removeFromParent(),this.addChildAt(n,e);const a=this.worldTransform.clone();return a.invert(),t.prepend(a),n.setFromMatrix(t),n},replaceChild(n,e){n.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(n)),e.setFromMatrix(n.localTransform),e.updateLocalTransform(),this.removeChild(n)}},WA={collectRenderables(n,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(n,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,n):this.collectRenderablesWithEffects(n,e,t))},collectRenderablesSimple(n,e,t){const a=this.children,r=a.length;for(let u=0;u<r;u++)a[u].collectRenderables(n,e,t)},collectRenderablesWithEffects(n,e,t){const{renderPipes:a}=e;for(let r=0;r<this.effects.length;r++){const u=this.effects[r];a[u.pipe].push(u,this,n)}this.collectRenderablesSimple(n,e,t);for(let r=this.effects.length-1;r>=0;r--){const u=this.effects[r];a[u.pipe].pop(u,this,n)}}};class ey{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class JA{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){const a=this._tests[t];if(a.test(e))return Cn.get(a.maskClass,e)}return e}returnMaskEffect(e){Cn.return(e)}}const O_=new JA;Ie.handleByList(Q.MaskEffect,O_._effectClasses);const $A={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)},addEffect(n){this.effects.indexOf(n)===-1&&(this.effects.push(n),this.effects.sort((t,a)=>t.priority-a.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(n){const e=this.effects.indexOf(n);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(n){const e=this._maskEffect;(e==null?void 0:e.mask)!==n&&(e&&(this.removeEffect(e),O_.returnMaskEffect(e),this._maskEffect=null),n!=null&&(this._maskEffect=O_.getMaskEffect(n),this.addEffect(this._maskEffect)))},get mask(){var n;return(n=this._maskEffect)==null?void 0:n.mask},setMask(n){this._maskOptions={...this._maskOptions,...n},n.mask&&(this.mask=n.mask),this._markStructureAsChanged()},set filters(n){var u;!Array.isArray(n)&&n&&(n=[n]);const e=this._filterEffect||(this._filterEffect=new ey);n=n;const t=(n==null?void 0:n.length)>0,a=((u=e.filters)==null?void 0:u.length)>0,r=t!==a;n=Array.isArray(n)?n.slice(0):n,e.filters=Object.freeze(n),r&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=n??null))},get filters(){var n;return(n=this._filterEffect)==null?void 0:n.filters},set filterArea(n){this._filterEffect||(this._filterEffect=new ey),this._filterEffect.filterArea=n},get filterArea(){var n;return(n=this._filterEffect)==null?void 0:n.filterArea}},eM={label:null,get name(){return it(Mt,"Container.name property has been removed, use Container.label instead"),this.label},set name(n){it(Mt,"Container.name property has been removed, use Container.label instead"),this.label=n},getChildByName(n,e=!1){return this.getChildByLabel(n,e)},getChildByLabel(n,e=!1){const t=this.children;for(let a=0;a<t.length;a++){const r=t[a];if(r.label===n||n instanceof RegExp&&n.test(r.label))return r}if(e)for(let a=0;a<t.length;a++){const u=t[a].getChildByLabel(n,!0);if(u)return u}return null},getChildrenByLabel(n,e=!1,t=[]){const a=this.children;for(let r=0;r<a.length;r++){const u=a[r];(u.label===n||n instanceof RegExp&&n.test(u.label))&&t.push(u)}if(e)for(let r=0;r<a.length;r++)a[r].getChildrenByLabel(n,!0,t);return t}},ji=Cn.getPool(ze),Jr=Cn.getPool(ci),tM=new ze,nM={getFastGlobalBounds(n,e){e||(e=new ci),e.clear(),this._getGlobalBoundsRecursive(!!n,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(n,e,t){let a=e;if(n&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(a=Jr.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const h=this.bounds;a.addFrame(h.minX,h.minY,h.maxX,h.maxY,this.groupTransform)}const u=this.children;for(let h=0;h<u.length;h++)u[h]._getGlobalBoundsRecursive(n,a,t)}if(r){let u=!1;const h=this.renderGroup||this.parentRenderGroup;for(let f=0;f<this.effects.length;f++)this.effects[f].addBounds&&(u||(u=!0,a.applyMatrix(h.worldTransform)),this.effects[f].addBounds(a,!0));u&&a.applyMatrix(h.worldTransform.copyTo(tM).invert()),e.addBounds(a),Jr.return(a)}else this.renderGroup&&(e.addBounds(a,this.relativeGroupTransform),Jr.return(a))}};function N_(n,e,t){t.clear();let a,r;return n.parent?e?a=n.parent.worldTransform:(r=ji.get().identity(),a=G_(n,r)):a=ze.IDENTITY,Lx(n,t,a,e),r&&ji.return(r),t.isValid||t.set(0,0,0,0),t}function Lx(n,e,t,a){var f,m;if(!n.visible||!n.measurable)return;let r;a?r=n.worldTransform:(n.updateLocalTransform(),r=ji.get(),r.appendFrom(n.localTransform,t));const u=e,h=!!n.effects.length;if(h&&(e=Jr.get().clear()),n.boundsArea)e.addRect(n.boundsArea,r);else{const y=n.bounds;y&&!y.isEmpty()&&(e.matrix=r,e.addBounds(y));for(let v=0;v<n.children.length;v++)Lx(n.children[v],e,r,a)}if(h){for(let y=0;y<n.effects.length;y++)(m=(f=n.effects[y]).addBounds)==null||m.call(f,e);u.addBounds(e,ze.IDENTITY),Jr.return(e)}a||ji.return(r)}function G_(n,e){const t=n.parent;return t&&(G_(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}function jx(n,e){if(n===16777215||!e)return e;if(e===16777215||!n)return n;const t=n>>16&255,a=n>>8&255,r=n&255,u=e>>16&255,h=e>>8&255,f=e&255,m=t*u/255|0,y=a*h/255|0,v=r*f/255|0;return(m<<16)+(y<<8)+v}const Yx=16777215;function ty(n,e){return n===Yx?e:e===Yx?n:jx(n,e)}function Qf(n){return((n&255)<<16)+(n&65280)+(n>>16&255)}const iM={getGlobalAlpha(n){if(n)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(n=new ze,e){if(e)return n.copyFrom(this.worldTransform);this.updateLocalTransform();const t=G_(this,ji.get().identity());return n.appendFrom(this.localTransform,t),ji.return(t),n},getGlobalTint(n){if(n)return this.renderGroup?Qf(this.renderGroup.worldColor):this.parentRenderGroup?Qf(ty(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=ty(e,t.localColor),t=t.parent;return Qf(e)}};function P_(n,e,t){return e.clear(),t||(t=ze.IDENTITY),Xx(n,e,t,n,!0),e.isValid||e.set(0,0,0,0),e}function Xx(n,e,t,a,r){var m,y;let u;if(r)u=ji.get(),u=t.copyTo(u);else{if(!n.visible||!n.measurable)return;n.updateLocalTransform();const v=n.localTransform;u=ji.get(),u.appendFrom(v,t)}const h=e,f=!!n.effects.length;if(f&&(e=Jr.get().clear()),n.boundsArea)e.addRect(n.boundsArea,u);else{n.renderPipeId&&(e.matrix=u,e.addBounds(n.bounds));const v=n.children;for(let S=0;S<v.length;S++)Xx(v[S],e,u,a,!1)}if(f){for(let v=0;v<n.effects.length;v++)(y=(m=n.effects[v]).addLocalBounds)==null||y.call(m,e,a);h.addBounds(e,ze.IDENTITY),Jr.return(e)}ji.return(u)}function qx(n,e){const t=n.children;for(let a=0;a<t.length;a++){const r=t[a],u=r.uid,h=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,f=e.index;(e.data[f]!==u||e.data[f+1]!==h)&&(e.data[e.index]=u,e.data[e.index+1]=h,e.didChange=!0),e.index=f+2,r.children.length&&qx(r,e)}return e.didChange}const aM=new ze,sM={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(n,e){const t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=n/e*t:this.scale.x=t},_setHeight(n,e){const t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=n/e*t:this.scale.y=t},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new ci});const n=this._localBoundsCacheData;return n.index=1,n.didChange=!1,n.data[0]!==this._didViewChangeTick&&(n.didChange=!0,n.data[0]=this._didViewChangeTick),qx(this,n),n.didChange&&P_(this,n.localBounds,aM),n.localBounds},getBounds(n,e){return N_(this,n,e||new ci)}},rM={_onRender:null,set onRender(n){const e=this.renderGroup||this.parentRenderGroup;if(!n){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=n},get onRender(){return this._onRender}},lM={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(n){this._zIndex!==n&&(this._zIndex=n,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(oM))}};function oM(n,e){return n._zIndex-e._zIndex}const uM={getGlobalPosition(n=new kt,e=!1){return this.parent?this.parent.toGlobal(this._position,n,e):(n.x=this._position.x,n.y=this._position.y),n},toGlobal(n,e,t=!1){const a=this.getGlobalTransform(ji.get(),t);return e=a.apply(n,e),ji.return(a),e},toLocal(n,e,t,a){e&&(n=e.toGlobal(n,t,a));const r=this.getGlobalTransform(ji.get(),a);return t=r.applyInverse(n,t),ji.return(r),t}};class Fx{constructor(){this.uid=It("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(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let cM=0;class hM{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new Kl(this.textureOptions)}createTexture(e,t,a){const r=new wn({...this.textureOptions,width:e,height:t,resolution:1,antialias:a,autoGarbageCollect:!1});return new He({source:r,label:`texturePool_${cM++}`})}getOptimalTexture(e,t,a=1,r){let u=Math.ceil(e*a-1e-6),h=Math.ceil(t*a-1e-6);u=Sc(u),h=Sc(h);const f=(u<<17)+(h<<1)+(r?1:0);this._texturePool[f]||(this._texturePool[f]=[]);let m=this._texturePool[f].pop();return m||(m=this.createTexture(u,h,r)),m.source._resolution=a,m.source.width=u/a,m.source.height=h/a,m.source.pixelWidth=u,m.source.pixelHeight=h,m.frame.x=0,m.frame.y=0,m.frame.width=e,m.frame.height=t,m.updateUvs(),this._poolKeyHash[m.uid]=f,m}getSameSizeTexture(e,t=!1){const a=e.source;return this.getOptimalTexture(e.width,e.height,a._resolution,t)}returnTexture(e,t=!1){const a=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[a].push(e)}clear(e){if(e=e!==!1,e)for(const t in this._texturePool){const a=this._texturePool[t];if(a)for(let r=0;r<a.length;r++)a[r].destroy(!0)}this._texturePool={}}}const hi=new hM;Ec.register(hi);class w_{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new ze,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 Fx,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const t=e.children;for(let a=0;a<t.length;a++){const r=t[a];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(hi.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const t=this.childrenToUpdate[e];t.list.fill(null),t.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(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const t=e.children;for(let a=0;a<t.length;a++)this.addChild(t[a])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const t=e.children;for(let a=0;a<t.length;a++)this.removeChild(t[a])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}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(e=[]){const t=this.root.children;for(let a=0;a<t.length;a++)this._getChildren(t[a],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;const a=e.children;for(let r=0;r<a.length;r++)this._getChildren(a[r],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new ze),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new ze),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 e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new ze),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function z_(n,e,t={}){for(const a in e)!t[a]&&e[a]!==void 0&&(n[a]=e[a])}const H_=new Mi(null),ny=new Mi(null),V_=new Mi(null,1,1),iy=new Mi(null),ay=1,L_=2,Zf=4;class zn extends Sa{constructor(e={}){var t,a;super(),this.uid=It("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 ze,this.relativeGroupTransform=new ze,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Mi(this,0,0),this._scale=V_,this._pivot=ny,this._origin=iy,this._skew=H_,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=[],z_(this,e,{children:!0,parent:!0,effects:!0}),(t=e.children)==null||t.forEach(r=>this.addChild(r)),(a=e.parent)==null||a.addChild(this)}static mixin(e){it("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Ie.mixin(zn,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||it(Mt,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const t=e[0],a=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),a&&(a.structureDidChange=!0),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t._updateFlags=15,a&&a.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const t=e[0],a=this.children.indexOf(t);return a>-1&&(this._didViewChangeTick++,this.children.splice(a,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,a),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=Cn.get(w_,this),this.groupTransform=ze.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),Cn.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new ze),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(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*UA}set angle(e){this.rotation=e*BA}get pivot(){return this._pivot===ny&&(this._pivot=new Mi(this,0,0)),this._pivot}set pivot(e){this._pivot===ny&&(this._pivot=new Mi(this,0,0),this._origin!==iy&&rt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===H_&&(this._skew=new Mi(this,0,0)),this._skew}set skew(e){this._skew===H_&&(this._skew=new Mi(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===V_&&(this._scale=new Mi(this,1,1)),this._scale}set scale(e){this._scale===V_&&(this._scale=new Mi(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===iy&&(this._origin=new Mi(this,0,0)),this._origin}set origin(e){this._origin===iy&&(this._origin=new Mi(this,0,0),this._pivot!==ny&&rt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||(e={});const t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){const a=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,a.width),t!==void 0&&this._setHeight(t,a.height)}_updateSkew(){const e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const t=this.localTransform,a=this._scale,r=this._pivot,u=this._origin,h=this._position,f=a._x,m=a._y,y=r._x,v=r._y,S=-u._x,T=-u._y;t.a=this._cx*f,t.b=this._sx*f,t.c=this._cy*m,t.d=this._sy*m,t.tx=h._x-(y*t.a+v*t.c)+(S*t.a+T*t.c)-S,t.ty=h._y-(y*t.b+v*t.d)+(S*t.b+T*t.d)-T}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=ay,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const a=Zt.shared.setValue(e??16777215).toBgrNumber();a!==this.localColor&&(this.localColor=a,this._updateFlags|=ay,this._onUpdate())}get tint(){return Qf(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=L_,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Zf,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Zf,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=Zf,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var r;if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=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 e=="boolean"?e:e==null?void 0:e.children)&&t)for(let u=0;u<t.length;++u)t[u].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}Ie.mixin(zn,ZA,nM,uM,rM,sM,$A,eM,lM,kA,QA,iM,WA);class j_ extends zn{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new ci(0,1,0,0),this._boundsDirty=!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const t=this.bounds,{x:a,y:r}=e;return a>=t.minX&&a<=t.maxX&&r>=t.minY&&r<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}destroy(e){var t,a;super.destroy(e),this._bounds=null;for(const r in this._gpuData)(a=(t=this._gpuData[r]).destroy)==null||a.call(t);this._gpuData=null}collectRenderablesSimple(e,t,a){const{renderPipes:r}=t;r.blendMode.pushBlendMode(this,this.groupBlendMode,e),r[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=!1;const h=this.children,f=h.length;for(let m=0;m<f;m++)h[m].collectRenderables(e,t,a);r.blendMode.popBlendMode(e)}}class ru extends j_{constructor(e=He.EMPTY){e instanceof He&&(e={texture:e});const{texture:t=He.EMPTY,anchor:a,roundPixels:r,width:u,height:h,...f}=e;super({label:"Sprite",...f}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Mi({_onUpdate:()=>{this.onViewUpdate()}}),a?this.anchor=a:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,u!==void 0&&(this.width=u),h!==void 0&&(this.height=h)}static from(e,t=!1){return e instanceof He?new ru(e):new ru(He.from(e,t))}set texture(e){e||(e=He.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,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 Rx(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return it("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,t=this._texture,a=this._bounds,{width:r,height:u}=t.orig;a.minX=-e._x*r,a.maxX=a.minX+r,a.minY=-e._y*u,a.maxY=a.minY+u}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const a=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(a)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}}const fM=new ci;function kx(n,e,t){const a=fM;n.measurable=!0,N_(n,t,a),e.addBoundsMask(a),n.measurable=!1}function Ix(n,e,t){const a=Jr.get();n.measurable=!0;const r=ji.get().identity(),u=Kx(n,t,r);P_(n,a,u),n.measurable=!1,e.addBoundsMask(a),ji.return(r),Jr.return(a)}function Kx(n,e,t){return n?(n!==e&&(Kx(n.parent,e,t),n.updateLocalTransform(),t.append(n.localTransform)),t):(rt("Mask bounds, renderable is not inside the root container"),t)}class Qx{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof ru),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(e,t){this.inverse||kx(this.mask,e,t)}addLocalBounds(e,t){Ix(this.mask,e,t)}containsPoint(e,t){const a=this.mask;return t(a,e)}destroy(){this.reset()}static test(e){return e instanceof ru}}Qx.extension=Q.MaskEffect;class Zx{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}Zx.extension=Q.MaskEffect;class Wx{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(e,t){kx(this.mask,e,t)}addLocalBounds(e,t){Ix(this.mask,e,t)}containsPoint(e,t){const a=this.mask;return t(a,e)}destroy(){this.reset()}static test(e){return e instanceof zn}}Wx.extension=Q.MaskEffect;let Jx={createCanvas:(n,e)=>{const t=document.createElement("canvas");return t.width=n,t.height=e,t},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,e)=>fetch(n,e),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")};const wt={get(){return Jx},set(n){Jx=n}};class $r extends wn{constructor(e){e.resource||(e.resource=wt.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.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(e=this.width,t=this.height,a=this._resolution){const r=super.resize(e,t,a);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}$r.extension=Q.TextureSource;class Wf extends wn{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}Wf.extension=Q.TextureSource;var Cc=(n=>(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(Cc||{});class Y_{constructor(e,t=null,a=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=a,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!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 t=this.next;return this.next=e?null:t,this.previous=null,t}}const $x=class qa{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 Y_(null,null,1/0),this.deltaMS=1/qa.targetFPMS,this.elapsedMS=1/qa.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),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(e,t,a=Cc.NORMAL){return this._addListener(new Y_(e,t,a))}addOnce(e,t,a=Cc.NORMAL){return this._addListener(new Y_(e,t,a,!0))}_addListener(e){let t=this._head.next,a=this._head;if(!t)e.connect(a);else{for(;t;){if(e.priority>t.priority){e.connect(a);break}a=t,t=t.next}e.previous||e.connect(a)}return this._startIfPossible(),this}remove(e,t){let a=this._head.next;for(;a;)a.match(e,t)?a=a.destroy():a=a.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const u=e-this._lastFrame|0;if(u<this._minElapsedMS)return;this._lastFrame=e-u%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*qa.targetFPMS;const a=this._head;let r=a.next;for(;r;)r=r.emit(this);a.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),a=Math.min(Math.max(0,t)/1e3,qa.targetFPMS);this._maxElapsedMS=1/a}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!qa._shared){const e=qa._shared=new qa;e.autoStart=!0,e._protected=!0}return qa._shared}static get system(){if(!qa._system){const e=qa._system=new qa;e.autoStart=!0,e._protected=!0}return qa._system}};$x.targetFPMS=.06;let ka=$x,X_;async function dM(){return X_??(X_=(async()=>{var h;const e=wt.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const t=await new Promise(f=>{const m=document.createElement("video");m.onloadeddata=()=>f(m),m.onerror=()=>f(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(!t)return"premultiply-alpha-on-upload";const a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);const u=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,u),e.deleteFramebuffer(r),e.deleteTexture(a),(h=e.getExtension("WEBGL_lose_context"))==null||h.loseContext(),u[0]<=u[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),X_}const sy=class kR extends wn{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...kR.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.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),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=ka.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!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 e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await dM(),this._load=new Promise((a,r)=>{this.isValid?a(this):(this._resolve=a,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.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 e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.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 e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ka.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||(ka.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ka.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};sy.extension=Q.TextureSource,sy.defaultOptions={...wn.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},sy.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let pM=sy;const Rc=(n,e,t=!1)=>(Array.isArray(n)||(n=[n]),e?n.map(a=>typeof a=="string"||t?e(a):a):n);class mM{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||rt(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const a=Rc(e);let r;for(let m=0;m<this.parsers.length;m++){const y=this.parsers[m];if(y.test(t)){r=y.getCacheableAssets(a,t);break}}const u=new Map(Object.entries(r||{}));r||a.forEach(m=>{u.set(m,t)});const h=[...u.keys()],f={cacheKeys:h,keys:a};a.forEach(m=>{this._cacheMap.set(m,f)}),h.forEach(m=>{const y=r?r[m]:t;this._cache.has(m)&&this._cache.get(m)!==y&&rt("[Cache] already has key:",m),this._cache.set(m,u.get(m))})}remove(e){if(!this._cacheMap.has(e)){rt(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(r=>{this._cache.delete(r)}),t.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Di=new mM,q_=[];Ie.handleByList(Q.TextureSource,q_);function eS(n={}){const e=n&&n.resource,t=e?n.resource:n,a=e?n:{resource:n};for(let r=0;r<q_.length;r++){const u=q_[r];if(u.test(t))return new u(a)}throw new Error(`Could not find a source type for resource: ${a.resource}`)}function yM(n={},e=!1){const t=n&&n.resource,a=t?n.resource:n,r=t?n:{resource:n};if(!e&&Di.has(a))return Di.get(a);const u=new He({source:eS(r)});return u.on("destroy",()=>{Di.has(a)&&Di.remove(a)}),e||Di.set(a,u),u}function gM(n,e=!1){return typeof n=="string"?Di.get(n):n instanceof wn?new He({source:n}):yM(n,e)}He.from=gM,wn.from=eS,Ie.add(Qx,Zx,Wx,pM,Wf,$r,C_);var tS=(n=>(n[n.Low=0]="Low",n[n.Normal=1]="Normal",n[n.High=2]="High",n))(tS||{});function Ds(n){if(typeof n!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(n)}`)}function Jf(n){return n.split("?")[0].split("#")[0]}function _M(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vM(n,e,t){return n.replace(new RegExp(_M(e),"g"),t)}function bM(n,e){let t="",a=0,r=-1,u=0,h=-1;for(let f=0;f<=n.length;++f){if(f<n.length)h=n.charCodeAt(f);else{if(h===47)break;h=47}if(h===47){if(!(r===f-1||u===1))if(r!==f-1&&u===2){if(t.length<2||a!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){const m=t.lastIndexOf("/");if(m!==t.length-1){m===-1?(t="",a=0):(t=t.slice(0,m),a=t.length-1-t.lastIndexOf("/")),r=f,u=0;continue}}else if(t.length===2||t.length===1){t="",a=0,r=f,u=0;continue}}}else t.length>0?t+=`/${n.slice(r+1,f)}`:t=n.slice(r+1,f),a=f-r-1;r=f,u=0}else h===46&&u!==-1?++u:u=-1}return t}const $f={toPosix(n){return vM(n,"\\","/")},isUrl(n){return/^https?:/.test(this.toPosix(n))},isDataUrl(n){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(n)},isBlobUrl(n){return n.startsWith("blob:")},hasProtocol(n){return/^[^/:]+:/.test(this.toPosix(n))},getProtocol(n){Ds(n),n=this.toPosix(n);const e=/^file:\/\/\//.exec(n);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(n);return t?t[0]:""},toAbsolute(n,e,t){if(Ds(n),this.isDataUrl(n)||this.isBlobUrl(n))return n;const a=Jf(this.toPosix(e??wt.get().getBaseUrl())),r=Jf(this.toPosix(t??this.rootname(a)));return n=this.toPosix(n),n.startsWith("/")?$f.join(r,n.slice(1)):this.isAbsolute(n)?n:this.join(a,n)},normalize(n){if(Ds(n),n.length===0)return".";if(this.isDataUrl(n)||this.isBlobUrl(n))return n;n=this.toPosix(n);let e="";const t=n.startsWith("/");this.hasProtocol(n)&&(e=this.rootname(n),n=n.slice(e.length));const a=n.endsWith("/");return n=bM(n),n.length>0&&a&&(n+="/"),t?`/${n}`:e+n},isAbsolute(n){return Ds(n),n=this.toPosix(n),this.hasProtocol(n)?!0:n.startsWith("/")},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const a=n[t];if(Ds(a),a.length>0)if(e===void 0)e=a;else{const r=n[t-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${a}`:e+=`/${a}`}}return e===void 0?".":this.normalize(e)},dirname(n){if(Ds(n),n.length===0)return".";n=this.toPosix(n);let e=n.charCodeAt(0);const t=e===47;let a=-1,r=!0;const u=this.getProtocol(n),h=n;n=n.slice(u.length);for(let f=n.length-1;f>=1;--f)if(e=n.charCodeAt(f),e===47){if(!r){a=f;break}}else r=!1;return a===-1?t?"/":this.isUrl(h)?u+n:u:t&&a===1?"//":u+n.slice(0,a)},rootname(n){Ds(n),n=this.toPosix(n);let e="";if(n.startsWith("/")?e="/":e=this.getProtocol(n),this.isUrl(n)){const t=n.indexOf("/",e.length);t!==-1?e=n.slice(0,t):e=n,e.endsWith("/")||(e+="/")}return e},basename(n,e){Ds(n),e&&Ds(e),n=Jf(this.toPosix(n));let t=0,a=-1,r=!0,u;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e.length===n.length&&e===n)return"";let h=e.length-1,f=-1;for(u=n.length-1;u>=0;--u){const m=n.charCodeAt(u);if(m===47){if(!r){t=u+1;break}}else f===-1&&(r=!1,f=u+1),h>=0&&(m===e.charCodeAt(h)?--h===-1&&(a=u):(h=-1,a=f))}return t===a?a=f:a===-1&&(a=n.length),n.slice(t,a)}for(u=n.length-1;u>=0;--u)if(n.charCodeAt(u)===47){if(!r){t=u+1;break}}else a===-1&&(r=!1,a=u+1);return a===-1?"":n.slice(t,a)},extname(n){Ds(n),n=Jf(this.toPosix(n));let e=-1,t=0,a=-1,r=!0,u=0;for(let h=n.length-1;h>=0;--h){const f=n.charCodeAt(h);if(f===47){if(!r){t=h+1;break}continue}a===-1&&(r=!1,a=h+1),f===46?e===-1?e=h:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||a===-1||u===0||u===1&&e===a-1&&e===t+1?"":n.slice(e,a)},parse(n){Ds(n);const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;n=Jf(this.toPosix(n));let t=n.charCodeAt(0);const a=this.isAbsolute(n);let r;e.root=this.rootname(n),a||this.hasProtocol(n)?r=1:r=0;let u=-1,h=0,f=-1,m=!0,y=n.length-1,v=0;for(;y>=r;--y){if(t=n.charCodeAt(y),t===47){if(!m){h=y+1;break}continue}f===-1&&(m=!1,f=y+1),t===46?u===-1?u=y:v!==1&&(v=1):u!==-1&&(v=-1)}return u===-1||f===-1||v===0||v===1&&u===f-1&&u===h+1?f!==-1&&(h===0&&a?e.base=e.name=n.slice(1,f):e.base=e.name=n.slice(h,f)):(h===0&&a?(e.name=n.slice(1,u),e.base=n.slice(1,f)):(e.name=n.slice(h,u),e.base=n.slice(h,f)),e.ext=n.slice(u,f)),e.dir=this.dirname(n),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function nS(n,e,t,a,r){const u=e[t];for(let h=0;h<u.length;h++){const f=u[h];t<e.length-1?nS(n.replace(a[t],f),e,t+1,a,r):r.push(n.replace(a[t],f))}}function xM(n){const e=/\{(.*?)\}/g,t=n.match(e),a=[];if(t){const r=[];t.forEach(u=>{const h=u.substring(1,u.length-1).split(",");r.push(h)}),nS(n,r,0,t,a)}else a.push(n);return a}const iS=n=>!Array.isArray(n);class aS{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}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(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(t[a])}`).join("&")}}getAlias(e){const{alias:t,src:a}=e;return Rc(t||a,u=>typeof u=="string"?u:Array.isArray(u)?u.map(h=>(h==null?void 0:h.src)??h):u!=null&&u.src?u.src:u,!0)}addManifest(e){this._manifest&&rt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const a=[];let r=t;Array.isArray(t)||(r=Object.entries(t).map(([u,h])=>typeof h=="string"||Array.isArray(h)?{alias:u,src:h}:{alias:u,...h})),r.forEach(u=>{const h=u.src,f=u.alias;let m;if(typeof f=="string"){const y=this._createBundleAssetId(e,f);a.push(y),m=[f,y]}else{const y=f.map(v=>this._createBundleAssetId(e,v));a.push(...y),m=[...f,...y]}this.add({...u,alias:m,src:h})}),this._bundles[e]=a}add(e){const t=[];Array.isArray(e)?t.push(...e):t.push(e);let a;a=u=>{this.hasKey(u)&&rt(`[Resolver] already has key: ${u} overwriting`)},Rc(t).forEach(u=>{const{src:h}=u;let{data:f,format:m,loadParser:y,parser:v}=u;const S=Rc(h).map(A=>typeof A=="string"?xM(A):Array.isArray(A)?A:[A]),T=this.getAlias(u);Array.isArray(T)?T.forEach(a):a(T);const E=[];S.forEach(A=>{A.forEach(U=>{let M={};if(typeof U!="object"){M.src=U;for(let G=0;G<this._parsers.length;G++){const P=this._parsers[G];if(P.test(U)){M=P.parse(U);break}}}else f=U.data??f,m=U.format??m,(U.loadParser||U.parser)&&(y=U.loadParser??y,v=U.parser??v),M={...M,...U};if(!T)throw new Error(`[Resolver] alias is undefined for this asset: ${M.src}`);M=this._buildResolvedAsset(M,{aliases:T,data:f,format:m,loadParser:y,parser:v,progressSize:u.progressSize}),E.push(M)})}),T.forEach(A=>{this._assetMap[A]=E})})}resolveBundle(e){const t=iS(e);e=Rc(e);const a={};return e.forEach(r=>{const u=this._bundles[r];if(u){const h=this.resolve(u),f={};for(const m in h){const y=h[m];f[this._extractAssetIdFromBundle(r,m)]=y}a[r]=f}}),t?a[e[0]]:a}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const a={};for(const r in t)a[r]=t[r].src;return a}return t.src}resolve(e){const t=iS(e);e=Rc(e);const a={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let u=this._assetMap[r];const h=this._getPreferredOrder(u);h==null||h.priority.forEach(f=>{h.params[f].forEach(m=>{const y=u.filter(v=>v[f]?v[f]===m:!1);y.length&&(u=y)})}),this._resolverHash[r]=u[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});a[r]=this._resolverHash[r]}),t?a[e[0]]:a}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){const a=e[t],r=this._preferredOrder.find(u=>u.params.format.includes(a.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){const{aliases:a,data:r,loadParser:u,parser:h,format:f,progressSize:m}=t;return(this._basePath||this._rootPath)&&(e.src=$f.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=a??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=u??e.loadParser,e.parser=h??e.parser,e.format=f??e.format??SM(e.src),m!==void 0&&(e.progressSize=m),e}}aS.RETINA_PREFIX=/@([0-9\.]+)x/;function SM(n){return n.split(".").pop().split("?").shift().split("#").shift()}const sS=(n,e)=>{const t=e.split("?")[1];return t&&(n+=`?${t}`),n},rS=class Km{constructor(e,t){this.linkedSheets=[];let a=e;(e==null?void 0:e.source)instanceof wn&&(a={texture:e,data:t});const{texture:r,data:u,cachePrefix:h=""}=a;this.cachePrefix=h,this._texture=r instanceof He?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=u;const f=parseFloat(u.meta.scale);f?(this.resolution=f,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(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Km.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const a=Km.BATCH_SIZE;for(;t-e<a&&t<this._frameKeys.length;){const r=this._frameKeys[t],u=this._frames[r],h=u.frame;if(h){let f=null,m=null;const y=u.trimmed!==!1&&u.sourceSize?u.sourceSize:u.frame,v=new Pt(0,0,Math.floor(y.w)/this.resolution,Math.floor(y.h)/this.resolution);u.rotated?f=new Pt(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.h)/this.resolution,Math.floor(h.w)/this.resolution):f=new Pt(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution),u.trimmed!==!1&&u.spriteSourceSize&&(m=new Pt(Math.floor(u.spriteSourceSize.x)/this.resolution,Math.floor(u.spriteSourceSize.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution)),this.textures[r]=new He({source:this.textureSource,frame:f,orig:v,trim:m,rotate:u.rotated?2:0,defaultAnchor:u.anchor,defaultBorders:u.borders,label:r.toString()})}t++}}_processAnimations(){const e=this.data.animations||{};for(const t in e){this.animations[t]=[];for(let a=0;a<e[t].length;a++){const r=e[t][a];this.animations[t].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Km.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Km.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var t;for(const a in this.textures)this.textures[a].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)==null||t.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};rS.BATCH_SIZE=1e3;let lS=rS;const TM=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function oS(n,e,t){const a={};if(n.forEach(r=>{a[r]=e}),Object.keys(e.textures).forEach(r=>{a[`${e.cachePrefix}${r}`]=e.textures[r]}),!t){const r=$f.dirname(n[0]);e.linkedSheets.forEach((u,h)=>{const f=oS([`${r}/${e.data.meta.related_multi_packs[h]}`],u,!0);Object.assign(a,f)})}return a}const EM={extension:Q.Asset,cache:{test:n=>n instanceof lS,getCacheableAssets:(n,e)=>oS(n,e,!1)},resolver:{extension:{type:Q.ResolveParser,name:"resolveSpritesheet"},test:n=>{const t=n.split("?")[0].split("."),a=t.pop(),r=t.pop();return a==="json"&&TM.includes(r)},parse:n=>{var t;const e=n.split(".");return{resolution:parseFloat(((t=aS.RETINA_PREFIX.exec(n))==null?void 0:t[1])??"1"),format:e[e.length-2],src:n}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Q.LoadParser,priority:tS.Normal,name:"spritesheetLoader"},async testParse(n,e){return $f.extname(e.src).toLowerCase()===".json"&&!!n.frames},async parse(n,e,t){var S,T;const{texture:a,imageFilename:r,textureOptions:u,cachePrefix:h}=(e==null?void 0:e.data)??{};let f=$f.dirname(e.src);f&&f.lastIndexOf("/")!==f.length-1&&(f+="/");let m;if(a instanceof He)m=a;else{const E=sS(f+(r??n.meta.image),e.src);m=(await t.load([{src:E,data:u}]))[E]}const y=new lS({texture:m.source,data:n,cachePrefix:h});await y.parse();const v=(S=n==null?void 0:n.meta)==null?void 0:S.related_multi_packs;if(Array.isArray(v)){const E=[];for(const U of v){if(typeof U!="string")continue;let M=f+U;(T=e.data)!=null&&T.ignoreMultiPack||(M=sS(M,e.src),E.push(t.load({src:M,data:{textureOptions:u,ignoreMultiPack:!0}})))}const A=await Promise.all(E);y.linkedSheets=A,A.forEach(U=>{U.linkedSheets=[y].concat(y.linkedSheets.filter(M=>M!==U))})}return y},async unload(n,e,t){await t.unload(n.textureSource._sourceOrigin),n.destroy(!1)}}};Ie.add(EM);class uS{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),a=this._canvas.width,r=this._canvas.height,u=t.width/a*this._renderer.resolution,h=t.height/r*this._renderer.resolution,f=t.left,m=t.top,y=`translate(${f}px, ${m}px) scale(${u}, ${h})`;y!==this._lastTransform&&(this._domElement.style.transform=y,this._lastTransform=y)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const a=this.canvas.width,r=this.canvas.height,u=t.contentRect.width/a*this._renderer.resolution,h=t.contentRect.height/r*this._renderer.resolution;(this._lastScaleX!==u||this._lastScaleY!==h)&&(this.updateTranslation(),this._lastScaleX=u,this._lastScaleY=h)}}),this._observer.observe(this._canvas)):this._tickerAttached||ka.shared.add(this.updateTranslation,this,Cc.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&ka.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class ed{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=ed.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new kt,this.page=new kt,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,a){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,a,r,u){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var F_=/iPhone/i,cS=/iPod/i,hS=/iPad/i,fS=/\biOS-universal(?:.+)Mac\b/i,k_=/\bAndroid(?:.+)Mobile\b/i,dS=/Android/i,Ac=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ry=/Silk/i,el=/Windows Phone/i,pS=/\bWindows(?:.+)ARM\b/i,mS=/BlackBerry/i,yS=/BB10/i,gS=/Opera Mini/i,_S=/\b(CriOS|Chrome)(?:.+)Mobile/i,vS=/Mobile(?:.+)Firefox\b/i,bS=function(n){return typeof n<"u"&&n.platform==="MacIntel"&&typeof n.maxTouchPoints=="number"&&n.maxTouchPoints>1&&typeof MSStream>"u"};function CM(n){return function(e){return e.test(n)}}function xS(n){var e={userAgent:"",platform:"",maxTouchPoints:0};!n&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof n=="string"?e.userAgent=n:n&&n.userAgent&&(e={userAgent:n.userAgent,platform:n.platform,maxTouchPoints:n.maxTouchPoints||0});var t=e.userAgent,a=t.split("[FBAN");typeof a[1]<"u"&&(t=a[0]),a=t.split("Twitter"),typeof a[1]<"u"&&(t=a[0]);var r=CM(t),u={apple:{phone:r(F_)&&!r(el),ipod:r(cS),tablet:!r(F_)&&(r(hS)||bS(e))&&!r(el),universal:r(fS),device:(r(F_)||r(cS)||r(hS)||r(fS)||bS(e))&&!r(el)},amazon:{phone:r(Ac),tablet:!r(Ac)&&r(ry),device:r(Ac)||r(ry)},android:{phone:!r(el)&&r(Ac)||!r(el)&&r(k_),tablet:!r(el)&&!r(Ac)&&!r(k_)&&(r(ry)||r(dS)),device:!r(el)&&(r(Ac)||r(ry)||r(k_)||r(dS))||r(/\bokhttp\b/i)},windows:{phone:r(el),tablet:r(pS),device:r(el)||r(pS)},other:{blackberry:r(mS),blackberry10:r(yS),opera:r(gS),firefox:r(vS),chrome:r(_S),device:r(mS)||r(yS)||r(gS)||r(vS)||r(_S)},any:!1,phone:!1,tablet:!1};return u.any=u.apple.device||u.android.device||u.windows.device||u.other.device,u.phone=u.apple.phone||u.android.phone||u.windows.phone,u.tablet=u.apple.tablet||u.android.tablet||u.windows.tablet,u}const RM=(xS.default??xS)(globalThis.navigator),AM=9,SS=100,MM=0,DM=0,TS=2,ES=1,UM=-1e3,BM=-1e3,OM=2,I_=class IR{constructor(e,t=RM){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){const e=document.createElement("button");e.style.width=`${ES}px`,e.style.height=`${ES}px`,e.style.position="absolute",e.style.top=`${UM}px`,e.style.left=`${BM}px`,e.style.zIndex=OM.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${MM}px`,this._div.style.left=`${DM}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=TS.toString(),this._canvasObserver=new uS({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,!0);const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(const e in this._pools)this._pools[e].forEach(a=>{a.parentNode&&a.parentNode.removeChild(a)}),delete this._pools[e];this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let a=0;a<t.length;a++)this._updateAccessibleObjects(t[a])}init(e){const a={accessibilityOptions:{...IR.defaultOptions,...(e==null?void 0:e.accessibilityOptions)||{}}};this.debug=a.accessibilityOptions.debug,this._activateOnTab=a.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=a.accessibilityOptions.deactivateOnMouseMove,a.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const a of this._children)a._renderId===this._renderId&&t.add(this._children.indexOf(a))}for(let a=this._children.length-1;a>=0;a--){const r=this._children[a];t.has(a)||(r._accessibleDiv&&r._accessibleDiv.parentNode&&(r._accessibleDiv.parentNode.removeChild(r._accessibleDiv),this._getPool(r.accessibleType).push(r._accessibleDiv),r._accessibleDiv=null),r._accessibleActive=!1,Vx(this._children,a,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let a=0;a<this._children.length;a++){const r=this._children[a];if(!r._accessibleActive||!r._accessibleDiv)continue;const u=r._accessibleDiv,h=r.hitArea||r.getBounds().rectangle;if(r.hitArea){const f=r.worldTransform;u.style.left=`${f.tx+h.x*f.a}px`,u.style.top=`${f.ty+h.y*f.d}px`,u.style.width=`${h.width*f.a}px`,u.style.height=`${h.height*f.d}px`}else this._capHitArea(h),u.style.left=`${h.x}px`,u.style.top=`${h.y}px`,u.style.width=`${h.width}px`,u.style.height=`${h.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:a}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>a&&(e.height=a-e.y)}_addChild(e){let a=this._getPool(e.accessibleType).pop();a?(a.innerHTML="",a.removeAttribute("title"),a.removeAttribute("aria-label"),a.tabIndex=0):(e.accessibleType==="button"?a=document.createElement("button"):(a=document.createElement(e.accessibleType),a.style.cssText=`
54
- color: transparent;
55
- pointer-events: none;
56
- padding: 0;
57
- margin: 0;
58
- border: 0;
59
- outline: 0;
60
- background: transparent;
61
- box-sizing: border-box;
62
- user-select: none;
63
- -webkit-user-select: none;
64
- -moz-user-select: none;
65
- -ms-user-select: none;
66
- `,e.accessibleText&&(a.innerText=e.accessibleText)),a.style.width=`${SS}px`,a.style.height=`${SS}px`,a.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",a.style.position="absolute",a.style.zIndex=TS.toString(),a.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?a.setAttribute("aria-live","off"):a.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?a.setAttribute("aria-relevant","additions"):a.setAttribute("aria-relevant","text"),a.addEventListener("click",this._onClick.bind(this)),a.addEventListener("focus",this._onFocus.bind(this)),a.addEventListener("focusout",this._onFocusOut.bind(this))),a.style.pointerEvents=e.accessiblePointerEvents,a.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?a.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(a.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&a.setAttribute("aria-label",e.accessibleHint),e.interactive?a.tabIndex=e.tabIndex:a.tabIndex=0,this.debug&&this._updateDebugHTML(a),e._accessibleActive=!0,e._accessibleDiv=a,a.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){const{container:a}=e.target,r=this._renderer.events.rootBoundary,u=Object.assign(new ed(r),{target:a});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(h=>r.dispatchEvent(u,h))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode!==AM||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){var e;this._deactivate(),this._destroyTouchHook(),(e=this._canvasObserver)==null||e.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};I_.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"accessibility"},I_.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let NM=I_;const GM={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},K_=Object.create(null),CS=Object.create(null);function td(n,e){let t=CS[n];return t===void 0&&(K_[e]===void 0&&(K_[e]=1),CS[n]=t=K_[e]++),t}let Mc;function RS(){return(!Mc||Mc!=null&&Mc.isContextLost())&&(Mc=wt.get().createCanvas().getContext("webgl",{})),Mc}let ly;function PM(){if(!ly){ly="mediump";const n=RS();n&&n.getShaderPrecisionFormat&&(ly=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision?"highp":"mediump")}return ly}function wM(n,e,t){return e?n:t?(n=n.replace("out vec4 finalColor;",""),`
67
-
68
- #ifdef GL_ES // This checks if it is WebGL1
69
- #define in varying
70
- #define finalColor gl_FragColor
71
- #define texture texture2D
72
- #endif
73
- ${n}
74
- `):`
75
-
76
- #ifdef GL_ES // This checks if it is WebGL1
77
- #define in attribute
78
- #define out varying
79
- #endif
80
- ${n}
81
- `}function zM(n,e,t){const a=t?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(n.substring(0,9)!=="precision"){let r=t?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&a!=="highp"&&(r="mediump"),`precision ${r} float;
82
- ${n}`}else if(a!=="highp"&&n.substring(0,15)==="precision highp")return n.replace("precision highp","precision mediump");return n}function HM(n,e){return e?`#version 300 es
83
- ${n}`:n}const VM={},LM={};function jM(n,{name:e="pixi-program"},t=!0){e=e.replace(/\s+/g,"-"),e+=t?"-fragment":"-vertex";const a=t?VM:LM;return a[e]?(a[e]++,e+=`-${a[e]}`):a[e]=1,n.indexOf("#define SHADER_NAME")!==-1?n:`${`#define SHADER_NAME ${e}`}
84
- ${n}`}function YM(n,e){return e?n.replace("#version 300 es",""):n}const Q_={stripVersion:YM,ensurePrecision:zM,addProgramDefines:wM,setProgramName:jM,insertVersion:HM},nd=Object.create(null),AS=class Wb{constructor(e){e={...Wb.defaultOptions,...e};const t=e.fragment.indexOf("#version 300 es")!==-1,a={stripVersion:t,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:PM()},setProgramName:{name:e.name},addProgramDefines:t,insertVersion:t};let r=e.fragment,u=e.vertex;Object.keys(Q_).forEach(h=>{const f=a[h];r=Q_[h](r,f,!0),u=Q_[h](u,f,!1)}),this.fragment=r,this.vertex=u,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=td(`${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,nd[this._cacheKey]=null}static from(e){const t=`${e.vertex}:${e.fragment}`;return nd[t]||(nd[t]=new Wb(e),nd[t]._cacheKey=t),nd[t]}};AS.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let lu=AS;const MS={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 Ql(n){return MS[n]??MS.float32}const XM={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",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function qM({source:n,entryPoint:e}){const t={},a=n.indexOf(`fn ${e}`);if(a!==-1){const r=n.indexOf("->",a);if(r!==-1){const u=n.substring(a,r),h=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let f;for(;(f=h.exec(u))!==null;){const m=XM[f[3]]??"float32";t[f[2]]={location:parseInt(f[1],10),format:m,stride:Ql(m).stride,offset:0,instance:!1,start:0}}}}return t}function Z_(n){var S,T;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,t=/@group\((\d+)\)/,a=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,u=/:\s*(\w+)/,h=/struct\s+(\w+)\s*{([^}]+)}/g,f=/(\w+)\s*:\s*([\w\<\>]+)/g,m=/struct\s+(\w+)/,y=(S=n.match(e))==null?void 0:S.map(E=>({group:parseInt(E.match(t)[1],10),binding:parseInt(E.match(a)[1],10),name:E.match(r)[2],isUniform:E.match(r)[1]==="<uniform>",type:E.match(u)[1]}));if(!y)return{groups:[],structs:[]};const v=((T=n.match(h))==null?void 0:T.map(E=>{const A=E.match(m)[1],U=E.match(f).reduce((M,G)=>{const[P,w]=G.split(":");return M[P.trim()]=w.trim(),M},{});return U?{name:A,members:U}:null}).filter(({name:E})=>y.some(A=>A.type===E)))??[];return{groups:y,structs:v}}var id=(n=>(n[n.VERTEX=1]="VERTEX",n[n.FRAGMENT=2]="FRAGMENT",n[n.COMPUTE=4]="COMPUTE",n))(id||{});function FM({groups:n}){const e=[];for(let t=0;t<n.length;t++){const a=n[t];e[a.group]||(e[a.group]=[]),a.isUniform?e[a.group].push({binding:a.binding,visibility:id.VERTEX|id.FRAGMENT,buffer:{type:"uniform"}}):a.type==="sampler"?e[a.group].push({binding:a.binding,visibility:id.FRAGMENT,sampler:{type:"filtering"}}):a.type==="texture_2d"&&e[a.group].push({binding:a.binding,visibility:id.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return e}function kM({groups:n}){const e=[];for(let t=0;t<n.length;t++){const a=n[t];e[a.group]||(e[a.group]={}),e[a.group][a.name]=a.binding}return e}function IM(n,e){const t=new Set,a=new Set,r=[...n.structs,...e.structs].filter(h=>t.has(h.name)?!1:(t.add(h.name),!0)),u=[...n.groups,...e.groups].filter(h=>{const f=`${h.name}-${h.binding}`;return a.has(f)?!1:(a.add(f),!0)});return{structs:r,groups:u}}const ad=Object.create(null);class Zl{constructor(e){var f,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:t,vertex:a,layout:r,gpuLayout:u,name:h}=e;if(this.name=h,this.fragment=t,this.vertex=a,t.source===a.source){const y=Z_(t.source);this.structsAndGroups=y}else{const y=Z_(a.source),v=Z_(t.source);this.structsAndGroups=IM(y,v)}this.layout=r??kM(this.structsAndGroups),this.gpuLayout=u??FM(this.structsAndGroups),this.autoAssignGlobalUniforms=((f=this.layout[0])==null?void 0:f.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((m=this.layout[1])==null?void 0:m.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:t}=this,a=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=td(a,"program")}get attributeData(){return this._attributeData??(this._attributeData=qM(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,ad[this._cacheKey]=null}static from(e){const t=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return ad[t]||(ad[t]=new Zl(e),ad[t]._cacheKey=t),ad[t]}}const DS=["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>"],KM=DS.reduce((n,e)=>(n[e]=!0,n),{});function QM(n,e){switch(n){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);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 US=class KR{constructor(e,t){this._touched=0,this.uid=It("uniform"),this._resourceType="uniformGroup",this._resourceId=It("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,t={...KR.defaultOptions,...t},this.uniformStructures=e;const a={};for(const r in e){const u=e[r];if(u.name=r,u.size=u.size??1,!KM[u.type]){const h=u.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(h){const[,f,m]=h;throw new Error(`Uniform type ${u.type} is not supported. Use type: '${f}', size: ${m} instead.`)}throw new Error(`Uniform type ${u.type} is not supported. Supported uniform types are: ${DS.join(", ")}`)}u.value??(u.value=QM(u.type,u.size)),a[r]=u.value}this.uniforms=a,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=td(Object.keys(a).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};US.defaultOptions={ubo:!1,isStatic:!1};let Yi=US;class tl{constructor(e){this.resources=Object.create(null),this._dirty=!0;let t=0;for(const a in e){const r=e[a];this.setResource(r,t++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let t=0;for(const a in this.resources)e[t++]=this.resources[a]._resourceId;this._key=e.join("|")}setResource(e,t){var r,u;const a=this.resources[t];e!==a&&(a&&((r=e.off)==null||r.call(e,"change",this.onResourceChange,this)),(u=e.on)==null||u.call(e,"change",this.onResourceChange,this),this.resources[t]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const t=this.resources;for(const a in t)t[a]._touched=e}destroy(){var t;const e=this.resources;for(const a in e){const r=e[a];(t=r==null?void 0:r.off)==null||t.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const t=this.resources;for(const a in t)t[a]===e&&(t[a]=null)}else this._updateKey()}}var Us=(n=>(n[n.WEBGL=1]="WEBGL",n[n.WEBGPU=2]="WEBGPU",n[n.BOTH=3]="BOTH",n))(Us||{});class Ia extends Sa{constructor(e){super(),this.uid=It("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:a,groups:r,resources:u,compatibleRenderers:h,groupMap:f}=e;this.gpuProgram=t,this.glProgram=a,h===void 0&&(h=0,t&&(h|=Us.WEBGPU),a&&(h|=Us.WEBGL)),this.compatibleRenderers=h;const m={};if(!u&&!r&&(u={}),u&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&r&&!f)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&r&&f)for(const y in f)for(const v in f[y]){const S=f[y][v];m[S]={group:y,binding:v,name:S}}else if(t&&r&&!f){const y=t.structsAndGroups.groups;f={},y.forEach(v=>{f[v.group]=f[v.group]||{},f[v.group][v.binding]=v.name,m[v.name]=v})}else if(u){r={},f={},t&&t.structsAndGroups.groups.forEach(S=>{f[S.group]=f[S.group]||{},f[S.group][S.binding]=S.name,m[S.name]=S});let y=0;for(const v in u)m[v]||(r[99]||(r[99]=new tl,this._ownedBindGroups.push(r[99])),m[v]={group:99,binding:y,name:v},f[99]=f[99]||{},f[99][y]=v,y++);for(const v in u){const S=v;let T=u[v];!T.source&&!T._resourceType&&(T=new Yi(T));const E=m[S];E&&(r[E.group]||(r[E.group]=new tl,this._ownedBindGroups.push(r[E.group])),r[E.group].setResource(T,E.binding))}}this.groups=r,this._uniformBindMap=f,this.resources=this._buildResourceAccessor(r,m)}addResource(e,t,a){var r,u;(r=this._uniformBindMap)[t]||(r[t]={}),(u=this._uniformBindMap[t])[a]||(u[a]=e),this.groups[t]||(this.groups[t]=new tl,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){const a={};for(const r in t){const u=t[r];Object.defineProperty(a,u.name,{get(){return e[u.group].getResource(u.binding)},set(h){e[u.group].setResource(h,u.binding)}})}return a}destroy(e=!1){var t,a;this.emit("destroy",this),e&&((t=this.gpuProgram)==null||t.destroy(),(a=this.glProgram)==null||a.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(e){const{gpu:t,gl:a,...r}=e;let u,h;return t&&(u=Zl.from(t)),a&&(h=lu.from(a)),new Ia({gpuProgram:u,glProgram:h,...r})}}const ZM={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},W_=0,J_=1,$_=2,ev=3,tv=4,nv=5,iv=class QR{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<W_)}set blend(e){!!(this.data&1<<W_)!==e&&(this.data^=1<<W_)}get offsets(){return!!(this.data&1<<J_)}set offsets(e){!!(this.data&1<<J_)!==e&&(this.data^=1<<J_)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<$_)}set culling(e){!!(this.data&1<<$_)!==e&&(this.data^=1<<$_)}get depthTest(){return!!(this.data&1<<ev)}set depthTest(e){!!(this.data&1<<ev)!==e&&(this.data^=1<<ev)}get depthMask(){return!!(this.data&1<<nv)}set depthMask(e){!!(this.data&1<<nv)!==e&&(this.data^=1<<nv)}get clockwiseFrontFace(){return!!(this.data&1<<tv)}set clockwiseFrontFace(e){!!(this.data&1<<tv)!==e&&(this.data^=1<<tv)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=ZM[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new QR;return e.depthTest=!1,e.blend=!0,e}};iv.default2d=iv.for2d();let Bs=iv;const BS=class Jb extends Ia{constructor(e){e={...Jb.defaultOptions,...e},super(e),this.enabled=!0,this._state=Bs.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(e,t,a,r){e.applyFilter(this,t,a,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:a,...r}=e;let u,h;return t&&(u=Zl.from(t)),a&&(h=lu.from(a)),new Jb({gpuProgram:u,glProgram:h,...r})}};BS.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let nl=BS;const av=[];Ie.handleByNamedList(Q.Environment,av);async function WM(n){if(!n)for(let e=0;e<av.length;e++){const t=av[e];if(t.value.test()){await t.value.load();return}}}let sd;function OS(){if(typeof sd=="boolean")return sd;try{sd=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{sd=!1}return sd}function NS(n,e,t=2){const a=e&&e.length,r=a?e[0]*t:n.length;let u=GS(n,0,r,t,!0);const h=[];if(!u||u.next===u.prev)return h;let f,m,y;if(a&&(u=n3(n,e,u,t)),n.length>80*t){f=n[0],m=n[1];let v=f,S=m;for(let T=t;T<r;T+=t){const E=n[T],A=n[T+1];E<f&&(f=E),A<m&&(m=A),E>v&&(v=E),A>S&&(S=A)}y=Math.max(v-f,S-m),y=y!==0?32767/y:0}return rd(u,h,t,f,m,y,0),h}function GS(n,e,t,a,r){let u;if(r===d3(n,e,t,a)>0)for(let h=e;h<t;h+=a)u=HS(h/a|0,n[h],n[h+1],u);else for(let h=t-a;h>=e;h-=a)u=HS(h/a|0,n[h],n[h+1],u);return u&&Dc(u,u.next)&&(ud(u),u=u.next),u}function ou(n,e){if(!n)return n;e||(e=n);let t=n,a;do if(a=!1,!t.steiner&&(Dc(t,t.next)||ln(t.prev,t,t.next)===0)){if(ud(t),t=e=t.prev,t===t.next)break;a=!0}else t=t.next;while(a||t!==e);return e}function rd(n,e,t,a,r,u,h){if(!n)return;!h&&u&&l3(n,a,r,u);let f=n;for(;n.prev!==n.next;){const m=n.prev,y=n.next;if(u?$M(n,a,r,u):JM(n)){e.push(m.i,n.i,y.i),ud(n),n=y.next,f=y.next;continue}if(n=y,n===f){h?h===1?(n=e3(ou(n),e),rd(n,e,t,a,r,u,2)):h===2&&t3(n,e,t,a,r,u):rd(ou(n),e,t,a,r,u,1);break}}}function JM(n){const e=n.prev,t=n,a=n.next;if(ln(e,t,a)>=0)return!1;const r=e.x,u=t.x,h=a.x,f=e.y,m=t.y,y=a.y,v=Math.min(r,u,h),S=Math.min(f,m,y),T=Math.max(r,u,h),E=Math.max(f,m,y);let A=a.next;for(;A!==e;){if(A.x>=v&&A.x<=T&&A.y>=S&&A.y<=E&&ld(r,f,u,m,h,y,A.x,A.y)&&ln(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function $M(n,e,t,a){const r=n.prev,u=n,h=n.next;if(ln(r,u,h)>=0)return!1;const f=r.x,m=u.x,y=h.x,v=r.y,S=u.y,T=h.y,E=Math.min(f,m,y),A=Math.min(v,S,T),U=Math.max(f,m,y),M=Math.max(v,S,T),G=sv(E,A,e,t,a),P=sv(U,M,e,t,a);let w=n.prevZ,z=n.nextZ;for(;w&&w.z>=G&&z&&z.z<=P;){if(w.x>=E&&w.x<=U&&w.y>=A&&w.y<=M&&w!==r&&w!==h&&ld(f,v,m,S,y,T,w.x,w.y)&&ln(w.prev,w,w.next)>=0||(w=w.prevZ,z.x>=E&&z.x<=U&&z.y>=A&&z.y<=M&&z!==r&&z!==h&&ld(f,v,m,S,y,T,z.x,z.y)&&ln(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;w&&w.z>=G;){if(w.x>=E&&w.x<=U&&w.y>=A&&w.y<=M&&w!==r&&w!==h&&ld(f,v,m,S,y,T,w.x,w.y)&&ln(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;z&&z.z<=P;){if(z.x>=E&&z.x<=U&&z.y>=A&&z.y<=M&&z!==r&&z!==h&&ld(f,v,m,S,y,T,z.x,z.y)&&ln(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function e3(n,e){let t=n;do{const a=t.prev,r=t.next.next;!Dc(a,r)&&wS(a,t,t.next,r)&&od(a,r)&&od(r,a)&&(e.push(a.i,t.i,r.i),ud(t),ud(t.next),t=n=r),t=t.next}while(t!==n);return ou(t)}function t3(n,e,t,a,r,u){let h=n;do{let f=h.next.next;for(;f!==h.prev;){if(h.i!==f.i&&c3(h,f)){let m=zS(h,f);h=ou(h,h.next),m=ou(m,m.next),rd(h,e,t,a,r,u,0),rd(m,e,t,a,r,u,0);return}f=f.next}h=h.next}while(h!==n)}function n3(n,e,t,a){const r=[];for(let u=0,h=e.length;u<h;u++){const f=e[u]*a,m=u<h-1?e[u+1]*a:n.length,y=GS(n,f,m,a,!1);y===y.next&&(y.steiner=!0),r.push(u3(y))}r.sort(i3);for(let u=0;u<r.length;u++)t=a3(r[u],t);return t}function i3(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const a=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=a-r}return t}function a3(n,e){const t=s3(n,e);if(!t)return e;const a=zS(t,n);return ou(a,a.next),ou(t,t.next)}function s3(n,e){let t=e;const a=n.x,r=n.y;let u=-1/0,h;if(Dc(n,t))return t;do{if(Dc(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const S=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(S<=a&&S>u&&(u=S,h=t.x<t.next.x?t:t.next,S===a))return h}t=t.next}while(t!==e);if(!h)return null;const f=h,m=h.x,y=h.y;let v=1/0;t=h;do{if(a>=t.x&&t.x>=m&&a!==t.x&&PS(r<y?a:u,r,m,y,r<y?u:a,r,t.x,t.y)){const S=Math.abs(r-t.y)/(a-t.x);od(t,n)&&(S<v||S===v&&(t.x>h.x||t.x===h.x&&r3(h,t)))&&(h=t,v=S)}t=t.next}while(t!==f);return h}function r3(n,e){return ln(n.prev,n,e.prev)<0&&ln(e.next,n,n.next)<0}function l3(n,e,t,a){let r=n;do r.z===0&&(r.z=sv(r.x,r.y,e,t,a)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,o3(r)}function o3(n){let e,t=1;do{let a=n,r;n=null;let u=null;for(e=0;a;){e++;let h=a,f=0;for(let y=0;y<t&&(f++,h=h.nextZ,!!h);y++);let m=t;for(;f>0||m>0&&h;)f!==0&&(m===0||!h||a.z<=h.z)?(r=a,a=a.nextZ,f--):(r=h,h=h.nextZ,m--),u?u.nextZ=r:n=r,r.prevZ=u,u=r;a=h}u.nextZ=null,t*=2}while(e>1);return n}function sv(n,e,t,a,r){return n=(n-t)*r|0,e=(e-a)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function u3(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function PS(n,e,t,a,r,u,h,f){return(r-h)*(e-f)>=(n-h)*(u-f)&&(n-h)*(a-f)>=(t-h)*(e-f)&&(t-h)*(u-f)>=(r-h)*(a-f)}function ld(n,e,t,a,r,u,h,f){return!(n===h&&e===f)&&PS(n,e,t,a,r,u,h,f)}function c3(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!h3(n,e)&&(od(n,e)&&od(e,n)&&f3(n,e)&&(ln(n.prev,n,e.prev)||ln(n,e.prev,e))||Dc(n,e)&&ln(n.prev,n,n.next)>0&&ln(e.prev,e,e.next)>0)}function ln(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Dc(n,e){return n.x===e.x&&n.y===e.y}function wS(n,e,t,a){const r=uy(ln(n,e,t)),u=uy(ln(n,e,a)),h=uy(ln(t,a,n)),f=uy(ln(t,a,e));return!!(r!==u&&h!==f||r===0&&oy(n,t,e)||u===0&&oy(n,a,e)||h===0&&oy(t,n,a)||f===0&&oy(t,e,a))}function oy(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function uy(n){return n>0?1:n<0?-1:0}function h3(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&wS(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function od(n,e){return ln(n.prev,n,n.next)<0?ln(n,e,n.next)>=0&&ln(n,n.prev,e)>=0:ln(n,e,n.prev)<0||ln(n,n.next,e)<0}function f3(n,e){let t=n,a=!1;const r=(n.x+e.x)/2,u=(n.y+e.y)/2;do t.y>u!=t.next.y>u&&t.next.y!==t.y&&r<(t.next.x-t.x)*(u-t.y)/(t.next.y-t.y)+t.x&&(a=!a),t=t.next;while(t!==n);return a}function zS(n,e){const t=rv(n.i,n.x,n.y),a=rv(e.i,e.x,e.y),r=n.next,u=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,a.next=t,t.prev=a,u.next=a,a.prev=u,a}function HS(n,e,t,a){const r=rv(n,e,t);return a?(r.next=a.next,r.prev=a,a.next.prev=r,a.next=r):(r.prev=r,r.next=r),r}function ud(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function rv(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function d3(n,e,t,a){let r=0;for(let u=e,h=t-a;u<t;u+=a)r+=(n[h]-n[u])*(n[u+1]+n[h+1]),h=u;return r}const p3=NS.default||NS;var Ta=(n=>(n[n.NONE=0]="NONE",n[n.COLOR=16384]="COLOR",n[n.STENCIL=1024]="STENCIL",n[n.DEPTH=256]="DEPTH",n[n.COLOR_DEPTH=16640]="COLOR_DEPTH",n[n.COLOR_STENCIL=17408]="COLOR_STENCIL",n[n.DEPTH_STENCIL=1280]="DEPTH_STENCIL",n[n.ALL=17664]="ALL",n))(Ta||{});class VS{constructor(e){this.items=[],this._name=e}emit(e,t,a,r,u,h,f,m){const{name:y,items:v}=this;for(let S=0,T=v.length;S<T;S++)v[S][y](e,t,a,r,u,h,f,m);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-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 m3=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],LS=class ZR extends Sa{constructor(e){super(),this.uid=It("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const t=[...m3,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck()}async init(e={}){const t=e.skipExtensionImports===!0?!0:e.manageImports===!1;await WM(t),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const a in this._systemsHash)e={...this._systemsHash[a].constructor.defaultOptions,...e};e={...ZR.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let a=0;a<this.runners.init.items.length;a++)await this.runners.init.items[a].init(e);this._initOptions=e}render(e,t){let a=e;if(a instanceof zn&&(a={container:a},t&&(it(Mt,"passing a second argument is deprecated, please use render options instead"),a.target=t.renderTexture)),a.target||(a.target=this.view.renderTarget),a.target===this.view.renderTarget&&(this._lastObjectRendered=a.container,a.clearColor??(a.clearColor=this.background.colorRgba),a.clear??(a.clear=this.background.clearBeforeRender)),a.clearColor){const r=Array.isArray(a.clearColor)&&a.clearColor.length===4;a.clearColor=r?a.clearColor:Zt.shared.setValue(a.clearColor).toArray()}a.transform||(a.container.updateLocalTransform(),a.transform=a.container.localTransform),a.container.visible&&(a.container.enableRenderGroup(),this.runners.prerender.emit(a),this.runners.renderStart.emit(a),this.runners.render.emit(a),this.runners.renderEnd.emit(a),this.runners.postrender.emit(a))}resize(e,t,a){const r=this.view.resolution;this.view.resize(e,t,a),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),a!==void 0&&a!==r&&this.runners.resolutionChange.emit(a)}clear(e={}){const t=this;e.target||(e.target=t.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=Ta.ALL);const{clear:a,clearColor:r,target:u}=e;Zt.shared.setValue(r??this.background.colorRgba),t.renderTarget.clear(u,a,Zt.shared.toArray())}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}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(...e){e.forEach(t=>{this.runners[t]=new VS(t)})}_addSystems(e){let t;for(t in e){const a=e[t];this._addSystem(a.value,a.name)}}_addSystem(e,t){const a=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=a,this._systemsHash[t]=a;for(const r in this.runners)this.runners[r].add(a);return this}_addPipes(e,t){const a=t.reduce((r,u)=>(r[u.name]=u.value,r),{});e.forEach(r=>{const u=r.value,h=r.name,f=a[h];this.renderPipes[h]=new u(this,f?new f:null),this.runners.destroy.add(this.renderPipes[h])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach(t=>{t.destroy()}),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&Ec.release(),this._systemsHash=null,this.renderPipes=null}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!OS())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()}};LS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let cy=LS,hy;function y3(n){return hy!==void 0||(hy=(()=>{var t;const e={stencil:!0,failIfMajorPerformanceCaveat:n??cy.defaultOptions.failIfMajorPerformanceCaveat};try{if(!wt.get().getWebGLRenderingContext())return!1;let r=wt.get().createCanvas().getContext("webgl",e);const u=!!((t=r==null?void 0:r.getContextAttributes())!=null&&t.stencil);if(r){const h=r.getExtension("WEBGL_lose_context");h&&h.loseContext()}return r=null,u}catch{return!1}})()),hy}let fy;async function g3(n={}){return fy!==void 0||(fy=await(async()=>{const e=wt.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(n)).requestDevice(),!0}catch{return!1}})()),fy}const jS=["webgl","webgpu","canvas"];async function _3(n){let e=[];n.preference?(e.push(n.preference),jS.forEach(u=>{u!==n.preference&&e.push(u)})):e=jS.slice();let t,a={};for(let u=0;u<e.length;u++){const h=e[u];if(h==="webgpu"&&await g3()){const{WebGPURenderer:f}=await Promise.resolve().then(()=>mB);t=f,a={...n,...n.webgpu};break}else if(h==="webgl"&&y3(n.failIfMajorPerformanceCaveat??cy.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:f}=await Promise.resolve().then(()=>Z4);t=f,a={...n,...n.webgl};break}else if(h==="canvas")throw a={...n},new Error("CanvasRenderer is not yet implemented")}if(delete a.webgpu,delete a.webgl,!t)throw new Error("No available renderer for the current environment");const r=new t;return await r.init(a),r}const dy="8.14.0";class YS{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,dy)}static destroy(){}}YS.extension=Q.Application;class XS{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,dy)}destroy(){this._renderer=null}}XS.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"initHook",priority:-10};const qS=class $b{constructor(...e){this.stage=new zn,e[0]!==void 0&&it(Mt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.renderer=await _3(e),$b._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return it(Mt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,t=!1){const a=$b._plugins.slice(0);a.reverse(),a.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};qS._plugins=[];let lv=qS;Ie.handleByList(Q.Application,lv._plugins),Ie.add(YS);class FS{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(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 t,a;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,a=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:u}=this._resizeTo;t=r,a=u}this.renderer.resize(t,a),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}FS.extension=Q.Application;class kS{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Cc.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?ka.shared:new ka,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}kS.extension=Q.Application;class v3 extends Sa{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return it(Mt,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return it(Mt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return it(Mt,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return it(Mt,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return it(Mt,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){var t;this.emit("destroy",this),this.removeAllListeners();for(const a in this.chars)(t=this.chars[a].texture)==null||t.destroy();this.chars=null,e&&(this.pages.forEach(a=>a.texture.destroy(!0)),this.pages=null)}}/**
85
- * tiny-lru
86
- *
87
- * @copyright 2025 Jason Mulligan <jason.mulligan@avoidwork.com>
88
- * @license BSD-3-Clause
89
- * @version 11.4.5
90
- */class b3{constructor(e=0,t=0,a=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=a,this.size=0,this.ttl=t}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){const t=this.items[e];delete this.items[e],this.size--,t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),this.last===t&&(this.last=t.prev)}return this}entries(e=this.keys()){return e.map(t=>[t,this.get(t)])}evict(e=!1){if(e||this.size>0){const t=this.first;delete this.items[t.key],--this.size===0?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(e){let t;return this.has(e)&&(t=this.items[e].expiry),t}get(e){const t=this.items[e];if(t!==void 0){if(this.ttl>0&&t.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(t),t.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e))}keys(){const e=[];let t=this.first;for(;t!==null;)e.push(t.key),t=t.next;return e}setWithEvicted(e,t,a=this.resetTtl){let r=null;if(this.has(e))this.set(e,t,!0,a);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let u=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t};++this.size===1?this.first=u:this.last.next=u,this.last=u}return r}set(e,t,a=!1,r=this.resetTtl){let u=this.items[e];return a||u!==void 0?(u.value=t,a===!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[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t},++this.size===1?this.first=u:this.last.next=u,this.last=u),this}values(e=this.keys()){return e.map(t=>this.get(t))}}function IS(n=1e3,e=0,t=!1){if(isNaN(n)||n<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof t!="boolean")throw new TypeError("Invalid resetTtl value");return new b3(n,e,t)}const x3=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function py(n){const e=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let t=n.fontFamily;Array.isArray(n.fontFamily)||(t=n.fontFamily.split(","));for(let a=t.length-1;a>=0;a--){let r=t[a].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!x3.includes(r)&&(r=`"${r}"`),t[a]=r}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${e} ${t.join(",")}`}const ov={willReadFrequently:!0},Os=class we{static get experimentalLetterSpacingSupported(){let e=we._experimentalLetterSpacingSupported;if(e===void 0){const t=wt.get().getCanvasRenderingContext2D().prototype;e=we._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,a,r,u,h,f,m,y){this.text=e,this.style=t,this.width=a,this.height=r,this.lines=u,this.lineWidths=h,this.lineHeight=f,this.maxLineWidth=m,this.fontProperties=y}static measureText(e=" ",t,a=we._canvas,r=t.wordWrap){var P;const u=`${e}-${t.styleKey}-wordWrap-${r}`;if(we._measurementCache.has(u))return we._measurementCache.get(u);const h=py(t),f=we.measureFont(h);f.fontSize===0&&(f.fontSize=t.fontSize,f.ascent=t.fontSize);const m=we.__context;m.font=h;const v=(r?we._wordWrap(e,t,a):e).split(/(?:\r\n|\r|\n)/),S=new Array(v.length);let T=0;for(let w=0;w<v.length;w++){const z=we._measureText(v[w],t.letterSpacing,m);S[w]=z,T=Math.max(T,z)}const E=((P=t._stroke)==null?void 0:P.width)||0;let A=T+E;t.dropShadow&&(A+=t.dropShadow.distance);const U=t.lineHeight||f.fontSize;let M=Math.max(U,f.fontSize+E)+(v.length-1)*(U+t.leading);t.dropShadow&&(M+=t.dropShadow.distance);const G=new we(e,t,A,M,v,S,U+t.leading,T,f);return we._measurementCache.set(u,G),G}static _measureText(e,t,a){let r=!1;we.experimentalLetterSpacingSupported&&(we.experimentalLetterSpacing?(a.letterSpacing=`${t}px`,a.textLetterSpacing=`${t}px`,r=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px"));const u=a.measureText(e);let h=u.width;const f=-u.actualBoundingBoxLeft;let y=u.actualBoundingBoxRight-f;if(h>0)if(r)h-=t,y-=t;else{const v=(we.graphemeSegmenter(e).length-1)*t;h+=v,y+=v}return Math.max(h,y)}static _wordWrap(e,t,a=we._canvas){const r=a.getContext("2d",ov);let u=0,h="",f="";const m=Object.create(null),{letterSpacing:y,whiteSpace:v}=t,S=we._collapseSpaces(v),T=we._collapseNewlines(v);let E=!S;const A=t.wordWrapWidth+y,U=we._tokenize(e);for(let M=0;M<U.length;M++){let G=U[M];if(we._isNewline(G)){if(!T){f+=we._addLine(h),E=!S,h="",u=0;continue}G=" "}if(S){const w=we.isBreakingSpace(G),z=we.isBreakingSpace(h[h.length-1]);if(w&&z)continue}const P=we._getFromCache(G,y,m,r);if(P>A)if(h!==""&&(f+=we._addLine(h),h="",u=0),we.canBreakWords(G,t.breakWords)){const w=we.wordWrapSplit(G);for(let z=0;z<w.length;z++){let ne=w[z],ie=ne,Z=1;for(;w[z+Z];){const me=w[z+Z];if(!we.canBreakChars(ie,me,G,z,t.breakWords))ne+=me;else break;ie=me,Z++}z+=Z-1;const Te=we._getFromCache(ne,y,m,r);Te+u>A&&(f+=we._addLine(h),E=!1,h="",u=0),h+=ne,u+=Te}}else{h.length>0&&(f+=we._addLine(h),h="",u=0);const w=M===U.length-1;f+=we._addLine(G,!w),E=!1,h="",u=0}else P+u>A&&(E=!1,f+=we._addLine(h),h="",u=0),(h.length>0||!we.isBreakingSpace(G)||E)&&(h+=G,u+=P)}return f+=we._addLine(h,!1),f}static _addLine(e,t=!0){return e=we._trimRight(e),e=t?`${e}
91
- `:e,e}static _getFromCache(e,t,a,r){let u=a[e];return typeof u!="number"&&(u=we._measureText(e,t,r)+t,a[e]=u),u}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const a=e[t];if(!we.isBreakingSpace(a))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:we._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:we._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let a="";if(typeof e!="string")return t;for(let r=0;r<e.length;r++){const u=e[r],h=e[r+1];if(we.isBreakingSpace(u,h)||we._isNewline(u)){a!==""&&(t.push(a),a=""),u==="\r"&&h===`
92
- `?(t.push(`\r
93
- `),r++):t.push(u);continue}a+=u}return a!==""&&t.push(a),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,a,r,u){return!0}static wordWrapSplit(e){return we.graphemeSegmenter(e)}static measureFont(e){if(we._fonts[e])return we._fonts[e];const t=we._context;t.font=e;const a=t.measureText(we.METRICS_STRING+we.BASELINE_SYMBOL),r={ascent:a.actualBoundingBoxAscent,descent:a.actualBoundingBoxDescent,fontSize:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent};return we._fonts[e]=r,r}static clearMetrics(e=""){e?delete we._fonts[e]:we._fonts={}}static get _canvas(){if(!we.__canvas){let e;try{const t=new OffscreenCanvas(0,0),a=t.getContext("2d",ov);if(a!=null&&a.measureText)return we.__canvas=t,t;e=wt.get().createCanvas()}catch{e=wt.get().createCanvas()}e.width=e.height=10,we.__canvas=e}return we.__canvas}static get _context(){return we.__context||(we.__context=we._canvas.getContext("2d",ov)),we.__context}};Os.METRICS_STRING="|ÉqÅ",Os.BASELINE_SYMBOL="M",Os.BASELINE_MULTIPLIER=1.4,Os.HEIGHT_MULTIPLIER=2,Os.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return e=>{const t=n.segment(e),a=[];let r=0;for(const u of t)a[r++]=u.segment;return a}}return n=>[...n]})(),Os.experimentalLetterSpacing=!1,Os._fonts={},Os._newlines=[10,13],Os._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],Os._measurementCache=IS(1e3);let dr=Os;const KS=[{offset:0,color:"white"},{offset:1,color:"black"}],uv=class ex{constructor(...e){this.uid=It("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let t=S3(e);t={...t.type==="radial"?ex.defaultRadialOptions:ex.defaultLinearOptions,...bx(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:Zt.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:a,y:r}=this.end,u=a-e,h=r-t;const f=u<0||h<0;if(this._wrapMode==="clamp-to-edge"){if(u<0){const M=e;e=a,a=M,u*=-1}if(h<0){const M=t;t=r,r=M,h*=-1}}const m=this.colorStops.length?this.colorStops:KS,y=this._textureSize,{canvas:v,context:S}=ZS(y,1),T=f?S.createLinearGradient(this._textureSize,0,0,0):S.createLinearGradient(0,0,this._textureSize,0);QS(T,m),S.fillStyle=T,S.fillRect(0,0,y,1),this.texture=new He({source:new Wf({resource:v,addressMode:this._wrapMode})});const E=Math.sqrt(u*u+h*h),A=Math.atan2(h,u),U=new ze;U.scale(E/y,1),U.rotate(A),U.translate(e,t),this.textureSpace==="local"&&U.scale(y,y),this.transform=U}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const e=this.colorStops.length?this.colorStops:KS,t=this._textureSize,{canvas:a,context:r}=ZS(t,t),{x:u,y:h}=this.center,{x:f,y:m}=this.outerCenter,y=this.innerRadius,v=this.outerRadius,S=f-v,T=m-v,E=t/(v*2),A=(u-S)*E,U=(h-T)*E,M=r.createRadialGradient(A,U,y*E,(f-S)*E,(m-T)*E,v*E);QS(M,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=M,r.translate(A,U),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-A,-U),r.fillRect(0,0,t,t),this.texture=new He({source:new Wf({resource:a,addressMode:this._wrapMode})});const G=new ze;G.scale(1/E,1/E),G.translate(S,T),this.textureSpace==="local"&&G.scale(t,t),this.transform=G}destroy(){var e;(e=this.texture)==null||e.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}`}};uv.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},uv.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let il=uv;function QS(n,e){for(let t=0;t<e.length;t++){const a=e[t];n.addColorStop(a.offset,a.color)}}function ZS(n,e){const t=wt.get().createCanvas(n,e),a=t.getContext("2d");return{canvas:t,context:a}}function S3(n){let e=n[0]??{};return(typeof e=="number"||n[1])&&(it("8.5.2","use options object instead"),e={type:"linear",start:{x:n[0],y:n[1]},end:{x:n[2],y:n[3]},textureSpace:n[4],textureSize:n[5]??il.defaultLinearOptions.textureSize}),e}const WS={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 my{constructor(e,t){this.uid=It("fillPattern"),this._tick=0,this.transform=new ze,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=WS[t].addressModeU,e.source.style.addressModeV=WS[t].addressModeV)}setTransform(e){const t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}var cv,JS;function T3(){if(JS)return cv;JS=1,cv=t;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function t(u){var h=[];return u.replace(e,function(f,m,y){var v=m.toLowerCase();for(y=r(y),v=="m"&&y.length>2&&(h.push([m].concat(y.splice(0,2))),v="l",m=m=="m"?"l":"L");;){if(y.length==n[v])return y.unshift(m),h.push(y);if(y.length<n[v])throw new Error("malformed path data");h.push([m].concat(y.splice(0,n[v])))}}),h}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(u){var h=u.match(a);return h?h.map(Number):[]}return cv}var E3=T3();const C3=xa(E3);function R3(n,e){const t=C3(n),a=[];let r=null,u=0,h=0;for(let f=0;f<t.length;f++){const m=t[f],y=m[0],v=m;switch(y){case"M":u=v[1],h=v[2],e.moveTo(u,h);break;case"m":u+=v[1],h+=v[2],e.moveTo(u,h);break;case"H":u=v[1],e.lineTo(u,h);break;case"h":u+=v[1],e.lineTo(u,h);break;case"V":h=v[1],e.lineTo(u,h);break;case"v":h+=v[1],e.lineTo(u,h);break;case"L":u=v[1],h=v[2],e.lineTo(u,h);break;case"l":u+=v[1],h+=v[2],e.lineTo(u,h);break;case"C":u=v[5],h=v[6],e.bezierCurveTo(v[1],v[2],v[3],v[4],u,h);break;case"c":e.bezierCurveTo(u+v[1],h+v[2],u+v[3],h+v[4],u+v[5],h+v[6]),u+=v[5],h+=v[6];break;case"S":u=v[3],h=v[4],e.bezierCurveToShort(v[1],v[2],u,h);break;case"s":e.bezierCurveToShort(u+v[1],h+v[2],u+v[3],h+v[4]),u+=v[3],h+=v[4];break;case"Q":u=v[3],h=v[4],e.quadraticCurveTo(v[1],v[2],u,h);break;case"q":e.quadraticCurveTo(u+v[1],h+v[2],u+v[3],h+v[4]),u+=v[3],h+=v[4];break;case"T":u=v[1],h=v[2],e.quadraticCurveToShort(u,h);break;case"t":u+=v[1],h+=v[2],e.quadraticCurveToShort(u,h);break;case"A":u=v[6],h=v[7],e.arcToSvg(v[1],v[2],v[3],v[4],v[5],u,h);break;case"a":u+=v[6],h+=v[7],e.arcToSvg(v[1],v[2],v[3],v[4],v[5],u,h);break;case"Z":case"z":e.closePath(),a.length>0&&(r=a.pop(),r?(u=r.startX,h=r.startY):(u=0,h=0)),r=null;break;default:rt(`Unknown SVG path command: ${y}`)}y!=="Z"&&y!=="z"&&r===null&&(r={startX:u,startY:h},a.push(r))}return e}class hv{constructor(e=0,t=0,a=0){this.type="circle",this.x=e,this.y=t,this.radius=a}clone(){return new hv(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const a=this.radius*this.radius;let r=this.x-e,u=this.y-t;return r*=r,u*=u,r+u<=a}strokeContains(e,t,a,r=.5){if(this.radius===0)return!1;const u=this.x-e,h=this.y-t,f=this.radius,m=(1-r)*a,y=Math.sqrt(u*u+h*h);return y<=f+m&&y>f-(a-m)}getBounds(e){return e||(e=new Pt),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class fv{constructor(e=0,t=0,a=0,r=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=a,this.halfHeight=r}clone(){return new fv(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let a=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return a*=a,r*=r,a+r<=1}strokeContains(e,t,a,r=.5){const{halfWidth:u,halfHeight:h}=this;if(u<=0||h<=0)return!1;const f=a*(1-r),m=a-f,y=u-m,v=h-m,S=u+f,T=h+f,E=e-this.x,A=t-this.y,U=E*E/(y*y)+A*A/(v*v),M=E*E/(S*S)+A*A/(T*T);return U>1&&M<=1}getBounds(e){return e||(e=new Pt),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function A3(n,e,t,a,r,u){const h=n-t,f=e-a,m=r-t,y=u-a,v=h*m+f*y,S=m*m+y*y;let T=-1;S!==0&&(T=v/S);let E,A;T<0?(E=t,A=a):T>1?(E=r,A=u):(E=t+T*m,A=a+T*y);const U=n-E,M=e-A;return U*U+M*M}let M3,D3;class cd{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const a=[];for(let r=0,u=t.length;r<u;r++)a.push(t[r].x,t[r].y);t=a}this.points=t,this.closePath=!0}isClockwise(){let e=0;const t=this.points,a=t.length;for(let r=0;r<a;r+=2){const u=t[r],h=t[r+1],f=t[(r+2)%a],m=t[(r+3)%a];e+=(f-u)*(m+h)}return e<0}containsPolygon(e){const t=this.getBounds(M3),a=e.getBounds(D3);if(!t.containsRect(a))return!1;const r=e.points;for(let u=0;u<r.length;u+=2){const h=r[u],f=r[u+1];if(!this.contains(h,f))return!1}return!0}clone(){const e=this.points.slice(),t=new cd(e);return t.closePath=this.closePath,t}contains(e,t){let a=!1;const r=this.points.length/2;for(let u=0,h=r-1;u<r;h=u++){const f=this.points[u*2],m=this.points[u*2+1],y=this.points[h*2],v=this.points[h*2+1];m>t!=v>t&&e<(y-f)*((t-m)/(v-m))+f&&(a=!a)}return a}strokeContains(e,t,a,r=.5){const u=a*a,h=u*(1-r),f=u-h,{points:m}=this,y=m.length-(this.closePath?0:2);for(let v=0;v<y;v+=2){const S=m[v],T=m[v+1],E=m[(v+2)%m.length],A=m[(v+3)%m.length],U=A3(e,t,S,T,E,A),M=Math.sign((E-S)*(t-T)-(A-T)*(e-S));if(U<=(M<0?f:h))return!0}return!1}getBounds(e){e||(e=new Pt);const t=this.points;let a=1/0,r=-1/0,u=1/0,h=-1/0;for(let f=0,m=t.length;f<m;f+=2){const y=t[f],v=t[f+1];a=y<a?y:a,r=y>r?y:r,u=v<u?v:u,h=v>h?v:h}return e.x=a,e.width=r-a,e.y=u,e.height=h-u,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return it("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return it("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 yy=(n,e,t,a,r,u,h)=>{const f=n-t,m=e-a,y=Math.sqrt(f*f+m*m);return y>=r-u&&y<=r+h};class dv{constructor(e=0,t=0,a=0,r=0,u=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=a,this.height=r,this.radius=u}getBounds(e){return e||(e=new Pt),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new dv(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+a&&t<=this.y+this.height-a||e>=this.x+a&&e<=this.x+this.width-a)return!0;let r=e-(this.x+a),u=t-(this.y+a);const h=a*a;if(r*r+u*u<=h||(r=e-(this.x+this.width-a),r*r+u*u<=h)||(u=t-(this.y+this.height-a),r*r+u*u<=h)||(r=e-(this.x+a),r*r+u*u<=h))return!0}return!1}strokeContains(e,t,a,r=.5){const{x:u,y:h,width:f,height:m,radius:y}=this,v=a*(1-r),S=a-v,T=u+y,E=h+y,A=f-y*2,U=m-y*2,M=u+f,G=h+m;return(e>=u-v&&e<=u+S||e>=M-S&&e<=M+v)&&t>=E&&t<=E+U||(t>=h-v&&t<=h+S||t>=G-S&&t<=G+v)&&e>=T&&e<=T+A?!0:e<T&&t<E&&yy(e,t,T,E,y,S,v)||e>M-y&&t<E&&yy(e,t,M-y,E,y,S,v)||e>M-y&&t>G-y&&yy(e,t,M-y,G-y,y,S,v)||e<T&&t>G-y&&yy(e,t,T,G-y,y,S,v)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const $S={};function pv(n,e,t){let a=2166136261;for(let r=0;r<e;r++)a^=n[r].uid,a=Math.imul(a,16777619),a>>>=0;return $S[a]||U3(n,e,a,t)}function U3(n,e,t,a){const r={};let u=0;for(let f=0;f<a;f++){const m=f<e?n[f]:He.EMPTY.source;r[u++]=m.source,r[u++]=m.style}const h=new tl(r);return $S[t]=h,h}class Uc{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,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(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function mv(n,e){const t=n.byteLength/8|0,a=new Float64Array(n,0,t);new Float64Array(e,0,t).set(a);const u=n.byteLength-t*8;if(u>0){const h=new Uint8Array(n,t*8,u);new Uint8Array(e,t*8,u).set(h)}}const B3={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var xn=(n=>(n[n.DISABLED=0]="DISABLED",n[n.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",n[n.MASK_ACTIVE=2]="MASK_ACTIVE",n[n.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",n[n.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",n[n.NONE=5]="NONE",n))(xn||{});function hd(n,e){return e.alphaMode==="no-premultiply-alpha"&&B3[n]||n}const O3=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
94
- `);function N3(n){let e="";for(let t=0;t<n;++t)t>0&&(e+=`
95
- else `),t<n-1&&(e+=`if(test == ${t}.0){}`);return e}function e1(n,e){if(n===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const t=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const a=O3.replace(/%forloop%/gi,N3(n));if(e.shaderSource(t,a),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))n=n/2|0;else break}}finally{e.deleteShader(t)}return n}let Bc=null;function G3(){var e;if(Bc)return Bc;const n=RS();return Bc=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),Bc=e1(Bc,n),(e=n.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Bc}class P3{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null}this.count=0}}class w3{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new P3,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}const fd=[];let gy=0;Ec.register({clear:()=>{if(fd.length>0)for(const n of fd)n&&n.destroy();fd.length=0,gy=0}});function t1(){return gy>0?fd[--gy]:new w3}function n1(n){fd[gy++]=n}let dd=0;const i1=class WR{constructor(e){this.uid=It("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...WR.defaultOptions,...e},e.maxTextures||(it("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=G3());const{maxTextures:t,attributesInitialSize:a,indicesInitialSize:r}=e;this.attributeBuffer=new Uc(a*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=t}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)n1(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,t){const a=e._batch.textures.ids[t._source.uid];return!a&&a!==0?!1:(e._textureId=a,e.texture=t,!0)}updateElement(e){this.dirty=!0;const t=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId)}break(e){const t=this._elements;if(!t[this.elementStart])return;let a=t1(),r=a.textures;r.clear();const u=t[this.elementStart];let h=hd(u.blendMode,u.texture._source),f=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,y=this.attributeBuffer.uint32View,v=this.indexBuffer;let S=this._batchIndexSize,T=this._batchIndexStart,E="startBatch";const A=this.maxTextures;for(let U=this.elementStart;U<this.elementSize;++U){const M=t[U];t[U]=null;const P=M.texture._source,w=hd(M.blendMode,P),z=h!==w||f!==M.topology;if(P._batchTick===dd&&!z){M._textureId=P._textureBindLocation,S+=M.indexSize,M.packAsQuad?(this.packQuadAttributes(M,m,y,M._attributeStart,M._textureId),this.packQuadIndex(v,M._indexStart,M._attributeStart/this.vertexSize)):(this.packAttributes(M,m,y,M._attributeStart,M._textureId),this.packIndex(M,v,M._indexStart,M._attributeStart/this.vertexSize)),M._batch=a;continue}P._batchTick=dd,(r.count>=A||z)&&(this._finishBatch(a,T,S-T,r,h,f,e,E),E="renderBatch",T=S,h=w,f=M.topology,a=t1(),r=a.textures,r.clear(),++dd),M._textureId=P._textureBindLocation=r.count,r.ids[P.uid]=r.count,r.textures[r.count++]=P,M._batch=a,S+=M.indexSize,M.packAsQuad?(this.packQuadAttributes(M,m,y,M._attributeStart,M._textureId),this.packQuadIndex(v,M._indexStart,M._attributeStart/this.vertexSize)):(this.packAttributes(M,m,y,M._attributeStart,M._textureId),this.packIndex(M,v,M._indexStart,M._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(a,T,S-T,r,h,f,e,E),T=S,++dd),this.elementStart=this.elementSize,this._batchIndexStart=T,this._batchIndexSize=S}_finishBatch(e,t,a,r,u,h,f,m){e.gpuBindGroup=null,e.bindGroup=null,e.action=m,e.batcher=this,e.textures=r,e.blendMode=u,e.topology=h,e.start=t,e.size=a,++dd,this.batches[this.batchIndex++]=e,f.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const t=Math.max(e,this.attributeBuffer.size*2),a=new Uc(t);mv(this.attributeBuffer.rawBinaryData,a.rawBinaryData),this.attributeBuffer=a}_resizeIndexBuffer(e){const t=this.indexBuffer;let a=Math.max(e,t.length*1.5);a+=a%2;const r=a>65535?new Uint32Array(a):new Uint16Array(a);if(r.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let u=0;u<t.length;u++)r[u]=t[u];else mv(t.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,t,a){e[t]=a+0,e[t+1]=a+1,e[t+2]=a+2,e[t+3]=a+0,e[t+4]=a+2,e[t+5]=a+3}packIndex(e,t,a,r){const u=e.indices,h=e.indexSize,f=e.indexOffset,m=e.attributeOffset;for(let y=0;y<h;y++)t[a++]=r+u[y+f]-m}destroy(){if(this.batches!==null){for(let e=0;e<this.batches.length;e++)n1(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e]&&(this._elements[e]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};i1.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let z3=i1;var xt=(n=>(n[n.MAP_READ=1]="MAP_READ",n[n.MAP_WRITE=2]="MAP_WRITE",n[n.COPY_SRC=4]="COPY_SRC",n[n.COPY_DST=8]="COPY_DST",n[n.INDEX=16]="INDEX",n[n.VERTEX=32]="VERTEX",n[n.UNIFORM=64]="UNIFORM",n[n.STORAGE=128]="STORAGE",n[n.INDIRECT=256]="INDIRECT",n[n.QUERY_RESOLVE=512]="QUERY_RESOLVE",n[n.STATIC=1024]="STATIC",n))(xt||{});class Ea extends Sa{constructor(e){let{data:t,size:a}=e;const{usage:r,label:u,shrinkToFit:h}=e;super(),this.uid=It("buffer"),this._resourceType="buffer",this._resourceId=It("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,t instanceof Array&&(t=new Float32Array(t)),this._data=t,a??(a=t==null?void 0:t.byteLength);const f=!!t;this.descriptor={size:a,usage:r,mappedAtCreation:f,label:u},this.shrinkToFit=h??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&xt.STATIC)}set static(e){e?this.descriptor.usage|=xt.STATIC:this.descriptor.usage&=~xt.STATIC}setDataWithSize(e,t,a){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){a&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?a&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=It("resource"),this.emit("change",this));return}a&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function a1(n,e){if(!(n instanceof Ea)){let t=e?xt.INDEX:xt.VERTEX;n instanceof Array&&(e?(n=new Uint32Array(n),t=xt.INDEX|xt.COPY_DST):(n=new Float32Array(n),t=xt.VERTEX|xt.COPY_DST)),n=new Ea({data:n,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t})}return n}function H3(n,e,t){const a=n.getAttribute(e);if(!a)return t.minX=0,t.minY=0,t.maxX=0,t.maxY=0,t;const r=a.buffer.data;let u=1/0,h=1/0,f=-1/0,m=-1/0;const y=r.BYTES_PER_ELEMENT,v=(a.offset||0)/y,S=(a.stride||8)/y;for(let T=v;T<r.length;T+=S){const E=r[T],A=r[T+1];E>f&&(f=E),A>m&&(m=A),E<u&&(u=E),A<h&&(h=A)}return t.minX=u,t.minY=h,t.maxX=f,t.maxY=m,t}function V3(n){return(n instanceof Ea||Array.isArray(n)||n.BYTES_PER_ELEMENT)&&(n={buffer:n}),n.buffer=a1(n.buffer,!1),n}class pd extends Sa{constructor(e={}){super(),this.uid=It("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new ci,this._boundsDirty=!0;const{attributes:t,indexBuffer:a,topology:r}=e;if(this.buffers=[],this.attributes={},t)for(const u in t)this.addAttribute(u,t[u]);this.instanceCount=e.instanceCount??1,a&&this.addIndex(a),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}addAttribute(e,t){const a=V3(t);this.buffers.indexOf(a.buffer)===-1&&(this.buffers.push(a.buffer),a.buffer.on("update",this.onBufferUpdate,this),a.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=a}addIndex(e){this.indexBuffer=a1(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,H3(this,"aPosition",this._bounds)):this._bounds}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const L3=new Float32Array(1),j3=new Uint32Array(1);class Y3 extends pd{constructor(){const t=new Ea({data:L3,label:"attribute-batch-buffer",usage:xt.VERTEX|xt.COPY_DST,shrinkToFit:!1}),a=new Ea({data:j3,label:"index-batch-buffer",usage:xt.INDEX|xt.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:r,offset:0},aUV:{buffer:t,format:"float32x2",stride:r,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:r,offset:20}},indexBuffer:a})}}function s1(n,e,t){if(n)for(const a in n){const r=a.toLocaleLowerCase(),u=e[r];if(u){let h=n[a];a==="header"&&(h=h.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),t&&u.push(`//----${t}----//`),u.push(h)}else rt(`${a} placement hook does not exist in shader`)}}const X3=/\{\{(.*?)\}\}/g;function r1(n){var a;const e={};return(((a=n.match(X3))==null?void 0:a.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function l1(n,e){let t;const a=/@in\s+([^;]+);/g;for(;(t=a.exec(n))!==null;)e.push(t[1])}function o1(n,e,t=!1){const a=[];l1(e,a),n.forEach(f=>{f.header&&l1(f.header,a)});const r=a;t&&r.sort();const u=r.map((f,m)=>` @location(${m}) ${f},`).join(`
96
- `);let h=e.replace(/@in\s+[^;]+;\s*/g,"");return h=h.replace("{{in}}",`
97
- ${u}
98
- `),h}function u1(n,e){let t;const a=/@out\s+([^;]+);/g;for(;(t=a.exec(n))!==null;)e.push(t[1])}function q3(n){const t=/\b(\w+)\s*:/g.exec(n);return t?t[1]:""}function F3(n){const e=/@.*?\s+/g;return n.replace(e,"")}function k3(n,e){const t=[];u1(e,t),n.forEach(m=>{m.header&&u1(m.header,t)});let a=0;const r=t.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${a++}) ${m}`).join(`,
99
- `),u=t.sort().map(m=>` var ${F3(m)};`).join(`
100
- `),h=`return VSOutput(
101
- ${t.sort().map(m=>` ${q3(m)}`).join(`,
102
- `)});`;let f=e.replace(/@out\s+[^;]+;\s*/g,"");return f=f.replace("{{struct}}",`
103
- ${r}
104
- `),f=f.replace("{{start}}",`
105
- ${u}
106
- `),f=f.replace("{{return}}",`
107
- ${h}
108
- `),f}function c1(n,e){let t=n;for(const a in e){const r=e[a];r.join(`
109
- `).length?t=t.replace(`{{${a}}}`,`//-----${a} START-----//
110
- ${r.join(`
111
- `)}
112
- //----${a} FINISH----//`):t=t.replace(`{{${a}}}`,"")}return t}const Wl=Object.create(null),yv=new Map;let I3=0;function K3({template:n,bits:e}){const t=h1(n,e);if(Wl[t])return Wl[t];const{vertex:a,fragment:r}=Z3(n,e);return Wl[t]=f1(a,r,e),Wl[t]}function Q3({template:n,bits:e}){const t=h1(n,e);return Wl[t]||(Wl[t]=f1(n.vertex,n.fragment,e)),Wl[t]}function Z3(n,e){const t=e.map(h=>h.vertex).filter(h=>!!h),a=e.map(h=>h.fragment).filter(h=>!!h);let r=o1(t,n.vertex,!0);r=k3(t,r);const u=o1(a,n.fragment,!0);return{vertex:r,fragment:u}}function h1(n,e){return e.map(t=>(yv.has(t)||yv.set(t,I3++),yv.get(t))).sort((t,a)=>t-a).join("-")+n.vertex+n.fragment}function f1(n,e,t){const a=r1(n),r=r1(e);return t.forEach(u=>{s1(u.vertex,a,u.name),s1(u.fragment,r,u.name)}),{vertex:c1(n,a),fragment:c1(e,r)}}const W3=`
113
- @in aPosition: vec2<f32>;
114
- @in aUV: vec2<f32>;
115
-
116
- @out @builtin(position) vPosition: vec4<f32>;
117
- @out vUV : vec2<f32>;
118
- @out vColor : vec4<f32>;
119
-
120
- {{header}}
121
-
122
- struct VSOutput {
123
- {{struct}}
124
- };
125
-
126
- @vertex
127
- fn main( {{in}} ) -> VSOutput {
128
-
129
- var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
130
- var modelMatrix = mat3x3<f32>(
131
- 1.0, 0.0, 0.0,
132
- 0.0, 1.0, 0.0,
133
- 0.0, 0.0, 1.0
134
- );
135
- var position = aPosition;
136
- var uv = aUV;
137
-
138
- {{start}}
139
-
140
- vColor = vec4<f32>(1., 1., 1., 1.);
141
-
142
- {{main}}
143
-
144
- vUV = uv;
145
-
146
- var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
147
-
148
- vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
149
-
150
- vColor *= globalUniforms.uWorldColorAlpha;
151
-
152
- {{end}}
153
-
154
- {{return}}
155
- };
156
- `,J3=`
157
- @in vUV : vec2<f32>;
158
- @in vColor : vec4<f32>;
159
-
160
- {{header}}
161
-
162
- @fragment
163
- fn main(
164
- {{in}}
165
- ) -> @location(0) vec4<f32> {
166
-
167
- {{start}}
168
-
169
- var outColor:vec4<f32>;
170
-
171
- {{main}}
172
-
173
- var finalColor:vec4<f32> = outColor * vColor;
174
-
175
- {{end}}
176
-
177
- return finalColor;
178
- };
179
- `,$3=`
180
- in vec2 aPosition;
181
- in vec2 aUV;
182
-
183
- out vec4 vColor;
184
- out vec2 vUV;
185
-
186
- {{header}}
187
-
188
- void main(void){
189
-
190
- mat3 worldTransformMatrix = uWorldTransformMatrix;
191
- mat3 modelMatrix = mat3(
192
- 1.0, 0.0, 0.0,
193
- 0.0, 1.0, 0.0,
194
- 0.0, 0.0, 1.0
195
- );
196
- vec2 position = aPosition;
197
- vec2 uv = aUV;
198
-
199
- {{start}}
200
-
201
- vColor = vec4(1.);
202
-
203
- {{main}}
204
-
205
- vUV = uv;
206
-
207
- mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
208
-
209
- gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
210
-
211
- vColor *= uWorldColorAlpha;
212
-
213
- {{end}}
214
- }
215
- `,eD=`
216
-
217
- in vec4 vColor;
218
- in vec2 vUV;
219
-
220
- out vec4 finalColor;
221
-
222
- {{header}}
223
-
224
- void main(void) {
225
-
226
- {{start}}
227
-
228
- vec4 outColor;
229
-
230
- {{main}}
231
-
232
- finalColor = outColor * vColor;
233
-
234
- {{end}}
235
- }
236
- `,tD={name:"global-uniforms-bit",vertex:{header:`
237
- struct GlobalUniforms {
238
- uProjectionMatrix:mat3x3<f32>,
239
- uWorldTransformMatrix:mat3x3<f32>,
240
- uWorldColorAlpha: vec4<f32>,
241
- uResolution: vec2<f32>,
242
- }
243
-
244
- @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
245
- `}},nD={name:"global-uniforms-bit",vertex:{header:`
246
- uniform mat3 uProjectionMatrix;
247
- uniform mat3 uWorldTransformMatrix;
248
- uniform vec4 uWorldColorAlpha;
249
- uniform vec2 uResolution;
250
- `}};function md({bits:n,name:e}){const t=K3({template:{fragment:J3,vertex:W3},bits:[tD,...n]});return Zl.from({name:e,vertex:{source:t.vertex,entryPoint:"main"},fragment:{source:t.fragment,entryPoint:"main"}})}function yd({bits:n,name:e}){return new lu({name:e,...Q3({template:{vertex:$3,fragment:eD},bits:[nD,...n]})})}const gv={name:"color-bit",vertex:{header:`
251
- @in aColor: vec4<f32>;
252
- `,main:`
253
- vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
254
- `}},_v={name:"color-bit",vertex:{header:`
255
- in vec4 aColor;
256
- `,main:`
257
- vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
258
- `}},vv={};function iD(n){const e=[];if(n===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let t=0;for(let a=0;a<n;a++)e.push(`@group(1) @binding(${t++}) var textureSource${a+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${t++}) var textureSampler${a+1}: sampler;`)}return e.join(`
259
- `)}function aD(n){const e=[];if(n===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let t=0;t<n;t++)t===n-1?e.push(" default:{"):e.push(` case ${t}:{`),e.push(` outColor = textureSampleGrad(textureSource${t+1}, textureSampler${t+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join(`
260
- `)}function bv(n){return vv[n]||(vv[n]={name:"texture-batch-bit",vertex:{header:`
261
- @in aTextureIdAndRound: vec2<u32>;
262
- @out @interpolate(flat) vTextureId : u32;
263
- `,main:`
264
- vTextureId = aTextureIdAndRound.y;
265
- `,end:`
266
- if(aTextureIdAndRound.x == 1)
267
- {
268
- vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
269
- }
270
- `},fragment:{header:`
271
- @in @interpolate(flat) vTextureId: u32;
272
-
273
- ${iD(n)}
274
- `,main:`
275
- var uvDx = dpdx(vUV);
276
- var uvDy = dpdy(vUV);
277
-
278
- ${aD(n)}
279
- `}}),vv[n]}const xv={};function sD(n){const e=[];for(let t=0;t<n;t++)t>0&&e.push("else"),t<n-1&&e.push(`if(vTextureId < ${t}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${t}], vUV);`),e.push("}");return e.join(`
280
- `)}function Sv(n){return xv[n]||(xv[n]={name:"texture-batch-bit",vertex:{header:`
281
- in vec2 aTextureIdAndRound;
282
- out float vTextureId;
283
-
284
- `,main:`
285
- vTextureId = aTextureIdAndRound.y;
286
- `,end:`
287
- if(aTextureIdAndRound.x == 1.)
288
- {
289
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
290
- }
291
- `},fragment:{header:`
292
- in float vTextureId;
293
-
294
- uniform sampler2D uTextures[${n}];
295
-
296
- `,main:`
297
-
298
- ${sD(n)}
299
- `}}),xv[n]}const gd={name:"round-pixels-bit",vertex:{header:`
300
- fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
301
- {
302
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
303
- }
304
- `}},_d={name:"round-pixels-bit",vertex:{header:`
305
- vec2 roundPixels(vec2 position, vec2 targetSize)
306
- {
307
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
308
- }
309
- `}},d1={};function Tv(n){let e=d1[n];if(e)return e;const t=new Int32Array(n);for(let a=0;a<n;a++)t[a]=a;return e=d1[n]=new Yi({uTextures:{value:t,type:"i32",size:n}},{isStatic:!0}),e}class rD extends Ia{constructor(e){const t=yd({name:"batch",bits:[_v,Sv(e),_d]}),a=md({name:"batch",bits:[gv,bv(e),gd]});super({glProgram:t,gpuProgram:a,resources:{batchSamplers:Tv(e)}})}}let Ev=null;const p1=class JR extends z3{constructor(e){super(e),this.geometry=new Y3,this.name=JR.extension.name,this.vertexSize=6,Ev??(Ev=new rD(e.maxTextures)),this.shader=Ev}packAttributes(e,t,a,r,u){const h=u<<16|e.roundPixels&65535,f=e.transform,m=f.a,y=f.b,v=f.c,S=f.d,T=f.tx,E=f.ty,{positions:A,uvs:U}=e,M=e.color,G=e.attributeOffset,P=G+e.attributeSize;for(let w=G;w<P;w++){const z=w*2,ne=A[z],ie=A[z+1];t[r++]=m*ne+v*ie+T,t[r++]=S*ie+y*ne+E,t[r++]=U[z],t[r++]=U[z+1],a[r++]=M,a[r++]=h}}packQuadAttributes(e,t,a,r,u){const h=e.texture,f=e.transform,m=f.a,y=f.b,v=f.c,S=f.d,T=f.tx,E=f.ty,A=e.bounds,U=A.maxX,M=A.minX,G=A.maxY,P=A.minY,w=h.uvs,z=e.color,ne=u<<16|e.roundPixels&65535;t[r+0]=m*M+v*P+T,t[r+1]=S*P+y*M+E,t[r+2]=w.x0,t[r+3]=w.y0,a[r+4]=z,a[r+5]=ne,t[r+6]=m*U+v*P+T,t[r+7]=S*P+y*U+E,t[r+8]=w.x1,t[r+9]=w.y1,a[r+10]=z,a[r+11]=ne,t[r+12]=m*U+v*G+T,t[r+13]=S*G+y*U+E,t[r+14]=w.x2,t[r+15]=w.y2,a[r+16]=z,a[r+17]=ne,t[r+18]=m*M+v*G+T,t[r+19]=S*G+y*M+E,t[r+20]=w.x3,t[r+21]=w.y3,a[r+22]=z,a[r+23]=ne}};p1.extension={type:[Q.Batcher],name:"default"};let Cv=p1;function lD(n,e,t,a,r,u,h,f=null){let m=0;t*=e,r*=u;const y=f.a,v=f.b,S=f.c,T=f.d,E=f.tx,A=f.ty;for(;m<h;){const U=n[t],M=n[t+1];a[r]=y*U+S*M+E,a[r+1]=v*U+T*M+A,r+=u,t+=e,m++}}function oD(n,e,t,a){let r=0;for(e*=t;r<a;)n[e]=0,n[e+1]=0,e+=t,r++}function m1(n,e,t,a,r){const u=e.a,h=e.b,f=e.c,m=e.d,y=e.tx,v=e.ty;t||(t=0),a||(a=2),r||(r=n.length/a-t);let S=t*a;for(let T=0;T<r;T++){const E=n[S],A=n[S+1];n[S]=u*E+f*A+y,n[S+1]=h*E+m*A+v,S+=a}}const uD=new ze;class Rv{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 e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,a=this.renderable;return a?jx(t,a.groupColor)+(this.alpha*a.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){var e;return((e=this.renderable)==null?void 0:e.groupTransform)||uD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.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 vd={extension:{type:Q.ShapeBuilder,name:"circle"},build(n,e){let t,a,r,u,h,f;if(n.type==="circle"){const z=n;if(h=f=z.radius,h<=0)return!1;t=z.x,a=z.y,r=u=0}else if(n.type==="ellipse"){const z=n;if(h=z.halfWidth,f=z.halfHeight,h<=0||f<=0)return!1;t=z.x,a=z.y,r=u=0}else{const z=n,ne=z.width/2,ie=z.height/2;t=z.x+ne,a=z.y+ie,h=f=Math.max(0,Math.min(z.radius,Math.min(ne,ie))),r=ne-h,u=ie-f}if(r<0||u<0)return!1;const m=Math.ceil(2.3*Math.sqrt(h+f)),y=m*8+(r?4:0)+(u?4:0);if(y===0)return!1;if(m===0)return e[0]=e[6]=t+r,e[1]=e[3]=a+u,e[2]=e[4]=t-r,e[5]=e[7]=a-u,!0;let v=0,S=m*4+(r?2:0)+2,T=S,E=y,A=r+h,U=u,M=t+A,G=t-A,P=a+U;if(e[v++]=M,e[v++]=P,e[--S]=P,e[--S]=G,u){const z=a-U;e[T++]=G,e[T++]=z,e[--E]=z,e[--E]=M}for(let z=1;z<m;z++){const ne=Math.PI/2*(z/m),ie=r+Math.cos(ne)*h,Z=u+Math.sin(ne)*f,Te=t+ie,me=t-ie,fe=a+Z,le=a-Z;e[v++]=Te,e[v++]=fe,e[--S]=fe,e[--S]=me,e[T++]=me,e[T++]=le,e[--E]=le,e[--E]=Te}A=r,U=u+f,M=t+A,G=t-A,P=a+U;const w=a-U;return e[v++]=M,e[v++]=P,e[--E]=w,e[--E]=M,r&&(e[v++]=G,e[v++]=P,e[--E]=w,e[--E]=G),!0},triangulate(n,e,t,a,r,u){if(n.length===0)return;let h=0,f=0;for(let v=0;v<n.length;v+=2)h+=n[v],f+=n[v+1];h/=n.length/2,f/=n.length/2;let m=a;e[m*t]=h,e[m*t+1]=f;const y=m++;for(let v=0;v<n.length;v+=2)e[m*t]=n[v],e[m*t+1]=n[v+1],v>0&&(r[u++]=m,r[u++]=y,r[u++]=m-1),m++;r[u++]=y+1,r[u++]=y,r[u++]=m-1}},cD={...vd,extension:{...vd.extension,name:"ellipse"}},hD={...vd,extension:{...vd.extension,name:"roundedRectangle"}},y1=1e-4,g1=1e-4;function fD(n){const e=n.length;if(e<6)return 1;let t=0;for(let a=0,r=n[e-2],u=n[e-1];a<e;a+=2){const h=n[a],f=n[a+1];t+=(h-r)*(f+u),r=h,u=f}return t<0?-1:1}function _1(n,e,t,a,r,u,h,f){const m=n-t*r,y=e-a*r,v=n+t*u,S=e+a*u;let T,E;h?(T=a,E=-t):(T=-a,E=t);const A=m+T,U=y+E,M=v+T,G=S+E;return f.push(A,U),f.push(M,G),2}function uu(n,e,t,a,r,u,h,f){const m=t-n,y=a-e;let v=Math.atan2(m,y),S=Math.atan2(r-n,u-e);f&&v<S?v+=Math.PI*2:!f&&v>S&&(S+=Math.PI*2);let T=v;const E=S-v,A=Math.abs(E),U=Math.sqrt(m*m+y*y),M=(15*A*Math.sqrt(U)/Math.PI>>0)+1,G=E/M;if(T+=G,f){h.push(n,e),h.push(t,a);for(let P=1,w=T;P<M;P++,w+=G)h.push(n,e),h.push(n+Math.sin(w)*U,e+Math.cos(w)*U);h.push(n,e),h.push(r,u)}else{h.push(t,a),h.push(n,e);for(let P=1,w=T;P<M;P++,w+=G)h.push(n+Math.sin(w)*U,e+Math.cos(w)*U),h.push(n,e);h.push(r,u),h.push(n,e)}return M*2}function dD(n,e,t,a,r,u){const h=y1;if(n.length===0)return;const f=e;let m=f.alignment;if(e.alignment!==.5){let oe=fD(n);m=(m-.5)*oe+.5}const y=new kt(n[0],n[1]),v=new kt(n[n.length-2],n[n.length-1]),S=a,T=Math.abs(y.x-v.x)<h&&Math.abs(y.y-v.y)<h;if(S){n=n.slice(),T&&(n.pop(),n.pop(),v.set(n[n.length-2],n[n.length-1]));const oe=(y.x+v.x)*.5,Re=(v.y+y.y)*.5;n.unshift(oe,Re),n.push(oe,Re)}const E=r,A=n.length/2;let U=n.length;const M=E.length/2,G=f.width/2,P=G*G,w=f.miterLimit*f.miterLimit;let z=n[0],ne=n[1],ie=n[2],Z=n[3],Te=0,me=0,fe=-(ne-Z),le=z-ie,Ce=0,ae=0,je=Math.sqrt(fe*fe+le*le);fe/=je,le/=je,fe*=G,le*=G;const Rt=m,V=(1-Rt)*2,W=Rt*2;S||(f.cap==="round"?U+=uu(z-fe*(V-W)*.5,ne-le*(V-W)*.5,z-fe*V,ne-le*V,z+fe*W,ne+le*W,E,!0)+2:f.cap==="square"&&(U+=_1(z,ne,fe,le,V,W,!0,E))),E.push(z-fe*V,ne-le*V),E.push(z+fe*W,ne+le*W);for(let oe=1;oe<A-1;++oe){z=n[(oe-1)*2],ne=n[(oe-1)*2+1],ie=n[oe*2],Z=n[oe*2+1],Te=n[(oe+1)*2],me=n[(oe+1)*2+1],fe=-(ne-Z),le=z-ie,je=Math.sqrt(fe*fe+le*le),fe/=je,le/=je,fe*=G,le*=G,Ce=-(Z-me),ae=ie-Te,je=Math.sqrt(Ce*Ce+ae*ae),Ce/=je,ae/=je,Ce*=G,ae*=G;const Re=ie-z,O=ne-Z,k=ie-Te,_e=me-Z,ye=Re*k+O*_e,Ue=O*k-_e*Re,Xe=Ue<0;if(Math.abs(Ue)<.001*Math.abs(ye)){E.push(ie-fe*V,Z-le*V),E.push(ie+fe*W,Z+le*W),ye>=0&&(f.join==="round"?U+=uu(ie,Z,ie-fe*V,Z-le*V,ie-Ce*V,Z-ae*V,E,!1)+4:U+=2,E.push(ie-Ce*W,Z-ae*W),E.push(ie+Ce*V,Z+ae*V));continue}const Be=(-fe+z)*(-le+Z)-(-fe+ie)*(-le+ne),At=(-Ce+Te)*(-ae+Z)-(-Ce+ie)*(-ae+me),St=(Re*At-k*Be)/Ue,Rn=(_e*Be-O*At)/Ue,Oi=(St-ie)*(St-ie)+(Rn-Z)*(Rn-Z),hn=ie+(St-ie)*V,Jn=Z+(Rn-Z)*V,$n=ie-(St-ie)*W,ei=Z-(Rn-Z)*W,Za=Math.min(Re*Re+O*O,k*k+_e*_e),jt=Xe?V:W,yr=Za+jt*jt*P;Oi<=yr?f.join==="bevel"||Oi/P>w?(Xe?(E.push(hn,Jn),E.push(ie+fe*W,Z+le*W),E.push(hn,Jn),E.push(ie+Ce*W,Z+ae*W)):(E.push(ie-fe*V,Z-le*V),E.push($n,ei),E.push(ie-Ce*V,Z-ae*V),E.push($n,ei)),U+=2):f.join==="round"?Xe?(E.push(hn,Jn),E.push(ie+fe*W,Z+le*W),U+=uu(ie,Z,ie+fe*W,Z+le*W,ie+Ce*W,Z+ae*W,E,!0)+4,E.push(hn,Jn),E.push(ie+Ce*W,Z+ae*W)):(E.push(ie-fe*V,Z-le*V),E.push($n,ei),U+=uu(ie,Z,ie-fe*V,Z-le*V,ie-Ce*V,Z-ae*V,E,!1)+4,E.push(ie-Ce*V,Z-ae*V),E.push($n,ei)):(E.push(hn,Jn),E.push($n,ei)):(E.push(ie-fe*V,Z-le*V),E.push(ie+fe*W,Z+le*W),f.join==="round"?Xe?U+=uu(ie,Z,ie+fe*W,Z+le*W,ie+Ce*W,Z+ae*W,E,!0)+2:U+=uu(ie,Z,ie-fe*V,Z-le*V,ie-Ce*V,Z-ae*V,E,!1)+2:f.join==="miter"&&Oi/P<=w&&(Xe?(E.push($n,ei),E.push($n,ei)):(E.push(hn,Jn),E.push(hn,Jn)),U+=2),E.push(ie-Ce*V,Z-ae*V),E.push(ie+Ce*W,Z+ae*W),U+=2)}z=n[(A-2)*2],ne=n[(A-2)*2+1],ie=n[(A-1)*2],Z=n[(A-1)*2+1],fe=-(ne-Z),le=z-ie,je=Math.sqrt(fe*fe+le*le),fe/=je,le/=je,fe*=G,le*=G,E.push(ie-fe*V,Z-le*V),E.push(ie+fe*W,Z+le*W),S||(f.cap==="round"?U+=uu(ie-fe*(V-W)*.5,Z-le*(V-W)*.5,ie-fe*V,Z-le*V,ie+fe*W,Z+le*W,E,!1)+2:f.cap==="square"&&(U+=_1(ie,Z,fe,le,V,W,!1,E)));const de=g1*g1;for(let oe=M;oe<U+M-2;++oe)z=E[oe*2],ne=E[oe*2+1],ie=E[(oe+1)*2],Z=E[(oe+1)*2+1],Te=E[(oe+2)*2],me=E[(oe+2)*2+1],!(Math.abs(z*(Z-me)+ie*(me-ne)+Te*(ne-Z))<de)&&u.push(oe,oe+1,oe+2)}function pD(n,e,t,a){const r=y1;if(n.length===0)return;const u=n[0],h=n[1],f=n[n.length-2],m=n[n.length-1],y=e||Math.abs(u-f)<r&&Math.abs(h-m)<r,v=t,S=n.length/2,T=v.length/2;for(let E=0;E<S;E++)v.push(n[E*2]),v.push(n[E*2+1]);for(let E=0;E<S-1;E++)a.push(T+E,T+E+1);y&&a.push(T+S-1,T)}function v1(n,e,t,a,r,u,h){const f=p3(n,e,2);if(!f)return;for(let y=0;y<f.length;y+=3)u[h++]=f[y]+r,u[h++]=f[y+1]+r,u[h++]=f[y+2]+r;let m=r*a;for(let y=0;y<n.length;y+=2)t[m]=n[y],t[m+1]=n[y+1],m+=a}const mD=[],yD={extension:{type:Q.ShapeBuilder,name:"polygon"},build(n,e){for(let t=0;t<n.points.length;t++)e[t]=n.points[t];return!0},triangulate(n,e,t,a,r,u){v1(n,mD,e,t,a,r,u)}},gD={extension:{type:Q.ShapeBuilder,name:"rectangle"},build(n,e){const t=n,a=t.x,r=t.y,u=t.width,h=t.height;return u>0&&h>0?(e[0]=a,e[1]=r,e[2]=a+u,e[3]=r,e[4]=a+u,e[5]=r+h,e[6]=a,e[7]=r+h,!0):!1},triangulate(n,e,t,a,r,u){let h=0;a*=t,e[a+h]=n[0],e[a+h+1]=n[1],h+=t,e[a+h]=n[2],e[a+h+1]=n[3],h+=t,e[a+h]=n[6],e[a+h+1]=n[7],h+=t,e[a+h]=n[4],e[a+h+1]=n[5],h+=t;const f=a/t;r[u++]=f,r[u++]=f+1,r[u++]=f+2,r[u++]=f+1,r[u++]=f+3,r[u++]=f+2}},_D={extension:{type:Q.ShapeBuilder,name:"triangle"},build(n,e){return e[0]=n.x,e[1]=n.y,e[2]=n.x2,e[3]=n.y2,e[4]=n.x3,e[5]=n.y3,!0},triangulate(n,e,t,a,r,u){let h=0;a*=t,e[a+h]=n[0],e[a+h+1]=n[1],h+=t,e[a+h]=n[2],e[a+h+1]=n[3],h+=t,e[a+h]=n[4],e[a+h+1]=n[5];const f=a/t;r[u++]=f,r[u++]=f+1,r[u++]=f+2}},vD=new ze,bD=new Pt;function xD(n,e,t,a){const r=e.matrix?n.copyFrom(e.matrix).invert():n.identity();if(e.textureSpace==="local"){const h=t.getBounds(bD);e.width&&h.pad(e.width);const{x:f,y:m}=h,y=1/h.width,v=1/h.height,S=-f*y,T=-m*v,E=r.a,A=r.b,U=r.c,M=r.d;r.a*=y,r.b*=y,r.c*=v,r.d*=v,r.tx=S*E+T*U+r.tx,r.ty=S*A+T*M+r.ty}else r.translate(e.texture.frame.x,e.texture.frame.y),r.scale(1/e.texture.source.width,1/e.texture.source.height);const u=e.texture.source.style;return!(e.fill instanceof il)&&u.addressMode==="clamp-to-edge"&&(u.addressMode="repeat",u.update()),a&&r.append(vD.copyFrom(a).invert()),r}const _y={};Ie.handleByMap(Q.ShapeBuilder,_y),Ie.add(gD,yD,_D,vd,cD,hD);const SD=new Pt,TD=new ze;function ED(n,e){const{geometryData:t,batches:a}=e;a.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let r=0;r<n.instructions.length;r++){const u=n.instructions[r];if(u.action==="texture")CD(u.data,a,t);else if(u.action==="fill"||u.action==="stroke"){const h=u.action==="stroke",f=u.data.path.shapePath,m=u.data.style,y=u.data.hole;h&&y&&b1(y.shapePath,m,!0,a,t),y&&(f.shapePrimitives[f.shapePrimitives.length-1].holes=y.shapePath.shapePrimitives),b1(f,m,h,a,t)}}}function CD(n,e,t){const a=[],r=_y.rectangle,u=SD;u.x=n.dx,u.y=n.dy,u.width=n.dw,u.height=n.dh;const h=n.transform;if(!r.build(u,a))return;const{vertices:f,uvs:m,indices:y}=t,v=y.length,S=f.length/2;h&&m1(a,h),r.triangulate(a,f,2,S,y,v);const T=n.image,E=T.uvs;m.push(E.x0,E.y0,E.x1,E.y1,E.x3,E.y3,E.x2,E.y2);const A=Cn.get(Rv);A.indexOffset=v,A.indexSize=y.length-v,A.attributeOffset=S,A.attributeSize=f.length/2-S,A.baseColor=n.style,A.alpha=n.alpha,A.texture=T,A.geometryData=t,e.push(A)}function b1(n,e,t,a,r){const{vertices:u,uvs:h,indices:f}=r;n.shapePrimitives.forEach(({shape:m,transform:y,holes:v})=>{const S=[],T=_y[m.type];if(!T.build(m,S))return;const E=f.length,A=u.length/2;let U="triangle-list";if(y&&m1(S,y),t){const w=m.closePath??!0,z=e;z.pixelLine?(pD(S,w,u,f),U="line-list"):dD(S,z,!1,w,u,f)}else if(v){const w=[],z=S.slice();RD(v).forEach(ie=>{w.push(z.length/2),z.push(...ie)}),v1(z,w,u,2,A,f,E)}else T.triangulate(S,u,2,A,f,E);const M=h.length/2,G=e.texture;if(G!==He.WHITE){const w=xD(TD,e,m,y);lD(u,2,A,h,M,2,u.length/2-A,w)}else oD(h,M,2,u.length/2-A);const P=Cn.get(Rv);P.indexOffset=E,P.indexSize=f.length-E,P.attributeOffset=A,P.attributeSize=u.length/2-A,P.baseColor=e.color,P.alpha=e.alpha,P.texture=G,P.geometryData=r,P.topology=U,a.push(P)})}function RD(n){const e=[];for(let t=0;t<n.length;t++){const a=n[t].shape,r=[];_y[a.type].build(a,r)&&e.push(r)}return e}class AD{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class MD{constructor(){this.instructions=new Fx}init(e){this.batcher=new Cv({maxTextures:e}),this.instructions.reset()}get geometry(){return it(PA,"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 Av=class tx{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash")}init(e){tx.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??tx.defaultOptions.bezierSmoothness}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),ED(e,t);const a=e.batchMode;e.customShader||a==="no-batch"?t.isBatchable=!1:a==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=!0,e.dirty=!1}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){const t=Cn.get(MD,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:a,geometryData:r}=this._gpuContextHash[e.uid],u=r.vertices.length,h=r.indices.length;for(let v=0;v<a.length;v++)a[v].applyTransform=!1;const f=t.batcher;f.ensureAttributeBuffer(u),f.ensureIndexBuffer(h),f.begin();for(let v=0;v<a.length;v++){const S=a[v];f.add(S)}f.finish(t.instructions);const m=f.geometry;m.indexBuffer.setDataWithSize(f.indexBuffer,f.indexSize,!0),m.buffers[0].setDataWithSize(f.attributeBuffer.float32View,f.attributeSize,!0);const y=f.batches;for(let v=0;v<y.length;v++){const S=y[v];S.bindGroup=pv(S.textures.textures,S.textures.count,this._renderer.limits.maxBatchableTextures)}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){const t=new AD;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null}_cleanGraphicsContextData(e){const t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(Cn.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(a=>{Cn.return(a)})}destroy(){for(const e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context)}};Av.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"graphicsContext"},Av.defaultOptions={bezierSmoothness:.5};let Mv=Av;const DD=8,vy=11920929e-14,UD=1;function x1(n,e,t,a,r,u,h,f,m,y){const S=Math.min(.99,Math.max(0,y??Mv.defaultOptions.bezierSmoothness));let T=(UD-S)/1;return T*=T,BD(e,t,a,r,u,h,f,m,n,T),n}function BD(n,e,t,a,r,u,h,f,m,y){Dv(n,e,t,a,r,u,h,f,m,y,0),m.push(h,f)}function Dv(n,e,t,a,r,u,h,f,m,y,v){if(v>DD)return;const S=(n+t)/2,T=(e+a)/2,E=(t+r)/2,A=(a+u)/2,U=(r+h)/2,M=(u+f)/2,G=(S+E)/2,P=(T+A)/2,w=(E+U)/2,z=(A+M)/2,ne=(G+w)/2,ie=(P+z)/2;if(v>0){let Z=h-n,Te=f-e;const me=Math.abs((t-h)*Te-(a-f)*Z),fe=Math.abs((r-h)*Te-(u-f)*Z);if(me>vy&&fe>vy){if((me+fe)*(me+fe)<=y*(Z*Z+Te*Te)){m.push(ne,ie);return}}else if(me>vy){if(me*me<=y*(Z*Z+Te*Te)){m.push(ne,ie);return}}else if(fe>vy){if(fe*fe<=y*(Z*Z+Te*Te)){m.push(ne,ie);return}}else if(Z=ne-(n+h)/2,Te=ie-(e+f)/2,Z*Z+Te*Te<=y){m.push(ne,ie);return}}Dv(n,e,S,T,G,P,ne,ie,m,y,v+1),Dv(ne,ie,w,z,U,M,h,f,m,y,v+1)}const OD=8,ND=11920929e-14,GD=1;function PD(n,e,t,a,r,u,h,f){const y=Math.min(.99,Math.max(0,f??Mv.defaultOptions.bezierSmoothness));let v=(GD-y)/1;return v*=v,wD(e,t,a,r,u,h,n,v),n}function wD(n,e,t,a,r,u,h,f){Uv(h,n,e,t,a,r,u,f,0),h.push(r,u)}function Uv(n,e,t,a,r,u,h,f,m){if(m>OD)return;const y=(e+a)/2,v=(t+r)/2,S=(a+u)/2,T=(r+h)/2,E=(y+S)/2,A=(v+T)/2;let U=u-e,M=h-t;const G=Math.abs((a-u)*M-(r-h)*U);if(G>ND){if(G*G<=f*(U*U+M*M)){n.push(E,A);return}}else if(U=E-(e+u)/2,M=A-(t+h)/2,U*U+M*M<=f){n.push(E,A);return}Uv(n,e,t,y,v,E,A,f,m+1),Uv(n,E,A,S,T,u,h,f,m+1)}function S1(n,e,t,a,r,u,h,f){let m=Math.abs(r-u);(!h&&r>u||h&&u>r)&&(m=2*Math.PI-m),f||(f=Math.max(6,Math.floor(6*Math.pow(a,1/3)*(m/Math.PI)))),f=Math.max(f,3);let y=m/f,v=r;y*=h?-1:1;for(let S=0;S<f+1;S++){const T=Math.cos(v),E=Math.sin(v),A=e+T*a,U=t+E*a;n.push(A,U),v+=y}}function zD(n,e,t,a,r,u){const h=n[n.length-2],m=n[n.length-1]-t,y=h-e,v=r-t,S=a-e,T=Math.abs(m*S-y*v);if(T<1e-8||u===0){(n[n.length-2]!==e||n[n.length-1]!==t)&&n.push(e,t);return}const E=m*m+y*y,A=v*v+S*S,U=m*v+y*S,M=u*Math.sqrt(E)/T,G=u*Math.sqrt(A)/T,P=M*U/E,w=G*U/A,z=M*S+G*y,ne=M*v+G*m,ie=y*(G+P),Z=m*(G+P),Te=S*(M+w),me=v*(M+w),fe=Math.atan2(Z-ne,ie-z),le=Math.atan2(me-ne,Te-z);S1(n,z+e,ne+t,u,fe,le,y*v>S*m)}const bd=Math.PI*2,Bv={centerX:0,centerY:0,ang1:0,ang2:0},Ov=({x:n,y:e},t,a,r,u,h,f,m)=>{n*=t,e*=a;const y=r*n-u*e,v=u*n+r*e;return m.x=y+h,m.y=v+f,m};function HD(n,e){const t=e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),a=e===1.5707963267948966?.551915024494:t,r=Math.cos(n),u=Math.sin(n),h=Math.cos(n+e),f=Math.sin(n+e);return[{x:r-u*a,y:u+r*a},{x:h+f*a,y:f-h*a},{x:h,y:f}]}const T1=(n,e,t,a)=>{const r=n*a-e*t<0?-1:1;let u=n*t+e*a;return u>1&&(u=1),u<-1&&(u=-1),r*Math.acos(u)},VD=(n,e,t,a,r,u,h,f,m,y,v,S,T)=>{const E=Math.pow(r,2),A=Math.pow(u,2),U=Math.pow(v,2),M=Math.pow(S,2);let G=E*A-E*M-A*U;G<0&&(G=0),G/=E*M+A*U,G=Math.sqrt(G)*(h===f?-1:1);const P=G*r/u*S,w=G*-u/r*v,z=y*P-m*w+(n+t)/2,ne=m*P+y*w+(e+a)/2,ie=(v-P)/r,Z=(S-w)/u,Te=(-v-P)/r,me=(-S-w)/u,fe=T1(1,0,ie,Z);let le=T1(ie,Z,Te,me);f===0&&le>0&&(le-=bd),f===1&&le<0&&(le+=bd),T.centerX=z,T.centerY=ne,T.ang1=fe,T.ang2=le};function LD(n,e,t,a,r,u,h,f=0,m=0,y=0){if(u===0||h===0)return;const v=Math.sin(f*bd/360),S=Math.cos(f*bd/360),T=S*(e-a)/2+v*(t-r)/2,E=-v*(e-a)/2+S*(t-r)/2;if(T===0&&E===0)return;u=Math.abs(u),h=Math.abs(h);const A=Math.pow(T,2)/Math.pow(u,2)+Math.pow(E,2)/Math.pow(h,2);A>1&&(u*=Math.sqrt(A),h*=Math.sqrt(A)),VD(e,t,a,r,u,h,m,y,v,S,T,E,Bv);let{ang1:U,ang2:M}=Bv;const{centerX:G,centerY:P}=Bv;let w=Math.abs(M)/(bd/4);Math.abs(1-w)<1e-7&&(w=1);const z=Math.max(Math.ceil(w),1);M/=z;let ne=n[n.length-2],ie=n[n.length-1];const Z={x:0,y:0};for(let Te=0;Te<z;Te++){const me=HD(U,M),{x:fe,y:le}=Ov(me[0],u,h,S,v,G,P,Z),{x:Ce,y:ae}=Ov(me[1],u,h,S,v,G,P,Z),{x:je,y:Rt}=Ov(me[2],u,h,S,v,G,P,Z);x1(n,ne,ie,fe,le,Ce,ae,je,Rt),ne=je,ie=Rt,U+=M}}function jD(n,e,t){const a=(h,f)=>{const m=f.x-h.x,y=f.y-h.y,v=Math.sqrt(m*m+y*y),S=m/v,T=y/v;return{len:v,nx:S,ny:T}},r=(h,f)=>{h===0?n.moveTo(f.x,f.y):n.lineTo(f.x,f.y)};let u=e[e.length-1];for(let h=0;h<e.length;h++){const f=e[h%e.length],m=f.radius??t;if(m<=0){r(h,f),u=f;continue}const y=e[(h+1)%e.length],v=a(f,u),S=a(f,y);if(v.len<1e-4||S.len<1e-4){r(h,f),u=f;continue}let T=Math.asin(v.nx*S.ny-v.ny*S.nx),E=1,A=!1;v.nx*S.nx-v.ny*-S.ny<0?T<0?T=Math.PI+T:(T=Math.PI-T,E=-1,A=!0):T>0&&(E=-1,A=!0);const U=T/2;let M,G=Math.abs(Math.cos(U)*m/Math.sin(U));G>Math.min(v.len/2,S.len/2)?(G=Math.min(v.len/2,S.len/2),M=Math.abs(G*Math.sin(U)/Math.cos(U))):M=m;const P=f.x+S.nx*G+-S.ny*M*E,w=f.y+S.ny*G+S.nx*M*E,z=Math.atan2(v.ny,v.nx)+Math.PI/2*E,ne=Math.atan2(S.ny,S.nx)-Math.PI/2*E;h===0&&n.moveTo(P+Math.cos(z)*M,w+Math.sin(z)*M),n.arc(P,w,M,z,ne,A),u=f}}function YD(n,e,t,a){const r=(f,m)=>Math.sqrt((f.x-m.x)**2+(f.y-m.y)**2),u=(f,m,y)=>({x:f.x+(m.x-f.x)*y,y:f.y+(m.y-f.y)*y}),h=e.length;for(let f=0;f<h;f++){const m=e[(f+1)%h],y=m.radius??t;if(y<=0){f===0?n.moveTo(m.x,m.y):n.lineTo(m.x,m.y);continue}const v=e[f],S=e[(f+2)%h],T=r(v,m);let E;if(T<1e-4)E=m;else{const M=Math.min(T/2,y);E=u(m,v,M/T)}const A=r(S,m);let U;if(A<1e-4)U=m;else{const M=Math.min(A/2,y);U=u(m,S,M/A)}f===0?n.moveTo(E.x,E.y):n.lineTo(E.x,E.y),n.quadraticCurveTo(m.x,m.y,U.x,U.y,a)}}const XD=new Pt;class qD{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ci,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();const a=this._currentPoly.points,r=a[a.length-2],u=a[a.length-1];return(r!==e||u!==t)&&a.push(e,t),this}arc(e,t,a,r,u,h){this._ensurePoly(!1);const f=this._currentPoly.points;return S1(f,e,t,a,r,u,h),this}arcTo(e,t,a,r,u){this._ensurePoly();const h=this._currentPoly.points;return zD(h,e,t,a,r,u),this}arcToSvg(e,t,a,r,u,h,f){const m=this._currentPoly.points;return LD(m,this._currentPoly.lastX,this._currentPoly.lastY,h,f,e,t,a,r,u),this}bezierCurveTo(e,t,a,r,u,h,f){this._ensurePoly();const m=this._currentPoly;return x1(this._currentPoly.points,m.lastX,m.lastY,e,t,a,r,u,h,f),this}quadraticCurveTo(e,t,a,r,u){this._ensurePoly();const h=this._currentPoly;return PD(this._currentPoly.points,h.lastX,h.lastY,e,t,a,r,u),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));const a=this.shapePrimitives,r=a.length;for(let u=0;u<e.instructions.length;u++){const h=e.instructions[u];this[h.action](...h.data)}if(e.checkForHoles&&a.length-r>1){let u=null;for(let h=r;h<a.length;h++){const f=a[h];if(f.shape.type==="polygon"){const m=f.shape,y=u==null?void 0:u.shape;y&&y.containsPolygon(m)?(u.holes||(u.holes=[]),u.holes.push(f),a.copyWithin(h,h+1),a.length--,h--):u=f}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,a,r,u){return this.drawShape(new Pt(e,t,a,r),u),this}circle(e,t,a,r){return this.drawShape(new hv(e,t,a),r),this}poly(e,t,a){const r=new cd(e);return r.closePath=t,this.drawShape(r,a),this}regularPoly(e,t,a,r,u=0,h){r=Math.max(r|0,3);const f=-1*Math.PI/2+u,m=Math.PI*2/r,y=[];for(let v=0;v<r;v++){const S=f-v*m;y.push(e+a*Math.cos(S),t+a*Math.sin(S))}return this.poly(y,!0,h),this}roundPoly(e,t,a,r,u,h=0,f){if(r=Math.max(r|0,3),u<=0)return this.regularPoly(e,t,a,r,h);const m=a*Math.sin(Math.PI/r)-.001;u=Math.min(u,m);const y=-1*Math.PI/2+h,v=Math.PI*2/r,S=(r-2)*Math.PI/r/2;for(let T=0;T<r;T++){const E=T*v+y,A=e+a*Math.cos(E),U=t+a*Math.sin(E),M=E+Math.PI+S,G=E-Math.PI-S,P=A+u*Math.cos(M),w=U+u*Math.sin(M),z=A+u*Math.cos(G),ne=U+u*Math.sin(G);T===0?this.moveTo(P,w):this.lineTo(P,w),this.quadraticCurveTo(A,U,z,ne,f)}return this.closePath()}roundShape(e,t,a=!1,r){return e.length<3?this:(a?YD(this,e,t,r):jD(this,e,t),this.closePath())}filletRect(e,t,a,r,u){if(u===0)return this.rect(e,t,a,r);const h=Math.min(a,r)/2,f=Math.min(h,Math.max(-h,u)),m=e+a,y=t+r,v=f<0?-f:0,S=Math.abs(f);return this.moveTo(e,t+S).arcTo(e+v,t+v,e+S,t,S).lineTo(m-S,t).arcTo(m-v,t+v,m,t+S,S).lineTo(m,y-S).arcTo(m-v,y-v,e+a-S,y,S).lineTo(e+S,y).arcTo(e+v,y-v,e,y-S,S).closePath()}chamferRect(e,t,a,r,u,h){if(u<=0)return this.rect(e,t,a,r);const f=Math.min(u,Math.min(a,r)/2),m=e+a,y=t+r,v=[e+f,t,m-f,t,m,t+f,m,y-f,m-f,y,e+f,y,e,y-f,e,t+f];for(let S=v.length-1;S>=2;S-=2)v[S]===v[S-2]&&v[S-1]===v[S-3]&&v.splice(S-1,2);return this.poly(v,!0,h)}ellipse(e,t,a,r,u){return this.drawShape(new fv(e,t,a,r),u),this}roundRect(e,t,a,r,u,h){return this.drawShape(new dv(e,t,a,r,u),h),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let a=this._currentPoly;return a&&this.endPoly(),a=new cd,a.points.push(e,t),this._currentPoly=a,this}endPoly(e=!1){const t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new cd,e)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let a=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const u=t.transform,h=a;a=u.a*a+u.c*r+u.tx,r=u.b*h+u.d*r+u.ty}this._currentPoly.points.push(a,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){const a=e.instructions[t];this[a.action](...a.data)}this.finish()}get bounds(){const e=this._bounds;e.clear();const t=this.shapePrimitives;for(let a=0;a<t.length;a++){const r=t[a],u=r.shape.getBounds(XD);r.transform?e.addRect(u,r.transform):e.addRect(u)}return e}}class al{constructor(e,t=!1){this.instructions=[],this.uid=It("graphicsPath"),this._dirty=!0,this.checkForHoles=t,typeof e=="string"?R3(e,this):this.instructions=(e==null?void 0:e.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new qD(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,a,r,u){const h=this.instructions[this.instructions.length-1],f=this.getLastPoint(kt.shared);let m=0,y=0;if(!h||h.action!=="bezierCurveTo")m=f.x,y=f.y;else{m=h.data[2],y=h.data[3];const v=f.x,S=f.y;m=v+(v-m),y=S+(S-y)}return this.instructions.push({action:"bezierCurveTo",data:[m,y,e,t,a,r,u]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,a){const r=this.instructions[this.instructions.length-1],u=this.getLastPoint(kt.shared);let h=0,f=0;if(!r||r.action!=="quadraticCurveTo")h=u.x,f=u.y;else{h=r.data[0],f=r.data[1];const m=u.x,y=u.y;h=m+(m-h),f=y+(y-f)}return this.instructions.push({action:"quadraticCurveTo",data:[h,f,e,t,a]}),this._dirty=!0,this}rect(e,t,a,r,u){return this.instructions.push({action:"rect",data:[e,t,a,r,u]}),this._dirty=!0,this}circle(e,t,a,r){return this.instructions.push({action:"circle",data:[e,t,a,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,t,a,r,u,h,f){u||(u=r/2);const m=-1*Math.PI/2+h,y=a*2,v=Math.PI*2/y,S=[];for(let T=0;T<y;T++){const E=T%2?u:r,A=T*v+m;S.push(e+E*Math.cos(A),t+E*Math.sin(A))}return this.poly(S,!0,f),this}clone(e=!1){const t=new al;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let a=0;a<this.instructions.length;a++){const r=this.instructions[a];t.instructions.push({action:r.action,data:r.data.slice()})}return t}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;const t=e.a,a=e.b,r=e.c,u=e.d,h=e.tx,f=e.ty;let m=0,y=0,v=0,S=0,T=0,E=0,A=0,U=0;for(let M=0;M<this.instructions.length;M++){const G=this.instructions[M],P=G.data;switch(G.action){case"moveTo":case"lineTo":m=P[0],y=P[1],P[0]=t*m+r*y+h,P[1]=a*m+u*y+f;break;case"bezierCurveTo":v=P[0],S=P[1],T=P[2],E=P[3],m=P[4],y=P[5],P[0]=t*v+r*S+h,P[1]=a*v+u*S+f,P[2]=t*T+r*E+h,P[3]=a*T+u*E+f,P[4]=t*m+r*y+h,P[5]=a*m+u*y+f;break;case"quadraticCurveTo":v=P[0],S=P[1],m=P[2],y=P[3],P[0]=t*v+r*S+h,P[1]=a*v+u*S+f,P[2]=t*m+r*y+h,P[3]=a*m+u*y+f;break;case"arcToSvg":m=P[5],y=P[6],A=P[0],U=P[1],P[0]=t*A+r*U,P[1]=a*A+u*U,P[5]=t*m+r*y+h,P[6]=a*m+u*y+f;break;case"circle":P[4]=xd(P[3],e);break;case"rect":P[4]=xd(P[4],e);break;case"ellipse":P[8]=xd(P[8],e);break;case"roundRect":P[5]=xd(P[5],e);break;case"addPath":P[0].transform(e);break;case"poly":P[2]=xd(P[2],e);break;default:rt("unknown transform action",G.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,a=this.instructions[t];if(!a)return e.x=0,e.y=0,e;for(;a.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;a=this.instructions[t]}switch(a.action){case"moveTo":case"lineTo":e.x=a.data[0],e.y=a.data[1];break;case"quadraticCurveTo":e.x=a.data[2],e.y=a.data[3];break;case"bezierCurveTo":e.x=a.data[4],e.y=a.data[5];break;case"arc":case"arcToSvg":e.x=a.data[5],e.y=a.data[6];break;case"addPath":a.data[0].getLastPoint(e);break}return e}}function xd(n,e){return n?n.prepend(e):e.clone()}function cn(n,e,t){const a=n.getAttribute(e);return a?Number(a):t}function FD(n,e){const t=n.querySelectorAll("defs");for(let a=0;a<t.length;a++){const r=t[a];for(let u=0;u<r.children.length;u++){const h=r.children[u];switch(h.nodeName.toLowerCase()){case"lineargradient":e.defs[h.id]=kD(h);break;case"radialgradient":e.defs[h.id]=ID();break}}}}function kD(n){const e=cn(n,"x1",0),t=cn(n,"y1",0),a=cn(n,"x2",1),r=cn(n,"y2",0),u=n.getAttribute("gradientUnits")||"objectBoundingBox",h=new il(e,t,a,r,u==="objectBoundingBox"?"local":"global");for(let f=0;f<n.children.length;f++){const m=n.children[f],y=cn(m,"offset",0),v=Zt.shared.setValue(m.getAttribute("stop-color")).toNumber();h.addColorStop(y,v)}return h}function ID(n){return rt("[SVG Parser] Radial gradients are not yet supported"),new il(0,0,1,0)}function E1(n){const e=n.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const C1={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 R1(n,e){const t=n.getAttribute("style"),a={},r={},u={strokeStyle:a,fillStyle:r,useFill:!1,useStroke:!1};for(const h in C1){const f=n.getAttribute(h);f&&A1(e,u,h,f.trim())}if(t){const h=t.split(";");for(let f=0;f<h.length;f++){const m=h[f].trim(),[y,v]=m.split(":");C1[y]&&A1(e,u,y,v.trim())}}return{strokeStyle:u.useStroke?a:null,fillStyle:u.useFill?r:null,useFill:u.useFill,useStroke:u.useStroke}}function A1(n,e,t,a){switch(t){case"stroke":if(a!=="none"){if(a.startsWith("url(")){const r=E1(a);e.strokeStyle.fill=n.defs[r]}else e.strokeStyle.color=Zt.shared.setValue(a).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(a);break;case"fill":if(a!=="none"){if(a.startsWith("url(")){const r=E1(a);e.fillStyle.fill=n.defs[r]}else e.fillStyle.color=Zt.shared.setValue(a).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(a);break;case"stroke-opacity":e.strokeStyle.alpha=Number(a);break;case"opacity":e.fillStyle.alpha=Number(a),e.strokeStyle.alpha=Number(a);break}}function KD(n){if(n.length<=2)return!0;const e=n.map(f=>f.area).sort((f,m)=>m-f),[t,a]=e,r=e[e.length-1],u=t/a,h=a/r;return!(u>3&&h<2)}function QD(n){return n.split(/(?=[Mm])/).filter(a=>a.trim().length>0)}function ZD(n){const e=n.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const t=e.map(Number),a=[],r=[];for(let v=0;v<t.length;v+=2)v+1<t.length&&(a.push(t[v]),r.push(t[v+1]));if(a.length===0||r.length===0)return 0;const u=Math.min(...a),h=Math.max(...a),f=Math.min(...r),m=Math.max(...r);return(h-u)*(m-f)}function M1(n,e){const t=new al(n,!1);for(const a of t.instructions)e.instructions.push(a)}function WD(n,e){if(typeof n=="string"){const h=document.createElement("div");h.innerHTML=n.trim(),n=h.querySelector("svg")}const t={context:e,defs:{},path:new al};FD(n,t);const a=n.children,{fillStyle:r,strokeStyle:u}=R1(n,t);for(let h=0;h<a.length;h++){const f=a[h];f.nodeName.toLowerCase()!=="defs"&&D1(f,t,r,u)}return e}function D1(n,e,t,a){const r=n.children,{fillStyle:u,strokeStyle:h}=R1(n,e);u&&t?t={...t,...u}:u&&(t=u),h&&a?a={...a,...h}:h&&(a=h);const f=!t&&!a;f&&(t={color:0});let m,y,v,S,T,E,A,U,M,G,P,w,z,ne,ie,Z,Te;switch(n.nodeName.toLowerCase()){case"path":{ne=n.getAttribute("d");const me=n.getAttribute("fill-rule"),fe=QD(ne),le=me==="evenodd",Ce=fe.length>1;if(le&&Ce){const je=fe.map(V=>({path:V,area:ZD(V)}));if(je.sort((V,W)=>W.area-V.area),fe.length>3||!KD(je))for(let V=0;V<je.length;V++){const W=je[V],de=V===0;e.context.beginPath();const oe=new al(void 0,!0);M1(W.path,oe),e.context.path(oe),de?(t&&e.context.fill(t),a&&e.context.stroke(a)):e.context.cut()}else for(let V=0;V<je.length;V++){const W=je[V],de=V%2===1;e.context.beginPath();const oe=new al(void 0,!0);M1(W.path,oe),e.context.path(oe),de?e.context.cut():(t&&e.context.fill(t),a&&e.context.stroke(a))}}else{const je=me?me==="evenodd":!0;ie=new al(ne,je),e.context.path(ie),t&&e.context.fill(t),a&&e.context.stroke(a)}break}case"circle":A=cn(n,"cx",0),U=cn(n,"cy",0),M=cn(n,"r",0),e.context.ellipse(A,U,M,M),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"rect":m=cn(n,"x",0),y=cn(n,"y",0),Z=cn(n,"width",0),Te=cn(n,"height",0),G=cn(n,"rx",0),P=cn(n,"ry",0),G||P?e.context.roundRect(m,y,Z,Te,G||P):e.context.rect(m,y,Z,Te),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"ellipse":A=cn(n,"cx",0),U=cn(n,"cy",0),G=cn(n,"rx",0),P=cn(n,"ry",0),e.context.beginPath(),e.context.ellipse(A,U,G,P),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"line":v=cn(n,"x1",0),S=cn(n,"y1",0),T=cn(n,"x2",0),E=cn(n,"y2",0),e.context.beginPath(),e.context.moveTo(v,S),e.context.lineTo(T,E),a&&e.context.stroke(a);break;case"polygon":z=n.getAttribute("points"),w=z.match(/\d+/g).map(me=>parseInt(me,10)),e.context.poly(w,!0),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"polyline":z=n.getAttribute("points"),w=z.match(/\d+/g).map(me=>parseInt(me,10)),e.context.poly(w,!1),a&&e.context.stroke(a);break;case"g":case"svg":break;default:{rt(`[SVG parser] <${n.nodeName}> elements unsupported`);break}}f&&(t=null);for(let me=0;me<r.length;me++)D1(r[me],e,t,a)}function JD(n){return Zt.isColorLike(n)}function U1(n){return n instanceof my}function B1(n){return n instanceof il}function $D(n){return n instanceof He}function eU(n,e,t){const a=Zt.shared.setValue(e??0);return n.color=a.toNumber(),n.alpha=a.alpha===1?t.alpha:a.alpha,n.texture=He.WHITE,{...t,...n}}function tU(n,e,t){return n.texture=e,{...t,...n}}function O1(n,e,t){return n.fill=e,n.color=16777215,n.texture=e.texture,n.matrix=e.transform,{...t,...n}}function N1(n,e,t){return e.buildGradient(),n.fill=e,n.color=16777215,n.texture=e.texture,n.matrix=e.transform,n.textureSpace=e.textureSpace,{...t,...n}}function nU(n,e){const t={...e,...n},a=Zt.shared.setValue(t.color);return t.alpha*=a.alpha,t.color=a.toNumber(),t}function cu(n,e){if(n==null)return null;const t={},a=n;return JD(n)?eU(t,n,e):$D(n)?tU(t,n,e):U1(n)?O1(t,n,e):B1(n)?N1(t,n,e):a.fill&&U1(a.fill)?O1(a,a.fill,e):a.fill&&B1(a.fill)?N1(a,a.fill,e):nU(a,e)}function by(n,e){const{width:t,alignment:a,miterLimit:r,cap:u,join:h,pixelLine:f,...m}=e,y=cu(n,m);return y?{width:t,alignment:a,miterLimit:r,cap:u,join:h,pixelLine:f,...y}:null}const iU=new kt,G1=new ze,Nv=class Zr extends Sa{constructor(){super(...arguments),this.uid=It("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new al,this._transform=new ze,this._fillStyle={...Zr.defaultFillStyle},this._strokeStyle={...Zr.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new ci,this._boundsDirty=!0}clone(){const e=new Zr;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=cu(e,Zr.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=by(e,Zr.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=cu(e,Zr.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=cu(e,Zr.defaultStrokeStyle),this}texture(e,t,a,r,u,h){return this.instructions.push({action:"texture",data:{image:e,dx:a||0,dy:r||0,dw:u||e.frame.width,dh:h||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?Zt.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new al,this}fill(e,t){let a;const r=this.instructions[this.instructions.length-1];return this._tick===0&&r&&r.action==="stroke"?a=r.data.path:a=this._activePath.clone(),a?(e!=null&&(t!==void 0&&typeof e=="number"&&(it(Mt,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=cu(e,Zr.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:a}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:t}=this._activePath.getLastPoint(kt.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(e){let t;const a=this.instructions[this.instructions.length-1];return this._tick===0&&a&&a.action==="fill"?t=a.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=by(e,Zr.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const t=this.instructions[this.instructions.length-1-e],a=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(a);else{t.data.hole=a;break}}return this._initNextPathLocation(),this}arc(e,t,a,r,u,h){this._tick++;const f=this._transform;return this._activePath.arc(f.a*e+f.c*t+f.tx,f.b*e+f.d*t+f.ty,a,r,u,h),this}arcTo(e,t,a,r,u){this._tick++;const h=this._transform;return this._activePath.arcTo(h.a*e+h.c*t+h.tx,h.b*e+h.d*t+h.ty,h.a*a+h.c*r+h.tx,h.b*a+h.d*r+h.ty,u),this}arcToSvg(e,t,a,r,u,h,f){this._tick++;const m=this._transform;return this._activePath.arcToSvg(e,t,a,r,u,m.a*h+m.c*f+m.tx,m.b*h+m.d*f+m.ty),this}bezierCurveTo(e,t,a,r,u,h,f){this._tick++;const m=this._transform;return this._activePath.bezierCurveTo(m.a*e+m.c*t+m.tx,m.b*e+m.d*t+m.ty,m.a*a+m.c*r+m.tx,m.b*a+m.d*r+m.ty,m.a*u+m.c*h+m.tx,m.b*u+m.d*h+m.ty,f),this}closePath(){var e;return this._tick++,(e=this._activePath)==null||e.closePath(),this}ellipse(e,t,a,r){return this._tick++,this._activePath.ellipse(e,t,a,r,this._transform.clone()),this}circle(e,t,a){return this._tick++,this._activePath.circle(e,t,a,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;const a=this._transform;return this._activePath.lineTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty),this}moveTo(e,t){this._tick++;const a=this._transform,r=this._activePath.instructions,u=a.a*e+a.c*t+a.tx,h=a.b*e+a.d*t+a.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=u,r[0].data[1]=h,this):(this._activePath.moveTo(u,h),this)}quadraticCurveTo(e,t,a,r,u){this._tick++;const h=this._transform;return this._activePath.quadraticCurveTo(h.a*e+h.c*t+h.tx,h.b*e+h.d*t+h.ty,h.a*a+h.c*r+h.tx,h.b*a+h.d*r+h.ty,u),this}rect(e,t,a,r){return this._tick++,this._activePath.rect(e,t,a,r,this._transform.clone()),this}roundRect(e,t,a,r,u){return this._tick++,this._activePath.roundRect(e,t,a,r,u,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,a,r,u=0,h){return this._tick++,this._activePath.regularPoly(e,t,a,r,u,h),this}roundPoly(e,t,a,r,u,h){return this._tick++,this._activePath.roundPoly(e,t,a,r,u,h),this}roundShape(e,t,a,r){return this._tick++,this._activePath.roundShape(e,t,a,r),this}filletRect(e,t,a,r,u){return this._tick++,this._activePath.filletRect(e,t,a,r,u),this}chamferRect(e,t,a,r,u,h){return this._tick++,this._activePath.chamferRect(e,t,a,r,u,h),this}star(e,t,a,r,u=0,h=0){return this._tick++,this._activePath.star(e,t,a,r,u,h,this._transform.clone()),this}svg(e){return this._tick++,WD(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.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(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,a,r,u,h){return e instanceof ze?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,a,r,u,h),this)}transform(e,t,a,r,u,h){return e instanceof ze?(this._transform.append(e),this):(G1.set(e,t,a,r,u,h),this._transform.append(G1),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,!this.dirty&&(this.emit("update",this,16),this.dirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){const a=this.instructions[t],r=a.action;if(r==="fill"){const u=a.data;e.addBounds(u.path.bounds)}else if(r==="texture"){const u=a.data;e.addFrame(u.dx,u.dy,u.dx+u.dw,u.dy+u.dh,u.transform)}if(r==="stroke"){const u=a.data,h=u.style.alignment,f=u.style.width*(1-h),m=u.path.bounds;e.addFrame(m.minX-f,m.minY-f,m.maxX+f,m.maxY+f)}}return e}containsPoint(e){var r;if(!this.bounds.containsPoint(e.x,e.y))return!1;const t=this.instructions;let a=!1;for(let u=0;u<t.length;u++){const h=t[u],f=h.data,m=f.path;if(!h.action||!m)continue;const y=f.style,v=m.shapePath.shapePrimitives;for(let S=0;S<v.length;S++){const T=v[S].shape;if(!y||!T)continue;const E=v[S].transform,A=E?E.applyInverse(e,iU):e;if(h.action==="fill")a=T.contains(A.x,A.y);else{const M=y;a=T.strokeContains(A.x,A.y,M.width,M.alignment)}const U=f.hole;if(U){const M=(r=U.shapePath)==null?void 0:r.shapePrimitives;if(M)for(let G=0;G<M.length;G++)M[G].shape.contains(A.x,A.y)&&(a=!1)}if(a)return!0}}return a}destroy(e=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const a=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(a)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(a))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Nv.defaultFillStyle={color:16777215,alpha:1,texture:He.WHITE,matrix:null,fill:null,textureSpace:"local"},Nv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:He.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Ns=Nv;const Gv=class Ff extends Sa{constructor(e={}){super(),this.uid=It("textStyle"),this._tick=0,aU(e);const t={...Ff.defaultTextStyle,...e};for(const a in t){const r=a;this[r]=t[a]}this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Ff.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Ff.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Ns.defaultFillStyle,...e},()=>{this._fill=cu({...this._originalFill},Ns.defaultFillStyle)})),this._fill=cu(e===0?"black":e,Ns.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Ns.defaultStrokeStyle,...e},()=>{this._stroke=by({...this._originalStroke},Ns.defaultStrokeStyle)})),this._stroke=by(e,Ns.defaultStrokeStyle),this.update())}update(){this._tick++,this.emit("update",this)}reset(){const e=Ff.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return`${this.uid}-${this._tick}`}clone(){return new Ff({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,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,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=!1){var a,r,u,h;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const f=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(a=this._fill)!=null&&a.texture&&this._fill.texture.destroy(f),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(f),(u=this._stroke)!=null&&u.texture&&this._stroke.texture.destroy(f),(h=this._originalStroke)!=null&&h.texture&&this._originalStroke.texture.destroy(f)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(a,r,u)=>(a[r]===u||(a[r]=u,t==null||t(r,u),this.update()),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Zt.isColorLike(e)||e instanceof il||e instanceof my)}};Gv.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},Gv.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 sl=Gv;function aU(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=sl.defaultDropShadow;n.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){it(Mt,"strokeThickness is now a part of stroke");const t=e.stroke;let a={};if(Zt.isColorLike(t))a.color=t;else if(t instanceof il||t instanceof my)a.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))a=t;else throw new Error("Invalid stroke value.");n.stroke={...a,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if(it(Mt,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&rt("The number of fill colors must match the number of fill gradient stops.");const t=new il({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),a=e.fillGradientStops.slice(),r=e.fill.map(u=>Zt.shared.setValue(u).toNumber());a.forEach((u,h)=>{t.addColorStop(u,r[h])}),n.fill={fill:t}}}class sU{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=!1}_createCanvasAndContext(e,t){const a=wt.get().createCanvas();a.width=e,a.height=t;const r=a.getContext("2d");return{canvas:a,context:r}}getOptimalCanvasAndContext(e,t,a=1){e=Math.ceil(e*a-1e-6),t=Math.ceil(t*a-1e-6),e=Sc(e),t=Sc(t);const r=(e<<17)+(t<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let u=this._canvasPool[r].pop();return u||(u=this._createCanvasAndContext(e,t)),u}returnCanvasAndContext(e){const t=e.canvas,{width:a,height:r}=t,u=(a<<17)+(r<<1);e.context.resetTransform(),e.context.clearRect(0,0,a,r),this._canvasPool[u].push(e)}clear(){this._canvasPool={}}}const rl=new sU;Ec.register(rl);const P1=1e5;function xy(n,e,t,a=0){if(n.texture===He.WHITE&&!n.fill)return Zt.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof my){const r=n.fill,u=e.createPattern(r.texture.source.resource,"repeat"),h=r.transform.copyTo(ze.shared);return h.scale(r.texture.frame.width,r.texture.frame.height),u.setTransform(h),u}else if(n.fill instanceof il){const r=n.fill,u=r.type==="linear",h=r.textureSpace==="local";let f=1,m=1;h&&t&&(f=t.width+a,m=t.height+a);let y,v=!1;if(u){const{start:S,end:T}=r;y=e.createLinearGradient(S.x*f,S.y*m,T.x*f,T.y*m),v=Math.abs(T.x-S.x)<Math.abs((T.y-S.y)*.1)}else{const{center:S,innerRadius:T,outerCenter:E,outerRadius:A}=r;y=e.createRadialGradient(S.x*f,S.y*m,T*f,E.x*f,E.y*m,A*f)}if(v&&h&&t){const S=t.lineHeight/m;for(let T=0;T<t.lines.length;T++){const E=(T*t.lineHeight+a/2)/m;r.colorStops.forEach(A=>{const U=E+A.offset*S;y.addColorStop(Math.floor(U*P1)/P1,Zt.shared.setValue(A.color).toHex())})}}else r.colorStops.forEach(S=>{y.addColorStop(S.offset,Zt.shared.setValue(S.color).toHex())});return y}}else{const r=e.createPattern(n.texture.source.resource,"repeat"),u=n.matrix.copyTo(ze.shared);return u.scale(n.texture.frame.width,n.texture.frame.height),r.setTransform(u),r}return rt("FillStyle not recognised",n),"red"}const w1=class $R extends v3{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;const t={...$R.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;const a=t.style.clone();t.overrideFill&&(a._fill.color=16777215,a._fill.alpha=1,a._fill.texture=He.WHITE,a._fill.fill=null),this.applyFillAsTint=t.overrideFill;const r=a.fontSize;a.fontSize=this.baseMeasurementFontSize;const u=py(a);t.overrideSize?a._stroke&&(a._stroke.width*=this.baseRenderedFontSize/r):a.fontSize=this.baseRenderedFontSize=r,this._style=a,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof Kl?t.textureStyle:new Kl(t.textureStyle)),this.fontMetrics=dr.measureFont(u),this.lineHeight=a.lineHeight||this.fontMetrics.fontSize||a.fontSize}ensureCharacters(e){var M,G;const t=dr.graphemeSegmenter(e).filter(P=>!this._currentChars.includes(P)).filter((P,w,z)=>z.indexOf(P)===w);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let a;this._currentPageIndex===-1?a=this._nextPage():a=this.pages[this._currentPageIndex];let{canvas:r,context:u}=a.canvasAndContext,h=a.texture.source;const f=this._style;let m=this._currentX,y=this._currentY,v=this._currentMaxCharHeight;const S=this.baseRenderedFontSize/this.baseMeasurementFontSize,T=this._padding*S;let E=!1;const A=r.width/this.resolution,U=r.height/this.resolution;for(let P=0;P<t.length;P++){const w=t[P],z=dr.measureText(w,f,r,!1);z.lineHeight=z.height;const ne=z.width*S,ie=Math.ceil((f.fontStyle==="italic"?2:1)*ne),Z=z.height*S,Te=ie+T*2,me=Z+T*2;if(E=!1,w!==`
310
- `&&w!=="\r"&&w!==" "&&w!==" "&&(E=!0,v=Math.ceil(Math.max(me,v))),m+Te>A&&(y+=v,v=me,m=0,y+v>U)){h.update();const le=this._nextPage();r=le.canvasAndContext.canvas,u=le.canvasAndContext.context,h=le.texture.source,m=0,y=0,v=0}const fe=ne/S-(((M=f.dropShadow)==null?void 0:M.distance)??0)-(((G=f._stroke)==null?void 0:G.width)??0);if(this.chars[w]={id:w.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:fe,kerning:{}},E){this._drawGlyph(u,z,m+T,y+T,S,f);const le=h.width*S,Ce=h.height*S,ae=new Pt(m/le*h.width,y/Ce*h.height,Te/le*h.width,me/Ce*h.height);this.chars[w].texture=new He({source:h,frame:ae}),m+=Math.ceil(Te)}}h.update(),this._currentX=m,this._currentY=y,this._currentMaxCharHeight=v,this._skipKerning&&this._applyKerning(t,u)}get pageTextures(){return it(Mt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const a=this._measureCache;for(let r=0;r<e.length;r++){const u=e[r];for(let h=0;h<this._currentChars.length;h++){const f=this._currentChars[h];let m=a[u];m||(m=a[u]=t.measureText(u).width);let y=a[f];y||(y=a[f]=t.measureText(f).width);let v=t.measureText(u+f).width,S=v-(m+y);S&&(this.chars[u].kerning[f]=S),v=t.measureText(u+f).width,S=v-(m+y),S&&(this.chars[f].kerning[u]=S)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=rl.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);const a=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),r=new He({source:new Wf({resource:t.canvas,resolution:a,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(r.source.style=this._textureStyle);const u={canvasAndContext:t,texture:r};return this.pages[this._currentPageIndex]=u,u}_setupContext(e,t,a){t.fontSize=this.baseRenderedFontSize,e.scale(a,a),e.font=py(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const r=t._stroke,u=(r==null?void 0:r.width)??0;if(r&&(e.lineWidth=u,e.lineJoin=r.join,e.miterLimit=r.miterLimit,e.strokeStyle=xy(r,e)),t._fill&&(e.fillStyle=xy(t._fill,e)),t.dropShadow){const h=t.dropShadow,f=Zt.shared.setValue(h.color).toArray(),m=h.blur*a,y=h.distance*a;e.shadowColor=`rgba(${f[0]*255},${f[1]*255},${f[2]*255},${h.alpha})`,e.shadowBlur=m,e.shadowOffsetX=Math.cos(h.angle)*y,e.shadowOffsetY=Math.sin(h.angle)*y}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,a,r,u,h){const f=t.text,m=t.fontProperties,y=h._stroke,v=((y==null?void 0:y.width)??0)*u,S=a+v/2,T=r-v/2,E=m.descent*u,A=t.lineHeight*u;let U=!1;h.stroke&&v&&(U=!0,e.strokeText(f,S,T+A-E));const{shadowBlur:M,shadowOffsetX:G,shadowOffsetY:P}=e;h._fill&&(U&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillText(f,S,T+A-E)),U&&(e.shadowBlur=M,e.shadowOffsetX=G,e.shadowOffsetY=P)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:a}=this.pages[e];rl.returnCanvasAndContext(t),a.destroy(!0)}this.pages=null}};w1.defaultOptions={textureSize:512,style:new sl,mipmap:!0};let z1=w1;function H1(n,e,t,a){const r={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};r.offsetY=t.baseLineOffset;let u=r.lines[0],h=null,f=!0;const m={width:0,start:0,index:0,positions:[],chars:[]},y=t.baseMeasurementFontSize/e.fontSize,v=e.letterSpacing*y,S=e.wordWrapWidth*y,T=e.lineHeight?e.lineHeight*y:t.lineHeight,E=e.wordWrap&&e.breakWords,A=G=>{const P=u.width;for(let w=0;w<m.index;w++){const z=G.positions[w];u.chars.push(G.chars[w]),u.charPositions.push(z+P)}u.width+=G.width,f=!1,m.width=0,m.index=0,m.chars.length=0},U=()=>{let G=u.chars.length-1;if(a){let P=u.chars[G];for(;P===" ";)u.width-=t.chars[P].xAdvance,P=u.chars[--G]}r.width=Math.max(r.width,u.width),u={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},f=!0,r.lines.push(u),r.height+=T},M=G=>G-v>S;for(let G=0;G<n.length+1;G++){let P;const w=G===n.length;w||(P=n[G]);const z=t.chars[P]||t.chars[" "];if(/(?:\s)/.test(P)||P==="\r"||P===`
311
- `||w){if(!f&&e.wordWrap&&M(u.width+m.width)?(U(),A(m),w||u.charPositions.push(0)):(m.start=u.width,A(m),w||u.charPositions.push(0)),P==="\r"||P===`
312
- `)U();else if(!w){const Te=z.xAdvance+(z.kerning[h]||0)+v;u.width+=Te,u.spaceWidth=Te,u.spacesIndex.push(u.charPositions.length),u.chars.push(P)}}else{const Z=z.kerning[h]||0,Te=z.xAdvance+Z+v;E&&M(u.width+m.width+Te)&&(A(m),U()),m.positions[m.index++]=m.width+Z,m.chars.push(P),m.width+=Te}h=P}return U(),e.align==="center"?rU(r):e.align==="right"?lU(r):e.align==="justify"&&oU(r),r}function rU(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],a=n.width/2-t.width/2;for(let r=0;r<t.charPositions.length;r++)t.charPositions[r]+=a}}function lU(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],a=n.width-t.width;for(let r=0;r<t.charPositions.length;r++)t.charPositions[r]+=a}}function oU(n){const e=n.width;for(let t=0;t<n.lines.length;t++){const a=n.lines[t];let r=0,u=a.spacesIndex[r++],h=0;const f=a.spacesIndex.length,y=(e-a.width)/f;for(let v=0;v<a.charPositions.length;v++)v===u&&(u=a.spacesIndex[r++],h+=y),a.charPositions[v]+=h}}function uU(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const e=[];for(let t=0,a=n.length;t<a;t++){const r=n[t];if(Array.isArray(r)){if(r.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);if(r[0].length===0||r[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const u=r[0].charCodeAt(0),h=r[1].charCodeAt(0);if(h<u)throw new Error("[BitmapFont]: Invalid character range.");for(let f=u,m=h;f<=m;f++)e.push(String.fromCharCode(f))}else e.push(...Array.from(r))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}let Sy=0;class cU{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=IS(1e3)}getFont(e,t){var h;let a=`${t.fontFamily}-bitmap`,r=!0;if(t._fill.fill&&!t._stroke?(a+=t._fill.fill.styleKey,r=!1):(t._stroke||t.dropShadow)&&(a=`${t.styleKey}-bitmap`,r=!1),!Di.has(a)){const f=Object.create(t);f.lineHeight=0;const m=new z1({style:f,overrideFill:r,overrideSize:!0,...this.defaultOptions});Sy++,Sy>50&&rt("BitmapText",`You have dynamically created ${Sy} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),m.once("destroy",()=>{Sy--,Di.remove(a)}),Di.set(a,m)}const u=Di.get(a);return(h=u.ensureCharacters)==null||h.call(u,e),u}getLayout(e,t,a=!0){const r=this.getFont(e,t),u=`${e}-${t.styleKey}-${a}`;if(this.measureCache.has(u))return this.measureCache.get(u);const h=dr.graphemeSegmenter(e),f=H1(h,t,r,a);return this.measureCache.set(u,f),f}measureText(e,t,a=!0){return this.getLayout(e,t,a)}install(...e){var y,v,S,T;let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:(y=e[2])==null?void 0:y.chars,resolution:(v=e[2])==null?void 0:v.resolution,padding:(S=e[2])==null?void 0:S.padding,skipKerning:(T=e[2])==null?void 0:T.skipKerning},it(Mt,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const a=t==null?void 0:t.name;if(!a)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const r=t.style,u=r instanceof sl?r:new sl(r),h=t.dynamicFill??this._canUseTintForStyle(u),f=new z1({style:u,overrideFill:h,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1,textureStyle:t.textureStyle}),m=uU(t.chars);return f.ensureCharacters(m.join("")),Di.set(`${a}-bitmap`,f),f.once("destroy",()=>Di.remove(`${a}-bitmap`)),f}uninstall(e){const t=`${e}-bitmap`,a=Di.get(t);a&&a.destroy()}_canUseTintForStyle(e){return!e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}}const hU=new cU;class V1{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new uS({domElement:this._domElement,renderer:this._renderer})}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e)}updateRenderable(e){}validateRenderable(e){return!0}postrender(){const e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}this._canvasObserver.ensureAttached();for(let t=0;t<e.length;t++){const a=e[t],r=a.element;if(!a.parent||a.globalDisplayStatus<7)r==null||r.remove(),e.splice(t,1),t--;else{this._domElement.contains(r)||(r.style.position="absolute",r.style.pointerEvents="auto",this._domElement.appendChild(r));const u=a.worldTransform,h=a._anchor,f=a.width*h.x,m=a.height*h.y;r.style.transformOrigin=`${f}px ${m}px`,r.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-f}, ${u.ty-m})`,r.style.opacity=a.groupAlpha.toString()}}}destroy(){var e;this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++)(e=this._attachedDomElements[t].element)==null||e.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}}V1.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"dom"};class fU{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(ka.system.add(this._tickerUpdate,this,Cc.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(ka.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}}const ll=new fU;class Ty extends ed{constructor(){super(...arguments),this.client=new kt,this.movement=new kt,this.offset=new kt,this.global=new kt,this.screen=new kt}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,a){return e.worldTransform.applyInverse(a||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,a,r,u,h,f,m,y,v,S,T,E,A,U){throw new Error("Method not implemented.")}}class Gs extends Ty{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Oc extends Ty{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Oc.DOM_DELTA_PIXEL=0,Oc.DOM_DELTA_LINE=1,Oc.DOM_DELTA_PAGE=2;const dU=2048,pU=new kt,Sd=new kt;class mU{constructor(e){this.dispatch=new Sa,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((a,r)=>a.priority-r.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let a=0,r=t.length;a<r;a++)t[a].fn(e);else rt(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){ll.pauseUpdate=!0;const r=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",u=this[r](this.rootTarget,this.rootTarget.eventMode,pU.set(e,t),this.hitTestFn,this.hitPruneFn);return u&&u[0]}propagate(e,t){if(!e.target)return;const a=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,u=a.length-1;r<u;r++)if(e.currentTarget=a[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=a.length-2;r>=0;r--)if(e.currentTarget=a[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,a=this._allInteractiveElements){if(a.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const r=Array.isArray(t)?t:[t];for(let u=a.length-1;u>=0;u--)r.forEach(h=>{e.currentTarget=a[u],this.notifyTarget(e,h)})}propagationPath(e){const t=[e];for(let a=0;a<dU&&e!==this.rootTarget&&e.parent;a++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,a,r,u,h=!1){let f=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(ll.pauseUpdate=!1),e.interactiveChildren&&e.children){const v=e.children;for(let S=v.length-1;S>=0;S--){const T=v[S],E=this.hitTestMoveRecursive(T,this._isInteractive(t)?t:T.eventMode,a,r,u,h||u(e,a));if(E){if(E.length>0&&!E[E.length-1].parent)continue;const A=e.isInteractive();(E.length>0||A)&&(A&&this._allInteractiveElements.push(e),E.push(e)),this._hitElements.length===0&&(this._hitElements=E),f=!0}}}const m=this._isInteractive(t),y=e.isInteractive();return y&&y&&this._allInteractiveElements.push(e),h||this._hitElements.length>0?null:f?this._hitElements:m&&!u(e,a)&&r(e,a)?y?[e]:[]:null}hitTestRecursive(e,t,a,r,u){if(this._interactivePrune(e)||u(e,a))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(ll.pauseUpdate=!1),e.interactiveChildren&&e.children){const m=e.children,y=a;for(let v=m.length-1;v>=0;v--){const S=m[v],T=this.hitTestRecursive(S,this._isInteractive(t)?t:S.eventMode,y,r,u);if(T){if(T.length>0&&!T[T.length-1].parent)continue;const E=e.isInteractive();return(T.length>0||E)&&T.push(e),T}}}const h=this._isInteractive(t),f=e.isInteractive();return h&&r(e,a)?f?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,Sd),!e.hitArea.contains(Sd.x,Sd.y)))return!0;if(e.effects&&e.effects.length)for(let a=0;a<e.effects.length;a++){const r=e.effects[a];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e!=null&&e.containsPoint?(e.worldTransform.applyInverse(t,Sd),e.containsPoint(Sd)):!1}notifyTarget(e,t){var u,h;if(!e.currentTarget.isInteractive())return;t??(t=e.type);const a=`on${t}`;(h=(u=e.currentTarget)[a])==null||h.call(u,e);const r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const r=t.button===2;this.dispatchEvent(t,r?"rightdown":"mousedown")}const a=this.trackingData(e.pointerId);a.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var m,y;if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const a=t.pointerType==="mouse"||t.pointerType==="pen",r=this.trackingData(e.pointerId),u=this.findMountedTarget(r.overTargets);if(((m=r.overTargets)==null?void 0:m.length)>0&&u!==t.target){const v=e.type==="mousemove"?"mouseout":"pointerout",S=this.createPointerEvent(e,v,u);if(this.dispatchEvent(S,"pointerout"),a&&this.dispatchEvent(S,"mouseout"),!t.composedPath().includes(u)){const T=this.createPointerEvent(e,"pointerleave",u);for(T.eventPhase=T.AT_TARGET;T.target&&!t.composedPath().includes(T.target);)T.currentTarget=T.target,this.notifyTarget(T),a&&this.notifyTarget(T,"mouseleave"),T.target=T.target.parent;this.freeEvent(T)}this.freeEvent(S)}if(u!==t.target){const v=e.type==="mousemove"?"mouseover":"pointerover",S=this.clonePointerEvent(t,v);this.dispatchEvent(S,"pointerover"),a&&this.dispatchEvent(S,"mouseover");let T=u==null?void 0:u.parent;for(;T&&T!==this.rootTarget.parent&&T!==t.target;)T=T.parent;if(!T||T===this.rootTarget.parent){const A=this.clonePointerEvent(t,"pointerenter");for(A.eventPhase=A.AT_TARGET;A.target&&A.target!==u&&A.target!==this.rootTarget.parent;)A.currentTarget=A.target,this.notifyTarget(A),a&&this.notifyTarget(A,"mouseenter"),A.target=A.target.parent;this.freeEvent(A)}this.freeEvent(S)}const h=[],f=this.enableGlobalMoveEvents??!0;this.moveOnAll?h.push("pointermove"):this.dispatchEvent(t,"pointermove"),f&&h.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?h.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),f&&h.push("globaltouchmove")),a&&(this.moveOnAll?h.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),f&&h.push("globalmousemove"),this.cursor=(y=t.target)==null?void 0:y.cursor),h.length>0&&this.all(t,h),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var h;if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),a=this.createPointerEvent(e),r=a.pointerType==="mouse"||a.pointerType==="pen";this.dispatchEvent(a,"pointerover"),r&&this.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(this.cursor=(h=a.target)==null?void 0:h.cursor);const u=this.clonePointerEvent(a,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==this.rootTarget.parent;)u.currentTarget=u.target,this.notifyTarget(u),r&&this.notifyTarget(u,"mouseenter"),u.target=u.target.parent;t.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(u)}mapPointerOut(e){if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const a=e.pointerType==="mouse"||e.pointerType==="pen",r=this.findMountedTarget(t.overTargets),u=this.createPointerEvent(e,"pointerout",r);this.dispatchEvent(u),a&&this.dispatchEvent(u,"mouseout");const h=this.createPointerEvent(e,"pointerleave",r);for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),a&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;t.overTargets=null,this.freeEvent(u),this.freeEvent(h)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),a=this.createPointerEvent(e);if(this.dispatchEvent(a,"pointerup"),a.pointerType==="touch")this.dispatchEvent(a,"touchend");else if(a.pointerType==="mouse"||a.pointerType==="pen"){const f=a.button===2;this.dispatchEvent(a,f?"rightup":"mouseup")}const r=this.trackingData(e.pointerId),u=this.findMountedTarget(r.pressTargetsByButton[e.button]);let h=u;if(u&&!a.composedPath().includes(u)){let f=u;for(;f&&!a.composedPath().includes(f);){if(a.currentTarget=f,this.notifyTarget(a,"pointerupoutside"),a.pointerType==="touch")this.notifyTarget(a,"touchendoutside");else if(a.pointerType==="mouse"||a.pointerType==="pen"){const m=a.button===2;this.notifyTarget(a,m?"rightupoutside":"mouseupoutside")}f=f.parent}delete r.pressTargetsByButton[e.button],h=f}if(h){const f=this.clonePointerEvent(a,"click");f.target=h,f.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:f.target,timeStamp:t});const m=r.clicksByButton[e.button];if(m.target===f.target&&t-m.timeStamp<200?++m.clickCount:m.clickCount=1,m.target=f.target,m.timeStamp=t,f.detail=m.clickCount,f.pointerType==="mouse"){const y=f.button===2;this.dispatchEvent(f,y?"rightclick":"click")}else f.pointerType==="touch"&&this.dispatchEvent(f,"tap");this.dispatchEvent(f,"pointertap"),this.freeEvent(f)}this.freeEvent(a)}mapPointerUpOutside(e){if(!(e instanceof Gs)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),a=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(a){let u=a;for(;u;)r.currentTarget=u,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),u=u.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof Oc)){rt("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let a=1;a<e.length&&e[a].parent===t;a++)t=e[a];return t}createPointerEvent(e,t,a){const r=this.allocateEvent(Gs);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=a??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t=="string"&&(r.type=t),r}createWheelEvent(e){const t=this.allocateEvent(Oc);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const a=this.allocateEvent(Gs);return a.nativeEvent=e.nativeEvent,a.originalEvent=e.originalEvent,this.copyPointerData(e,a),this.copyMouseData(e,a),this.copyData(e,a),a.target=e.target,a.path=e.composedPath().slice(),a.type=t??a.type,a}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof Gs&&t instanceof Gs&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof Ty&&t instanceof Ty&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const a=e.currentTarget._events[t];if(a)if("fn"in a)a.once&&e.currentTarget.removeListener(t,a.fn,void 0,!0),a.fn.call(a.context,e);else for(let r=0,u=a.length;r<u&&!e.propagationImmediatelyStopped;r++)a[r].once&&e.currentTarget.removeListener(t,a[r].fn,void 0,!0),a[r].fn.call(a[r].context,e)}}const yU=1,gU={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Pv=class nx{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new mU(null),ll.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Gs(null),this._rootWheelEvent=new Oc(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...nx.defaultEventFeatures},{set:(t,a,r)=>(a==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),t[a]=r,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:a}=this.renderer;this.setTargetElement(t),this.resolution=a,nx._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){ll.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||(e="default");let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const a=this.cursorStyles[e];if(a)switch(typeof a){case"string":t&&(this.domElement.style.cursor=a);break;case"function":a(e);break;case"object":t&&Object.assign(this.domElement.style,a);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let a=0,r=t.length;a<r;a++){const u=t[a],h=this._bootstrapEvent(this._rootPointerEvent,u);this.rootBoundary.mapEvent(h)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,ll.pointerMoved();const t=this._normalizeToPointerData(e);for(let a=0,r=t.length;a<r;a++){const u=this._bootstrapEvent(this._rootPointerEvent,t[a]);this.rootBoundary.mapEvent(u)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const a=t!==this.domElement?"outside":"",r=this._normalizeToPointerData(e);for(let u=0,h=r.length;u<h;u++){const f=this._bootstrapEvent(this._rootPointerEvent,r[u]);f.type+=a,this.rootBoundary.mapEvent(f)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let a=0,r=t.length;a<r;a++){const u=this._bootstrapEvent(this._rootPointerEvent,t[a]);this.rootBoundary.mapEvent(u)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,ll.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;ll.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;ll.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,a){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},u=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*u,e.y=(a-r.top)*(this.domElement.height/r.height)*u}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let a=0,r=e.changedTouches.length;a<r;a++){const u=e.changedTouches[a];typeof u.button>"u"&&(u.button=0),typeof u.buttons>"u"&&(u.buttons=1),typeof u.isPrimary>"u"&&(u.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof u.width>"u"&&(u.width=u.radiusX||1),typeof u.height>"u"&&(u.height=u.radiusY||1),typeof u.tiltX>"u"&&(u.tiltX=0),typeof u.tiltY>"u"&&(u.tiltY=0),typeof u.pointerType>"u"&&(u.pointerType="touch"),typeof u.pointerId>"u"&&(u.pointerId=u.identifier||0),typeof u.pressure>"u"&&(u.pressure=u.force||.5),typeof u.twist>"u"&&(u.twist=0),typeof u.tangentialPressure>"u"&&(u.tangentialPressure=0),typeof u.layerX>"u"&&(u.layerX=u.offsetX=u.clientX),typeof u.layerY>"u"&&(u.layerY=u.offsetY=u.clientY),u.isNormalized=!0,u.type=e.type,t.push(u)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const a=e;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=yU),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,t.push(a)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=gU[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};Pv.extension={name:"events",type:[Q.WebGLSystem,Q.CanvasSystem,Q.WebGPUSystem],priority:-1},Pv.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let L1=Pv;const _U={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(n){this.eventMode=n?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??L1.defaultEventMode},set eventMode(n){this._internalEventMode=n},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(n,e,t){const a=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,r=typeof t=="object"?t.signal:void 0,u=typeof t=="object"?t.once===!0:!1,h=typeof e=="function"?void 0:e;n=a?`${n}capture`:n;const f=typeof e=="function"?e:e.handleEvent,m=this;r&&r.addEventListener("abort",()=>{m.off(n,f,h)}),u?m.once(n,f,h):m.on(n,f,h)},removeEventListener(n,e,t){const a=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,r=typeof e=="function"?void 0:e;n=a?`${n}capture`:n,e=typeof e=="function"?e:e.handleEvent,this.off(n,e,r)},dispatchEvent(n){if(!(n instanceof ed))throw new Error("Container cannot propagate events outside of the Federated Events API");return n.defaultPrevented=!1,n.path=null,n.target=this,n.manager.dispatchEvent(n),!n.defaultPrevented}};var vU=`in vec2 aPosition;
313
- out vec2 vTextureCoord;
314
-
315
- uniform vec4 uInputSize;
316
- uniform vec4 uOutputFrame;
317
- uniform vec4 uOutputTexture;
318
-
319
- vec4 filterVertexPosition( void )
320
- {
321
- vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
322
-
323
- position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
324
- position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
325
-
326
- return vec4(position, 0.0, 1.0);
327
- }
328
-
329
- vec2 filterTextureCoord( void )
330
- {
331
- return aPosition * (uOutputFrame.zw * uInputSize.zw);
332
- }
333
-
334
- void main(void)
335
- {
336
- gl_Position = filterVertexPosition();
337
- vTextureCoord = filterTextureCoord();
338
- }
339
- `,bU=`in vec2 vTextureCoord;
340
- out vec4 finalColor;
341
- uniform sampler2D uTexture;
342
- void main() {
343
- finalColor = texture(uTexture, vTextureCoord);
344
- }
345
- `,j1=`struct GlobalFilterUniforms {
346
- uInputSize: vec4<f32>,
347
- uInputPixel: vec4<f32>,
348
- uInputClamp: vec4<f32>,
349
- uOutputFrame: vec4<f32>,
350
- uGlobalFrame: vec4<f32>,
351
- uOutputTexture: vec4<f32>,
352
- };
353
-
354
- @group(0) @binding(0) var <uniform> gfu: GlobalFilterUniforms;
355
- @group(0) @binding(1) var uTexture: texture_2d<f32>;
356
- @group(0) @binding(2) var uSampler: sampler;
357
-
358
- struct VSOutput {
359
- @builtin(position) position: vec4<f32>,
360
- @location(0) uv: vec2<f32>
361
- };
362
-
363
- fn filterVertexPosition(aPosition: vec2<f32>) -> vec4<f32>
364
- {
365
- var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
366
-
367
- position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
368
- position.y = position.y * (2.0 * gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
369
-
370
- return vec4(position, 0.0, 1.0);
371
- }
372
-
373
- fn filterTextureCoord(aPosition: vec2<f32>) -> vec2<f32>
374
- {
375
- return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
376
- }
377
-
378
- @vertex
379
- fn mainVertex(
380
- @location(0) aPosition: vec2<f32>,
381
- ) -> VSOutput {
382
- return VSOutput(
383
- filterVertexPosition(aPosition),
384
- filterTextureCoord(aPosition)
385
- );
386
- }
387
-
388
- @fragment
389
- fn mainFragment(
390
- @location(0) uv: vec2<f32>,
391
- ) -> @location(0) vec4<f32> {
392
- return textureSample(uTexture, uSampler, uv);
393
- }
394
- `;class xU extends nl{constructor(){const e=Zl.from({vertex:{source:j1,entryPoint:"mainVertex"},fragment:{source:j1,entryPoint:"mainFragment"},name:"passthrough-filter"}),t=lu.from({vertex:vU,fragment:bU,name:"passthrough-filter"});super({gpuProgram:e,glProgram:t})}}class Y1{constructor(e){this._renderer=e}push(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}Y1.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"filter"};const X1=new ze;function SU(n,e){e.clear();const t=e.matrix;for(let a=0;a<n.length;a++){const r=n[a];if(r.globalDisplayStatus<7)continue;const u=r.renderGroup??r.parentRenderGroup;u!=null&&u.isCachedAsTexture?e.matrix=X1.copyFrom(u.textureOffsetInverseTransform).append(r.worldTransform):u!=null&&u._parentCacheAsTextureRenderGroup?e.matrix=X1.copyFrom(u._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(r.groupTransform):e.matrix=r.worldTransform,e.addBounds(r.bounds)}return e.matrix=t,e}const TU=new pd({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class EU{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new ci,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}}class q1{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new Yi({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new tl({}),this.renderer=e}get activeBackTexture(){var e;return(e=this._activeFilterData)==null?void 0:e.backTexture}push(e){const t=this.renderer,a=e.filterEffect.filters,r=this._pushFilterData();r.skip=!1,r.filters=a,r.container=e.container,r.outputRenderSurface=t.renderTarget.renderSurface;const u=t.renderTarget.renderTarget.colorTexture.source,h=u.resolution,f=u.antialias;if(a.every(E=>!E.enabled)){r.skip=!0;return}const m=r.bounds;if(this._calculateFilterArea(e,m),this._calculateFilterBounds(r,t.renderTarget.rootViewPort,f,h,1),r.skip)return;const y=this._getPreviousFilterData(),v=this._findFilterResolution(h);let S=0,T=0;y&&(S=y.bounds.minX,T=y.bounds.minY),this._calculateGlobalFrame(r,S,T,v,u.width,u.height),this._setupFilterTextures(r,m,t,y)}generateFilteredTexture({texture:e,filters:t}){const a=this._pushFilterData();this._activeFilterData=a,a.skip=!1,a.filters=t;const r=e.source,u=r.resolution,h=r.antialias;if(t.every(E=>!E.enabled))return a.skip=!0,e;const f=a.bounds;if(f.addRect(e.frame),this._calculateFilterBounds(a,f.rectangle,h,u,0),a.skip)return e;const m=u;this._calculateGlobalFrame(a,0,0,m,r.width,r.height),a.outputRenderSurface=hi.getOptimalTexture(f.width,f.height,a.resolution,a.antialias),a.backTexture=He.EMPTY,a.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(a,!0);const T=a.outputRenderSurface;return T.source.alphaMode="premultiplied-alpha",T}pop(){const e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,!1),t.blendRequired&&hi.returnTexture(t.backTexture),hi.returnTexture(t.inputTexture))}getBackTexture(e,t,a){const r=e.colorTexture.source._resolution,u=hi.getOptimalTexture(t.width,t.height,r,!1);let h=t.minX,f=t.minY;a&&(h-=a.minX,f-=a.minY),h=Math.floor(h*r),f=Math.floor(f*r);const m=Math.ceil(t.width*r),y=Math.ceil(t.height*r);return this.renderer.renderTarget.copyToTexture(e,u,{x:h,y:f},{width:m,height:y},{x:0,y:0}),u}applyFilter(e,t,a,r){const u=this.renderer,h=this._activeFilterData,m=h.outputRenderSurface===a,y=u.renderTarget.rootRenderTarget.colorTexture.source._resolution,v=this._findFilterResolution(y);let S=0,T=0;if(m){const A=this._findPreviousFilterOffset();S=A.x,T=A.y}this._updateFilterUniforms(t,a,h,S,T,v,m,r);const E=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(E,t,u)}calculateSpriteMatrix(e,t){const a=this._activeFilterData,r=e.set(a.inputTexture._source.width,0,0,a.inputTexture._source.height,a.bounds.minX,a.bounds.minY),u=t.worldTransform.copyTo(ze.shared),h=t.renderGroup||t.parentRenderGroup;return h&&h.cacheToLocalTransform&&u.prepend(h.cacheToLocalTransform),u.invert(),r.prepend(u),r.scale(1/t.texture.orig.width,1/t.texture.orig.height),r.translate(t.anchor.x,t.anchor.y),r}destroy(){var e;(e=this._passthroughFilter)==null||e.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new xU),this._passthroughFilter}_setupBindGroupsAndRender(e,t,a){if(a.renderPipes.uniformBatch){const r=a.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(r,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,a.encoder.draw({geometry:TU,shader:e,state:e._state,topology:"triangle-list"}),a.type===Us.WEBGL&&a.renderTarget.finishRenderPass()}_setupFilterTextures(e,t,a,r){if(e.backTexture=He.EMPTY,e.inputTexture=hi.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){a.renderTarget.finishRenderPass();const u=a.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(u,t,r==null?void 0:r.bounds)}a.renderTarget.bind(e.inputTexture,!0),a.globalUniforms.push({offset:t})}_calculateGlobalFrame(e,t,a,r,u,h){const f=e.globalFrame;f.x=t*r,f.y=a*r,f.width=u*r,f.height=h*r}_updateFilterUniforms(e,t,a,r,u,h,f,m){const y=this._filterGlobalUniforms.uniforms,v=y.uOutputFrame,S=y.uInputSize,T=y.uInputPixel,E=y.uInputClamp,A=y.uGlobalFrame,U=y.uOutputTexture;f?(v[0]=a.bounds.minX-r,v[1]=a.bounds.minY-u):(v[0]=0,v[1]=0),v[2]=e.frame.width,v[3]=e.frame.height,S[0]=e.source.width,S[1]=e.source.height,S[2]=1/S[0],S[3]=1/S[1],T[0]=e.source.pixelWidth,T[1]=e.source.pixelHeight,T[2]=1/T[0],T[3]=1/T[1],E[0]=.5*T[2],E[1]=.5*T[3],E[2]=e.frame.width*S[2]-.5*T[2],E[3]=e.frame.height*S[3]-.5*T[3];const M=this.renderer.renderTarget.rootRenderTarget.colorTexture;A[0]=r*h,A[1]=u*h,A[2]=M.source.width*h,A[3]=M.source.height*h,t instanceof He&&(t.source.resource=null);const G=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!m),t instanceof He?(U[0]=t.frame.width,U[1]=t.frame.height):(U[0]=G.width,U[1]=G.height),U[2]=G.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,a=this._filterStackIndex;for(;a>0;){a--;const r=this._filterStack[a];if(!r.skip){e=r.bounds.minX,t=r.bounds.minY;break}}return{x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?SU(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){const r=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;r&&t.applyMatrix(r)}}_applyFiltersToTexture(e,t){const a=e.inputTexture,r=e.bounds,u=e.filters,h=e.firstEnabledIndex,f=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(a.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),h===f)u[h].apply(this,a,e.outputRenderSurface,t);else{let m=e.inputTexture;const y=hi.getOptimalTexture(r.width,r.height,m.source._resolution,!1);let v=y;for(let S=h;S<f;S++){const T=u[S];if(!T.enabled)continue;T.apply(this,m,v,!0);const E=m;m=v,v=E}u[f].apply(this,m,e.outputRenderSurface,t),hi.returnTexture(y)}}_calculateFilterBounds(e,t,a,r,u){var G;const h=this.renderer,f=e.bounds,m=e.filters;let y=1/0,v=0,S=!0,T=!1,E=!1,A=!0,U=-1,M=-1;for(let P=0;P<m.length;P++){const w=m[P];if(!w.enabled)continue;if(U===-1&&(U=P),M=P,y=Math.min(y,w.resolution==="inherit"?r:w.resolution),v+=w.padding,w.antialias==="off"?S=!1:w.antialias==="inherit"&&S&&(S=a),w.clipToViewport||(A=!1),!!!(w.compatibleRenderers&h.type)){E=!1;break}if(w.blendRequired&&!(((G=h.backBuffer)==null?void 0:G.useBackBuffer)??!0)){rt("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),E=!1;break}E=!0,T||(T=w.blendRequired)}if(!E){e.skip=!0;return}if(A&&f.fitBounds(0,t.width/r,0,t.height/r),f.scale(y).ceil().scale(1/y).pad((v|0)*u),!f.isPositive){e.skip=!0;return}e.antialias=S,e.resolution=y,e.blendRequired=T,e.firstEnabledIndex=U,e.lastEnabledIndex=M}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>0&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new EU),this._filterStackIndex++,e}}q1.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"filter"};var CU=`in vec2 vMaskCoord;
395
- in vec2 vTextureCoord;
396
-
397
- uniform sampler2D uTexture;
398
- uniform sampler2D uMaskTexture;
399
-
400
- uniform float uAlpha;
401
- uniform vec4 uMaskClamp;
402
- uniform float uInverse;
403
-
404
- out vec4 finalColor;
405
-
406
- void main(void)
407
- {
408
- float clip = step(3.5,
409
- step(uMaskClamp.x, vMaskCoord.x) +
410
- step(uMaskClamp.y, vMaskCoord.y) +
411
- step(vMaskCoord.x, uMaskClamp.z) +
412
- step(vMaskCoord.y, uMaskClamp.w));
413
-
414
- // TODO look into why this is needed
415
- float npmAlpha = uAlpha;
416
- vec4 original = texture(uTexture, vTextureCoord);
417
- vec4 masky = texture(uMaskTexture, vMaskCoord);
418
- float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
419
-
420
- float a = alphaMul * masky.r * npmAlpha * clip;
421
-
422
- if (uInverse == 1.0) {
423
- a = 1.0 - a;
424
- }
425
-
426
- finalColor = original * a;
427
- }
428
- `,RU=`in vec2 aPosition;
429
-
430
- out vec2 vTextureCoord;
431
- out vec2 vMaskCoord;
432
-
433
-
434
- uniform vec4 uInputSize;
435
- uniform vec4 uOutputFrame;
436
- uniform vec4 uOutputTexture;
437
- uniform mat3 uFilterMatrix;
438
-
439
- vec4 filterVertexPosition( vec2 aPosition )
440
- {
441
- vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
442
-
443
- position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
444
- position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
445
-
446
- return vec4(position, 0.0, 1.0);
447
- }
448
-
449
- vec2 filterTextureCoord( vec2 aPosition )
450
- {
451
- return aPosition * (uOutputFrame.zw * uInputSize.zw);
452
- }
453
-
454
- vec2 getFilterCoord( vec2 aPosition )
455
- {
456
- return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
457
- }
458
-
459
- void main(void)
460
- {
461
- gl_Position = filterVertexPosition(aPosition);
462
- vTextureCoord = filterTextureCoord(aPosition);
463
- vMaskCoord = getFilterCoord(aPosition);
464
- }
465
- `,F1=`struct GlobalFilterUniforms {
466
- uInputSize:vec4<f32>,
467
- uInputPixel:vec4<f32>,
468
- uInputClamp:vec4<f32>,
469
- uOutputFrame:vec4<f32>,
470
- uGlobalFrame:vec4<f32>,
471
- uOutputTexture:vec4<f32>,
472
- };
473
-
474
- struct MaskUniforms {
475
- uFilterMatrix:mat3x3<f32>,
476
- uMaskClamp:vec4<f32>,
477
- uAlpha:f32,
478
- uInverse:f32,
479
- };
480
-
481
- @group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
482
- @group(0) @binding(1) var uTexture: texture_2d<f32>;
483
- @group(0) @binding(2) var uSampler : sampler;
484
-
485
- @group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;
486
- @group(1) @binding(1) var uMaskTexture: texture_2d<f32>;
487
-
488
- struct VSOutput {
489
- @builtin(position) position: vec4<f32>,
490
- @location(0) uv : vec2<f32>,
491
- @location(1) filterUv : vec2<f32>,
492
- };
493
-
494
- fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
495
- {
496
- var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
497
-
498
- position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
499
- position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
500
-
501
- return vec4(position, 0.0, 1.0);
502
- }
503
-
504
- fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
505
- {
506
- return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
507
- }
508
-
509
- fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
510
- {
511
- return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);
512
- }
513
-
514
- fn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>
515
- {
516
- return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
517
- }
518
-
519
- fn getSize() -> vec2<f32>
520
- {
521
- return gfu.uGlobalFrame.zw;
522
- }
523
-
524
- @vertex
525
- fn mainVertex(
526
- @location(0) aPosition : vec2<f32>,
527
- ) -> VSOutput {
528
- return VSOutput(
529
- filterVertexPosition(aPosition),
530
- filterTextureCoord(aPosition),
531
- getFilterCoord(aPosition)
532
- );
533
- }
534
-
535
- @fragment
536
- fn mainFragment(
537
- @location(0) uv: vec2<f32>,
538
- @location(1) filterUv: vec2<f32>,
539
- @builtin(position) position: vec4<f32>
540
- ) -> @location(0) vec4<f32> {
541
-
542
- var maskClamp = filterUniforms.uMaskClamp;
543
- var uAlpha = filterUniforms.uAlpha;
544
-
545
- var clip = step(3.5,
546
- step(maskClamp.x, filterUv.x) +
547
- step(maskClamp.y, filterUv.y) +
548
- step(filterUv.x, maskClamp.z) +
549
- step(filterUv.y, maskClamp.w));
550
-
551
- var mask = textureSample(uMaskTexture, uSampler, filterUv);
552
- var source = textureSample(uTexture, uSampler, uv);
553
- var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);
554
-
555
- var a: f32 = alphaMul * mask.r * uAlpha * clip;
556
-
557
- if (filterUniforms.uInverse == 1.0) {
558
- a = 1.0 - a;
559
- }
560
-
561
- return source * a;
562
- }
563
- `;class AU extends nl{constructor(e){const{sprite:t,...a}=e,r=new Cx(t.texture),u=new Yi({uFilterMatrix:{value:new ze,type:"mat3x3<f32>"},uMaskClamp:{value:r.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),h=Zl.from({vertex:{source:F1,entryPoint:"mainVertex"},fragment:{source:F1,entryPoint:"mainFragment"}}),f=lu.from({vertex:RU,fragment:CU,name:"mask-filter"});super({...a,gpuProgram:h,glProgram:f,clipToViewport:!1,resources:{filterUniforms:u,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=r}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,a,r){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,a,r)}}class hu extends j_{constructor(e){e instanceof Ns&&(e={context:e});const{context:t,roundPixels:a,...r}=e||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new Ns,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=a??!1}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===!0||(e==null?void 0:e.context)===!0)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){return e?new hu(this._context.clone()):(this._ownedContext=null,new hu(this._context))}lineStyle(e,t,a){it(Mt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return e&&(r.width=e),t&&(r.color=t),a&&(r.alpha=a),this.context.strokeStyle=r,this}beginFill(e,t){it(Mt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const a={};return e!==void 0&&(a.color=e),t!==void 0&&(a.alpha=t),this.context.fillStyle=a,this}endFill(){it(Mt,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return(e.width!==Ns.defaultStrokeStyle.width||e.color!==Ns.defaultStrokeStyle.color||e.alpha!==Ns.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return it(Mt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return it(Mt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return it(Mt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return it(Mt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return it(Mt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return it(Mt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}const k1=class eA extends pd{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(it(Mt,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...eA.defaultOptions,...t};const a=t.positions||new Float32Array([0,0,1,0,1,1,0,1]);let r=t.uvs;r||(t.positions?r=new Float32Array(a.length):r=new Float32Array([0,0,1,0,1,1,0,1]));const u=t.indices||new Uint32Array([0,1,2,0,2,3]),h=t.shrinkBuffersToFit,f=new Ea({data:a,label:"attribute-mesh-positions",shrinkToFit:h,usage:xt.VERTEX|xt.COPY_DST}),m=new Ea({data:r,label:"attribute-mesh-uvs",shrinkToFit:h,usage:xt.VERTEX|xt.COPY_DST}),y=new Ea({data:u,label:"index-mesh-buffer",shrinkToFit:h,usage:xt.INDEX|xt.COPY_DST});super({attributes:{aPosition:{buffer:f,format:"float32x2",stride:8,offset:0},aUV:{buffer:m,format:"float32x2",stride:8,offset:0}},indexBuffer:y,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};k1.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let wv=k1,fu=null,ol=null;function MU(n,e){fu||(fu=wt.get().createCanvas(256,128),ol=fu.getContext("2d",{willReadFrequently:!0}),ol.globalCompositeOperation="copy",ol.globalAlpha=1),(fu.width<n||fu.height<e)&&(fu.width=Sc(n),fu.height=Sc(e))}function I1(n,e,t){for(let a=0,r=4*t*e;a<e;++a,r+=4)if(n[r+3]!==0)return!1;return!0}function K1(n,e,t,a,r){const u=4*e;for(let h=a,f=a*u+4*t;h<=r;++h,f+=u)if(n[f+3]!==0)return!1;return!0}function DU(...n){let e=n[0];e.canvas||(e={canvas:n[0],resolution:n[1]});const{canvas:t}=e,a=Math.min(e.resolution??1,1),r=e.width??t.width,u=e.height??t.height;let h=e.output;if(MU(r,u),!ol)throw new TypeError("Failed to get canvas 2D context");ol.drawImage(t,0,0,r,u,0,0,r*a,u*a);const m=ol.getImageData(0,0,r,u).data;let y=0,v=0,S=r-1,T=u-1;for(;v<u&&I1(m,r,v);)++v;if(v===u)return Pt.EMPTY;for(;I1(m,r,T);)--T;for(;K1(m,r,y,v,T);)++y;for(;K1(m,r,S,v,T);)--S;return++S,++T,ol.globalCompositeOperation="source-over",ol.strokeRect(y,v,S-y,T-v),ol.globalCompositeOperation="copy",h??(h=new Pt),h.set(y/a,v/a,(S-y)/a,(T-v)/a),h}const Q1=new Pt;class UU{getCanvasAndContext(e){const{text:t,style:a,resolution:r=1}=e,u=a._getFinalPadding(),h=dr.measureText(t||" ",a),f=Math.ceil(Math.ceil(Math.max(1,h.width)+u*2)*r),m=Math.ceil(Math.ceil(Math.max(1,h.height)+u*2)*r),y=rl.getOptimalCanvasAndContext(f,m);this._renderTextToCanvas(t,a,u,r,y);const v=a.trim?DU({canvas:y.canvas,width:f,height:m,resolution:1,output:Q1}):Q1.set(0,0,f,m);return{canvasAndContext:y,frame:v}}returnCanvasAndContext(e){rl.returnCanvasAndContext(e)}_renderTextToCanvas(e,t,a,r,u){var w,z,ne,ie;const{canvas:h,context:f}=u,m=py(t),y=dr.measureText(e||" ",t),v=y.lines,S=y.lineHeight,T=y.lineWidths,E=y.maxLineWidth,A=y.fontProperties,U=h.height;if(f.resetTransform(),f.scale(r,r),f.textBaseline=t.textBaseline,(w=t._stroke)!=null&&w.width){const Z=t._stroke;f.lineWidth=Z.width,f.miterLimit=Z.miterLimit,f.lineJoin=Z.join,f.lineCap=Z.cap}f.font=m;let M,G;const P=t.dropShadow?2:1;for(let Z=0;Z<P;++Z){const Te=t.dropShadow&&Z===0,me=Te?Math.ceil(Math.max(1,U)+a*2):0,fe=me*r;if(Te){f.fillStyle="black",f.strokeStyle="black";const ae=t.dropShadow,je=ae.color,Rt=ae.alpha;f.shadowColor=Zt.shared.setValue(je).setAlpha(Rt).toRgbaString();const V=ae.blur*r,W=ae.distance*r;f.shadowBlur=V,f.shadowOffsetX=Math.cos(ae.angle)*W,f.shadowOffsetY=Math.sin(ae.angle)*W+fe}else{if(f.fillStyle=t._fill?xy(t._fill,f,y,a*2):null,(z=t._stroke)!=null&&z.width){const ae=t._stroke.width*.5+a*2;f.strokeStyle=xy(t._stroke,f,y,ae)}f.shadowColor="black"}let le=(S-A.fontSize)/2;S-A.fontSize<0&&(le=0);const Ce=((ne=t._stroke)==null?void 0:ne.width)??0;for(let ae=0;ae<v.length;ae++)M=Ce/2,G=Ce/2+ae*S+A.ascent+le,t.align==="right"?M+=E-T[ae]:t.align==="center"&&(M+=(E-T[ae])/2),(ie=t._stroke)!=null&&ie.width&&this._drawLetterSpacing(v[ae],t,u,M+a,G+a-me,!0),t._fill!==void 0&&this._drawLetterSpacing(v[ae],t,u,M+a,G+a-me)}}_drawLetterSpacing(e,t,a,r,u,h=!1){const{context:f}=a,m=t.letterSpacing;let y=!1;if(dr.experimentalLetterSpacingSupported&&(dr.experimentalLetterSpacing?(f.letterSpacing=`${m}px`,f.textLetterSpacing=`${m}px`,y=!0):(f.letterSpacing="0px",f.textLetterSpacing="0px")),m===0||y){h?f.strokeText(e,r,u):f.fillText(e,r,u);return}let v=r;const S=dr.graphemeSegmenter(e);let T=f.measureText(e).width,E=0;for(let A=0;A<S.length;++A){const U=S[A];h?f.strokeText(U,v,u):f.fillText(U,v,u);let M="";for(let G=A+1;G<S.length;++G)M+=S[G];E=f.measureText(M).width,v+=T-E+m,T=E}}}const zv=new UU,Z1="http://www.w3.org/2000/svg",W1="http://www.w3.org/1999/xhtml";class J1{constructor(){this.svgRoot=document.createElementNS(Z1,"svg"),this.foreignObject=document.createElementNS(Z1,"foreignObject"),this.domElement=document.createElementNS(W1,"div"),this.styleElement=document.createElementNS(W1,"style");const{foreignObject:e,svgRoot:t,styleElement:a,domElement:r}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(a),e.appendChild(r),this.image=wt.get().createImage()}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null}}let $1;function BU(n,e,t,a){a||(a=$1||($1=new J1));const{domElement:r,styleElement:u,svgRoot:h}=a;r.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${n}</div>`,r.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(u.textContent=t),document.body.appendChild(h);const f=r.getBoundingClientRect();h.remove();const m=e.padding*2;return{width:f.width-m,height:f.height-m}}class eT{constructor(){this._tempState=Bs.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,t,a){const r=e.renderer,u=this._didUploadHash[a.uid];r.shader.bind(a,u),u||(this._didUploadHash[a.uid]=!0),r.shader.updateUniformGroup(r.globalUniforms.uniformGroup),r.geometry.bind(t,a.glProgram)}execute(e,t){const a=e.renderer;this._tempState.blendMode=t.blendMode,a.state.set(this._tempState);const r=t.textures.textures;for(let u=0;u<t.textures.count;u++)a.texture.bind(r[u],u);a.geometry.draw(t.topology,t.size,t.start)}}eT.extension={type:[Q.WebGLPipesAdaptor],name:"batch"};const Ey=Bs.for2d();class tT{start(e,t,a){const r=e.renderer,u=r.encoder,h=a.gpuProgram;this._shader=a,this._geometry=t,u.setGeometry(t,h),Ey.blendMode="normal",r.pipeline.getPipeline(t,h,Ey);const f=r.globalUniforms.bindGroup;u.resetBindGroup(1),u.setBindGroup(0,f,h)}execute(e,t){const a=this._shader.gpuProgram,r=e.renderer,u=r.encoder;if(!t.bindGroup){const m=t.textures;t.bindGroup=pv(m.textures,m.count,r.limits.maxBatchableTextures)}Ey.blendMode=t.blendMode;const h=r.bindGroup.getBindGroup(t.bindGroup,a,1),f=r.pipeline.getPipeline(this._geometry,a,Ey,t.topology);t.bindGroup._touch(r.textureGC.count),u.setPipeline(f),u.renderPassEncoder.setBindGroup(1,h),u.renderPassEncoder.drawIndexed(t.size,1,t.start)}}tT.extension={type:[Q.WebGPUPipesAdaptor],name:"batch"};const Hv=class tA{constructor(e,t){var a,r;this.state=Bs.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,(r=(a=this._adaptor).init)==null||r.call(a,this)}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new Cv({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(const a in this._activeBatches)this._activeBatches[a].begin()}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let a=this._activeBatches[e.batcherName];a||(a=this._activeBatches[e.batcherName]=tA.getBatcher(e.batcherName),a.begin()),this._activeBatch=a}this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){this._activeBatch.break(e);const t=this._activeBatches;for(const a in t){const r=t[a],u=r.geometry;u.indexBuffer.setDataWithSize(r.indexBuffer,r.indexSize,!0),u.buffers[0].setDataWithSize(r.attributeBuffer.float32View,r.attributeSize,!1)}}upload(e){const t=this._batchersByInstructionSet[e.uid];for(const a in t){const r=t[a],u=r.geometry;r.dirty&&(r.dirty=!1,u.buffers[0].update(r.attributeSize*4))}}execute(e){if(e.action==="startBatch"){const t=e.batcher,a=t.geometry,r=t.shader;this._adaptor.start(this,a,r)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null}};Hv.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"batch"},Hv._availableBatchers=Object.create(null);let nT=Hv;Ie.handleByMap(Q.Batcher,nT._availableBatchers),Ie.add(Cv);const Td={name:"local-uniform-bit",vertex:{header:`
564
-
565
- struct LocalUniforms {
566
- uTransformMatrix:mat3x3<f32>,
567
- uColor:vec4<f32>,
568
- uRound:f32,
569
- }
570
-
571
- @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
572
- `,main:`
573
- vColor *= localUniforms.uColor;
574
- modelMatrix *= localUniforms.uTransformMatrix;
575
- `,end:`
576
- if(localUniforms.uRound == 1)
577
- {
578
- vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
579
- }
580
- `}},OU={...Td,vertex:{...Td.vertex,header:Td.vertex.header.replace("group(1)","group(2)")}},Vv={name:"local-uniform-bit",vertex:{header:`
581
-
582
- uniform mat3 uTransformMatrix;
583
- uniform vec4 uColor;
584
- uniform float uRound;
585
- `,main:`
586
- vColor *= uColor;
587
- modelMatrix = uTransformMatrix;
588
- `,end:`
589
- if(uRound == 1.)
590
- {
591
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
592
- }
593
- `}},NU={name:"texture-bit",vertex:{header:`
594
-
595
- struct TextureUniforms {
596
- uTextureMatrix:mat3x3<f32>,
597
- }
598
-
599
- @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
600
- `,main:`
601
- uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
602
- `},fragment:{header:`
603
- @group(2) @binding(0) var uTexture: texture_2d<f32>;
604
- @group(2) @binding(1) var uSampler: sampler;
605
-
606
-
607
- `,main:`
608
- outColor = textureSample(uTexture, uSampler, vUV);
609
- `}},GU={name:"texture-bit",vertex:{header:`
610
- uniform mat3 uTextureMatrix;
611
- `,main:`
612
- uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
613
- `},fragment:{header:`
614
- uniform sampler2D uTexture;
615
-
616
-
617
- `,main:`
618
- outColor = texture(uTexture, vUV);
619
- `}},PU=new ci;class wU extends ey{constructor(){super(),this.filters=[new AU({sprite:new ru(He.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e}}class iT{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,a){const r=this._renderer;if(r.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){const u=e.mask;u.includeInBuild=!0,u.collectRenderables(a,r,null),u.includeInBuild=!1}r.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){const t=this._renderer,a=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const r=Cn.get(wU);if(r.inverse=e.inverse,a){e.mask.mask.measurable=!0;const u=N_(e.mask.mask,!0,PU);e.mask.mask.measurable=!1,u.ceil();const h=t.renderTarget.renderTarget.colorTexture.source,f=hi.getOptimalTexture(u.width,u.height,h._resolution,h.antialias);t.renderTarget.push(f,!0),t.globalUniforms.push({offset:u,worldColor:4294967295});const m=r.sprite;m.texture=f,m.worldTransform.tx=u.minX,m.worldTransform.ty=u.minY,this._activeMaskStage.push({filterEffect:r,maskedContainer:e.maskedContainer,filterTexture:f})}else r.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:r,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const r=this._activeMaskStage[this._activeMaskStage.length-1];a&&(t.type===Us.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:r.maskedContainer,filterEffect:r.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const r=this._activeMaskStage.pop();a&&hi.returnTexture(r.filterTexture),Cn.return(r.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}iT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"alphaMask"};class aT{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,a){this._renderer.renderPipes.batch.break(a);const u=this._colorStack;u[this._colorStackIndex]=u[this._colorStackIndex-1]&e.mask;const h=this._colorStack[this._colorStackIndex];h!==this._currentColor&&(this._currentColor=h,a.add({renderPipeId:"colorMask",colorMask:h,canBundle:!1})),this._colorStackIndex++}pop(e,t,a){this._renderer.renderPipes.batch.break(a);const u=this._colorStack;this._colorStackIndex--;const h=u[this._colorStackIndex-1];h!==this._currentColor&&(this._currentColor=h,a.add({renderPipeId:"colorMask",colorMask:h,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._renderer=null,this._colorStack=null}}aT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"colorMask"};class sT{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,a){var r;const u=e,h=this._renderer;h.renderPipes.batch.break(a),h.renderPipes.blendMode.setBlendMode(u.mask,"none",a),a.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const f=u.mask;f.includeInBuild=!0,this._maskHash.has(u)||this._maskHash.set(u,{instructionsStart:0,instructionsLength:0});const m=this._maskHash.get(u);m.instructionsStart=a.instructionSize,f.collectRenderables(a,h,null),f.includeInBuild=!1,h.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const y=a.instructionSize-m.instructionsStart-1;m.instructionsLength=y;const v=h.renderTarget.renderTarget.uid;(r=this._maskStackHash)[v]??(r[v]=0)}pop(e,t,a){const r=e,u=this._renderer;u.renderPipes.batch.break(a),u.renderPipes.blendMode.setBlendMode(r.mask,"none",a),a.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:!1});const h=this._maskHash.get(e);for(let f=0;f<h.instructionsLength;f++)a.instructions[a.instructionSize++]=a.instructions[h.instructionsStart++];a.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const a=this._renderer,r=a.renderTarget.renderTarget.uid;let u=(t=this._maskStackHash)[r]??(t[r]=0);e.action==="pushMaskBegin"?(a.renderTarget.ensureDepthStencil(),a.stencil.setStencilMode(xn.RENDERING_MASK_ADD,u),u++,a.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?a.stencil.setStencilMode(xn.INVERSE_MASK_ACTIVE,u):a.stencil.setStencilMode(xn.MASK_ACTIVE,u),a.colorMask.setMask(15)):e.action==="popMaskBegin"?(a.colorMask.setMask(0),u!==0?a.stencil.setStencilMode(xn.RENDERING_MASK_REMOVE,u):(a.renderTarget.clear(null,Ta.STENCIL),a.stencil.setStencilMode(xn.DISABLED,u)),u--):e.action==="popMaskEnd"&&(e.inverse?a.stencil.setStencilMode(xn.INVERSE_MASK_ACTIVE,u):a.stencil.setStencilMode(xn.MASK_ACTIVE,u),a.colorMask.setMask(15)),this._maskStackHash[r]=u}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}sT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"stencilMask"};var Cy=(n=>(n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",n))(Cy||{});class zU{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t}}class rT{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:t}=this,a=this.getGlBuffer(e);t.bindBuffer(a.type,a.buffer)}bindBufferBase(e,t){const{_gl:a}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,a.bindBufferBase(a.UNIFORM_BUFFER,t,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let a=0,r=this._nextBindBaseIndex;for(;a<2;){r>=this._maxBindings&&(r=this._minBaseLocation,a++);const u=this._boundBufferBases[r];if(u&&u._lastBindCallId===this._bindCallId){r++;continue}break}return t=r,this._nextBindBaseIndex=r+1,a>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){const t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,a,r){const{_gl:u}=this;a||(a=0),t||(t=0),this._boundBufferBases[t]=null,u.bindBufferRange(u.UNIFORM_BUFFER,t||0,e.buffer,a*256,r||256)}updateBuffer(e){const{_gl:t}=this,a=this.getGlBuffer(e);if(e._updateID===a.updateID)return a;a.updateID=e._updateID,t.bindBuffer(a.type,a.buffer);const r=e.data,u=e.descriptor.usage&xt.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return r?a.byteLength>=r.byteLength?t.bufferSubData(a.type,0,r,0,e._updateSize/r.BYTES_PER_ELEMENT):(a.byteLength=r.byteLength,t.bufferData(a.type,r,u)):(a.byteLength=e.descriptor.size,t.bufferData(a.type,a.byteLength,u)),a}destroyAll(){const e=this._gl;for(const t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,t){const a=this._gpuBuffers[e.uid],r=this._gl;t||r.deleteBuffer(a.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:t}=this;let a=Cy.ARRAY_BUFFER;e.descriptor.usage&xt.INDEX?a=Cy.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&xt.UNIFORM&&(a=Cy.UNIFORM_BUFFER);const r=new zU(t.createBuffer(),a);return this._gpuBuffers[e.uid]=r,e.on("destroy",this.onBufferDestroy,this),r}resetState(){this._boundBufferBases=Object.create(null)}}rT.extension={type:[Q.WebGLSystem],name:"buffer"};const Lv=class nA{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...nA.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(rt("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=!1),t?this.canvas=wt.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const a=this._renderer.background.alpha<1,r=e.premultipliedAlpha??!0,u=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:a,premultipliedAlpha:r,antialias:u,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&rt("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof wt.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,!1),t.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,t){let a;const r=this.canvas;if(e===2&&(a=r.getContext("webgl2",t)),!a&&(a=r.getContext("webgl",t),!a))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=a,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const a=e.getExtension("WEBGL_provoking_vertex");a&&a.provokingVertexWEBGL(a.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{var t;this.gl.isContextLost()&&((t=this.extensions.loseContext)==null||t.restoreContext())},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){var t;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(t=this.extensions.loseContext)==null||t.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const t=e.getContextAttributes();t&&!t.stencil&&rt("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const a=this.supports,r=this.webGLVersion===2,u=this.extensions;a.uint32Indices=r||!!u.uint32ElementIndex,a.uniformBufferObject=r,a.vertexArrayObject=r||!!u.vertexArrayObject,a.srgbTextures=r||!!u.srgb,a.nonPowOf2wrapping=r,a.nonPowOf2mipmaps=r,a.msaa=r,a.uint32Indices||rt("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};Lv.extension={type:[Q.WebGLSystem],name:"context"},Lv.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let HU=Lv;function lT(n,e){for(const t in n.attributes){const a=n.attributes[t],r=e[t];r?(a.format??(a.format=r.format),a.offset??(a.offset=r.offset),a.instance??(a.instance=r.instance)):rt(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}VU(n)}function VU(n){const{buffers:e,attributes:t}=n,a={},r={};for(const u in e){const h=e[u];a[h.uid]=0,r[h.uid]=0}for(const u in t){const h=t[u];a[h.buffer.uid]+=Ql(h.format).stride}for(const u in t){const h=t[u];h.stride??(h.stride=a[h.buffer.uid]),h.start??(h.start=r[h.buffer.uid]),r[h.buffer.uid]+=Ql(h.format).stride}}var jv=(n=>(n[n.RGBA=6408]="RGBA",n[n.RGB=6407]="RGB",n[n.RG=33319]="RG",n[n.RED=6403]="RED",n[n.RGBA_INTEGER=36249]="RGBA_INTEGER",n[n.RGB_INTEGER=36248]="RGB_INTEGER",n[n.RG_INTEGER=33320]="RG_INTEGER",n[n.RED_INTEGER=36244]="RED_INTEGER",n[n.ALPHA=6406]="ALPHA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n))(jv||{}),oT=(n=>(n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n))(oT||{}),Ct=(n=>(n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",n[n.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",n[n.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",n[n.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",n[n.BYTE=5120]="BYTE",n[n.SHORT=5122]="SHORT",n[n.INT=5124]="INT",n[n.FLOAT=5126]="FLOAT",n[n.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",n[n.HALF_FLOAT=36193]="HALF_FLOAT",n))(Ct||{});const uT={uint8x2:Ct.UNSIGNED_BYTE,uint8x4:Ct.UNSIGNED_BYTE,sint8x2:Ct.BYTE,sint8x4:Ct.BYTE,unorm8x2:Ct.UNSIGNED_BYTE,unorm8x4:Ct.UNSIGNED_BYTE,snorm8x2:Ct.BYTE,snorm8x4:Ct.BYTE,uint16x2:Ct.UNSIGNED_SHORT,uint16x4:Ct.UNSIGNED_SHORT,sint16x2:Ct.SHORT,sint16x4:Ct.SHORT,unorm16x2:Ct.UNSIGNED_SHORT,unorm16x4:Ct.UNSIGNED_SHORT,snorm16x2:Ct.SHORT,snorm16x4:Ct.SHORT,float16x2:Ct.HALF_FLOAT,float16x4:Ct.HALF_FLOAT,float32:Ct.FLOAT,float32x2:Ct.FLOAT,float32x3:Ct.FLOAT,float32x4:Ct.FLOAT,uint32:Ct.UNSIGNED_INT,uint32x2:Ct.UNSIGNED_INT,uint32x3:Ct.UNSIGNED_INT,uint32x4:Ct.UNSIGNED_INT,sint32:Ct.INT,sint32x2:Ct.INT,sint32x3:Ct.INT,sint32x4:Ct.INT};function LU(n){return uT[n]??uT.float32}const jU={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class cT{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=r=>t.bindVertexArrayOES(r),e.deleteVertexArray=r=>t.deleteVertexArrayOES(r));const a=this._renderer.context.extensions.vertexAttribDivisorANGLE;a&&(e.drawArraysInstanced=(r,u,h,f)=>{a.drawArraysInstancedANGLE(r,u,h,f)},e.drawElementsInstanced=(r,u,h,f,m)=>{a.drawElementsInstancedANGLE(r,u,h,f,m)},e.vertexAttribDivisor=(r,u)=>a.vertexAttribDivisorANGLE(r,u)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,t){const a=this.gl;this._activeGeometry=e;const r=this.getVao(e,t);this._activeVao!==r&&(this._activeVao=r,a.bindVertexArray(r)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this._renderer.buffer;for(let a=0;a<e.buffers.length;a++){const r=e.buffers[a];t.updateBuffer(r)}}checkCompatibility(e,t){const a=e.attributes,r=t._attributeData;for(const u in r)if(!a[u])throw new Error(`shader and geometry incompatible, geometry missing the "${u}" attribute`)}getSignature(e,t){const a=e.attributes,r=t._attributeData,u=["g",e.uid];for(const h in a)r[h]&&u.push(h,r[h].location);return u.join("-")}getVao(e,t){var a;return((a=this._geometryVaoHash[e.uid])==null?void 0:a[t._key])||this.initGeometryVao(e,t)}initGeometryVao(e,t,a=!0){const r=this._renderer.gl,u=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);const h=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const f=this._geometryVaoHash[e.uid];let m=f[h];if(m)return f[t._key]=m,m;lT(e,t._attributeData);const y=e.buffers;m=r.createVertexArray(),r.bindVertexArray(m);for(let v=0;v<y.length;v++){const S=y[v];u.bind(S)}return this.activateVao(e,t),f[t._key]=m,f[h]=m,r.bindVertexArray(null),m}onGeometryDestroy(e,t){const a=this._geometryVaoHash[e.uid],r=this.gl;if(a){if(t)for(const u in a)this._activeVao!==a[u]&&this.unbind(),r.deleteVertexArray(a[u]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const t=this.gl;for(const a in this._geometryVaoHash){if(e)for(const r in this._geometryVaoHash[a]){const u=this._geometryVaoHash[a];this._activeVao!==u&&this.unbind(),t.deleteVertexArray(u[r])}this._geometryVaoHash[a]=null}}activateVao(e,t){var f;const a=this._renderer.gl,r=this._renderer.buffer,u=e.attributes;e.indexBuffer&&r.bind(e.indexBuffer);let h=null;for(const m in u){const y=u[m],v=y.buffer,S=r.getGlBuffer(v),T=t._attributeData[m];if(T){h!==S&&(r.bind(v),h=S);const E=T.location;a.enableVertexAttribArray(E);const A=Ql(y.format),U=LU(y.format);if(((f=T.format)==null?void 0:f.substring(1,4))==="int"?a.vertexAttribIPointer(E,A.size,U,y.stride,y.offset):a.vertexAttribPointer(E,A.size,U,A.normalised,y.stride,y.offset),y.instance)if(this.hasInstance){const M=y.divisor??1;a.vertexAttribDivisor(E,M)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,a,r){const{gl:u}=this._renderer,h=this._activeGeometry,f=jU[e||h.topology];if(r??(r=h.instanceCount),h.indexBuffer){const m=h.indexBuffer.data.BYTES_PER_ELEMENT,y=m===2?u.UNSIGNED_SHORT:u.UNSIGNED_INT;r!==1?u.drawElementsInstanced(f,t||h.indexBuffer.data.length,y,(a||0)*m,r):u.drawElements(f,t||h.indexBuffer.data.length,y,(a||0)*m)}else r!==1?u.drawArraysInstanced(f,a||0,t||h.getSize(),r):u.drawArrays(f,a||0,t||h.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null,this._geometryVaoHash=null}}cT.extension={type:[Q.WebGLSystem],name:"geometry"};const YU=new pd({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),Yv=class iA{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:t,antialias:a}={...iA.defaultOptions,...e};this.useBackBuffer=t,this._antialias=a,this._renderer.context.supports.msaa||(rt("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=Bs.for2d();const r=new lu({vertex:`
620
- attribute vec2 aPosition;
621
- out vec2 vUv;
622
-
623
- void main() {
624
- gl_Position = vec4(aPosition, 0.0, 1.0);
625
-
626
- vUv = (aPosition + 1.0) / 2.0;
627
-
628
- // flip dem UVs
629
- vUv.y = 1.0 - vUv.y;
630
- }`,fragment:`
631
- in vec2 vUv;
632
- out vec4 finalColor;
633
-
634
- uniform sampler2D uTexture;
635
-
636
- void main() {
637
- finalColor = texture(uTexture, vUv);
638
- }`,name:"big-triangle"});this._bigTriangleShader=new Ia({glProgram:r,resources:{uTexture:He.WHITE.source}})}renderStart(e){const t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){const a=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=a.colorTexture,e.target=this._getBackBufferTexture(a.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:YU,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new He({source:new wn({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};Yv.extension={type:[Q.WebGLSystem],name:"backBuffer",priority:1},Yv.defaultOptions={useBackBuffer:!1};let XU=Yv;class hT{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}hT.extension={type:[Q.WebGLSystem],name:"colorMask"};class fT{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram)}finishRenderPass(){}draw(e){const t=this._renderer,{geometry:a,shader:r,state:u,skipSync:h,topology:f,size:m,start:y,instanceCount:v}=e;t.shader.bind(r,h),t.geometry.bind(a,t.shader._activeProgram),u&&t.state.set(u),t.geometry.draw(f,m,y,v??a.instanceCount)}destroy(){this._renderer=null}}fT.extension={type:[Q.WebGLSystem],name:"encoder"};class dT{constructor(e){this._renderer=e}contextChange(){const e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=e1(this.maxTextures,e);const t=this._renderer.context.webGLVersion===2;this.maxUniformBindings=t?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0}destroy(){}}dT.extension={type:[Q.WebGLSystem],name:"limits"};class qU{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}const Jl=[];Jl[xn.NONE]=void 0,Jl[xn.DISABLED]={stencilWriteMask:0,stencilReadMask:0},Jl[xn.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},Jl[xn.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},Jl[xn.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},Jl[xn.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};class pT{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:xn.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState()}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:xn.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=xn.NONE,this._stencilCache.stencilReference=0}setStencilMode(e,t){const a=this._renderTargetStencilState[this._activeRenderTarget.uid],r=this._gl,u=Jl[e],h=this._stencilCache;if(a.stencilMode=e,a.stencilReference=t,e===xn.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,r.disable(r.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,r.enable(r.STENCIL_TEST)),(e!==h.stencilMode||h.stencilReference!==t)&&(h.stencilMode=e,h.stencilReference=t,r.stencilFunc(this._comparisonFuncMapping[u.stencilBack.compare],t,255),r.stencilOp(r.KEEP,r.KEEP,this._stencilOpsMapping[u.stencilBack.passOp]))}}pT.extension={type:[Q.WebGLSystem],name:"stencil"};class mT{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!OS())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ea({data:new Float32Array(t.layout.size/4),usage:xt.UNIFORM|xt.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let a=this._syncFunctionHash[t];if(!a){const r=Object.keys(e.uniformStructures).map(f=>e.uniformStructures[f]),u=this._adaptor.createUboElements(r),h=this._generateUboSync(u.uboElements);a=this._syncFunctionHash[t]={layout:u,syncFunction:h}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,a){const r=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ea({data:new Float32Array(r.layout.size/4),usage:xt.UNIFORM|xt.COPY_DST}));let u=null;return t||(t=e.buffer.data,u=e.buffer.dataInt32),a||(a=0),r.syncFunction(e.uniforms,t,u,a),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}}const yT={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};function FU(n){const e=n.map(u=>({data:u,offset:0,size:0})),t=16;let a=0,r=0;for(let u=0;u<e.length;u++){const h=e[u];if(a=yT[h.data.type],!a)throw new Error(`Unknown type ${h.data.type}`);h.data.size>1&&(a=Math.max(a,t)*h.data.size);const f=a===12?16:a;h.size=a;const m=r%t;m>0&&t-m<f?r+=(t-m)%16:r+=(a-m%a)%a,h.offset=r,r+=a}return r=Math.ceil(r/16)*16,{uboElements:e,size:r}}const du=[{type:"mat3x3<f32>",test:n=>n.value.a!==void 0,ubo:`
639
- var matrix = uv[name].toArray(true);
640
- data[offset] = matrix[0];
641
- data[offset + 1] = matrix[1];
642
- data[offset + 2] = matrix[2];
643
- data[offset + 4] = matrix[3];
644
- data[offset + 5] = matrix[4];
645
- data[offset + 6] = matrix[5];
646
- data[offset + 8] = matrix[6];
647
- data[offset + 9] = matrix[7];
648
- data[offset + 10] = matrix[8];
649
- `,uniform:`
650
- gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
651
- `},{type:"vec4<f32>",test:n=>n.type==="vec4<f32>"&&n.size===1&&n.value.width!==void 0,ubo:`
652
- v = uv[name];
653
- data[offset] = v.x;
654
- data[offset + 1] = v.y;
655
- data[offset + 2] = v.width;
656
- data[offset + 3] = v.height;
657
- `,uniform:`
658
- cv = ud[name].value;
659
- v = uv[name];
660
- if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
661
- cv[0] = v.x;
662
- cv[1] = v.y;
663
- cv[2] = v.width;
664
- cv[3] = v.height;
665
- gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
666
- }
667
- `},{type:"vec2<f32>",test:n=>n.type==="vec2<f32>"&&n.size===1&&n.value.x!==void 0,ubo:`
668
- v = uv[name];
669
- data[offset] = v.x;
670
- data[offset + 1] = v.y;
671
- `,uniform:`
672
- cv = ud[name].value;
673
- v = uv[name];
674
- if (cv[0] !== v.x || cv[1] !== v.y) {
675
- cv[0] = v.x;
676
- cv[1] = v.y;
677
- gl.uniform2f(ud[name].location, v.x, v.y);
678
- }
679
- `},{type:"vec4<f32>",test:n=>n.type==="vec4<f32>"&&n.size===1&&n.value.red!==void 0,ubo:`
680
- v = uv[name];
681
- data[offset] = v.red;
682
- data[offset + 1] = v.green;
683
- data[offset + 2] = v.blue;
684
- data[offset + 3] = v.alpha;
685
- `,uniform:`
686
- cv = ud[name].value;
687
- v = uv[name];
688
- if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
689
- cv[0] = v.red;
690
- cv[1] = v.green;
691
- cv[2] = v.blue;
692
- cv[3] = v.alpha;
693
- gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
694
- }
695
- `},{type:"vec3<f32>",test:n=>n.type==="vec3<f32>"&&n.size===1&&n.value.red!==void 0,ubo:`
696
- v = uv[name];
697
- data[offset] = v.red;
698
- data[offset + 1] = v.green;
699
- data[offset + 2] = v.blue;
700
- `,uniform:`
701
- cv = ud[name].value;
702
- v = uv[name];
703
- if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
704
- cv[0] = v.red;
705
- cv[1] = v.green;
706
- cv[2] = v.blue;
707
- gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
708
- }
709
- `}];function gT(n,e,t,a){const r=[`
710
- var v = null;
711
- var v2 = null;
712
- var t = 0;
713
- var index = 0;
714
- var name = null;
715
- var arrayOffset = null;
716
- `];let u=0;for(let f=0;f<n.length;f++){const m=n[f],y=m.data.name;let v=!1,S=0;for(let T=0;T<du.length;T++)if(du[T].test(m.data)){S=m.offset/4,r.push(`name = "${y}";`,`offset += ${S-u};`,du[T][e]||du[T].ubo),v=!0;break}if(!v)if(m.data.size>1)S=m.offset/4,r.push(t(m,S-u));else{const T=a[m.data.type];S=m.offset/4,r.push(`
717
- v = uv.${y};
718
- offset += ${S-u};
719
- ${T};
720
- `)}u=S}const h=r.join(`
721
- `);return new Function("uv","data","dataInt32","offset",h)}function Nc(n,e){return`
722
- for (let i = 0; i < ${n*e}; i++) {
723
- data[offset + (((i / ${n})|0) * 4) + (i % ${n})] = v[i];
724
- }
725
- `}const _T={f32:`
726
- data[offset] = v;`,i32:`
727
- dataInt32[offset] = v;`,"vec2<f32>":`
728
- data[offset] = v[0];
729
- data[offset + 1] = v[1];`,"vec3<f32>":`
730
- data[offset] = v[0];
731
- data[offset + 1] = v[1];
732
- data[offset + 2] = v[2];`,"vec4<f32>":`
733
- data[offset] = v[0];
734
- data[offset + 1] = v[1];
735
- data[offset + 2] = v[2];
736
- data[offset + 3] = v[3];`,"vec2<i32>":`
737
- dataInt32[offset] = v[0];
738
- dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
739
- dataInt32[offset] = v[0];
740
- dataInt32[offset + 1] = v[1];
741
- dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
742
- dataInt32[offset] = v[0];
743
- dataInt32[offset + 1] = v[1];
744
- dataInt32[offset + 2] = v[2];
745
- dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
746
- data[offset] = v[0];
747
- data[offset + 1] = v[1];
748
- data[offset + 4] = v[2];
749
- data[offset + 5] = v[3];`,"mat3x3<f32>":`
750
- data[offset] = v[0];
751
- data[offset + 1] = v[1];
752
- data[offset + 2] = v[2];
753
- data[offset + 4] = v[3];
754
- data[offset + 5] = v[4];
755
- data[offset + 6] = v[5];
756
- data[offset + 8] = v[6];
757
- data[offset + 9] = v[7];
758
- data[offset + 10] = v[8];`,"mat4x4<f32>":`
759
- for (let i = 0; i < 16; i++) {
760
- data[offset + i] = v[i];
761
- }`,"mat3x2<f32>":Nc(3,2),"mat4x2<f32>":Nc(4,2),"mat2x3<f32>":Nc(2,3),"mat4x3<f32>":Nc(4,3),"mat2x4<f32>":Nc(2,4),"mat3x4<f32>":Nc(3,4)},kU={..._T,"mat2x2<f32>":`
762
- data[offset] = v[0];
763
- data[offset + 1] = v[1];
764
- data[offset + 2] = v[2];
765
- data[offset + 3] = v[3];
766
- `};function IU(n,e){const t=Math.max(yT[n.data.type]/16,1),a=n.data.value.length/n.data.size,r=(4-a%4)%4,u=n.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
767
- v = uv.${n.data.name};
768
- offset += ${e};
769
-
770
- arrayOffset = offset;
771
-
772
- t = 0;
773
-
774
- for(var i=0; i < ${n.data.size*t}; i++)
775
- {
776
- for(var j = 0; j < ${a}; j++)
777
- {
778
- ${u}[arrayOffset++] = v[t++];
779
- }
780
- ${r!==0?`arrayOffset += ${r};`:""}
781
- }
782
- `}function KU(n){return gT(n,"uboStd40",IU,_T)}class vT extends mT{constructor(){super({createUboElements:FU,generateUboSync:KU})}}vT.extension={type:[Q.WebGLSystem],name:"ubo"};class QU{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Pt}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Pt}copyToTexture(e,t,a,r,u){const h=this._renderTargetSystem,f=this._renderer,m=h.getGpuRenderTarget(e),y=f.gl;return this.finishRenderPass(e),y.bindFramebuffer(y.FRAMEBUFFER,m.resolveTargetFramebuffer),f.texture.bind(t,0),y.copyTexSubImage2D(y.TEXTURE_2D,0,u.x,u.y,a.x,a.y,r.width,r.height),t}startRenderPass(e,t=!0,a,r){const u=this._renderTargetSystem,h=e.colorTexture,f=u.getGpuRenderTarget(e);let m=r.y;e.isRoot&&(m=h.pixelHeight-r.height),e.colorTextures.forEach(S=>{this._renderer.texture.unbind(S)});const y=this._renderer.gl;y.bindFramebuffer(y.FRAMEBUFFER,f.framebuffer);const v=this._viewPortCache;(v.x!==r.x||v.y!==m||v.width!==r.width||v.height!==r.height)&&(v.x=r.x,v.y=m,v.width=r.width,v.height=r.height,y.viewport(r.x,m,r.width,r.height)),!f.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(f),this.clear(e,t,a)}finishRenderPass(e){const a=this._renderTargetSystem.getGpuRenderTarget(e);if(!a.msaa)return;const r=this._renderer.gl;r.bindFramebuffer(r.FRAMEBUFFER,a.resolveTargetFramebuffer),r.bindFramebuffer(r.READ_FRAMEBUFFER,a.framebuffer),r.blitFramebuffer(0,0,a.width,a.height,0,0,a.width,a.height,r.COLOR_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,a.framebuffer)}initGpuRenderTarget(e){const a=this._renderer.gl,r=new qU;return e.colorTexture instanceof $r?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),r.framebuffer=null,r):(this._initColor(e,r),a.bindFramebuffer(a.FRAMEBUFFER,null),r)}destroyGpuRenderTarget(e){const t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(a=>{t.deleteRenderbuffer(a)}),e.msaaRenderBuffer=null}clear(e,t,a){if(!t)return;const r=this._renderTargetSystem;typeof t=="boolean"&&(t=t?Ta.ALL:Ta.NONE);const u=this._renderer.gl;if(t&Ta.COLOR){a??(a=r.defaultClearColor);const h=this._clearColorCache,f=a;(h[0]!==f[0]||h[1]!==f[1]||h[2]!==f[2]||h[3]!==f[3])&&(h[0]=f[0],h[1]=f[1],h[2]=f[2],h[3]=f[3],u.clearColor(f[0],f[1],f[2],f[3]))}u.clear(t)}resizeGpuRenderTarget(e){if(e.isRoot)return;const a=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,a),(e.stencil||e.depth)&&this._resizeStencil(a)}_initColor(e,t){const a=this._renderer,r=a.gl,u=r.createFramebuffer();if(t.resolveTargetFramebuffer=u,r.bindFramebuffer(r.FRAMEBUFFER,u),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((h,f)=>{const m=h.source;m.antialias&&(a.context.supports.msaa?t.msaa=!0:rt("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),a.texture.bindSource(m,0);const v=a.texture.getGlSource(m).texture;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+f,3553,v,0)}),t.msaa){const h=r.createFramebuffer();t.framebuffer=h,r.bindFramebuffer(r.FRAMEBUFFER,h),e.colorTextures.forEach((f,m)=>{const y=r.createRenderbuffer();t.msaaRenderBuffer[m]=y})}else t.framebuffer=u;this._resizeColor(e,t)}_resizeColor(e,t){const a=e.colorTexture.source;if(t.width=a.pixelWidth,t.height=a.pixelHeight,e.colorTextures.forEach((r,u)=>{u!==0&&r.source.resize(a.width,a.height,a._resolution)}),t.msaa){const r=this._renderer,u=r.gl,h=t.framebuffer;u.bindFramebuffer(u.FRAMEBUFFER,h),e.colorTextures.forEach((f,m)=>{const y=f.source;r.texture.bindSource(y,0);const S=r.texture.getGlSource(y).internalFormat,T=t.msaaRenderBuffer[m];u.bindRenderbuffer(u.RENDERBUFFER,T),u.renderbufferStorageMultisample(u.RENDERBUFFER,4,S,y.pixelWidth,y.pixelHeight),u.framebufferRenderbuffer(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0+m,u.RENDERBUFFER,T)})}}_initStencil(e){if(e.framebuffer===null)return;const t=this._renderer.gl,a=t.createRenderbuffer();e.depthStencilRenderBuffer=a,t.bindRenderbuffer(t.RENDERBUFFER,a),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,a),this._resizeStencil(e)}_resizeStencil(e){const t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,this._renderer.context.webGLVersion===2?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height)}prerender(e){const t=e.colorTexture.resource;this._renderer.context.multiView&&$r.test(t)&&this._renderer.context.ensureCanvasSize(t)}postrender(e){if(this._renderer.context.multiView&&$r.test(e.colorTexture.resource)){const t=this._renderer.context.canvas,a=e.colorTexture;a.context2D.drawImage(t,0,a.pixelHeight-t.height)}}}function ZU(n,e,t,a,r,u){const h=u?1:-1;return n.identity(),n.a=1/a*2,n.d=h*(1/r*2),n.tx=-1-e*n.a,n.ty=-h-t*n.d,n}const Gc=new Map;Ec.register(Gc);function bT(n,e){if(!Gc.has(n)){const t=new He({source:new $r({resource:n,...e})}),a=()=>{Gc.get(n)===t&&Gc.delete(n)};t.once("destroy",a),t.source.once("destroy",a),Gc.set(n,t)}return Gc.get(n)}function WU(n){const e=n.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const xT=class aA{constructor(e={}){if(this.uid=It("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...aA.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new wn({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(a=>a.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof He||e.depthStencilTexture instanceof wn?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new wn({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,a=this.resolution,r=!1){this.dirtyId++,this.colorTextures.forEach((u,h)=>{r&&h===0||u.source.resize(e,t,a)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,a)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};xT.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let Xv=xT;class ST{constructor(e){this.rootViewPort=new Pt,this.viewport=new Pt,this.onRenderTargetChange=new VS("onRenderTargetChange"),this.projectionMatrix=new ze,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:a,frame:r}){var u,h;this._renderTargetStack.length=0,this.push(e,t,a,r),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=WU(this.rootRenderTarget),(h=(u=this.adaptor).prerender)==null||h.call(u,this.rootRenderTarget)}postrender(){var e,t;(t=(e=this.adaptor).postrender)==null||t.call(e,this.rootRenderTarget)}bind(e,t=!0,a,r){const u=this.getRenderTarget(e),h=this.renderTarget!==u;this.renderTarget=u,this.renderSurface=e;const f=this.getGpuRenderTarget(u);(u.pixelWidth!==f.width||u.pixelHeight!==f.height)&&(this.adaptor.resizeGpuRenderTarget(u),f.width=u.pixelWidth,f.height=u.pixelHeight);const m=u.colorTexture,y=this.viewport,v=m.pixelWidth,S=m.pixelHeight;if(!r&&e instanceof He&&(r=e.frame),r){const T=m._resolution;y.x=r.x*T+.5|0,y.y=r.y*T+.5|0,y.width=r.width*T+.5|0,y.height=r.height*T+.5|0}else y.x=0,y.y=0,y.width=v,y.height=S;return ZU(this.projectionMatrix,0,0,y.width/m.resolution,y.height/m.resolution,!u.isRoot),this.adaptor.startRenderPass(u,t,a,y),h&&this.onRenderTargetChange.emit(u),u}clear(e,t=Ta.ALL,a){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,a,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=Ta.ALL,a,r){const u=this.bind(e,t,a,r);return this._renderTargetStack.push({renderTarget:u,frame:r}),u}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,a,r,u){a.x<0&&(r.width+=a.x,u.x-=a.x,a.x=0),a.y<0&&(r.height+=a.y,u.y-=a.y,a.y=0);const{pixelWidth:h,pixelHeight:f}=e;return r.width=Math.min(r.width,h-a.x),r.height=Math.min(r.height,f-a.y),this.adaptor.copyToTexture(e,t,a,r,u)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return $r.test(e)&&(e=bT(e).source),e instanceof Xv?t=e:e instanceof wn&&(t=new Xv({colorTextures:[e]}),e.source instanceof $r&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);const a=this._gpuRenderTargetHash[t.uid];a&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(a))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null}}class TT extends ST{constructor(e){super(e),this.adaptor=new QU,this.adaptor.init(e,this)}}TT.extension={type:[Q.WebGLSystem],name:"renderTarget"};class qv extends Sa{constructor({buffer:e,offset:t,size:a}){super(),this.uid=It("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=It("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=a,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=It("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}}function JU(n,e){const t=[],a=[`
783
- var g = s.groups;
784
- var sS = r.shader;
785
- var p = s.glProgram;
786
- var ugS = r.uniformGroup;
787
- var resources;
788
- `];let r=!1,u=0;const h=e._getProgramData(n.glProgram);for(const m in n.groups){const y=n.groups[m];t.push(`
789
- resources = g[${m}].resources;
790
- `);for(const v in y.resources){const S=y.resources[v];if(S instanceof Yi)if(S.ubo){const T=n._uniformBindMap[m][Number(v)];t.push(`
791
- sS.bindUniformBlock(
792
- resources[${v}],
793
- '${T}',
794
- ${n.glProgram._uniformBlockData[T].index}
795
- );
796
- `)}else t.push(`
797
- ugS.updateUniformGroup(resources[${v}], p, sD);
798
- `);else if(S instanceof qv){const T=n._uniformBindMap[m][Number(v)];t.push(`
799
- sS.bindUniformBlock(
800
- resources[${v}],
801
- '${T}',
802
- ${n.glProgram._uniformBlockData[T].index}
803
- );
804
- `)}else if(S instanceof wn){const T=n._uniformBindMap[m][v],E=h.uniformData[T];E&&(r||(r=!0,a.push(`
805
- var tS = r.texture;
806
- `)),e._gl.uniform1i(E.location,u),t.push(`
807
- tS.bind(resources[${v}], ${u});
808
- `),u++)}}}const f=[...a,...t].join(`
809
- `);return new Function("r","s","sD",f)}class $U{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function ET(n,e,t){const a=n.createShader(e);return n.shaderSource(a,t),n.compileShader(a),a}function Fv(n){const e=new Array(n);for(let t=0;t<e.length;t++)e[t]=!1;return e}function CT(n,e){switch(n){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Fv(2*e);case"bvec3":return Fv(3*e);case"bvec4":return Fv(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let Ry=null;const RT={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},e4={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function AT(n,e){if(!Ry){const t=Object.keys(RT);Ry={};for(let a=0;a<t.length;++a){const r=t[a];Ry[n[r]]=RT[r]}}return Ry[e]}function t4(n,e){const t=AT(n,e);return e4[t]||"float32"}function n4(n,e,t=!1){const a={},r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES);for(let h=0;h<r;h++){const f=e.getActiveAttrib(n,h);if(f.name.startsWith("gl_"))continue;const m=t4(e,f.type);a[f.name]={location:0,format:m,stride:Ql(m).stride,offset:0,instance:!1,start:0}}const u=Object.keys(a);if(t){u.sort((h,f)=>h>f?1:-1);for(let h=0;h<u.length;h++)a[u[h]].location=h,e.bindAttribLocation(n,h,u[h]);e.linkProgram(n)}else for(let h=0;h<u.length;h++)a[u[h]].location=e.getAttribLocation(n,u[h]);return a}function i4(n,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const t={},a=e.getProgramParameter(n,e.ACTIVE_UNIFORM_BLOCKS);for(let r=0;r<a;r++){const u=e.getActiveUniformBlockName(n,r),h=e.getUniformBlockIndex(n,u),f=e.getActiveUniformBlockParameter(n,r,e.UNIFORM_BLOCK_DATA_SIZE);t[u]={name:u,index:h,size:f}}return t}function a4(n,e){const t={},a=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let r=0;r<a;r++){const u=e.getActiveUniform(n,r),h=u.name.replace(/\[.*?\]$/,""),f=!!u.name.match(/\[.*?\]$/),m=AT(e,u.type);t[h]={name:h,index:r,type:m,size:u.size,isArray:f,value:CT(m,u.size)}}return t}function MT(n,e){const t=n.getShaderSource(e).split(`
810
- `).map((y,v)=>`${v}: ${y}`),a=n.getShaderInfoLog(e),r=a.split(`
811
- `),u={},h=r.map(y=>parseFloat(y.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(y=>y&&!u[y]?(u[y]=!0,!0):!1),f=[""];h.forEach(y=>{t[y-1]=`%c${t[y-1]}%c`,f.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const m=t.join(`
812
- `);f[0]=m,console.error(a),console.groupCollapsed("click to view full shader code"),console.warn(...f),console.groupEnd()}function s4(n,e,t,a){n.getProgramParameter(e,n.LINK_STATUS)||(n.getShaderParameter(t,n.COMPILE_STATUS)||MT(n,t),n.getShaderParameter(a,n.COMPILE_STATUS)||MT(n,a),console.error("PixiJS Error: Could not initialize shader."),n.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(e)))}function r4(n,e){const t=ET(n,n.VERTEX_SHADER,e.vertex),a=ET(n,n.FRAGMENT_SHADER,e.fragment),r=n.createProgram();n.attachShader(r,t),n.attachShader(r,a);const u=e.transformFeedbackVaryings;u&&(typeof n.transformFeedbackVaryings!="function"?rt("TransformFeedback is not supported but TransformFeedbackVaryings are given."):n.transformFeedbackVaryings(r,u.names,u.bufferMode==="separate"?n.SEPARATE_ATTRIBS:n.INTERLEAVED_ATTRIBS)),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS)||s4(n,r,t,a),e._attributeData=n4(r,n,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=a4(r,n),e._uniformBlockData=i4(r,n),n.deleteShader(t),n.deleteShader(a);const h={};for(const m in e._uniformData){const y=e._uniformData[m];h[m]={location:n.getUniformLocation(r,m),value:CT(y.type,y.size)}}return new $U(r,h)}const Ay={textureCount:0,blockIndex:0};class DT{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_programDataHash")}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(e,t){if(this._setProgram(e.glProgram),t)return;Ay.textureCount=0,Ay.blockIndex=0;let a=this._shaderSyncFunctions[e.glProgram._key];a||(a=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),a(this._renderer,e,Ay)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,Ay)}bindUniformBlock(e,t,a=0){const r=this._renderer.buffer,u=this._getProgramData(this._activeProgram),h=e._bufferResource;h||this._renderer.ubo.updateUniformGroup(e);const f=e.buffer,m=r.updateBuffer(f),y=r.freeLocationForBufferBase(m);if(h){const{offset:S,size:T}=e;S===0&&T===f.data.byteLength?r.bindBufferBase(m,y):r.bindBufferRange(m,y,S)}else r.getLastBindBaseLocation(m)!==y&&r.bindBufferBase(m,y);const v=this._activeProgram._uniformBlockData[t].index;u.uniformBlockBindings[a]!==y&&(u.uniformBlockBindings[a]=y,this._renderer.gl.uniformBlockBinding(u.program,v,y))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const t=this._getProgramData(e);this._gl.useProgram(t.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const t=e._key;return this._programDataHash[t]=r4(this._gl,e),this._programDataHash[t]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null}_generateShaderSync(e,t){return JU(e,t)}resetState(){this._activeProgram=null}}DT.extension={type:[Q.WebGLSystem],name:"shader"};const l4={f32:`if (cv !== v) {
813
- cu.value = v;
814
- gl.uniform1f(location, v);
815
- }`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
816
- cv[0] = v[0];
817
- cv[1] = v[1];
818
- gl.uniform2f(location, v[0], v[1]);
819
- }`,"vec3<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
820
- cv[0] = v[0];
821
- cv[1] = v[1];
822
- cv[2] = v[2];
823
- gl.uniform3f(location, v[0], v[1], v[2]);
824
- }`,"vec4<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
825
- cv[0] = v[0];
826
- cv[1] = v[1];
827
- cv[2] = v[2];
828
- cv[3] = v[3];
829
- gl.uniform4f(location, v[0], v[1], v[2], v[3]);
830
- }`,i32:`if (cv !== v) {
831
- cu.value = v;
832
- gl.uniform1i(location, v);
833
- }`,"vec2<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
834
- cv[0] = v[0];
835
- cv[1] = v[1];
836
- gl.uniform2i(location, v[0], v[1]);
837
- }`,"vec3<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
838
- cv[0] = v[0];
839
- cv[1] = v[1];
840
- cv[2] = v[2];
841
- gl.uniform3i(location, v[0], v[1], v[2]);
842
- }`,"vec4<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
843
- cv[0] = v[0];
844
- cv[1] = v[1];
845
- cv[2] = v[2];
846
- cv[3] = v[3];
847
- gl.uniform4i(location, v[0], v[1], v[2], v[3]);
848
- }`,u32:`if (cv !== v) {
849
- cu.value = v;
850
- gl.uniform1ui(location, v);
851
- }`,"vec2<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
852
- cv[0] = v[0];
853
- cv[1] = v[1];
854
- gl.uniform2ui(location, v[0], v[1]);
855
- }`,"vec3<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
856
- cv[0] = v[0];
857
- cv[1] = v[1];
858
- cv[2] = v[2];
859
- gl.uniform3ui(location, v[0], v[1], v[2]);
860
- }`,"vec4<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
861
- cv[0] = v[0];
862
- cv[1] = v[1];
863
- cv[2] = v[2];
864
- cv[3] = v[3];
865
- gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
866
- }`,bool:`if (cv !== v) {
867
- cu.value = v;
868
- gl.uniform1i(location, v);
869
- }`,"vec2<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
870
- cv[0] = v[0];
871
- cv[1] = v[1];
872
- gl.uniform2i(location, v[0], v[1]);
873
- }`,"vec3<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
874
- cv[0] = v[0];
875
- cv[1] = v[1];
876
- cv[2] = v[2];
877
- gl.uniform3i(location, v[0], v[1], v[2]);
878
- }`,"vec4<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
879
- cv[0] = v[0];
880
- cv[1] = v[1];
881
- cv[2] = v[2];
882
- cv[3] = v[3];
883
- gl.uniform4i(location, v[0], v[1], v[2], v[3]);
884
- }`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},o4={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function u4(n,e){const t=[`
885
- var v = null;
886
- var cv = null;
887
- var cu = null;
888
- var t = 0;
889
- var gl = renderer.gl;
890
- var name = null;
891
- `];for(const a in n.uniforms){if(!e[a]){n.uniforms[a]instanceof Yi?n.uniforms[a].ubo?t.push(`
892
- renderer.shader.bindUniformBlock(uv.${a}, "${a}");
893
- `):t.push(`
894
- renderer.shader.updateUniformGroup(uv.${a});
895
- `):n.uniforms[a]instanceof qv&&t.push(`
896
- renderer.shader.bindBufferResource(uv.${a}, "${a}");
897
- `);continue}const r=n.uniformStructures[a];let u=!1;for(let h=0;h<du.length;h++){const f=du[h];if(r.type===f.type&&f.test(r)){t.push(`name = "${a}";`,du[h].uniform),u=!0;break}}if(!u){const f=(r.size===1?l4:o4)[r.type].replace("location",`ud["${a}"].location`);t.push(`
898
- cu = ud["${a}"];
899
- cv = cu.value;
900
- v = uv["${a}"];
901
- ${f};`)}}return new Function("ud","uv","renderer","syncData",t.join(`
902
- `))}class UT{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,t,a){const r=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==r.uniformDirtyGroups[e.uid])&&(r.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(r.uniformData,e.uniforms,this._renderer,a))}_getUniformSyncFunction(e,t){var a;return((a=this._uniformGroupSyncHash[e._signature])==null?void 0:a[t._key])||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){const a=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),r=this._getSignature(e,t._uniformData,"u");return this._cache[r]||(this._cache[r]=this._generateUniformsSync(e,t._uniformData)),a[t._key]=this._cache[r],a[t._key]}_generateUniformsSync(e,t){return u4(e,t)}_getSignature(e,t,a){const r=e.uniforms,u=[`${a}-`];for(const h in r)u.push(h),t[h]&&u.push(t[h].type);return u.join("-")}destroy(){this._renderer=null,this._cache=null}}UT.extension={type:[Q.WebGLSystem],name:"uniformGroup"};function c4(n){const e={};if(e.normal=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e.add=[n.ONE,n.ONE],e.multiply=[n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.screen=[n.ONE,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[n.SRC_ALPHA,n.ONE,n.ONE,n.ONE],e["screen-npm"]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.erase=[n.ZERO,n.ONE_MINUS_SRC_ALPHA],!(n instanceof wt.get().getWebGLRenderingContext()))e.min=[n.ONE,n.ONE,n.ONE,n.ONE,n.MIN,n.MIN],e.max=[n.ONE,n.ONE,n.ONE,n.ONE,n.MAX,n.MAX];else{const a=n.getExtension("EXT_blend_minmax");a&&(e.min=[n.ONE,n.ONE,n.ONE,n.ONE,a.MIN_EXT,a.MIN_EXT],e.max=[n.ONE,n.ONE,n.ONE,n.ONE,a.MAX_EXT,a.MAX_EXT])}return e}const h4=0,f4=1,d4=2,p4=3,m4=4,y4=5,BT=class ix{constructor(e){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[h4]=this.setBlend,this.map[f4]=this.setOffset,this.map[d4]=this.setCullFace,this.map[p4]=this.setDepthTest,this.map[m4]=this.setFrontFace,this.map[y4]=this.setDepthMask,this.checks=[],this.defaultState=Bs.for2d(),e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(e){this.gl=e,this.blendModesMap=c4(e),this.resetState()}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,a=0;for(;t;)t&1&&this.map[a].call(this,!!(e.data&1<<a)),t>>=1,a++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(ix._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(ix._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=!1;const t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]))}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const t=this.blendModesMap[e],a=this.gl;t.length===2?a.blendFunc(t[0],t[1]):a.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,a.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,t){const a=this.checks.indexOf(e);t&&a===-1?this.checks.push(e):!t&&a!==-1&&this.checks.splice(a,1)}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};BT.extension={type:[Q.WebGLSystem],name:"state"};let g4=BT;class _4{constructor(e){this.target=oT.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=Ct.UNSIGNED_BYTE,this.internalFormat=jv.RGBA,this.format=jv.RGBA,this.samplerType=0}}const v4={id:"buffer",upload(n,e,t){e.width===n.width||e.height===n.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,n.width,n.height,e.format,e.type,n.resource):t.texImage2D(e.target,0,e.internalFormat,n.width,n.height,0,e.format,e.type,n.resource),e.width=n.width,e.height=n.height}},b4={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},x4={id:"compressed",upload(n,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let a=n.pixelWidth,r=n.pixelHeight;const u=!!b4[n.format];for(let h=0;h<n.resource.length;h++){const f=n.resource[h];u?t.compressedTexImage2D(t.TEXTURE_2D,h,e.internalFormat,a,r,0,f):t.texImage2D(t.TEXTURE_2D,h,e.internalFormat,a,r,0,e.format,e.type,f),a=Math.max(a>>1,1),r=Math.max(r>>1,1)}}},OT={id:"image",upload(n,e,t,a){const r=e.width,u=e.height,h=n.pixelWidth,f=n.pixelHeight,m=n.resourceWidth,y=n.resourceHeight;m<h||y<f?((r!==h||u!==f)&&t.texImage2D(e.target,0,e.internalFormat,h,f,0,e.format,e.type,null),a===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,m,y,e.format,e.type,n.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,n.resource)):r===h&&u===f?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,n.resource):a===2?t.texImage2D(e.target,0,e.internalFormat,h,f,0,e.format,e.type,n.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,n.resource),e.width=h,e.height=f}},S4={id:"video",upload(n,e,t,a){if(!n.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}OT.upload(n,e,t,a)}},NT={linear:9729,nearest:9728},T4={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},kv={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},E4={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function GT(n,e,t,a,r,u,h,f){const m=u;if(!f||n.addressModeU!=="repeat"||n.addressModeV!=="repeat"||n.addressModeW!=="repeat"){const y=kv[h?"clamp-to-edge":n.addressModeU],v=kv[h?"clamp-to-edge":n.addressModeV],S=kv[h?"clamp-to-edge":n.addressModeW];e[r](m,e.TEXTURE_WRAP_S,y),e[r](m,e.TEXTURE_WRAP_T,v),e.TEXTURE_WRAP_R&&e[r](m,e.TEXTURE_WRAP_R,S)}if((!f||n.magFilter!=="linear")&&e[r](m,e.TEXTURE_MAG_FILTER,NT[n.magFilter]),t){if(!f||n.mipmapFilter!=="linear"){const y=T4[n.minFilter][n.mipmapFilter];e[r](m,e.TEXTURE_MIN_FILTER,y)}}else e[r](m,e.TEXTURE_MIN_FILTER,NT[n.minFilter]);if(a&&n.maxAnisotropy>1){const y=Math.min(n.maxAnisotropy,e.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[r](m,a.TEXTURE_MAX_ANISOTROPY_EXT,y)}n.compare&&e[r](m,e.TEXTURE_COMPARE_FUNC,E4[n.compare])}function C4(n){return{r8unorm:n.RED,r8snorm:n.RED,r8uint:n.RED,r8sint:n.RED,r16uint:n.RED,r16sint:n.RED,r16float:n.RED,rg8unorm:n.RG,rg8snorm:n.RG,rg8uint:n.RG,rg8sint:n.RG,r32uint:n.RED,r32sint:n.RED,r32float:n.RED,rg16uint:n.RG,rg16sint:n.RG,rg16float:n.RG,rgba8unorm:n.RGBA,"rgba8unorm-srgb":n.RGBA,rgba8snorm:n.RGBA,rgba8uint:n.RGBA,rgba8sint:n.RGBA,bgra8unorm:n.RGBA,"bgra8unorm-srgb":n.RGBA,rgb9e5ufloat:n.RGB,rgb10a2unorm:n.RGBA,rg11b10ufloat:n.RGB,rg32uint:n.RG,rg32sint:n.RG,rg32float:n.RG,rgba16uint:n.RGBA,rgba16sint:n.RGBA,rgba16float:n.RGBA,rgba32uint:n.RGBA,rgba32sint:n.RGBA,rgba32float:n.RGBA,stencil8:n.STENCIL_INDEX8,depth16unorm:n.DEPTH_COMPONENT,depth24plus:n.DEPTH_COMPONENT,"depth24plus-stencil8":n.DEPTH_STENCIL,depth32float:n.DEPTH_COMPONENT,"depth32float-stencil8":n.DEPTH_STENCIL}}function R4(n,e){let t={},a=n.RGBA;return n instanceof wt.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":n.SRGB8_ALPHA8,"bgra8unorm-srgb":n.SRGB8_ALPHA8},a=n.RGBA8),{r8unorm:n.R8,r8snorm:n.R8_SNORM,r8uint:n.R8UI,r8sint:n.R8I,r16uint:n.R16UI,r16sint:n.R16I,r16float:n.R16F,rg8unorm:n.RG8,rg8snorm:n.RG8_SNORM,rg8uint:n.RG8UI,rg8sint:n.RG8I,r32uint:n.R32UI,r32sint:n.R32I,r32float:n.R32F,rg16uint:n.RG16UI,rg16sint:n.RG16I,rg16float:n.RG16F,rgba8unorm:n.RGBA,...t,rgba8snorm:n.RGBA8_SNORM,rgba8uint:n.RGBA8UI,rgba8sint:n.RGBA8I,bgra8unorm:a,rgb9e5ufloat:n.RGB9_E5,rgb10a2unorm:n.RGB10_A2,rg11b10ufloat:n.R11F_G11F_B10F,rg32uint:n.RG32UI,rg32sint:n.RG32I,rg32float:n.RG32F,rgba16uint:n.RGBA16UI,rgba16sint:n.RGBA16I,rgba16float:n.RGBA16F,rgba32uint:n.RGBA32UI,rgba32sint:n.RGBA32I,rgba32float:n.RGBA32F,stencil8:n.STENCIL_INDEX8,depth16unorm:n.DEPTH_COMPONENT16,depth24plus:n.DEPTH_COMPONENT24,"depth24plus-stencil8":n.DEPTH24_STENCIL8,depth32float:n.DEPTH_COMPONENT32F,"depth32float-stencil8":n.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function A4(n){return{r8unorm:n.UNSIGNED_BYTE,r8snorm:n.BYTE,r8uint:n.UNSIGNED_BYTE,r8sint:n.BYTE,r16uint:n.UNSIGNED_SHORT,r16sint:n.SHORT,r16float:n.HALF_FLOAT,rg8unorm:n.UNSIGNED_BYTE,rg8snorm:n.BYTE,rg8uint:n.UNSIGNED_BYTE,rg8sint:n.BYTE,r32uint:n.UNSIGNED_INT,r32sint:n.INT,r32float:n.FLOAT,rg16uint:n.UNSIGNED_SHORT,rg16sint:n.SHORT,rg16float:n.HALF_FLOAT,rgba8unorm:n.UNSIGNED_BYTE,"rgba8unorm-srgb":n.UNSIGNED_BYTE,rgba8snorm:n.BYTE,rgba8uint:n.UNSIGNED_BYTE,rgba8sint:n.BYTE,bgra8unorm:n.UNSIGNED_BYTE,"bgra8unorm-srgb":n.UNSIGNED_BYTE,rgb9e5ufloat:n.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:n.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:n.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:n.UNSIGNED_INT,rg32sint:n.INT,rg32float:n.FLOAT,rgba16uint:n.UNSIGNED_SHORT,rgba16sint:n.SHORT,rgba16float:n.HALF_FLOAT,rgba32uint:n.UNSIGNED_INT,rgba32sint:n.INT,rgba32float:n.FLOAT,stencil8:n.UNSIGNED_BYTE,depth16unorm:n.UNSIGNED_SHORT,depth24plus:n.UNSIGNED_INT,"depth24plus-stencil8":n.UNSIGNED_INT_24_8,depth32float:n.FLOAT,"depth32float-stencil8":n.FLOAT_32_UNSIGNED_INT_24_8_REV}}const M4=4;class PT{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:OT,buffer:v4,video:S4,compressed:x4},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=R4(e,this._renderer.context.extensions),this._mapFormatToType=A4(e),this._mapFormatToFormat=C4(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let t=0;t<16;t++)this.bind(He.EMPTY,t)}initSource(e){this.bind(e)}bind(e,t=0){const a=e.source;e?(this.bindSource(a,t),this._useSeparateSamplers&&this._bindSampler(a.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t))}bindSource(e,t=0){const a=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=He.EMPTY.source);const r=this.getGlSource(e);a.bindTexture(r.target,r.texture)}}_bindSampler(e,t=0){const a=this._gl;if(!e){this._boundSamplers[t]=null,a.bindSampler(t,null);return}const r=this._getGlSampler(e);this._boundSamplers[t]!==r&&(this._boundSamplers[t]=r,a.bindSampler(t,r))}unbind(e){const t=e.source,a=this._boundTextures,r=this._gl;for(let u=0;u<a.length;u++)if(a[u]===t){this._activateLocation(u);const h=this.getGlSource(t);r.bindTexture(h.target,null),a[u]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const t=this._gl,a=new _4(t.createTexture());if(a.type=this._mapFormatToType[e.format],a.internalFormat=this._mapFormatToInternalFormat[e.format],a.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const r=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(r))+1}return this._glTextures[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),a}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,t){const a=this._gl,r=this.getGlSource(e);a.bindTexture(a.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=e,GT(e.style,a,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",a.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t)}onSourceUnload(e){const t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture))}onSourceUpdate(e){const t=this._gl,a=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,a.texture),this._boundTextures[this._activeTextureLocation]=e;const r=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==r&&(this._premultiplyAlpha=r,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,a,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,t=!0){t&&this.bindSource(e,0);const a=this.getGlSource(e);this._gl.generateMipmap(a.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const t=this._gl,a=this._gl.createSampler();return this._glSamplers[e._resourceId]=a,GT(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",a,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:t,width:a,height:r}=this.getPixels(e),u=wt.get().createCanvas();u.width=a,u.height=r;const h=u.getContext("2d");if(h){const f=h.createImageData(a,r);f.data.set(t),h.putImageData(f,0,0)}return u}getPixels(e){const t=e.source.resolution,a=e.frame,r=Math.max(Math.round(a.width*t),1),u=Math.max(Math.round(a.height*t),1),h=new Uint8Array(M4*r*u),f=this._renderer,m=f.renderTarget.getRenderTarget(e),y=f.renderTarget.getGpuRenderTarget(m),v=f.gl;return v.bindFramebuffer(v.FRAMEBUFFER,y.resolveTargetFramebuffer),v.readPixels(Math.round(a.x*t),Math.round(a.y*t),r,u,v.RGBA,v.UNSIGNED_BYTE,h),{pixels:new Uint8ClampedArray(h.buffer),width:r,height:u}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._glTextures=null,this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(He.EMPTY.source),this._boundSamplers=Object.create(null);const e=this._gl;this._premultiplyAlpha=!1,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}PT.extension={type:[Q.WebGLSystem],name:"texture"};class wT{contextChange(e){const t=new Yi({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),a=e.limits.maxBatchableTextures,r=yd({name:"graphics",bits:[_v,Sv(a),Vv,_d]});this.shader=new Ia({glProgram:r,resources:{localUniforms:t,batchSamplers:Tv(a)}})}execute(e,t){const a=t.context,r=a.customShader||this.shader,u=e.renderer,h=u.graphicsContext,{batcher:f,instructions:m}=h.getContextRenderData(a);r.groups[0]=u.globalUniforms.bindGroup,u.state.set(e.state),u.shader.bind(r),u.geometry.bind(f.geometry,r.glProgram);const y=m.instructions;for(let v=0;v<m.instructionSize;v++){const S=y[v];if(S.size){for(let T=0;T<S.textures.count;T++)u.texture.bind(S.textures.textures[T],T);u.geometry.draw(S.topology,S.size,S.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}wT.extension={type:[Q.WebGLPipesAdaptor],name:"graphics"};class zT{init(){const e=yd({name:"mesh",bits:[Vv,GU,_d]});this._shader=new Ia({glProgram:e,resources:{uTexture:He.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new ze}}}})}execute(e,t){const a=e.renderer;let r=t._shader;if(r){if(!r.glProgram){rt("Mesh shader has no glProgram",t.shader);return}}else{r=this._shader;const u=t.texture,h=u.source;r.resources.uTexture=h,r.resources.uSampler=h.style,r.resources.textureUniforms.uniforms.uTextureMatrix=u.textureMatrix.mapCoord}r.groups[100]=a.globalUniforms.bindGroup,r.groups[101]=e.localUniformsBindGroup,a.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}zT.extension={type:[Q.WebGLPipesAdaptor],name:"mesh"};class HT{constructor(e){this._renderer=e}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}HT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"customRender"};class My{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(){}}function Iv(n,e){const t=n.instructionSet,a=t.instructions;for(let r=0;r<t.instructionSize;r++){const u=a[r];e[u.renderPipeId].execute(u)}}const D4=new ze;class VT{constructor(e){this._renderer=e}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t)}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e))}destroy(){this._renderer=null}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(Cn.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e)}_addRenderableCacheAsTexture(e,t){const a=e._batchableRenderGroup??(e._batchableRenderGroup=Cn.get(My));a.renderable=e.root,a.transform=e.root.relativeGroupTransform,a.texture=e.texture,a.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.blendMode.pushBlendMode(e,e.root.groupBlendMode,t),this._renderer.renderPipes.batch.addToBatch(a,t),this._renderer.renderPipes.blendMode.popBlendMode(t)}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=!1;const t=D4.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,!0,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295,offset:{x:0,y:0}}),Iv(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),Iv(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}VT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"renderGroup"};function Kv(n,e){e||(e=0);for(let t=e;t<n.length&&n[t];t++)n[t]=null}const U4=new zn,LT=Zf|ay|L_;function jT(n,e=!1){B4(n);const t=n.childrenToUpdate,a=n.updateTick++;for(const r in t){const u=Number(r),h=t[r],f=h.list,m=h.index;for(let y=0;y<m;y++){const v=f[y];v.parentRenderGroup===n&&v.relativeRenderGroupDepth===u&&YT(v,a,0)}Kv(f,m),h.index=0}if(e)for(let r=0;r<n.renderGroupChildren.length;r++)jT(n.renderGroupChildren[r],e)}function B4(n){const e=n.root;let t;if(n.renderGroupParent){const a=n.renderGroupParent;n.worldTransform.appendFrom(e.relativeGroupTransform,a.worldTransform),n.worldColor=ty(e.groupColor,a.worldColor),t=e.groupAlpha*a.worldAlpha}else n.worldTransform.copyFrom(e.localTransform),n.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,n.worldAlpha=t,n.worldColorAlpha=n.worldColor+((t*255|0)<<24)}function YT(n,e,t){if(e===n.updateTick)return;n.updateTick=e,n.didChange=!1;const a=n.localTransform;n.updateLocalTransform();const r=n.parent;if(r&&!r.renderGroup?(t|=n._updateFlags,n.relativeGroupTransform.appendFrom(a,r.relativeGroupTransform),t&LT&&XT(n,r,t)):(t=n._updateFlags,n.relativeGroupTransform.copyFrom(a),t&LT&&XT(n,U4,t)),!n.renderGroup){const u=n.children,h=u.length;for(let y=0;y<h;y++)YT(u[y],e,t);const f=n.parentRenderGroup,m=n;m.renderPipeId&&!f.structureDidChange&&f.updateRenderable(m)}}function XT(n,e,t){if(t&ay){n.groupColor=ty(n.localColor,e.groupColor);let a=n.localAlpha*e.groupAlpha;a=a<0?0:a>1?1:a,n.groupAlpha=a,n.groupColorAlpha=n.groupColor+((a*255|0)<<24)}t&L_&&(n.groupBlendMode=n.localBlendMode==="inherit"?e.groupBlendMode:n.localBlendMode),t&Zf&&(n.globalDisplayStatus=n.localDisplayStatus&e.globalDisplayStatus),n._updateFlags=0}function O4(n,e){const{list:t}=n.childrenRenderablesToUpdate;let a=!1;for(let r=0;r<n.childrenRenderablesToUpdate.index;r++){const u=t[r];if(a=e[u.renderPipeId].validateRenderable(u),a)break}return n.structureDidChange=a,a}const N4=new ze;class qT{constructor(e){this._renderer=e}render({container:e,transform:t}){const a=e.parent,r=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const u=this._renderer,h=N4;t&&(h.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const f=u.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),u.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),Iv(e.renderGroup,f),f.uniformBatch&&f.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(h),e.parent=a,e.renderGroup.renderGroupParent=r}destroy(){this._renderer=null}_updateCachedRenderGroups(e,t){if(e._parentCacheAsTextureRenderGroup=t,e.isCachedAsTexture){if(!e.textureNeedsUpdate)return;t=e}for(let a=e.renderGroupChildren.length-1;a>=0;a--)this._updateCachedRenderGroups(e.renderGroupChildren[a],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){const a=e.root.getLocalBounds();a.ceil();const r=e.texture;e.texture&&hi.returnTexture(e.texture,!0);const u=this._renderer,h=e.textureOptions.resolution||u.view.resolution,f=e.textureOptions.antialias??u.view.antialias,m=e.textureOptions.scaleMode??"linear",y=hi.getOptimalTexture(a.width,a.height,h,f);y._source.style=new Kl({scaleMode:m}),e.texture=y,e._textureBounds||(e._textureBounds=new ci),e._textureBounds.copyFrom(a),r!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=!0)}}else e.texture&&(hi.returnTexture(e.texture,!0),e.texture=null)}_updateRenderGroups(e){const t=this._renderer,a=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=a,e.structureDidChange?Kv(e.childrenRenderablesToUpdate.list,0):O4(e,a),jT(e),e.structureDidChange?(e.structureDidChange=!1,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let r=0;r<e.renderGroupChildren.length;r++)this._updateRenderGroups(e.renderGroupChildren[r])}_updateRenderables(e){const{list:t,index:a}=e.childrenRenderablesToUpdate;for(let r=0;r<a;r++){const u=t[r];u.didViewUpdate&&e.updateRenderable(u)}Kv(t,a)}_buildInstructions(e,t){const a=e.root,r=e.instructionSet;r.reset();const u=t.renderPipes?t:t.batch.renderer,h=u.renderPipes;h.batch.buildStart(r),h.blendMode.buildStart(),h.colorMask.buildStart(),a.sortableChildren&&a.sortChildren(),a.collectRenderablesWithEffects(r,u,null),h.batch.buildEnd(r),h.blendMode.buildEnd(r)}}qT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"renderGroup"};class FT{constructor(e){this._renderer=e}addRenderable(e,t){const a=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,a),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=new My;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}FT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"sprite"};const Qv=class sA{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Zt(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...sA.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){Zt.shared.setValue(e).alpha<1&&this._backgroundColor.alpha===1&&rt("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Qv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"background",priority:0},Qv.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let G4=Qv;const Ed={};Ie.handle(Q.BlendMode,n=>{if(!n.name)throw new Error("BlendMode extension must have a name property");Ed[n.name]=n.ref},n=>{delete Ed[n.name]});class kT{constructor(e){this._blendModeStack=[],this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}pushBlendMode(e,t,a){this._blendModeStack.push(t),this.setBlendMode(e,t,a)}popBlendMode(e){this._blendModeStack.pop();const t=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,t,e)}setBlendMode(e,t,a){var u;const r=e instanceof w_;if(this._activeBlendMode===t){this._isAdvanced&&e&&!r&&((u=this._renderableList)==null||u.push(e));return}this._isAdvanced&&this._endAdvancedBlendMode(a),this._activeBlendMode=t,e&&(this._isAdvanced=!!Ed[t],this._isAdvanced&&this._beginAdvancedBlendMode(e,a))}_beginAdvancedBlendMode(e,t){this._renderer.renderPipes.batch.break(t);const a=this._activeBlendMode;if(!Ed[a]){rt(`Unable to assign BlendMode: '${a}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}const r=this._ensureFilterEffect(a),u=e instanceof w_,h={renderPipeId:"filter",action:"pushFilter",filterEffect:r,renderables:u?null:[e],container:u?e.root:null,canBundle:!1};this._renderableList=h.renderables,t.add(h)}_ensureFilterEffect(e){let t=this._filterHash[e];return t||(t=this._filterHash[e]=new ey,t.filters=[new Ed[e]]),t}_endAdvancedBlendMode(e){this._isAdvanced=!1,this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}kT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"blendMode"};const Zv={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Wv=class rA{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof zn||e instanceof He?{target:e,...t}:{...t,...e}}async image(e){const t=wt.get().createImage();return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,rA.defaultImageOptions);const{format:t,quality:a}=e,r=this.canvas(e);if(r.toBlob!==void 0)return new Promise((u,h)=>{r.toBlob(f=>{if(!f){h(new Error("ICanvas.toBlob failed!"));return}const m=new FileReader;m.onload=()=>u(m.result),m.onerror=h,m.readAsDataURL(f)},Zv[t],a)});if(r.toDataURL!==void 0)return r.toDataURL(Zv[t],a);if(r.convertToBlob!==void 0){const u=await r.convertToBlob({type:Zv[t],quality:a});return new Promise((h,f)=>{const m=new FileReader;m.onload=()=>h(m.result),m.onerror=f,m.readAsDataURL(u)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,a=this._renderer;if(t instanceof He)return a.texture.generateCanvas(t);const r=a.textureGenerator.generateTexture(e),u=a.texture.generateCanvas(r);return r.destroy(!0),u}pixels(e){e=this._normalizeOptions(e);const t=e.target,a=this._renderer,r=t instanceof He?t:a.textureGenerator.generateTexture(e),u=a.texture.getPixels(r);return t instanceof zn&&r.destroy(!0),u}texture(e){return e=this._normalizeOptions(e),e.target instanceof He?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),a=document.createElement("a");a.download=e.filename??"image.png",a.href=t.toDataURL("image/png"),document.body.appendChild(a),a.click(),document.body.removeChild(a)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const a=this.canvas(e),r=a.toDataURL();console.log(`[Pixi Texture] ${a.width}px ${a.height}px`);const u=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${r}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",u)}destroy(){this._renderer=null}};Wv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"extract"},Wv.defaultImageOptions={format:"png",quality:1};let P4=Wv;class Jv extends He{static create(e){return new Jv({source:new wn(e)})}resize(e,t,a){return this.source.resize(e,t,a),this}}const w4=new Pt,z4=new ci,H4=[0,0,0,0];class IT{constructor(e){this._renderer=e}generateTexture(e){var y;e instanceof zn&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,a=e.antialias||this._renderer.view.antialias,r=e.target;let u=e.clearColor;u?u=Array.isArray(u)&&u.length===4?u:Zt.shared.setValue(u).toArray():u=H4;const h=((y=e.frame)==null?void 0:y.copyTo(w4))||P_(r,z4).rectangle;h.width=Math.max(h.width,1/t)|0,h.height=Math.max(h.height,1/t)|0;const f=Jv.create({...e.textureSourceOptions,width:h.width,height:h.height,resolution:t,antialias:a}),m=ze.shared.translate(-h.x,-h.y);return this._renderer.render({container:r,transform:m,target:f,clearColor:u}),f.source.updateMipmaps(),f}destroy(){this._renderer=null}}IT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"textureGenerator"};function Cd(n,e,t){const a=(n>>24&255)/255;e[t++]=(n&255)/255*a,e[t++]=(n>>8&255)/255*a,e[t++]=(n>>16&255)/255*a,e[t++]=a}class KT{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:a,worldColor:r,offset:u}){const h=this._renderer.renderTarget.renderTarget,f=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new ze,worldColor:4294967295,offset:new kt},m={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||h.size,worldTransformMatrix:a||f.worldTransformMatrix,worldColor:r||f.worldColor,offset:u||f.offset,bindGroup:null},y=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(y);const v=y.uniforms;v.uProjectionMatrix=m.projectionMatrix,v.uResolution=m.resolution,v.uWorldTransformMatrix.copyFrom(m.worldTransformMatrix),v.uWorldTransformMatrix.tx-=m.offset.x,v.uWorldTransformMatrix.ty-=m.offset.y,Cd(m.worldColor,v.uWorldColorAlpha,0),y.update();let S;this._renderer.renderPipes.uniformBatch?S=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(y,!1):(S=this._bindGroupPool.pop()||new tl,this._activeBindGroups.push(S),S.setResource(y,0)),m.bindGroup=S,this._currentGlobalUniformData=m}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Us.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new Yi({uProjectionMatrix:{value:new ze,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null}}KT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"globalUniforms"};let V4=1;class QT{constructor(){this._tasks=[],this._offset=0}init(){ka.system.add(this._update,this)}repeat(e,t,a=!0){const r=V4++;let u=0;return a&&(this._offset+=1e3,u=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:u,last:performance.now(),repeat:!0,id:r}),r}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){const e=performance.now();for(let t=0;t<this._tasks.length;t++){const a=this._tasks[t];if(e-a.offset-a.last>=a.duration){const r=e-a.start;a.func(r),a.last=e}}}destroy(){ka.system.remove(this._update,this),this._tasks.length=0}}QT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"scheduler",priority:0};let ZT=!1;function L4(n){if(!ZT){if(wt.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${dy} (${n}) http://www.pixijs.com/
903
-
904
- `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${dy} - ${n} - http://www.pixijs.com/`);ZT=!0}}class $v{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===Us.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),L4(t)}}}$v.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"hello",priority:-2},$v.defaultOptions={hello:!1};function j4(n){let e=!1;for(const a in n)if(n[a]==null){e=!0;break}if(!e)return n;const t=Object.create(null);for(const a in n){const r=n[a];r&&(t[a]=r)}return t}function Y4(n){let e=0;for(let t=0;t<n.length;t++)n[t]==null?e++:n[t-e]=n[t];return n.length-=e,n}let X4=0;const e0=class lA{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e}init(e){e={...lA.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive}get enabled(){return!!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=j4(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)Y4(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t})}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t})}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=X4++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick)}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now)}run(){var u;const e=this._now,t=this._managedRenderables,a=this._renderer.renderPipes;let r=0;for(let h=0;h<t.length;h++){const f=t[h];if(f===null){r++;continue}const m=f.renderGroup??f.parentRenderGroup,y=((u=m==null?void 0:m.instructionSet)==null?void 0:u.gcTick)??-1;if(((m==null?void 0:m.gcTick)??0)===y&&(f._lastUsed=e),e-f._lastUsed>this.maxUnusedTime){if(!f.destroyed){const v=a;m&&(m.structureDidChange=!0),v[f.renderPipeId].destroyRenderable(f)}f._lastUsed=-1,r++,f.off("destroyed",this._removeRenderable,this)}else t[h-r]=f}t.length-=r}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(e){const t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null)}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(const a of e.renderGroupChildren)this._updateInstructionGCTick(a,t)}};e0.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"renderableGC",priority:0},e0.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let q4=e0;const t0=class oA{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...oA.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const a=e[t];a.autoGarbageCollect&&a.resource&&a._touched>-1&&this.count-a._touched>this.maxIdle&&(a._touched=-1,a.unload())}}destroy(){this._renderer=null}};t0.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"textureGC"},t0.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let F4=t0;const n0=class uA{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...uA.defaultOptions,...e},e.view&&(it(Mt,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new Pt(0,0,e.width,e.height),this.canvas=e.canvas||wt.get().createCanvas(),this.antialias=!!e.antialias,this.texture=bT(this.canvas,e),this.renderTarget=new Xv({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(e,t,a){this.texture.source.resize(e,t,a),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(e=!1){(typeof e=="boolean"?e:!!(e!=null&&e.removeView))&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.texture.destroy()}};n0.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"view",priority:0},n0.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};const WT=[G4,KT,$v,n0,qT,F4,IT,P4,XS,q4,QT],JT=[kT,nT,FT,VT,iT,sT,aT,HT],k4=[...WT,vT,XU,HU,dT,rT,PT,TT,cT,UT,DT,fT,g4,pT,hT],I4=[...JT],K4=[eT,zT,wT],$T=[],eE=[],tE=[];Ie.handleByNamedList(Q.WebGLSystem,$T),Ie.handleByNamedList(Q.WebGLPipes,eE),Ie.handleByNamedList(Q.WebGLPipesAdaptor,tE),Ie.add(...k4,...I4,...K4);class Q4 extends cy{constructor(){const e={name:"webgl",type:Us.WEBGL,systems:$T,renderPipes:eE,renderPipeAdaptors:tE};super(e)}}const Z4=Object.freeze(Object.defineProperty({__proto__:null,WebGLRenderer:Q4},Symbol.toStringTag,{value:"Module"}));class nE{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(e){this._gpu=e}getBindGroup(e,t,a){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,a)}_createBindGroup(e,t,a){const r=this._gpu.device,u=t.layout[a],h=[],f=this._renderer;for(const v in u){const S=e.resources[v]??e.resources[u[v]];let T;if(S._resourceType==="uniformGroup"){const E=S;f.ubo.updateUniformGroup(E);const A=E.buffer;T={buffer:f.buffer.getGPUBuffer(A),offset:0,size:A.descriptor.size}}else if(S._resourceType==="buffer"){const E=S;T={buffer:f.buffer.getGPUBuffer(E),offset:0,size:E.descriptor.size}}else if(S._resourceType==="bufferResource"){const E=S;T={buffer:f.buffer.getGPUBuffer(E.buffer),offset:E.offset,size:E.size}}else if(S._resourceType==="textureSampler"){const E=S;T=f.texture.getGpuSampler(E)}else if(S._resourceType==="textureSource"){const E=S;T=f.texture.getGpuSource(E).createView({})}h.push({binding:u[v],resource:T})}const m=f.shader.getProgramData(t).bindGroups[a],y=r.createBindGroup({layout:m,entries:h});return this._hash[e._key]=y,y}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}nE.extension={type:[Q.WebGPUSystem],name:"bindGroup"};class iE{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),a=e.data;return e._updateID&&a&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,a.buffer,0,(e._updateSize||a.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(mv(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}iE.extension={type:[Q.WebGPUSystem],name:"buffer"};class W4{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let a=t+e*4;if(a=Math.ceil(a/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,a>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=a,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let a=0;a<e.length;a++)this.data[t/4+a]=e[a];return t}destroy(){this.data=null}}class aE{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}aE.extension={type:[Q.WebGPUSystem],name:"colorMask"};class i0{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await wt.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),a=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(u=>t.features.has(u)),r=await t.requestDevice({requiredFeatures:a});return{adapter:t,device:r}}destroy(){this.gpu=null,this._renderer=null}}i0.extension={type:[Q.WebGPUSystem],name:"device"},i0.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class sE{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,a,r){const u=this._renderer.pipeline.getPipeline(e,t,a,r);this.setPipeline(u)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,a){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const r=this._renderer.bindGroup.getBindGroup(t,a,e);this.renderPassEncoder.setBindGroup(e,r)}setGeometry(e,t){const a=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const r in a)this._setVertexBuffer(parseInt(r,10),e.attributes[a[r]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const a in e.groups){const r=e.groups[a];t||this._syncBindGroup(r),this.setBindGroup(a,r,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const a=e.resources[t];a.isUniformGroup&&this._renderer.ubo.updateUniformGroup(a)}}draw(e){const{geometry:t,shader:a,state:r,topology:u,size:h,start:f,instanceCount:m,skipSync:y}=e;this.setPipelineFromGeometryProgramAndState(t,a.gpuProgram,r,u),this.setGeometry(t,a.gpuProgram),this._setShaderBindGroups(a,y),t.indexBuffer?this.renderPassEncoder.drawIndexed(h||t.indexBuffer.data.length,m??t.instanceCount,f||0):this.renderPassEncoder.draw(h||t.getSize(),m??t.instanceCount,f||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,a={...this._boundVertexBuffer},r=this._boundIndexBuffer,u={...this._boundBindGroup};this._clearCache();const h=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(h.x,h.y,h.width,h.height,0,1),this.setPipeline(t);for(const f in a)this._setVertexBuffer(f,a[f]);for(const f in u)this.setBindGroup(f,u[f],null);this._setIndexBuffer(r)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}sE.extension={type:[Q.WebGPUSystem],name:"encoder",priority:1};class rE{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}rE.extension={type:[Q.WebGPUSystem],name:"limits"};class lE{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:xn.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const a=this._renderTargetStencilState[this._activeRenderTarget.uid];a.stencilMode=e,a.stencilReference=t;const r=this._renderer;r.pipeline.setStencilMode(e),r.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}lE.extension={type:[Q.WebGPUSystem],name:"stencil"};const Dy={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function J4(n){const e=n.map(a=>({data:a,offset:0,size:0}));let t=0;for(let a=0;a<e.length;a++){const r=e[a];let u=Dy[r.data.type].size;const h=Dy[r.data.type].align;if(!Dy[r.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${r.data.type}`);r.data.size>1&&(u=Math.max(u,h)*r.data.size),t=Math.ceil(t/h)*h,r.size=u,r.offset=t,t+=u}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function $4(n,e){const{size:t,align:a}=Dy[n.data.type],r=(a-t)/4,u=n.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
905
- v = uv.${n.data.name};
906
- ${e!==0?`offset += ${e};`:""}
907
-
908
- arrayOffset = offset;
909
-
910
- t = 0;
911
-
912
- for(var i=0; i < ${n.data.size*(t/4)}; i++)
913
- {
914
- for(var j = 0; j < ${t/4}; j++)
915
- {
916
- ${u}[arrayOffset++] = v[t++];
917
- }
918
- ${r!==0?`arrayOffset += ${r};`:""}
919
- }
920
- `}function eB(n){return gT(n,"uboWgsl",$4,kU)}class oE extends mT{constructor(){super({createUboElements:J4,generateUboSync:eB})}}oE.extension={type:[Q.WebGPUSystem],name:"ubo"};const $l=128;class uE{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new W4({minUniformOffsetAlignment:$l});const t=256/$l;for(let a=0;a<t;a++){let r=xt.UNIFORM|xt.COPY_DST;a===0&&(r|=xt.COPY_SRC),this._buffers.push(new Ea({data:this._batchBuffer.data,usage:r}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const a=e.buffer.data,r=this._batchBuffer.addEmptyGroup(a.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,r/4),this._bindGroupHash[e.uid]=this._getBindGroup(r/$l),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,a=this._batchBuffer.addGroup(t);return this._getBufferResource(a/$l)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/$l)}getArrayBufferResource(e){const a=this._batchBuffer.addGroup(e)/$l;return this._getBufferResource(a)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new qv({buffer:t,offset:(e/2|0)*256,size:$l})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new tl({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const a=this._renderer.gpu.device.createCommandEncoder();for(let r=1;r<this._buffers.length;r++){const u=this._buffers[r];a.copyBufferToBuffer(e.getGPUBuffer(t),$l,e.getGPUBuffer(u),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([a.finish()])}destroy(){var e;for(let t=0;t<this._bindGroups.length;t++)(e=this._bindGroups[t])==null||e.destroy();this._bindGroups=null,this._bindGroupHash=null;for(let t=0;t<this._buffers.length;t++)this._buffers[t].destroy();this._buffers=null;for(let t=0;t<this._bufferResources.length;t++)this._bufferResources[t].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}uE.extension={type:[Q.WebGPUPipes],name:"uniformBatch"};const tB={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function nB(n,e,t,a,r){return n<<24|e<<16|t<<10|a<<5|r}function iB(n,e,t,a){return t<<6|n<<3|a<<1|e}class cE{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(xn.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Jl[e],this._updatePipeHash())}setPipeline(e,t,a,r){const u=this.getPipeline(e,t,a);r.setPipeline(u)}getPipeline(e,t,a,r){e._layoutKey||(lT(e,t.attributeData),this._generateBufferKey(e)),r||(r=e.topology);const u=nB(e._layoutKey,t._layoutKey,a.data,a._blendModeId,tB[r]);return this._pipeCache[u]?this._pipeCache[u]:(this._pipeCache[u]=this._createPipeline(e,t,a,r),this._pipeCache[u])}_createPipeline(e,t,a,r){const u=this._gpu.device,h=this._createVertexBufferLayouts(e,t),f=this._renderer.state.getColorTargets(a);f[0].writeMask=this._stencilMode===xn.RENDERING_MASK_ADD?0:this._colorMask;const m=this._renderer.shader.getProgramData(t).pipeline,y={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:h},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:f},primitive:{topology:r,cullMode:a.cullMode},layout:m,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(y.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:a.depthTest,depthCompare:a.depthTest?"less":"always"}),u.createRenderPipeline(y)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let a=0;const r=Object.keys(e.attributes).sort();for(let h=0;h<r.length;h++){const f=e.attributes[r[h]];t[a++]=f.offset,t[a++]=f.format,t[a++]=f.stride,t[a++]=f.instance}const u=t.join("|");return e._layoutKey=td(u,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){const t=[];let a=0;const r=Object.keys(e.attributeData).sort();for(let h=0;h<r.length;h++){const f=e.attributeData[r[h]];t[a++]=f.location}const u=t.join("|");return e._attributeLocationsKey=td(u,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){const a=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[a])return this._bindingNamesCache[a];const r=this._createVertexBufferLayouts(e,t),u=Object.create(null),h=t.attributeData;for(let f=0;f<r.length;f++){const y=Object.values(r[f].attributes)[0].shaderLocation;for(const v in h)if(h[v].location===y){u[f]=v;break}}return this._bindingNamesCache[a]=u,u}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);const a=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[a])return this._bufferLayoutsCache[a];const r=[];return e.buffers.forEach(u=>{const h={arrayStride:0,stepMode:"vertex",attributes:[]},f=h.attributes;for(const m in t.attributeData){const y=e.attributes[m];(y.divisor??1)!==1&&rt(`Attribute ${m} has an invalid divisor value of '${y.divisor}'. WebGPU only supports a divisor value of 1`),y.buffer===u&&(h.arrayStride=y.stride,h.stepMode=y.instance?"instance":"vertex",f.push({shaderLocation:t.attributeData[m].location,offset:y.offset,format:y.format}))}f.length&&r.push(h)}),this._bufferLayoutsCache[a]=r,r}_updatePipeHash(){const e=iB(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}cE.extension={type:[Q.WebGPUSystem],name:"pipeline"};class aB{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class sB{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,a,r,u){const h=this._renderer,f=this._getGpuColorTexture(e),m=h.texture.getGpuSource(t.source);return h.encoder.commandEncoder.copyTextureToTexture({texture:f,origin:a},{texture:m,origin:u},r),t}startRenderPass(e,t=!0,a,r){const h=this._renderTargetSystem.getGpuRenderTarget(e),f=this.getDescriptor(e,t,a);h.descriptor=f,this._renderer.pipeline.setRenderTarget(h),this._renderer.encoder.beginRenderPass(h),this._renderer.encoder.setViewport(r)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,a){typeof t=="boolean"&&(t=t?Ta.ALL:Ta.NONE);const r=this._renderTargetSystem,u=r.getGpuRenderTarget(e),h=e.colorTextures.map((y,v)=>{const S=u.contexts[v];let T,E;S?T=S.getCurrentTexture().createView():T=this._renderer.texture.getGpuSource(y).createView({mipLevelCount:1}),u.msaaTextures[v]&&(E=T,T=this._renderer.texture.getTextureView(u.msaaTextures[v]));const A=t&Ta.COLOR?"clear":"load";return a??(a=r.defaultClearColor),{view:T,resolveTarget:E,clearValue:a,storeOp:"store",loadOp:A}});let f;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=u.msaa?4:1),e.depthStencilTexture){const y=t&Ta.STENCIL?"clear":"load",v=t&Ta.DEPTH?"clear":"load";f={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:y,depthClearValue:1,depthLoadOp:v,depthStoreOp:"store"}}return{colorAttachments:h,depthStencilAttachment:f}}clear(e,t=!0,a,r){if(!t)return;const{gpu:u,encoder:h}=this._renderer,f=u.device;if(h.commandEncoder===null){const y=f.createCommandEncoder(),v=this.getDescriptor(e,t,a),S=y.beginRenderPass(v);S.setViewport(r.x,r.y,r.width,r.height,0,1),S.end();const T=y.finish();f.queue.submit([T])}else this.startRenderPass(e,t,a,r)}initGpuRenderTarget(e){e.isRoot=!0;const t=new aB;return e.colorTextures.forEach((a,r)=>{if(a instanceof $r){const u=a.resource.getContext("webgpu"),h=a.transparent?"premultiplied":"opaque";try{u.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:h})}catch(f){console.error(f)}t.contexts[r]=u}if(t.msaa=a.source.antialias,a.source.antialias){const u=new wn({width:0,height:0,sampleCount:4});t.msaaTextures[r]=u}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((a,r)=>{const u=t.msaaTextures[r];u==null||u.resize(a.source.width,a.source.height,a.source._resolution)})}}class hE extends ST{constructor(e){super(e),this.adaptor=new sB,this.adaptor.init(e,this)}}hE.extension={type:[Q.WebGPUSystem],name:"renderTarget"};class fE{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,a=e.gpuLayout.map(u=>t.createBindGroupLayout({entries:u})),r={bindGroupLayouts:a};return this._gpuProgramData[e._layoutKey]={bindGroups:a,pipeline:t.createPipelineLayout(r)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}fE.extension={type:[Q.WebGPUSystem],name:"shader"};const sa={};sa.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},sa.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}},sa.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}},sa.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},sa.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},sa.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}},sa["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},sa["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}},sa["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}},sa.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},sa.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}},sa.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};class dE{constructor(){this.defaultState=new Bs,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:sa[e.blendMode]||sa.normal}]}destroy(){this.gpu=null}}dE.extension={type:[Q.WebGPUSystem],name:"state"};const rB={type:"image",upload(n,e,t){const a=n.resource,r=(n.pixelWidth|0)*(n.pixelHeight|0),u=a.byteLength/r;t.device.queue.writeTexture({texture:e},a,{offset:0,rowsPerImage:n.pixelHeight,bytesPerRow:n.pixelHeight*u},{width:n.pixelWidth,height:n.pixelHeight,depthOrArrayLayers:1})}},pE={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},lB={blockBytes:4,blockWidth:1,blockHeight:1},oB={type:"compressed",upload(n,e,t){let a=n.pixelWidth,r=n.pixelHeight;const u=pE[n.format]||lB;for(let h=0;h<n.resource.length;h++){const f=n.resource[h],m=Math.ceil(a/u.blockWidth)*u.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:h},f,{offset:0,bytesPerRow:m},{width:Math.ceil(a/u.blockWidth)*u.blockWidth,height:Math.ceil(r/u.blockHeight)*u.blockHeight,depthOrArrayLayers:1}),a=Math.max(a>>1,1),r=Math.max(r>>1,1)}}},mE={type:"image",upload(n,e,t){const a=n.resource;if(!a)return;if(globalThis.HTMLImageElement&&a instanceof HTMLImageElement){const f=wt.get().createCanvas(a.width,a.height);f.getContext("2d").drawImage(a,0,0,a.width,a.height),n.resource=f,rt("ImageSource: Image element passed, converting to canvas and replacing resource.")}const r=Math.min(e.width,n.resourceWidth||n.pixelWidth),u=Math.min(e.height,n.resourceHeight||n.pixelHeight),h=n.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:a},{texture:e,premultipliedAlpha:h},{width:r,height:u})}},uB={type:"video",upload(n,e,t){mE.upload(n,e,t)}};class cB{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
921
- var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
922
- vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
923
-
924
- struct VertexOutput {
925
- @builtin(position) position : vec4<f32>,
926
- @location(0) texCoord : vec2<f32>,
927
- };
928
-
929
- @vertex
930
- fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
931
- var output : VertexOutput;
932
- output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
933
- output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
934
- return output;
935
- }
936
-
937
- @group(0) @binding(0) var imgSampler : sampler;
938
- @group(0) @binding(1) var img : texture_2d<f32>;
939
-
940
- @fragment
941
- fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
942
- return textureSample(img, imgSampler, texCoord);
943
- }
944
- `})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let a=e;const r=e.depthOrArrayLayers||1,u=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!u){const m={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};a=this.device.createTexture(m)}const h=this.device.createCommandEncoder({}),f=t.getBindGroupLayout(0);for(let m=0;m<r;++m){let y=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:m,arrayLayerCount:1}),v=u?1:0;for(let S=1;S<e.mipLevelCount;++S){const T=a.createView({baseMipLevel:v++,mipLevelCount:1,dimension:"2d",baseArrayLayer:m,arrayLayerCount:1}),E=h.beginRenderPass({colorAttachments:[{view:T,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),A=this.device.createBindGroup({layout:f,entries:[{binding:0,resource:this.sampler},{binding:1,resource:y}]});E.setPipeline(t),E.setBindGroup(0,A),E.draw(3,1,0,0),E.end(),y=T}}if(!u){const m={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r};for(let y=1;y<e.mipLevelCount;++y)h.copyTextureToTexture({texture:a,mipLevel:y-1},{texture:e,mipLevel:y},m),m.width=Math.ceil(m.width/2),m.height=Math.ceil(m.height/2)}return this.device.queue.submit([h.finish()]),u||a.destroy(),e}}class yE{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:mE,buffer:rB,video:uB,compressed:oB},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash")}contextChange(e){this._gpu=e}initSource(e){return this._gpuSources[e.uid]?this._gpuSources[e.uid]:this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){const m=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(m))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const a=pE[e.format]||{blockWidth:1,blockHeight:1},r=Math.ceil(e.pixelWidth/a.blockWidth)*a.blockWidth,u=Math.ceil(e.pixelHeight/a.blockHeight)*a.blockHeight,h={label:e.label,size:{width:r,height:u},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},f=this._gpuSources[e.uid]=this._gpu.device.createTexture(h);return this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),f}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new cB(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source;return this._bindGroupHash[e.uid]=new tl({0:t,1:t.style,2:new Yi({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,a=t.gpu.device.createCommandEncoder(),r=wt.get().createCanvas();r.width=e.source.pixelWidth,r.height=e.source.pixelHeight;const u=r.getContext("webgpu");return u.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:wt.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),a.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:u.getCurrentTexture()},{width:r.width,height:r.height}),t.gpu.device.queue.submit([a.finish()]),r}getPixels(e){const t=this.generateCanvas(e),a=rl.getOptimalCanvasAndContext(t.width,t.height),r=a.context;r.drawImage(t,0,0);const{width:u,height:h}=t,f=r.getImageData(0,0,u,h),m=new Uint8ClampedArray(f.data.buffer);return rl.returnCanvasAndContext(a),{pixels:m,width:u,height:h}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e),a=this._bindGroupHash[t];a==null||a.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}yE.extension={type:[Q.WebGPUSystem],name:"texture"};class gE{constructor(){this._maxTextures=0}contextChange(e){const t=new Yi({uTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;const a=md({name:"graphics",bits:[gv,bv(this._maxTextures),OU,gd]});this.shader=new Ia({gpuProgram:a,resources:{localUniforms:t}})}execute(e,t){const a=t.context,r=a.customShader||this.shader,u=e.renderer,h=u.graphicsContext,{batcher:f,instructions:m}=h.getContextRenderData(a),y=u.encoder;y.setGeometry(f.geometry,r.gpuProgram);const v=u.globalUniforms.bindGroup;y.setBindGroup(0,v,r.gpuProgram);const S=u.renderPipes.uniformBatch.getUniformBindGroup(r.resources.localUniforms,!0);y.setBindGroup(2,S,r.gpuProgram);const T=m.instructions;let E=null;for(let A=0;A<m.instructionSize;A++){const U=T[A];if(U.topology!==E&&(E=U.topology,y.setPipelineFromGeometryProgramAndState(f.geometry,r.gpuProgram,e.state,U.topology)),r.groups[1]=U.bindGroup,!U.gpuBindGroup){const M=U.textures;U.bindGroup=pv(M.textures,M.count,this._maxTextures),U.gpuBindGroup=u.bindGroup.getBindGroup(U.bindGroup,r.gpuProgram,1)}y.setBindGroup(1,U.bindGroup,r.gpuProgram),y.renderPassEncoder.drawIndexed(U.size,1,U.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}gE.extension={type:[Q.WebGPUPipesAdaptor],name:"graphics"};class _E{init(){const e=md({name:"mesh",bits:[Td,NU,gd]});this._shader=new Ia({gpuProgram:e,resources:{uTexture:He.EMPTY._source,uSampler:He.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new ze}}}})}execute(e,t){const a=e.renderer;let r=t._shader;if(!r)r=this._shader,r.groups[2]=a.texture.getTextureBindGroup(t.texture);else if(!r.gpuProgram){rt("Mesh shader has no gpuProgram",t.shader);return}const u=r.gpuProgram;if(u.autoAssignGlobalUniforms&&(r.groups[0]=a.globalUniforms.bindGroup),u.autoAssignLocalUniforms){const h=e.localUniforms;r.groups[1]=a.renderPipes.uniformBatch.getUniformBindGroup(h,!0)}a.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}_E.extension={type:[Q.WebGPUPipesAdaptor],name:"mesh"};const hB=[...WT,oE,sE,i0,rE,iE,yE,hE,fE,dE,cE,aE,lE,nE],fB=[...JT,uE],dB=[tT,_E,gE],vE=[],bE=[],xE=[];Ie.handleByNamedList(Q.WebGPUSystem,vE),Ie.handleByNamedList(Q.WebGPUPipes,bE),Ie.handleByNamedList(Q.WebGPUPipesAdaptor,xE),Ie.add(...hB,...fB,...dB);class pB extends cy{constructor(){const e={name:"webgpu",type:Us.WEBGPU,systems:vE,renderPipes:bE,renderPipeAdaptors:xE};super(e)}}const mB=Object.freeze(Object.defineProperty({__proto__:null,WebGPURenderer:pB},Symbol.toStringTag,{value:"Module"}));class yB{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{Cn.return(e)}),this.batches.length=0}}class SE{constructor(e,t){this.state=Bs.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this)}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const t=e.context,a=!!e._gpuData,r=this.renderer.graphicsContext.updateGpuContext(t);return!!(r.isBatchable||a!==r.isBatchable)}addRenderable(e,t){const a=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),a.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const a=this._getGpuDataForRenderable(e).batches;for(let r=0;r<a.length;r++){const u=a[r];u._batcher.updateElement(u)}}execute(e){if(!e.isRenderable)return;const t=this.renderer,a=e.context;if(!t.graphicsContext.getGpuContext(a).batches.length)return;const u=a.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const h=u.resources.localUniforms.uniforms;h.uTransformMatrix=e.groupTransform,h.uRound=t._roundPixels|e._roundPixels,Cd(e.groupColorAlpha,h.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=this._getGpuDataForRenderable(e),a=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),a.isBatchable&&this._updateBatchesForRenderable(e,t)}_addToBatcher(e,t){const a=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(e).batches;for(let u=0;u<r.length;u++){const h=r[u];a.addToBatch(h,t)}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){const t=new yB;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){const a=e.context,r=this.renderer.graphicsContext.getGpuContext(a),u=this.renderer._roundPixels|e._roundPixels;t.batches=r.batches.map(h=>{const f=Cn.get(Rv);return h.copyTo(f),f.renderable=e,f.roundPixels=u,f})}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}SE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"graphics"};const TE=class cA extends wv{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(it(Mt,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...cA.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,a=[],r=[],u=[],h=this.verticesX-1,f=this.verticesY-1,m=this.width/h,y=this.height/f;for(let S=0;S<t;S++){const T=S%this.verticesX,E=S/this.verticesX|0;a.push(T*m,E*y),r.push(T/h,E/f)}const v=h*f;for(let S=0;S<v;S++){const T=S%h,E=S/h|0,A=E*this.verticesX+T,U=E*this.verticesX+T+1,M=(E+1)*this.verticesX+T,G=(E+1)*this.verticesX+T+1;u.push(A,U,M,U,G,M)}this.buffers[0].data=new Float32Array(a),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint32Array(u),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};TE.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let gB=TE;class a0{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1)}get uvs(){const t=this.geometry.getBuffer("aUV"),a=t.data;let r=a;const u=this.texture.textureMatrix;return u.isSimple||(r=this._transformedUvs,(this._textureMatrixUpdateId!==u._updateID||this._uvUpdateId!==t._updateID)&&((!r||r.length<a.length)&&(r=this._transformedUvs=new Float32Array(a.length)),this._textureMatrixUpdateId=u._updateID,this._uvUpdateId=t._updateID,u.multiplyUvs(a,r))),r}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class EE{destroy(){}}class CE{constructor(e,t){this.localUniforms=new Yi({uTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new tl({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),a=t.batched,r=e.batched;if(t.batched=r,a!==r)return!0;if(r){const u=e._geometry;if(u.indices.length!==t.indexSize||u.positions.length!==t.vertexSize)return t.indexSize=u.indices.length,t.vertexSize=u.positions.length,!0;const h=this._getBatchableMesh(e);return h.texture.uid!==e._texture.uid&&(h._textureMatrixUpdateId=-1),!h._batcher.checkAndUpdateTexture(h,e._texture)}return!1}addRenderable(e,t){var u,h;const a=this.renderer.renderPipes.batch,r=this._getMeshData(e);if(e.didViewUpdate&&(r.indexSize=(u=e._geometry.indices)==null?void 0:u.length,r.vertexSize=(h=e._geometry.positions)==null?void 0:h.length),r.batched){const f=this._getBatchableMesh(e);f.setTexture(e._texture),f.geometry=e._geometry,a.addToBatch(f,t)}else a.break(t),t.add(e)}updateRenderable(e){if(e.batched){const t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t)}}execute(e){if(!e.isRenderable)return;e.state.blendMode=hd(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Cd(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){var t,a;return(t=e._gpuData)[a=this.renderer.uid]||(t[a]=new EE),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,a;return(t=e._gpuData)[a=this.renderer.uid]||(t[a]=new EE),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=new a0;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}CE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"mesh"};class _B{execute(e,t){const a=e.state,r=e.renderer,u=t.shader||e.defaultShader;u.resources.uTexture=t.texture._source,u.resources.uniforms=e.localUniforms;const h=r.gl,f=e.getBuffers(t);r.shader.bind(u),r.state.set(a),r.geometry.bind(f.geometry,u.glProgram);const y=f.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?h.UNSIGNED_SHORT:h.UNSIGNED_INT;h.drawElements(h.TRIANGLES,t.particleChildren.length*6,y,0)}}class vB{execute(e,t){const a=e.renderer,r=t.shader||e.defaultShader;r.groups[0]=a.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,!0),r.groups[1]=a.texture.getTextureBindGroup(t.texture);const u=e.state,h=e.getBuffers(t);a.encoder.draw({geometry:h.geometry,shader:t.shader||e.defaultShader,state:u,size:t.particleChildren.length*6})}}function RE(n,e=null){const t=n*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let a=0,r=0;a<t;a+=6,r+=4)e[a+0]=r+0,e[a+1]=r+1,e[a+2]=r+2,e[a+3]=r+0,e[a+4]=r+2,e[a+5]=r+3;return e}function bB(n){return{dynamicUpdate:AE(n,!0),staticUpdate:AE(n,!1)}}function AE(n,e){const t=[];t.push(`
945
-
946
- var index = 0;
947
-
948
- for (let i = 0; i < ps.length; ++i)
949
- {
950
- const p = ps[i];
951
-
952
- `);let a=0;for(const u in n){const h=n[u];if(e!==h.dynamic)continue;t.push(`offset = index + ${a}`),t.push(h.code);const f=Ql(h.format);a+=f.stride/4}t.push(`
953
- index += stride * 4;
954
- }
955
- `),t.unshift(`
956
- var stride = ${a};
957
- `);const r=t.join(`
958
- `);return new Function("ps","f32v","u32v",r)}class xB{constructor(e){this._size=0,this._generateParticleUpdateCache={};const t=this._size=e.size??1e3,a=e.properties;let r=0,u=0;for(const v in a){const S=a[v],T=Ql(S.format);S.dynamic?u+=T.stride:r+=T.stride}this._dynamicStride=u/4,this._staticStride=r/4,this.staticAttributeBuffer=new Uc(t*4*r),this.dynamicAttributeBuffer=new Uc(t*4*u),this.indexBuffer=RE(t);const h=new pd;let f=0,m=0;this._staticBuffer=new Ea({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:xt.VERTEX|xt.COPY_DST}),this._dynamicBuffer=new Ea({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:xt.VERTEX|xt.COPY_DST});for(const v in a){const S=a[v],T=Ql(S.format);S.dynamic?(h.addAttribute(S.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:f*4,format:S.format}),f+=T.size):(h.addAttribute(S.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:m*4,format:S.format}),m+=T.size)}h.addIndex(this.indexBuffer);const y=this.getParticleUpdate(a);this._dynamicUpload=y.dynamicUpdate,this._staticUpload=y.staticUpdate,this.geometry=h}getParticleUpdate(e){const t=SB(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return bB(e)}update(e,t){e.length>this._size&&(t=!0,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new Uc(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new Uc(this._size*this._dynamicStride*4*4),this.indexBuffer=RE(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const a=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,a.float32View,a.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,!0),t){const r=this.staticAttributeBuffer;this._staticUpload(e,r.float32View,r.uint32View),this._staticBuffer.setDataWithSize(r.float32View,e.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}function SB(n){const e=[];for(const t in n){const a=n[t];e.push(t,a.code,a.dynamic?"d":"s")}return e.join("_")}var TB=`varying vec2 vUV;
959
- varying vec4 vColor;
960
-
961
- uniform sampler2D uTexture;
962
-
963
- void main(void){
964
- vec4 color = texture2D(uTexture, vUV) * vColor;
965
- gl_FragColor = color;
966
- }`,EB=`attribute vec2 aVertex;
967
- attribute vec2 aUV;
968
- attribute vec4 aColor;
969
-
970
- attribute vec2 aPosition;
971
- attribute float aRotation;
972
-
973
- uniform mat3 uTranslationMatrix;
974
- uniform float uRound;
975
- uniform vec2 uResolution;
976
- uniform vec4 uColor;
977
-
978
- varying vec2 vUV;
979
- varying vec4 vColor;
980
-
981
- vec2 roundPixels(vec2 position, vec2 targetSize)
982
- {
983
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
984
- }
985
-
986
- void main(void){
987
- float cosRotation = cos(aRotation);
988
- float sinRotation = sin(aRotation);
989
- float x = aVertex.x * cosRotation - aVertex.y * sinRotation;
990
- float y = aVertex.x * sinRotation + aVertex.y * cosRotation;
991
-
992
- vec2 v = vec2(x, y);
993
- v = v + aPosition;
994
-
995
- gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
996
-
997
- if(uRound == 1.0)
998
- {
999
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
1000
- }
1001
-
1002
- vUV = aUV;
1003
- vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
1004
- }
1005
- `,ME=`
1006
- struct ParticleUniforms {
1007
- uTranslationMatrix:mat3x3<f32>,
1008
- uColor:vec4<f32>,
1009
- uRound:f32,
1010
- uResolution:vec2<f32>,
1011
- };
1012
-
1013
- fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
1014
- {
1015
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
1016
- }
1017
-
1018
- @group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;
1019
-
1020
- @group(1) @binding(0) var uTexture: texture_2d<f32>;
1021
- @group(1) @binding(1) var uSampler : sampler;
1022
-
1023
- struct VSOutput {
1024
- @builtin(position) position: vec4<f32>,
1025
- @location(0) uv : vec2<f32>,
1026
- @location(1) color : vec4<f32>,
1027
- };
1028
- @vertex
1029
- fn mainVertex(
1030
- @location(0) aVertex: vec2<f32>,
1031
- @location(1) aPosition: vec2<f32>,
1032
- @location(2) aUV: vec2<f32>,
1033
- @location(3) aColor: vec4<f32>,
1034
- @location(4) aRotation: f32,
1035
- ) -> VSOutput {
1036
-
1037
- let v = vec2(
1038
- aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),
1039
- aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)
1040
- ) + aPosition;
1041
-
1042
- var position = vec4((uniforms.uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
1043
-
1044
- if(uniforms.uRound == 1.0) {
1045
- position = vec4(roundPixels(position.xy, uniforms.uResolution), position.zw);
1046
- }
1047
-
1048
- let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;
1049
-
1050
- return VSOutput(
1051
- position,
1052
- aUV,
1053
- vColor,
1054
- );
1055
- }
1056
-
1057
- @fragment
1058
- fn mainFragment(
1059
- @location(0) uv: vec2<f32>,
1060
- @location(1) color: vec4<f32>,
1061
- @builtin(position) position: vec4<f32>,
1062
- ) -> @location(0) vec4<f32> {
1063
-
1064
- var sample = textureSample(uTexture, uSampler, uv) * color;
1065
-
1066
- return sample;
1067
- }`;class CB extends Ia{constructor(){const e=lu.from({vertex:EB,fragment:TB}),t=Zl.from({fragment:{source:ME,entryPoint:"mainFragment"},vertex:{source:ME,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:He.WHITE.source,uSampler:new Kl({}),uniforms:{uTranslationMatrix:{value:new ze,type:"mat3x3<f32>"},uColor:{value:new Zt(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}}class DE{constructor(e,t){this.state=Bs.for2d(),this.localUniforms=new Yi({uTranslationMatrix:{value:new ze,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new CB,this.state=Bs.for2d()}validateRenderable(e){return!1}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e)}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new xB({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){const t=e.particleChildren;if(t.length===0)return;const a=this.renderer,r=this.getBuffers(e);e.texture||(e.texture=t[0].texture);const u=this.state;r.update(t,e._childrenDirty),e._childrenDirty=!1,u.blendMode=hd(e.blendMode,e.texture._source);const h=this.localUniforms.uniforms,f=h.uTranslationMatrix;e.worldTransform.copyTo(f),f.prepend(a.globalUniforms.globalUniformData.projectionMatrix),h.uResolution=a.globalUniforms.globalUniformData.resolution,h.uRound=a._roundPixels|e._roundPixels,Cd(e.groupColorAlpha,h.uColor,0),this.adaptor.execute(this,e)}destroy(){this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class UE extends DE{constructor(e){super(e,new _B)}}UE.extension={type:[Q.WebGLPipes],name:"particle"};class BE extends DE{constructor(e){super(e,new vB)}}BE.extension={type:[Q.WebGPUPipes],name:"particle"};const OE=class ax{constructor(e){if(e instanceof He)this.texture=e,z_(this,ax.defaultOptions,{});else{const t={...ax.defaultOptions,...e};z_(this,t,{})}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor()}get tint(){return Qf(this._tint)}set tint(e){this._tint=Zt.shared.setValue(e??16777215).toBgrNumber(),this._updateColor()}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24)}};OE.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};let NE=OE;const GE={vertex:{attributeName:"aVertex",format:"float32x2",code:`
1068
- const texture = p.texture;
1069
- const sx = p.scaleX;
1070
- const sy = p.scaleY;
1071
- const ax = p.anchorX;
1072
- const ay = p.anchorY;
1073
- const trim = texture.trim;
1074
- const orig = texture.orig;
1075
-
1076
- if (trim)
1077
- {
1078
- w1 = trim.x - (ax * orig.width);
1079
- w0 = w1 + trim.width;
1080
-
1081
- h1 = trim.y - (ay * orig.height);
1082
- h0 = h1 + trim.height;
1083
- }
1084
- else
1085
- {
1086
- w1 = -ax * (orig.width);
1087
- w0 = w1 + orig.width;
1088
-
1089
- h1 = -ay * (orig.height);
1090
- h0 = h1 + orig.height;
1091
- }
1092
-
1093
- f32v[offset] = w1 * sx;
1094
- f32v[offset + 1] = h1 * sy;
1095
-
1096
- f32v[offset + stride] = w0 * sx;
1097
- f32v[offset + stride + 1] = h1 * sy;
1098
-
1099
- f32v[offset + (stride * 2)] = w0 * sx;
1100
- f32v[offset + (stride * 2) + 1] = h0 * sy;
1101
-
1102
- f32v[offset + (stride * 3)] = w1 * sx;
1103
- f32v[offset + (stride * 3) + 1] = h0 * sy;
1104
- `,dynamic:!1},position:{attributeName:"aPosition",format:"float32x2",code:`
1105
- var x = p.x;
1106
- var y = p.y;
1107
-
1108
- f32v[offset] = x;
1109
- f32v[offset + 1] = y;
1110
-
1111
- f32v[offset + stride] = x;
1112
- f32v[offset + stride + 1] = y;
1113
-
1114
- f32v[offset + (stride * 2)] = x;
1115
- f32v[offset + (stride * 2) + 1] = y;
1116
-
1117
- f32v[offset + (stride * 3)] = x;
1118
- f32v[offset + (stride * 3) + 1] = y;
1119
- `,dynamic:!0},rotation:{attributeName:"aRotation",format:"float32",code:`
1120
- var rotation = p.rotation;
1121
-
1122
- f32v[offset] = rotation;
1123
- f32v[offset + stride] = rotation;
1124
- f32v[offset + (stride * 2)] = rotation;
1125
- f32v[offset + (stride * 3)] = rotation;
1126
- `,dynamic:!1},uvs:{attributeName:"aUV",format:"float32x2",code:`
1127
- var uvs = p.texture.uvs;
1128
-
1129
- f32v[offset] = uvs.x0;
1130
- f32v[offset + 1] = uvs.y0;
1131
-
1132
- f32v[offset + stride] = uvs.x1;
1133
- f32v[offset + stride + 1] = uvs.y1;
1134
-
1135
- f32v[offset + (stride * 2)] = uvs.x2;
1136
- f32v[offset + (stride * 2) + 1] = uvs.y2;
1137
-
1138
- f32v[offset + (stride * 3)] = uvs.x3;
1139
- f32v[offset + (stride * 3) + 1] = uvs.y3;
1140
- `,dynamic:!1},color:{attributeName:"aColor",format:"unorm8x4",code:`
1141
- const c = p.color;
1142
-
1143
- u32v[offset] = c;
1144
- u32v[offset + stride] = c;
1145
- u32v[offset + (stride * 2)] = c;
1146
- u32v[offset + (stride * 3)] = c;
1147
- `,dynamic:!1}},RB=new ci(0,0,0,0),PE=class sx extends j_{constructor(e={}){e={...sx.defaultOptions,...e,dynamicProperties:{...sx.defaultOptions.dynamicProperties,...e==null?void 0:e.dynamicProperties}};const{dynamicProperties:t,shader:a,roundPixels:r,texture:u,particles:h,...f}=e;super({label:"ParticleContainer",...f}),this.renderPipeId="particle",this.batched=!1,this._childrenDirty=!1,this.texture=u||null,this.shader=a,this._properties={};for(const m in GE){const y=GE[m],v=t[m];this._properties[m]={...y,dynamic:v}}this.allowChildren=!0,this.roundPixels=r??!1,this.particleChildren=h??[]}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=!1;for(let a=0;a<e.length;a++){const r=this.particleChildren.indexOf(e[a]);r>-1&&(this.particleChildren.splice(r,1),t=!0)}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=!0}onViewUpdate(){this._childrenDirty=!0,super.onViewUpdate()}get bounds(){return RB}updateBounds(){}destroy(e=!1){var a,r;if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const u=typeof e=="boolean"?e:e==null?void 0:e.textureSource,h=this.texture??((a=this.particleChildren[0])==null?void 0:a.texture);h&&h.destroy(u)}this.texture=null,(r=this.shader)==null||r.destroy()}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);const a=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),a}removeParticleAt(e){const t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};PE.defaultOptions={dynamicProperties:{vertex:!1,position:!0,rotation:!1,uvs:!1,color:!1},roundPixels:!1};let AB=PE;const wE=class hA extends gB{constructor(e={}){e={...hA.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){var t,a;this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=(t=e.anchor)==null?void 0:t.x,this._anchorY=(a=e.anchor)==null?void 0:a.y,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,{width:t,height:a,_leftWidth:r,_rightWidth:u,_topHeight:h,_bottomHeight:f,_anchorX:m,_anchorY:y}=this,v=r+u,S=t>v?1:t/v,T=h+f,E=a>T?1:a/T,A=Math.min(S,E),U=m*t,M=y*a;e[0]=e[8]=e[16]=e[24]=-U,e[2]=e[10]=e[18]=e[26]=r*A-U,e[4]=e[12]=e[20]=e[28]=t-u*A-U,e[6]=e[14]=e[22]=e[30]=t-U,e[1]=e[3]=e[5]=e[7]=-M,e[9]=e[11]=e[13]=e[15]=h*A-M,e[17]=e[19]=e[21]=e[23]=a-f*A-M,e[25]=e[27]=e[29]=e[31]=a-M,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,a=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=a*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-a*this._bottomHeight,this.getBuffer("aUV").update()}};wE.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let MB=wE;class DB extends a0{constructor(){super(),this.geometry=new MB}destroy(){this.geometry.destroy()}}class zE{constructor(e){this._renderer=e}addRenderable(e,t){const a=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,a),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture)}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=e._gpuData[this._renderer.uid]=new DB,a=t;return a.renderable=e,a.transform=e.groupTransform,a.texture=e._texture,a.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,a),t}destroy(){this._renderer=null}}zE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"nineSliceSprite"};const UB={name:"tiling-bit",vertex:{header:`
1148
- struct TilingUniforms {
1149
- uMapCoord:mat3x3<f32>,
1150
- uClampFrame:vec4<f32>,
1151
- uClampOffset:vec2<f32>,
1152
- uTextureTransform:mat3x3<f32>,
1153
- uSizeAnchor:vec4<f32>
1154
- };
1155
-
1156
- @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
1157
- @group(2) @binding(1) var uTexture: texture_2d<f32>;
1158
- @group(2) @binding(2) var uSampler: sampler;
1159
- `,main:`
1160
- uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
1161
-
1162
- position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
1163
- `},fragment:{header:`
1164
- struct TilingUniforms {
1165
- uMapCoord:mat3x3<f32>,
1166
- uClampFrame:vec4<f32>,
1167
- uClampOffset:vec2<f32>,
1168
- uTextureTransform:mat3x3<f32>,
1169
- uSizeAnchor:vec4<f32>
1170
- };
1171
-
1172
- @group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
1173
- @group(2) @binding(1) var uTexture: texture_2d<f32>;
1174
- @group(2) @binding(2) var uSampler: sampler;
1175
- `,main:`
1176
-
1177
- var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
1178
- coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
1179
- var unclamped = coord;
1180
- coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
1181
-
1182
- var bias = 0.;
1183
-
1184
- if(unclamped.x == coord.x && unclamped.y == coord.y)
1185
- {
1186
- bias = -32.;
1187
- }
1188
-
1189
- outColor = textureSampleBias(uTexture, uSampler, coord, bias);
1190
- `}},BB={name:"tiling-bit",vertex:{header:`
1191
- uniform mat3 uTextureTransform;
1192
- uniform vec4 uSizeAnchor;
1193
-
1194
- `,main:`
1195
- uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
1196
-
1197
- position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
1198
- `},fragment:{header:`
1199
- uniform sampler2D uTexture;
1200
- uniform mat3 uMapCoord;
1201
- uniform vec4 uClampFrame;
1202
- uniform vec2 uClampOffset;
1203
- `,main:`
1204
-
1205
- vec2 coord = vUV + ceil(uClampOffset - vUV);
1206
- coord = (uMapCoord * vec3(coord, 1.0)).xy;
1207
- vec2 unclamped = coord;
1208
- coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
1209
-
1210
- outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
1211
-
1212
- `}};let s0,r0;class OB extends Ia{constructor(){s0??(s0=md({name:"tiling-sprite-shader",bits:[Td,UB,gd]})),r0??(r0=yd({name:"tiling-sprite-shader",bits:[Vv,BB,_d]}));const e=new Yi({uMapCoord:{value:new ze,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new ze,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:r0,gpuProgram:s0,resources:{localUniforms:new Yi({uTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:He.EMPTY.source,uSampler:He.EMPTY.source.style}})}updateUniforms(e,t,a,r,u,h){const f=this.resources.tilingUniforms,m=h.width,y=h.height,v=h.textureMatrix,S=f.uniforms.uTextureTransform;S.set(a.a*m/e,a.b*m/t,a.c*y/e,a.d*y/t,a.tx/e,a.ty/t),S.invert(),f.uniforms.uMapCoord=v.mapCoord,f.uniforms.uClampFrame=v.uClampFrame,f.uniforms.uClampOffset=v.uClampOffset,f.uniforms.uTextureTransform=S,f.uniforms.uSizeAnchor[0]=e,f.uniforms.uSizeAnchor[1]=t,f.uniforms.uSizeAnchor[2]=r,f.uniforms.uSizeAnchor[3]=u,h&&(this.resources.uTexture=h.source,this.resources.uSampler=h.source.style)}}class NB extends wv{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function GB(n,e){const t=n.anchor.x,a=n.anchor.y;e[0]=-t*n.width,e[1]=-a*n.height,e[2]=(1-t)*n.width,e[3]=-a*n.height,e[4]=(1-t)*n.width,e[5]=(1-a)*n.height,e[6]=-t*n.width,e[7]=(1-a)*n.height}function PB(n,e,t,a){let r=0;const u=n.length/e,h=a.a,f=a.b,m=a.c,y=a.d,v=a.tx,S=a.ty;for(t*=e;r<u;){const T=n[t],E=n[t+1];n[t]=h*T+m*E+v,n[t+1]=f*T+y*E+S,t+=e,r++}}function wB(n,e){const t=n.texture,a=t.frame.width,r=t.frame.height;let u=0,h=0;n.applyAnchorToTexture&&(u=n.anchor.x,h=n.anchor.y),e[0]=e[6]=-u,e[2]=e[4]=1-u,e[1]=e[3]=-h,e[5]=e[7]=1-h;const f=ze.shared;f.copyFrom(n._tileTransform.matrix),f.tx/=n.width,f.ty/=n.height,f.invert(),f.scale(n.width/a,n.height/r),PB(e,2,0,f)}const Uy=new NB;class zB{constructor(){this.canBatch=!0,this.geometry=new wv({indices:Uy.indices.slice(),positions:Uy.positions.slice(),uvs:Uy.uvs.slice()})}destroy(){var e;this.geometry.destroy(),(e=this.shader)==null||e.destroy()}}class HE{constructor(e){this._state=Bs.default2d,this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),a=t.canBatch;this._updateCanBatch(e);const r=t.canBatch;if(r&&r===a){const{batchableMesh:u}=t;return!u._batcher.checkAndUpdateTexture(u,e.texture)}return a!==r}addRenderable(e,t){const a=this._renderer.renderPipes.batch;this._updateCanBatch(e);const r=this._getTilingSpriteData(e),{geometry:u,canBatch:h}=r;if(h){r.batchableMesh||(r.batchableMesh=new a0);const f=r.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),f.geometry=u,f.renderable=e,f.transform=e.groupTransform,f.setTexture(e._texture)),f.roundPixels=this._renderer._roundPixels|e._roundPixels,a.addToBatch(f,t)}else a.break(t),r.shader||(r.shader=new OB),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;const a=t.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=this._renderer._roundPixels|e._roundPixels,Cd(e.groupColorAlpha,a.uColor,0),this._state.blendMode=hd(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Uy,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:a}=t;if(a){const{batchableMesh:r}=t;e.didViewUpdate&&this._updateBatchableMesh(e),r._batcher.updateElement(r)}else if(e.didViewUpdate){const{shader:r}=t;r.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new zB;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:a}=t,r=e.texture.source.style;r.addressMode!=="repeat"&&(r.addressMode="repeat",r.update()),wB(e,a.uvs),GB(e,a.positions)}destroy(){this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),a=e.texture;let r=!0;return this._renderer.type===Us.WEBGL&&(r=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=a.textureMatrix.isSimple&&(r||a.source.isPowerOfTwo),t.canBatch}}HE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"tilingSprite"};const HB={name:"local-uniform-msdf-bit",vertex:{header:`
1213
- struct LocalUniforms {
1214
- uColor:vec4<f32>,
1215
- uTransformMatrix:mat3x3<f32>,
1216
- uDistance: f32,
1217
- uRound:f32,
1218
- }
1219
-
1220
- @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
1221
- `,main:`
1222
- vColor *= localUniforms.uColor;
1223
- modelMatrix *= localUniforms.uTransformMatrix;
1224
- `,end:`
1225
- if(localUniforms.uRound == 1)
1226
- {
1227
- vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
1228
- }
1229
- `},fragment:{header:`
1230
- struct LocalUniforms {
1231
- uColor:vec4<f32>,
1232
- uTransformMatrix:mat3x3<f32>,
1233
- uDistance: f32
1234
- }
1235
-
1236
- @group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
1237
- `,main:`
1238
- outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
1239
- `}},VB={name:"local-uniform-msdf-bit",vertex:{header:`
1240
- uniform mat3 uTransformMatrix;
1241
- uniform vec4 uColor;
1242
- uniform float uRound;
1243
- `,main:`
1244
- vColor *= uColor;
1245
- modelMatrix *= uTransformMatrix;
1246
- `,end:`
1247
- if(uRound == 1.)
1248
- {
1249
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
1250
- }
1251
- `},fragment:{header:`
1252
- uniform float uDistance;
1253
- `,main:`
1254
- outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
1255
- `}},LB={name:"msdf-bit",fragment:{header:`
1256
- fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
1257
-
1258
- // MSDF
1259
- var median = msdfColor.r + msdfColor.g + msdfColor.b -
1260
- min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
1261
- max(msdfColor.r, max(msdfColor.g, msdfColor.b));
1262
-
1263
- // SDF
1264
- median = min(median, msdfColor.a);
1265
-
1266
- var screenPxDistance = distance * (median - 0.5);
1267
- var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
1268
- if (median < 0.01) {
1269
- alpha = 0.0;
1270
- } else if (median > 0.99) {
1271
- alpha = 1.0;
1272
- }
1273
-
1274
- // Gamma correction for coverage-like alpha
1275
- var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
1276
- var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
1277
- var coverage: f32 = pow(shapeColor.a * alpha, gamma);
1278
-
1279
- return coverage;
1280
-
1281
- }
1282
- `}},jB={name:"msdf-bit",fragment:{header:`
1283
- float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
1284
-
1285
- // MSDF
1286
- float median = msdfColor.r + msdfColor.g + msdfColor.b -
1287
- min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
1288
- max(msdfColor.r, max(msdfColor.g, msdfColor.b));
1289
-
1290
- // SDF
1291
- median = min(median, msdfColor.a);
1292
-
1293
- float screenPxDistance = distance * (median - 0.5);
1294
- float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
1295
-
1296
- if (median < 0.01) {
1297
- alpha = 0.0;
1298
- } else if (median > 0.99) {
1299
- alpha = 1.0;
1300
- }
1301
-
1302
- // Gamma correction for coverage-like alpha
1303
- float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
1304
- float gamma = mix(1.0, 1.0 / 2.2, luma);
1305
- float coverage = pow(shapeColor.a * alpha, gamma);
1306
-
1307
- return coverage;
1308
- }
1309
- `}};let l0,o0;class YB extends Ia{constructor(e){const t=new Yi({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new ze,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});l0??(l0=md({name:"sdf-shader",bits:[gv,bv(e),HB,LB,gd]})),o0??(o0=yd({name:"sdf-shader",bits:[_v,Sv(e),VB,jB,_d]})),super({glProgram:o0,gpuProgram:l0,resources:{localUniforms:t,batchSamplers:Tv(e)}})}}class XB extends hu{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}}class VE{constructor(e){this._renderer=e}validateRenderable(e){const t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const a=this._getGpuBitmapText(e);LE(e,a),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,a)),this._renderer.renderPipes.graphics.addRenderable(a,t),a.context.customShader&&this._updateDistanceField(e)}updateRenderable(e){const t=this._getGpuBitmapText(e);LE(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:a}=t,r=hU.getFont(e.text,e._style);a.clear(),r.distanceField.type!=="none"&&(a.customShader||(a.customShader=new YB(this._renderer.limits.maxBatchableTextures)));const u=dr.graphemeSegmenter(e.text),h=e._style;let f=r.baseLineOffset;const m=H1(u,h,r,!0),y=h.padding,v=m.scale;let S=m.width,T=m.height+m.offsetY;h._stroke&&(S+=h._stroke.width/v,T+=h._stroke.width/v),a.translate(-e._anchor._x*S-y,-e._anchor._y*T-y).scale(v,v);const E=r.applyFillAsTint?h._fill.color:16777215;let A=r.fontMetrics.fontSize,U=r.lineHeight;h.lineHeight&&(A=h.fontSize/v,U=h.lineHeight/v);let M=(U-A)/2;M-r.baseLineOffset<0&&(M=0);for(let G=0;G<m.lines.length;G++){const P=m.lines[G];for(let w=0;w<P.charPositions.length;w++){const z=P.chars[w],ne=r.chars[z];if(ne!=null&&ne.texture){const ie=ne.texture;a.texture(ie,E||"black",Math.round(P.charPositions[w]+ne.xOffset),Math.round(f+ne.yOffset+M),ie.orig.width,ie.orig.height)}}f+=U}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new XB;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,a=e._style.fontFamily,r=Di.get(`${a}-bitmap`),{a:u,b:h,c:f,d:m}=e.groupTransform,y=Math.sqrt(u*u+h*h),v=Math.sqrt(f*f+m*m),S=(Math.abs(y)+Math.abs(v))/2,T=r.baseRenderedFontSize/e._style.fontSize,E=S*r.distanceField.range*(1/T);t.customShader.resources.localUniforms.uniforms.uDistance=E}destroy(){this._renderer=null}}VE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"bitmapText"};function LE(n,e){e.groupTransform=n.groupTransform,e.groupColorAlpha=n.groupColorAlpha,e.groupColor=n.groupColor,e.groupBlendMode=n.groupBlendMode,e.globalDisplayStatus=n.globalDisplayStatus,e.groupTransform=n.groupTransform,e.localDisplayStatus=n.localDisplayStatus,e.groupAlpha=n.groupAlpha,e._roundPixels=n._roundPixels}class qB extends My{constructor(e){super(),this.generatingTexture=!1,this.currentKey="--",this._renderer=e,e.runners.resolutionChange.add(this)}resolutionChange(){const e=this.renderable;e._autoResolution&&e.onViewUpdate()}destroy(){const{htmlText:e}=this._renderer;e.getReferenceCount(this.currentKey)===null?e.returnTexturePromise(this.texturePromise):e.decreaseReferenceCount(this.currentKey),this._renderer.runners.resolutionChange.remove(this),this.texturePromise=null,this._renderer=null}}function u0(n,e){const{texture:t,bounds:a}=n,r=e._style._getFinalPadding();Rx(a,e._anchor,t);const u=e._anchor._x*r*2,h=e._anchor._y*r*2;a.minX-=r-u,a.minY-=r-h,a.maxX-=r-u,a.maxY-=r-h}class jE{constructor(e){this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),a=e.styleKey;return t.currentKey!==a}addRenderable(e,t){const a=this._getGpuText(e);if(e._didTextUpdate){const r=e._autoResolution?this._renderer.resolution:e.resolution;(a.currentKey!==e.styleKey||e.resolution!==r)&&this._updateGpuText(e).catch(u=>{console.error(u)}),e._didTextUpdate=!1,u0(a,e)}this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;const a=t.texturePromise;t.texturePromise=null,t.generatingTexture=!0,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let r=this._renderer.htmlText.getTexturePromise(e);a&&(r=r.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(t.currentKey),this._renderer.htmlText.returnTexturePromise(a)})),t.texturePromise=r,t.currentKey=e.styleKey,t.texture=await r;const u=e.renderGroup||e.parentRenderGroup;u&&(u.structureDidChange=!0),t.generatingTexture=!1,u0(t,e)}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new qB(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=He.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}jE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"htmlText"};function FB(){const{userAgent:n}=wt.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(n)}const kB=new ci;function YE(n,e,t,a){const r=kB;r.minX=0,r.minY=0,r.maxX=n.width/a|0,r.maxY=n.height/a|0;const u=hi.getOptimalTexture(r.width,r.height,a,!1);return u.source.uploadMethodId="image",u.source.resource=n,u.source.alphaMode="premultiply-alpha-on-upload",u.frame.width=e/a,u.frame.height=t/a,u.source.emit("update",u.source),u.updateUvs(),u}function IB(n,e){const t=e.fontFamily,a=[],r={},u=/font-family:([^;"\s]+)/g,h=n.match(u);function f(m){r[m]||(a.push(m),r[m]=!0)}if(Array.isArray(t))for(let m=0;m<t.length;m++)f(t[m]);else f(t);h&&h.forEach(m=>{const y=m.split(":")[1].trim();f(y)});for(const m in e.tagStyles){const y=e.tagStyles[m].fontFamily;f(y)}return a}async function KB(n){const t=await(await wt.get().fetch(n)).blob(),a=new FileReader;return await new Promise((u,h)=>{a.onloadend=()=>u(a.result),a.onerror=h,a.readAsDataURL(t)})}async function QB(n,e){const t=await KB(e);return`@font-face {
1310
- font-family: "${n.fontFamily}";
1311
- font-weight: ${n.fontWeight};
1312
- font-style: ${n.fontStyle};
1313
- src: url('${t}');
1314
- }`}const c0=new Map;async function ZB(n){const e=n.filter(t=>Di.has(`${t}-and-url`)).map(t=>{if(!c0.has(t)){const{entries:a}=Di.get(`${t}-and-url`),r=[];a.forEach(u=>{const h=u.url,m=u.faces.map(y=>({weight:y.weight,style:y.style}));r.push(...m.map(y=>QB({fontWeight:y.weight,fontStyle:y.style,fontFamily:t},h)))}),c0.set(t,Promise.all(r).then(u=>u.join(`
1315
- `)))}return c0.get(t)});return(await Promise.all(e)).join(`
1316
- `)}function WB(n,e,t,a,r){const{domElement:u,styleElement:h,svgRoot:f}=r;u.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${n}</div>`,u.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),h.textContent=a;const{width:m,height:y}=r.image;return f.setAttribute("width",m.toString()),f.setAttribute("height",y.toString()),new XMLSerializer().serializeToString(f)}function JB(n,e){const t=rl.getOptimalCanvasAndContext(n.width,n.height,e),{context:a}=t;return a.clearRect(0,0,n.width,n.height),a.drawImage(n,0,0),t}function $B(n,e,t){return new Promise(async a=>{t&&await new Promise(r=>setTimeout(r,100)),n.onload=()=>{a()},n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,n.crossOrigin="anonymous"})}class XE{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===Us.WEBGPU}getTexture(e){return this.getTexturePromise(e)}getManagedTexture(e){const t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].promise;const a=this._buildTexturePromise(e).then(r=>(this._activeTextures[t].texture=r,r));return this._activeTextures[t]={texture:null,promise:a,usageCount:1},a}getReferenceCount(e){var t;return((t=this._activeTextures[e])==null?void 0:t.usageCount)??null}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}decreaseReferenceCount(e){const t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t.texture):t.promise.then(a=>{t.texture=a,this._cleanUp(t.texture)}).catch(()=>{rt("HTMLTextSystem: Failed to clean texture")}),this._activeTextures[e]=null))}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){const{text:t,style:a,resolution:r,textureStyle:u}=e,h=Cn.get(J1),f=IB(t,a),m=await ZB(f),y=BU(t,a,m,h),v=Math.ceil(Math.ceil(Math.max(1,y.width)+a.padding*2)*r),S=Math.ceil(Math.ceil(Math.max(1,y.height)+a.padding*2)*r),T=h.image,E=2;T.width=(v|0)+E,T.height=(S|0)+E;const A=WB(t,a,r,m,h);await $B(T,A,FB()&&f.length>0);const U=T;let M;this._createCanvas&&(M=JB(T,r));const G=YE(M?M.canvas:U,T.width-E,T.height-E,r);return u&&(G.source.style=u),this._createCanvas&&(this._renderer.texture.initSource(G.source),rl.returnCanvasAndContext(M)),Cn.return(h),G}returnTexturePromise(e){e.then(t=>{this._cleanUp(t)}).catch(()=>{rt("HTMLTextSystem: Failed to clean texture")})}_cleanUp(e){hi.returnTexture(e,!0),e.source.resource=null,e.source.uploadMethodId="unknown"}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexturePromise(this._activeTextures[e].promise);this._activeTextures=null}}XE.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"htmlText"};class eO extends My{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this)}resolutionChange(){const e=this.renderable;e._autoResolution&&e.onViewUpdate()}destroy(){const{canvasText:e}=this._renderer;e.getReferenceCount(this.currentKey)>0?e.decreaseReferenceCount(this.currentKey):this.texture&&e.returnTexture(this.texture),this._renderer.runners.resolutionChange.remove(this),this._renderer=null}}class qE{constructor(e){this._renderer=e}validateRenderable(e){const t=this._getGpuText(e),a=e.styleKey;return t.currentKey!==a?!0:e._didTextUpdate}addRenderable(e,t){const a=this._getGpuText(e);if(e._didTextUpdate){const r=e._autoResolution?this._renderer.resolution:e.resolution;(a.currentKey!==e.styleKey||e.resolution!==r)&&this._updateGpuText(e),e._didTextUpdate=!1,u0(a,e)}this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}_updateGpuText(e){const t=this._getGpuText(e);t.texture&&this._renderer.canvasText.decreaseReferenceCount(t.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e.styleKey}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new eO(this._renderer);return t.currentKey="--",t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}qE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"text"};class FE{constructor(e){this._activeTextures={},this._renderer=e}getTexture(e,t,a,r){typeof e=="string"&&(it("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:a,resolution:t}),e.style instanceof sl||(e.style=new sl(e.style)),e.textureStyle instanceof Kl||(e.textureStyle=new Kl(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:u,style:h,textureStyle:f}=e,m=e.resolution??this._renderer.resolution,{frame:y,canvasAndContext:v}=zv.getCanvasAndContext({text:u,style:h,resolution:m}),S=YE(v.canvas,y.width,y.height,m);if(f&&(S.source.style=f),h.trim&&(y.pad(h.padding),S.frame.copyFrom(y),S.frame.scale(1/m),S.updateUvs()),h.filters){const T=this._applyFilters(S,h.filters);return this.returnTexture(S),zv.returnCanvasAndContext(v),T}return this._renderer.texture.initSource(S._source),zv.returnCanvasAndContext(v),S}returnTexture(e){const t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",hi.returnTexture(e,!0)}renderTextToCanvas(){it("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;const a=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle});return this._activeTextures[t]={texture:a,usageCount:1},a}decreaseReferenceCount(e){const t=this._activeTextures[e];t.usageCount--,t.usageCount===0&&(this.returnTexture(t.texture),this._activeTextures[e]=null)}getReferenceCount(e){var t;return((t=this._activeTextures[e])==null?void 0:t.usageCount)??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}_applyFilters(e,t){const a=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(a,!1),r}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null}}FE.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"canvasText"},Ie.add(CA,RA);var By={exports:{}},ul={};/**
1317
- * @license React
1318
- * react-reconciler-constants.production.js
1319
- *
1320
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1321
- *
1322
- * This source code is licensed under the MIT license found in the
1323
- * LICENSE file in the root directory of this source tree.
1324
- */var kE;function tO(){return kE||(kE=1,ul.ConcurrentRoot=1,ul.ContinuousEventPriority=8,ul.DefaultEventPriority=32,ul.DiscreteEventPriority=2,ul.IdleEventPriority=268435456,ul.LegacyRoot=0,ul.NoEventPriority=0),ul}var cl={};/**
1325
- * @license React
1326
- * react-reconciler-constants.development.js
1327
- *
1328
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1329
- *
1330
- * This source code is licensed under the MIT license found in the
1331
- * LICENSE file in the root directory of this source tree.
1332
- */var IE;function nO(){return IE||(IE=1,process.env.NODE_ENV!=="production"&&(cl.ConcurrentRoot=1,cl.ContinuousEventPriority=8,cl.DefaultEventPriority=32,cl.DiscreteEventPriority=2,cl.IdleEventPriority=268435456,cl.LegacyRoot=0,cl.NoEventPriority=0)),cl}var KE;function iO(){return KE||(KE=1,process.env.NODE_ENV==="production"?By.exports=tO():By.exports=nO()),By.exports}var Pc=iO();const h0=Ve.createContext({}),aO=h0.Provider;h0.Consumer;function QE(n,e){const t=Object.getPrototypeOf(n),a=Object.getOwnPropertyDescriptor(t,e);return!(typeof a>"u"||a.writable||a.set)}const eo={currentUpdatePriority:Pc.DefaultEventPriority,unmountQueue:new Set};function ZE(n,...e){}function WE(n,e={}){const t=n;return t.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},e),t}var sO="0.0.0-development",rO={version:sO};function lO(){}function JE(n,e,t){e instanceof nl&&(e.__pixireact.parent=n,typeof t=="number"?n.__pixireact.filters.splice(t,0,e):n.__pixireact.filters.push(e),n.filters=n.__pixireact.filters)}function f0(n,e){e&&(e instanceof zn?n.addChild(e):e instanceof nl&&JE(n,e))}function oO(){}function uO(){return!1}const d0=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),Oy=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function $E(n){return Array.isArray(n)}function e2(n,e,t={arrays:"reference",objects:"reference",strict:!0}){const{arrays:a,objects:r,strict:u}=t;if(typeof n!=typeof e||!!n!=!!e)return!1;if(dO(n)||hO(n))return n===e;const h=fO(n);if(h&&r==="reference")return n===e;const f=$E(n);if(f&&a==="reference")return n===e;if((f||h)&&n===e)return!0;let m;for(m in n)if(!(m in e))return!1;let y=n;if(u&&(y=e),h&&a==="shallow"&&r==="shallow"){for(m in y)if(!e2(n[m],e[m],{strict:u,objects:"reference"}))return!1}else for(m in y)if(n[m]!==e[m])return!1;if(t2(m)){if(f&&n.length===0&&e.length===0||h&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}function cO(n){return n===null}function hO(n){return typeof n=="number"}function fO(n){return!(n!==Object(n)||$E(n)||typeof n=="function")}function dO(n){return typeof n=="string"}function t2(n){return n===void 0}const pO=Object.freeze(["children","key","ref"]);function mO(n,e=[]){const t={};return Object.entries(n).reduce((a,[r,u])=>(e.includes(r)||(a[r]=u),a),t)}function p0(n,e=[]){return mO(n,pO.concat(e))}const yO="__default";function n2(n,e={},t=!1){const a=p0(n),r=p0(e),u=Object.entries(a),h=[];if(t){const f=Object.keys(r);let m=0;for(;m<f.length;){const y=f[m];!(y in a)&&u.unshift([y,`${yO}remove`]),m+=1}}return u.forEach(([f,m])=>{if(e2(m,r[f]))return;if(f in Oy){h.push([f,m,!0,[]]);return}let y=[];f.includes("-")&&(y=f.split("-")),h.push([f,m,!1,y]);for(const v in a){const S=a[v];v.startsWith(`${f}-`)&&h.push([v,S,!1,v.split("-")])}}),{changes:h}}function gO(n){const e=n;return!(!e||!e.changes)}const _O="__default",i2=new Map,a2={};function s2(n,e){if(n){const t=n[e];if(!t2(t)&&!cO(t))return t}return n}function r2(n,e){const{__pixireact:t={},...a}=n;let r;gO(e)?r=e:r=n2(e,a);const{changes:u}=r;let h=0;for(;h<u.length;){const f=u[h];let m=!1,y=f[0],v=f[1];const S=f[2],T=f[3];let E=n,A=E[y];if(y==="draw"&&typeof v=="function"&&(n instanceof hu?v(n):(m=!0,ZE("warn",`The \`draw\` prop was used on a \`${t.type}\` component, but it's only valid on \`graphics\` components.`))),y in d0){const U=y;m=!0,a2[y]||(a2[y]=!0,ZE("warn",`Event names must be pascal case; instead of \`${y}\`, you probably want \`${d0[U]}\`.`))}if(!m){if(T.length&&(A=T.reduce(s2,E),!(A&&A.set))){const[U,...M]=T.reverse();E=M.reverse().reduce(s2,E),y=U}if(v===`${_O}remove`)if(E instanceof zn){let U=i2.get(E.constructor);U||(U=E.constructor,U=new U,i2.set(E.constructor,U)),v=U[y]}else v=0;if(S&&t){const M=Oy[y];v?E[M]=v:delete E[M]}else QE(E,y)||(E[y]=v)}h+=1}return n}function vO(n,e,t,a){const{children:r,...u}=a,{children:h,...f}=t,m=n2(u,f,!0);return m.changes.length?m:null}function bO(n,e,t,a){const r=vO(n,e,t,a);r&&r2(n,r)}const xO=Object.freeze([...Object.keys(d0),"draw"]),m0={};function SO(n){const e=n.charAt(0),t=n.substring(1);return`${e.toUpperCase()}${t}`}function TO(n,e){return e.toLowerCase()}function EO(n){let e=n;return n.startsWith("pixi")&&(e=n.replace(/^pixi([A-Z])/,TO)),e}function CO(n,e,t){const a=EO(n),r=SO(a);if(!(r in m0))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const u=m0[r],h=p0(e,xO);Object.entries(e).forEach(([m,y])=>{if(m in Oy){const v=Oy[m];h[v]=y}});const f=WE(new u(h),{root:t,type:a});return r2(f,e),f}var Ny={exports:{}},y0={exports:{}},Gy={exports:{}},g0={};/**
1333
- * @license React
1334
- * scheduler.production.js
1335
- *
1336
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1337
- *
1338
- * This source code is licensed under the MIT license found in the
1339
- * LICENSE file in the root directory of this source tree.
1340
- */var l2;function RO(){return l2||(l2=1,(function(n){function e(V,W){var de=V.length;V.push(W);e:for(;0<de;){var oe=de-1>>>1,Re=V[oe];if(0<r(Re,W))V[oe]=W,V[de]=Re,de=oe;else break e}}function t(V){return V.length===0?null:V[0]}function a(V){if(V.length===0)return null;var W=V[0],de=V.pop();if(de!==W){V[0]=de;e:for(var oe=0,Re=V.length,O=Re>>>1;oe<O;){var k=2*(oe+1)-1,_e=V[k],ye=k+1,Ue=V[ye];if(0>r(_e,de))ye<Re&&0>r(Ue,_e)?(V[oe]=Ue,V[ye]=de,oe=ye):(V[oe]=_e,V[k]=de,oe=k);else if(ye<Re&&0>r(Ue,de))V[oe]=Ue,V[ye]=de,oe=ye;else break e}}return W}function r(V,W){var de=V.sortIndex-W.sortIndex;return de!==0?de:V.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var h=Date,f=h.now();n.unstable_now=function(){return h.now()-f}}var m=[],y=[],v=1,S=null,T=3,E=!1,A=!1,U=!1,M=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function w(V){for(var W=t(y);W!==null;){if(W.callback===null)a(y);else if(W.startTime<=V)a(y),W.sortIndex=W.expirationTime,e(m,W);else break;W=t(y)}}function z(V){if(U=!1,w(V),!A)if(t(m)!==null)A=!0,je();else{var W=t(y);W!==null&&Rt(z,W.startTime-V)}}var ne=!1,ie=-1,Z=5,Te=-1;function me(){return!(n.unstable_now()-Te<Z)}function fe(){if(ne){var V=n.unstable_now();Te=V;var W=!0;try{e:{A=!1,U&&(U=!1,G(ie),ie=-1),E=!0;var de=T;try{t:{for(w(V),S=t(m);S!==null&&!(S.expirationTime>V&&me());){var oe=S.callback;if(typeof oe=="function"){S.callback=null,T=S.priorityLevel;var Re=oe(S.expirationTime<=V);if(V=n.unstable_now(),typeof Re=="function"){S.callback=Re,w(V),W=!0;break t}S===t(m)&&a(m),w(V)}else a(m);S=t(m)}if(S!==null)W=!0;else{var O=t(y);O!==null&&Rt(z,O.startTime-V),W=!1}}break e}finally{S=null,T=de,E=!1}W=void 0}}finally{W?le():ne=!1}}}var le;if(typeof P=="function")le=function(){P(fe)};else if(typeof MessageChannel<"u"){var Ce=new MessageChannel,ae=Ce.port2;Ce.port1.onmessage=fe,le=function(){ae.postMessage(null)}}else le=function(){M(fe,0)};function je(){ne||(ne=!0,le())}function Rt(V,W){ie=M(function(){V(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_continueExecution=function(){A||E||(A=!0,je())},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_getFirstCallbackNode=function(){return t(m)},n.unstable_next=function(V){switch(T){case 1:case 2:case 3:var W=3;break;default:W=T}var de=T;T=W;try{return V()}finally{T=de}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(V,W){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var de=T;T=V;try{return W()}finally{T=de}},n.unstable_scheduleCallback=function(V,W,de){var oe=n.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?oe+de:oe):de=oe,V){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=de+Re,V={id:v++,callback:W,priorityLevel:V,startTime:de,expirationTime:Re,sortIndex:-1},de>oe?(V.sortIndex=de,e(y,V),t(m)===null&&V===t(y)&&(U?(G(ie),ie=-1):U=!0,Rt(z,de-oe))):(V.sortIndex=Re,e(m,V),A||E||(A=!0,je())),V},n.unstable_shouldYield=me,n.unstable_wrapCallback=function(V){var W=T;return function(){var de=T;T=W;try{return V.apply(this,arguments)}finally{T=de}}}})(g0)),g0}var _0={};/**
1341
- * @license React
1342
- * scheduler.development.js
1343
- *
1344
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1345
- *
1346
- * This source code is licensed under the MIT license found in the
1347
- * LICENSE file in the root directory of this source tree.
1348
- */var o2;function AO(){return o2||(o2=1,(function(n){process.env.NODE_ENV!=="production"&&(function(){function e(){if(me){var V=n.unstable_now();Ce=V;var W=!0;try{e:{z=!1,ne&&(ne=!1,Z(fe),fe=-1),w=!0;var de=P;try{t:{for(h(V),G=a(A);G!==null&&!(G.expirationTime>V&&m());){var oe=G.callback;if(typeof oe=="function"){G.callback=null,P=G.priorityLevel;var Re=oe(G.expirationTime<=V);if(V=n.unstable_now(),typeof Re=="function"){G.callback=Re,h(V),W=!0;break t}G===a(A)&&r(A),h(V)}else r(A);G=a(A)}if(G!==null)W=!0;else{var O=a(U);O!==null&&v(f,O.startTime-V),W=!1}}break e}finally{G=null,P=de,w=!1}W=void 0}}finally{W?ae():me=!1}}}function t(V,W){var de=V.length;V.push(W);e:for(;0<de;){var oe=de-1>>>1,Re=V[oe];if(0<u(Re,W))V[oe]=W,V[de]=Re,de=oe;else break e}}function a(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var W=V[0],de=V.pop();if(de!==W){V[0]=de;e:for(var oe=0,Re=V.length,O=Re>>>1;oe<O;){var k=2*(oe+1)-1,_e=V[k],ye=k+1,Ue=V[ye];if(0>u(_e,de))ye<Re&&0>u(Ue,_e)?(V[oe]=Ue,V[ye]=de,oe=ye):(V[oe]=_e,V[k]=de,oe=k);else if(ye<Re&&0>u(Ue,de))V[oe]=Ue,V[ye]=de,oe=ye;else break e}}return W}function u(V,W){var de=V.sortIndex-W.sortIndex;return de!==0?de:V.id-W.id}function h(V){for(var W=a(U);W!==null;){if(W.callback===null)r(U);else if(W.startTime<=V)r(U),W.sortIndex=W.expirationTime,t(A,W);else break;W=a(U)}}function f(V){if(ne=!1,h(V),!z)if(a(A)!==null)z=!0,y();else{var W=a(U);W!==null&&v(f,W.startTime-V)}}function m(){return!(n.unstable_now()-Ce<le)}function y(){me||(me=!0,ae())}function v(V,W){fe=ie(function(){V(n.unstable_now())},W)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var S=performance;n.unstable_now=function(){return S.now()}}else{var T=Date,E=T.now();n.unstable_now=function(){return T.now()-E}}var A=[],U=[],M=1,G=null,P=3,w=!1,z=!1,ne=!1,ie=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,Te=typeof setImmediate<"u"?setImmediate:null,me=!1,fe=-1,le=5,Ce=-1;if(typeof Te=="function")var ae=function(){Te(e)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,Rt=je.port2;je.port1.onmessage=e,ae=function(){Rt.postMessage(null)}}else ae=function(){ie(e,0)};n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_continueExecution=function(){z||w||(z=!0,y())},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return P},n.unstable_getFirstCallbackNode=function(){return a(A)},n.unstable_next=function(V){switch(P){case 1:case 2:case 3:var W=3;break;default:W=P}var de=P;P=W;try{return V()}finally{P=de}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(V,W){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var de=P;P=V;try{return W()}finally{P=de}},n.unstable_scheduleCallback=function(V,W,de){var oe=n.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?oe+de:oe):de=oe,V){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=de+Re,V={id:M++,callback:W,priorityLevel:V,startTime:de,expirationTime:Re,sortIndex:-1},de>oe?(V.sortIndex=de,t(U,V),a(A)===null&&V===a(U)&&(ne?(Z(fe),fe=-1):ne=!0,v(f,de-oe))):(V.sortIndex=Re,t(A,V),z||w||(z=!0,y())),V},n.unstable_shouldYield=m,n.unstable_wrapCallback=function(V){var W=P;return function(){var de=P;P=W;try{return V.apply(this,arguments)}finally{P=de}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(_0)),_0}var u2;function c2(){return u2||(u2=1,process.env.NODE_ENV==="production"?Gy.exports=RO():Gy.exports=AO()),Gy.exports}/**
1349
- * @license React
1350
- * react-reconciler.production.js
1351
- *
1352
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1353
- *
1354
- * This source code is licensed under the MIT license found in the
1355
- * LICENSE file in the root directory of this source tree.
1356
- */var h2;function MO(){return h2||(h2=1,(function(n){n.exports=function(e){function t(l,o,d,_){return new ug(l,o,d,_)}function a(){}function r(l){var o="https://react.dev/errors/"+l;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+l+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(l){return l===null||typeof l!="object"?null:(l=Hp&&l[Hp]||l["@@iterator"],typeof l=="function"?l:null)}function h(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===W0?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case Rl:return"Fragment";case Ao:return"Portal";case Xh:return"Profiler";case Np:return"StrictMode";case Fh:return"Suspense";case wp:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case Ga:return(l.displayName||"Context")+".Provider";case qh:return(l._context.displayName||"Context")+".Consumer";case Pp:var o=l.render;return l=l.displayName,l||(l=o.displayName||o.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case kh:return o=l.displayName||null,o!==null?o:h(l.type)||"Memo";case Ks:o=l._payload,l=l._init;try{return h(l(o))}catch{}}return null}function f(l){if(Vp===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);Vp=o&&o[1]||"",_i=-1<d.stack.indexOf(`
1357
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
1358
- `+Vp+l+_i}function m(l,o){if(!l||Ih)return"";Ih=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var _={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(Pe){var Ee=Pe}Reflect.construct(l,[],Ae)}else{try{Ae.call()}catch(Pe){Ee=Pe}l.call(Ae.prototype)}}else{try{throw Error()}catch(Pe){Ee=Pe}(Ae=l())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(Pe){if(Pe&&Ee&&typeof Pe.stack=="string")return[Pe.stack,Ee.stack]}return[null,null]}};_.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(_.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(_.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=_.DetermineComponentFrameRoot(),B=C[0],H=C[1];if(B&&H){var I=B.split(`
1359
- `),se=H.split(`
1360
- `);for(x=_=0;_<I.length&&!I[_].includes("DetermineComponentFrameRoot");)_++;for(;x<se.length&&!se[x].includes("DetermineComponentFrameRoot");)x++;if(_===I.length||x===se.length)for(_=I.length-1,x=se.length-1;1<=_&&0<=x&&I[_]!==se[x];)x--;for(;1<=_&&0<=x;_--,x--)if(I[_]!==se[x]){if(_!==1||x!==1)do if(_--,x--,0>x||I[_]!==se[x]){var ge=`
1361
- `+I[_].replace(" at new "," at ");return l.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",l.displayName)),ge}while(1<=_&&0<=x);break}}}finally{Ih=!1,Error.prepareStackTrace=d}return(d=l?l.displayName||l.name:"")?f(d):""}function y(l){switch(l.tag){case 26:case 27:case 5:return f(l.type);case 16:return f("Lazy");case 13:return f("Suspense");case 19:return f("SuspenseList");case 0:case 15:return l=m(l.type,!1),l;case 11:return l=m(l.type.render,!1),l;case 1:return l=m(l.type,!0),l;default:return""}}function v(l){try{var o="";do o+=y(l),l=l.return;while(l);return o}catch(d){return`
1362
- Error generating stack: `+d.message+`
1363
- `+d.stack}}function S(l){var o=l,d=l;if(l.alternate)for(;o.return;)o=o.return;else{l=o;do o=l,(o.flags&4098)!==0&&(d=o.return),l=o.return;while(l)}return o.tag===3?d:null}function T(l){if(S(l)!==l)throw Error(r(188))}function E(l){var o=l.alternate;if(!o){if(o=S(l),o===null)throw Error(r(188));return o!==l?null:l}for(var d=l,_=o;;){var x=d.return;if(x===null)break;var C=x.alternate;if(C===null){if(_=x.return,_!==null){d=_;continue}break}if(x.child===C.child){for(C=x.child;C;){if(C===d)return T(x),l;if(C===_)return T(x),o;C=C.sibling}throw Error(r(188))}if(d.return!==_.return)d=x,_=C;else{for(var B=!1,H=x.child;H;){if(H===d){B=!0,d=x,_=C;break}if(H===_){B=!0,_=x,d=C;break}H=H.sibling}if(!B){for(H=C.child;H;){if(H===d){B=!0,d=C,_=x;break}if(H===_){B=!0,_=C,d=x;break}H=H.sibling}if(!B)throw Error(r(189))}}if(d.alternate!==_)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?l:o}function A(l){var o=l.tag;if(o===5||o===26||o===27||o===6)return l;for(l=l.child;l!==null;){if(o=A(l),o!==null)return o;l=l.sibling}return null}function U(l){var o=l.tag;if(o===5||o===26||o===27||o===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(o=U(l),o!==null))return o;l=l.sibling}return null}function M(l){return{current:l}}function G(l){0>fs||(l.current=wa[fs],wa[fs]=null,fs--)}function P(l,o){fs++,wa[fs]=l.current,l.current=o}function w(l){return l>>>=0,l===0?32:31-(rf(l)/Wi|0)|0}function z(l){var o=l&42;if(o!==0)return o;switch(l&-l){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:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function ne(l,o){var d=l.pendingLanes;if(d===0)return 0;var _=0,x=l.suspendedLanes,C=l.pingedLanes,B=l.warmLanes;l=l.finishedLanes!==0;var H=d&134217727;return H!==0?(d=H&~x,d!==0?_=z(d):(C&=H,C!==0?_=z(C):l||(B=H&~B,B!==0&&(_=z(B))))):(H=d&~x,H!==0?_=z(H):C!==0?_=z(C):l||(B=d&~B,B!==0&&(_=z(B)))),_===0?0:o!==0&&o!==_&&(o&x)===0&&(x=_&-_,B=o&-o,x>=B||x===32&&(B&4194176)!==0)?o:_}function ie(l,o){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&o)===0}function Z(l,o){switch(l){case 1:case 2:case 4:case 8:return o+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Te(){var l=Iu;return Iu<<=1,(Iu&4194176)===0&&(Iu=128),l}function me(){var l=lf;return lf<<=1,(lf&62914560)===0&&(lf=4194304),l}function fe(l){for(var o=[],d=0;31>d;d++)o.push(l);return o}function le(l,o){l.pendingLanes|=o,o!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Ce(l,o,d,_,x,C){var B=l.pendingLanes;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=d,l.entangledLanes&=d,l.errorRecoveryDisabledLanes&=d,l.shellSuspendCounter=0;var H=l.entanglements,I=l.expirationTimes,se=l.hiddenUpdates;for(d=B&~d;0<d;){var ge=31-bi(d),Ae=1<<ge;H[ge]=0,I[ge]=-1;var Ee=se[ge];if(Ee!==null)for(se[ge]=null,ge=0;ge<Ee.length;ge++){var Pe=Ee[ge];Pe!==null&&(Pe.lane&=-536870913)}d&=~Ae}_!==0&&ae(l,_,0),C!==0&&x===0&&l.tag!==0&&(l.suspendedLanes|=C&~(B&~o))}function ae(l,o,d){l.pendingLanes|=o,l.suspendedLanes&=~o;var _=31-bi(o);l.entangledLanes|=o,l.entanglements[_]=l.entanglements[_]|1073741824|d&4194218}function je(l,o){var d=l.entangledLanes|=o;for(l=l.entanglements;d;){var _=31-bi(d),x=1<<_;x&o|l[_]&o&&(l[_]|=o),d&=~x}}function Rt(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function V(l){if(zi&&typeof zi.onCommitFiberRoot=="function")try{zi.onCommitFiberRoot(Ol,l,void 0,(l.current.flags&128)===128)}catch{}}function W(l){if(typeof Hg=="function"&&Vg(l),zi&&typeof zi.setStrictMode=="function")try{zi.setStrictMode(Ol,l)}catch{}}function de(l,o){return l===o&&(l!==0||1/l===1/o)||l!==l&&o!==o}function oe(l,o){if(typeof l=="object"&&l!==null){var d=uf.get(l);return d!==void 0?d:(o={value:l,source:o,stack:v(o)},uf.set(l,o),o)}return{value:l,source:o,stack:v(o)}}function Re(l,o){Xn[qn++]=cf,Xn[qn++]=Bn,Bn=l,cf=o}function O(l,o,d){pa[Ji++]=tr,pa[Ji++]=nr,pa[Ji++]=ma,ma=l;var _=tr;l=nr;var x=32-bi(_)-1;_&=~(1<<x),d+=1;var C=32-bi(o)+x;if(30<C){var B=x-x%5;C=(_&(1<<B)-1).toString(32),_>>=B,x-=B,tr=1<<32-bi(o)+x|d<<x|_,nr=C+l}else tr=1<<C|d<<x|_,nr=l}function k(l){l.return!==null&&(Re(l,1),O(l,1,0))}function _e(l){for(;l===Bn;)Bn=Xn[--qn],Xn[qn]=null,cf=Xn[--qn],Xn[qn]=null;for(;l===ma;)ma=pa[--Ji],pa[Ji]=null,nr=pa[--Ji],pa[Ji]=null,tr=pa[--Ji],pa[Ji]=null}function ye(l,o){P(Hr,o),P(Zu,l),P(Fn,null),l=Do(o),G(Fn),P(Fn,l)}function Ue(){G(Fn),G(Zu),G(Hr)}function Xe(l){l.memoizedState!==null&&P(No,l);var o=Fn.current,d=fg(o,l.type);o!==d&&(P(Zu,l),P(Fn,d))}function Be(l){Zu.current===l&&(G(Fn),G(Zu)),No.current===l&&(G(No),hs?$s._currentValue=Ml:$s._currentValue2=Ml)}function At(l){var o=Error(r(418,""));throw Jn(oe(o,l)),Wu}function St(l,o){if(!vi)throw Error(r(175));nm(l.stateNode,l.type,l.memoizedProps,o,l)||At(l)}function Rn(l){for(si=l.return;si;)switch(si.tag){case 3:case 27:ds=!0;return;case 5:case 13:ds=!1;return;default:si=si.return}}function Oi(l){if(!vi||l!==si)return!1;if(!_t)return Rn(l),_t=!0,!1;var o=!1;if(an?l.tag!==3&&l.tag!==27&&(l.tag!==5||ef(l.type)&&!Zs(l.type,l.memoizedProps))&&(o=!0):l.tag!==3&&(l.tag!==5||ef(l.type)&&!Zs(l.type,l.memoizedProps))&&(o=!0),o&&Sn&&At(l),Rn(l),l.tag===13){if(!vi)throw Error(r(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Sn=im(l)}else Sn=si?Mg(l.stateNode):null;return!0}function hn(){vi&&(Sn=si=null,_t=!1)}function Jn(l){za===null?za=[l]:za.push(l)}function $n(){for(var l=un,o=ps=un=0;o<l;){var d=pn[o];pn[o++]=null;var _=pn[o];pn[o++]=null;var x=pn[o];pn[o++]=null;var C=pn[o];if(pn[o++]=null,_!==null&&x!==null){var B=_.pending;B===null?x.next=x:(x.next=B.next,B.next=x),_.pending=x}C!==0&&yr(d,x,C)}}function ei(l,o,d,_){pn[un++]=l,pn[un++]=o,pn[un++]=d,pn[un++]=_,ps|=_,l.lanes|=_,l=l.alternate,l!==null&&(l.lanes|=_)}function Za(l,o,d,_){return ei(l,o,d,_),fl(l)}function jt(l,o){return ei(l,null,null,o),fl(l)}function yr(l,o,d){l.lanes|=d;var _=l.alternate;_!==null&&(_.lanes|=d);for(var x=!1,C=l.return;C!==null;)C.childLanes|=d,_=C.alternate,_!==null&&(_.childLanes|=d),C.tag===22&&(l=C.stateNode,l===null||l._visibility&1||(x=!0)),l=C,C=C.return;x&&o!==null&&l.tag===3&&(C=l.stateNode,x=31-bi(d),C=C.hiddenUpdates,l=C[x],l===null?C[x]=[o]:l.push(o),o.lane=d|536870912)}function fl(l){if(50<rc)throw rc=0,qo=null,Error(r(185));for(var o=l.return;o!==null;)l=o,o=l.return;return l.tag===3?l.stateNode:null}function Ye(l){l!==Nl&&l.next===null&&(Nl===null?Si=Nl=l:Nl=Nl.next=l),kn=!0,hm||(hm=!0,Xc(Yc))}function yt(l,o){if(!ir&&kn){ir=!0;do for(var d=!1,_=Si;_!==null;){if(l!==0){var x=_.pendingLanes;if(x===0)var C=0;else{var B=_.suspendedLanes,H=_.pingedLanes;C=(1<<31-bi(42|l)+1)-1,C&=x&~(B&~H),C=C&201326677?C&201326677|1:C?C|2:0}C!==0&&(d=!0,Wa(_,C))}else C=pt,C=ne(_,_===Ht?C:0),(C&3)===0||ie(_,C)||(d=!0,Wa(_,C));_=_.next}while(d);ir=!1}}function Yc(){kn=hm=!1;var l=0;Go!==0&&(pg()&&(l=Go),Go=0);for(var o=da(),d=null,_=Si;_!==null;){var x=_.next,C=so(_,o);C===0?(_.next=null,d===null?Si=x:d.next=x,x===null&&(Nl=d)):(d=_,(l!==0||(C&3)!==0)&&(kn=!0)),_=x}yt(l)}function so(l,o){for(var d=l.suspendedLanes,_=l.pingedLanes,x=l.expirationTimes,C=l.pendingLanes&-62914561;0<C;){var B=31-bi(C),H=1<<B,I=x[B];I===-1?((H&d)===0||(H&_)!==0)&&(x[B]=Z(H,o)):I<=o&&(l.expiredLanes|=H),C&=~H}if(o=Ht,d=pt,d=ne(l,l===o?d:0),_=l.callbackNode,d===0||l===o&&Ot===2||l.cancelPendingCommit!==null)return _!==null&&_!==null&&um(_),l.callbackNode=null,l.callbackPriority=0;if((d&3)===0||ie(l,d)){if(o=d&-d,o===l.callbackPriority)return o;switch(_!==null&&um(_),Rt(d)){case 2:case 8:d=wg;break;case 32:d=of;break;case 268435456:d=zg;break;default:d=of}return _=Hs.bind(null,l),d=Ku(d,_),l.callbackPriority=o,l.callbackNode=d,o}return _!==null&&_!==null&&um(_),l.callbackPriority=2,l.callbackNode=null,2}function Hs(l,o){var d=l.callbackNode;if(us()&&l.callbackNode!==d)return null;var _=pt;return _=ne(l,l===Ht?_:0),_===0?null:(Gh(l,_,o),so(l,da()),l.callbackNode!=null&&l.callbackNode===d?Hs.bind(null,l):null)}function Wa(l,o){if(us())return null;Gh(l,o,!0)}function Xc(l){eb?er(function(){(Bt&6)!==0?Ku(cm,l):l()}):Ku(cm,l)}function ro(){return Go===0&&(Go=Te()),Go}function gr(l,o){if(Ju===null){var d=Ju=[];fm=0,Po=ro(),Gl={status:"pending",value:void 0,then:function(_){d.push(_)}}}return fm++,o.then(yu,yu),o}function yu(){if(--fm===0&&Ju!==null){Gl!==null&&(Gl.status="fulfilled");var l=Ju;Ju=null,Po=0,Gl=null;for(var o=0;o<l.length;o++)(0,l[o])()}}function ti(l,o){var d=[],_={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return l.then(function(){_.status="fulfilled",_.value=o;for(var x=0;x<d.length;x++)(0,d[x])(o)},function(x){for(_.status="rejected",_.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),_}function la(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Vs(l,o){l=l.updateQueue,o.updateQueue===l&&(o.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function fi(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function di(l,o,d){var _=l.updateQueue;if(_===null)return null;if(_=_.shared,(Bt&2)!==0){var x=_.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),_.pending=o,o=fl(l),yr(l,null,d),o}return ei(l,_,o,d),fl(l)}function pi(l,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194176)!==0)){var _=o.lanes;_&=l.pendingLanes,d|=_,o.lanes=d,je(l,d)}}function Xi(l,o){var d=l.updateQueue,_=l.alternate;if(_!==null&&(_=_.updateQueue,d===_)){var x=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var B={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};C===null?x=C=B:C=C.next=B,d=d.next}while(d!==null);C===null?x=C=o:C=C.next=o}else x=C=o;d={baseState:_.baseState,firstBaseUpdate:x,lastBaseUpdate:C,shared:_.shared,callbacks:_.callbacks},l.updateQueue=d;return}l=d.lastBaseUpdate,l===null?d.firstBaseUpdate=o:l.next=o,d.lastBaseUpdate=o}function Ni(){if(hf){var l=Gl;if(l!==null)throw l}}function D(l,o,d,_){hf=!1;var x=l.updateQueue;Vr=!1;var C=x.firstBaseUpdate,B=x.lastBaseUpdate,H=x.shared.pending;if(H!==null){x.shared.pending=null;var I=H,se=I.next;I.next=null,B===null?C=se:B.next=se,B=I;var ge=l.alternate;ge!==null&&(ge=ge.updateQueue,H=ge.lastBaseUpdate,H!==B&&(H===null?ge.firstBaseUpdate=se:H.next=se,ge.lastBaseUpdate=I))}if(C!==null){var Ae=x.baseState;B=0,ge=se=I=null,H=C;do{var Ee=H.lane&-536870913,Pe=Ee!==H.lane;if(Pe?(pt&Ee)===Ee:(_&Ee)===Ee){Ee!==0&&Ee===Po&&(hf=!0),ge!==null&&(ge=ge.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var be=l,Vi=H;Ee=o;var Kn=d;switch(Vi.tag){case 1:if(be=Vi.payload,typeof be=="function"){Ae=be.call(Kn,Ae,Ee);break e}Ae=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Vi.payload,Ee=typeof be=="function"?be.call(Kn,Ae,Ee):be,Ee==null)break e;Ae=Is({},Ae,Ee);break e;case 2:Vr=!0}}Ee=H.callback,Ee!==null&&(l.flags|=64,Pe&&(l.flags|=8192),Pe=x.callbacks,Pe===null?x.callbacks=[Ee]:Pe.push(Ee))}else Pe={lane:Ee,tag:H.tag,payload:H.payload,callback:H.callback,next:null},ge===null?(se=ge=Pe,I=Ae):ge=ge.next=Pe,B|=Ee;if(H=H.next,H===null){if(H=x.shared.pending,H===null)break;Pe=H,H=Pe.next,Pe.next=null,x.lastBaseUpdate=Pe,x.shared.pending=null}}while(!0);ge===null&&(I=Ae),x.baseState=I,x.firstBaseUpdate=se,x.lastBaseUpdate=ge,C===null&&(x.shared.lanes=0),Xr|=B,l.lanes=B,l.memoizedState=Ae}}function X(l,o){if(typeof l!="function")throw Error(r(191,l));l.call(o)}function ce(l,o){var d=l.callbacks;if(d!==null)for(l.callbacks=null,l=0;l<d.length;l++)X(d[l],o)}function xe(l,o){if(xi(l,o))return!0;if(typeof l!="object"||l===null||typeof o!="object"||o===null)return!1;var d=Object.keys(l),_=Object.keys(o);if(d.length!==_.length)return!1;for(_=0;_<d.length;_++){var x=d[_];if(!db.call(o,x)||!xi(l[x],o[x]))return!1}return!0}function Oe(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Le(){}function qe(l,o,d){switch(d=l[d],d===void 0?l.push(o):d!==o&&(o.then(Le,Le),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw l=o.reason,l===ms?Error(r(483)):l;default:if(typeof o.status=="string")o.then(Le,Le);else{if(l=Ht,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=o,l.status="pending",l.then(function(_){if(o.status==="pending"){var x=o;x.status="fulfilled",x.value=_}},function(_){if(o.status==="pending"){var x=o;x.status="rejected",x.reason=_}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw l=o.reason,l===ms?Error(r(483)):l}throw wo=o,ms}}function ft(){if(wo===null)throw Error(r(459));var l=wo;return wo=null,l}function We(l){var o=$u;return $u+=1,zo===null&&(zo=[]),qe(zo,l,o)}function An(l,o){o=o.props.ref,l.ref=o!==void 0?o:null}function Gi(l,o){throw o.$$typeof===Ki?Error(r(525)):(l=Object.prototype.toString.call(o),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":l)))}function lo(l){var o=l._init;return o(l._payload)}function _r(l){function o(K,F){if(l){var J=K.deletions;J===null?(K.deletions=[F],K.flags|=16):J.push(F)}}function d(K,F){if(!l)return null;for(;F!==null;)o(K,F),F=F.sibling;return null}function _(K){for(var F=new Map;K!==null;)K.key!==null?F.set(K.key,K):F.set(K.index,K),K=K.sibling;return F}function x(K,F){return K=ca(K,F),K.index=0,K.sibling=null,K}function C(K,F,J){return K.index=J,l?(J=K.alternate,J!==null?(J=J.index,J<F?(K.flags|=33554434,F):J):(K.flags|=33554434,F)):(K.flags|=1048576,F)}function B(K){return l&&K.alternate===null&&(K.flags|=33554434),K}function H(K,F,J,he){return F===null||F.tag!==6?(F=ha(J,K.mode,he),F.return=K,F):(F=x(F,J),F.return=K,F)}function I(K,F,J,he){var Ne=J.type;return Ne===Rl?ge(K,F,J.props.children,he,J.key):F!==null&&(F.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Ks&&lo(Ne)===F.type)?(F=x(F,J.props),An(F,J),F.return=K,F):(F=Lh(J.type,J.key,J.props,null,K.mode,he),An(F,J),F.return=K,F)}function se(K,F,J,he){return F===null||F.tag!==4||F.stateNode.containerInfo!==J.containerInfo||F.stateNode.implementation!==J.implementation?(F=jh(J,K.mode,he),F.return=K,F):(F=x(F,J.children||[]),F.return=K,F)}function ge(K,F,J,he,Ne){return F===null||F.tag!==7?(F=El(J,K.mode,he,Ne),F.return=K,F):(F=x(F,J),F.return=K,F)}function Ae(K,F,J){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=ha(""+F,K.mode,J),F.return=K,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case Xu:return J=Lh(F.type,F.key,F.props,null,K.mode,J),An(J,F),J.return=K,J;case Ao:return F=jh(F,K.mode,J),F.return=K,F;case Ks:var he=F._init;return F=he(F._payload),Ae(K,F,J)}if(ii(F)||u(F))return F=El(F,K.mode,J,null),F.return=K,F;if(typeof F.then=="function")return Ae(K,We(F),J);if(F.$$typeof===Ga)return Ae(K,Ou(K,F),J);Gi(K,F)}return null}function Ee(K,F,J,he){var Ne=F!==null?F.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ne!==null?null:H(K,F,""+J,he);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case Xu:return J.key===Ne?I(K,F,J,he):null;case Ao:return J.key===Ne?se(K,F,J,he):null;case Ks:return Ne=J._init,J=Ne(J._payload),Ee(K,F,J,he)}if(ii(J)||u(J))return Ne!==null?null:ge(K,F,J,he,null);if(typeof J.then=="function")return Ee(K,F,We(J),he);if(J.$$typeof===Ga)return Ee(K,F,Ou(K,J),he);Gi(K,J)}return null}function Pe(K,F,J,he,Ne){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return K=K.get(J)||null,H(F,K,""+he,Ne);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case Xu:return K=K.get(he.key===null?J:he.key)||null,I(F,K,he,Ne);case Ao:return K=K.get(he.key===null?J:he.key)||null,se(F,K,he,Ne);case Ks:var Nt=he._init;return he=Nt(he._payload),Pe(K,F,J,he,Ne)}if(ii(he)||u(he))return K=K.get(J)||null,ge(F,K,he,Ne,null);if(typeof he.then=="function")return Pe(K,F,J,We(he),Ne);if(he.$$typeof===Ga)return Pe(K,F,J,Ou(F,he),Ne);Gi(F,he)}return null}function be(K,F,J,he){for(var Ne=null,Nt=null,Ge=F,Je=F=0,Kt=null;Ge!==null&&Je<J.length;Je++){Ge.index>Je?(Kt=Ge,Ge=null):Kt=Ge.sibling;var at=Ee(K,Ge,J[Je],he);if(at===null){Ge===null&&(Ge=Kt);break}l&&Ge&&at.alternate===null&&o(K,Ge),F=C(at,F,Je),Nt===null?Ne=at:Nt.sibling=at,Nt=at,Ge=Kt}if(Je===J.length)return d(K,Ge),_t&&Re(K,Je),Ne;if(Ge===null){for(;Je<J.length;Je++)Ge=Ae(K,J[Je],he),Ge!==null&&(F=C(Ge,F,Je),Nt===null?Ne=Ge:Nt.sibling=Ge,Nt=Ge);return _t&&Re(K,Je),Ne}for(Ge=_(Ge);Je<J.length;Je++)Kt=Pe(Ge,K,Je,J[Je],he),Kt!==null&&(l&&Kt.alternate!==null&&Ge.delete(Kt.key===null?Je:Kt.key),F=C(Kt,F,Je),Nt===null?Ne=Kt:Nt.sibling=Kt,Nt=Kt);return l&&Ge.forEach(function(li){return o(K,li)}),_t&&Re(K,Je),Ne}function Vi(K,F,J,he){if(J==null)throw Error(r(151));for(var Ne=null,Nt=null,Ge=F,Je=F=0,Kt=null,at=J.next();Ge!==null&&!at.done;Je++,at=J.next()){Ge.index>Je?(Kt=Ge,Ge=null):Kt=Ge.sibling;var li=Ee(K,Ge,at.value,he);if(li===null){Ge===null&&(Ge=Kt);break}l&&Ge&&li.alternate===null&&o(K,Ge),F=C(li,F,Je),Nt===null?Ne=li:Nt.sibling=li,Nt=li,Ge=Kt}if(at.done)return d(K,Ge),_t&&Re(K,Je),Ne;if(Ge===null){for(;!at.done;Je++,at=J.next())at=Ae(K,at.value,he),at!==null&&(F=C(at,F,Je),Nt===null?Ne=at:Nt.sibling=at,Nt=at);return _t&&Re(K,Je),Ne}for(Ge=_(Ge);!at.done;Je++,at=J.next())at=Pe(Ge,K,Je,at.value,he),at!==null&&(l&&at.alternate!==null&&Ge.delete(at.key===null?Je:at.key),F=C(at,F,Je),Nt===null?Ne=at:Nt.sibling=at,Nt=at);return l&&Ge.forEach(function(qr){return o(K,qr)}),_t&&Re(K,Je),Ne}function Kn(K,F,J,he){if(typeof J=="object"&&J!==null&&J.type===Rl&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case Xu:e:{for(var Ne=J.key;F!==null;){if(F.key===Ne){if(Ne=J.type,Ne===Rl){if(F.tag===7){d(K,F.sibling),he=x(F,J.props.children),he.return=K,K=he;break e}}else if(F.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Ks&&lo(Ne)===F.type){d(K,F.sibling),he=x(F,J.props),An(he,J),he.return=K,K=he;break e}d(K,F);break}else o(K,F);F=F.sibling}J.type===Rl?(he=El(J.props.children,K.mode,he,J.key),he.return=K,K=he):(he=Lh(J.type,J.key,J.props,null,K.mode,he),An(he,J),he.return=K,K=he)}return B(K);case Ao:e:{for(Ne=J.key;F!==null;){if(F.key===Ne)if(F.tag===4&&F.stateNode.containerInfo===J.containerInfo&&F.stateNode.implementation===J.implementation){d(K,F.sibling),he=x(F,J.children||[]),he.return=K,K=he;break e}else{d(K,F);break}else o(K,F);F=F.sibling}he=jh(J,K.mode,he),he.return=K,K=he}return B(K);case Ks:return Ne=J._init,J=Ne(J._payload),Kn(K,F,J,he)}if(ii(J))return be(K,F,J,he);if(u(J)){if(Ne=u(J),typeof Ne!="function")throw Error(r(150));return J=Ne.call(J),Vi(K,F,J,he)}if(typeof J.then=="function")return Kn(K,F,We(J),he);if(J.$$typeof===Ga)return Kn(K,F,Ou(K,J),he);Gi(K,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,F!==null&&F.tag===6?(d(K,F.sibling),he=x(F,J),he.return=K,K=he):(d(K,F),he=ha(J,K.mode,he),he.return=K,K=he),B(K)):d(K,F)}return function(K,F,J,he){try{$u=0;var Ne=Kn(K,F,J,he);return zo=null,Ne}catch(Ge){if(Ge===ms)throw Ge;var Nt=t(29,Ge,null,K.mode);return Nt.lanes=he,Nt.return=K,Nt}finally{}}}function dl(l,o){l=bs,P(df,l),P(Ho,o),bs=l|o.baseLanes}function gu(){P(df,bs),P(Ho,Ho.current)}function Fd(){bs=df.current,G(Ho),G(df)}function vr(l){var o=l.alternate;P(Tn,Tn.current&1),P(ri,l),ys===null&&(o===null||Ho.current!==null||o.memoizedState!==null)&&(ys=l)}function kd(l){if(l.tag===22){if(P(Tn,Tn.current),P(ri,l),ys===null){var o=l.alternate;o!==null&&o.memoizedState!==null&&(ys=l)}}else Ja()}function Ja(){P(Tn,Tn.current),P(ri,ri.current)}function $a(l){G(ri),ys===l&&(ys=null),G(Tn)}function es(l){for(var o=l;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Fu(d)||Jh(d)))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break;for(;o.sibling===null;){if(o.return===null||o.return===l)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}function Wt(){throw Error(r(321))}function Ls(l,o){if(o===null)return!1;for(var d=0;d<o.length&&d<l.length;d++)if(!xi(l[d],o[d]))return!1;return!0}function qc(l,o,d,_,x,C){return Lr=C,lt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,ke.H=l===null||l.memoizedState===null?wl:jr,Pl=!1,C=d(_,x),Pl=!1,Vo&&(C=oo(o,d,_,x)),Id(l),C}function Id(l){ke.H=gs;var o=Ut!==null&&Ut.next!==null;if(Lr=0,mn=Ut=lt=null,pf=!1,ec=0,Lo=null,o)throw Error(r(300));l===null||On||(l=l.dependencies,l!==null&&fh(l)&&(On=!0))}function oo(l,o,d,_){lt=l;var x=0;do{if(Vo&&(Lo=null),ec=0,Vo=!1,25<=x)throw Error(r(301));if(x+=1,mn=Ut=null,l.updateQueue!=null){var C=l.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}ke.H=zl,C=o(d,_)}while(Vo);return C}function _u(){var l=ke.H,o=l.useState()[0];return o=typeof o.then=="function"?fn(o):o,l=l.useState()[0],(Ut!==null?Ut.memoizedState:null)!==l&&(lt.flags|=1024),o}function pl(){var l=mf!==0;return mf=0,l}function Fc(l,o,d){o.updateQueue=l.updateQueue,o.flags&=-2053,l.lanes&=~d}function uo(l){if(pf){for(l=l.memoizedState;l!==null;){var o=l.queue;o!==null&&(o.pending=null),l=l.next}pf=!1}Lr=0,mn=Ut=lt=null,Vo=!1,ec=mf=0,Lo=null}function Hn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?lt.memoizedState=mn=l:mn=mn.next=l,mn}function tn(){if(Ut===null){var l=lt.alternate;l=l!==null?l.memoizedState:null}else l=Ut.next;var o=mn===null?lt.memoizedState:mn.next;if(o!==null)mn=o,Ut=l;else{if(l===null)throw lt.alternate===null?Error(r(467)):Error(r(310));Ut=l,l={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},mn===null?lt.memoizedState=mn=l:mn=mn.next=l}return mn}function fn(l){var o=ec;return ec+=1,Lo===null&&(Lo=[]),l=qe(Lo,l,o),o=lt,(mn===null?o.memoizedState:mn.next)===null&&(o=o.alternate,ke.H=o===null||o.memoizedState===null?wl:jr),l}function vu(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return fn(l);if(l.$$typeof===Ga)return Ln(l)}throw Error(r(438,String(l)))}function co(l){var o=null,d=lt.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var _=lt.alternate;_!==null&&(_=_.updateQueue,_!==null&&(_=_.memoCache,_!=null&&(o={data:_.data.map(function(x){return x.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=dm(),lt.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(l),_=0;_<l;_++)d[_]=zp;return o.index++,d}function Vn(l,o){return typeof o=="function"?o(l):o}function ml(l){var o=tn();return yl(o,Ut,l)}function yl(l,o,d){var _=l.queue;if(_===null)throw Error(r(311));_.lastRenderedReducer=d;var x=l.baseQueue,C=_.pending;if(C!==null){if(x!==null){var B=x.next;x.next=C.next,C.next=B}o.baseQueue=x=C,_.pending=null}if(C=l.baseState,x===null)l.memoizedState=C;else{o=x.next;var H=B=null,I=null,se=o,ge=!1;do{var Ae=se.lane&-536870913;if(Ae!==se.lane?(pt&Ae)===Ae:(Lr&Ae)===Ae){var Ee=se.revertLane;if(Ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),Ae===Po&&(ge=!0);else if((Lr&Ee)===Ee){se=se.next,Ee===Po&&(ge=!0);continue}else Ae={lane:0,revertLane:se.revertLane,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},I===null?(H=I=Ae,B=C):I=I.next=Ae,lt.lanes|=Ee,Xr|=Ee;Ae=se.action,Pl&&d(C,Ae),C=se.hasEagerState?se.eagerState:d(C,Ae)}else Ee={lane:Ae,revertLane:se.revertLane,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},I===null?(H=I=Ee,B=C):I=I.next=Ee,lt.lanes|=Ae,Xr|=Ae;se=se.next}while(se!==null&&se!==o);if(I===null?B=C:I.next=H,!xi(C,l.memoizedState)&&(On=!0,ge&&(d=Gl,d!==null)))throw d;l.memoizedState=C,l.baseState=B,l.baseQueue=I,_.lastRenderedState=C}return x===null&&(_.lanes=0),[l.memoizedState,_.dispatch]}function bu(l){var o=tn(),d=o.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var _=d.dispatch,x=d.pending,C=o.memoizedState;if(x!==null){d.pending=null;var B=x=x.next;do C=l(C,B.action),B=B.next;while(B!==x);xi(C,o.memoizedState)||(On=!0),o.memoizedState=C,o.baseQueue===null&&(o.baseState=C),d.lastRenderedState=C}return[C,_]}function kc(l,o,d){var _=lt,x=tn(),C=_t;if(C){if(d===void 0)throw Error(r(407));d=d()}else d=o();var B=!xi((Ut||x).memoizedState,d);if(B&&(x.memoizedState=d,On=!0),x=x.queue,Wc(Aa.bind(null,_,x,l),[l]),x.getSnapshot!==o||B||mn!==null&&mn.memoizedState.tag&1){if(_.flags|=2048,qi(9,Ra.bind(null,_,x,d,o),{destroy:void 0},null),Ht===null)throw Error(r(349));C||(Lr&60)!==0||Kd(_,o,d)}return d}function Kd(l,o,d){l.flags|=16384,l={getSnapshot:o,value:d},o=lt.updateQueue,o===null?(o=dm(),lt.updateQueue=o,o.stores=[l]):(d=o.stores,d===null?o.stores=[l]:d.push(l))}function Ra(l,o,d,_){o.value=d,o.getSnapshot=_,xu(o)&&Ma(l)}function Aa(l,o,d){return d(function(){xu(o)&&Ma(l)})}function xu(l){var o=l.getSnapshot;l=l.value;try{var d=o();return!xi(l,d)}catch{return!0}}function Ma(l){var o=jt(l,2);o!==null&&jn(o,l,2)}function br(l){var o=Hn();if(typeof l=="function"){var d=l;if(l=d(),Pl){W(!0);try{d()}finally{W(!1)}}}return o.memoizedState=o.baseState=l,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:l},o}function Qd(l,o,d,_){return l.baseState=d,yl(l,Ut,typeof _=="function"?_:Vn)}function Jy(l,o,d,_,x){if(go(l))throw Error(r(485));if(l=o.action,l!==null){var C={payload:x,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){C.listeners.push(B)}};ke.T!==null?d(!0):C.isTransition=!1,_(C),d=o.pending,d===null?(C.next=o.pending=C,Zd(o,C)):(C.next=d.next,o.pending=d.next=C)}}function Zd(l,o){var d=o.action,_=o.payload,x=l.state;if(o.isTransition){var C=ke.T,B={};ke.T=B;try{var H=d(x,_),I=ke.S;I!==null&&I(B,H),Wd(l,o,H)}catch(se){Kc(l,o,se)}finally{ke.T=C}}else try{C=d(x,_),Wd(l,o,C)}catch(se){Kc(l,o,se)}}function Wd(l,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(_){Ic(l,o,_)},function(_){return Kc(l,o,_)}):Ic(l,o,d)}function Ic(l,o,d){o.status="fulfilled",o.value=d,Qc(o),l.state=d,o=l.pending,o!==null&&(d=o.next,d===o?l.pending=null:(d=d.next,o.next=d,Zd(l,d)))}function Kc(l,o,d){var _=l.pending;if(l.pending=null,_!==null){_=_.next;do o.status="rejected",o.reason=d,Qc(o),o=o.next;while(o!==_)}l.action=null}function Qc(l){l=l.listeners;for(var o=0;o<l.length;o++)(0,l[o])()}function $y(l,o){return o}function Jd(l,o){if(_t){var d=Ht.formState;if(d!==null){e:{var _=lt;if(_t){if(Sn){var x=ku(Sn,ds);if(x){Sn=Mg(x),_=lb(x);break e}}At(_)}_=!1}_&&(o=d[0])}}d=Hn(),d.memoizedState=d.baseState=o,_={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$y,lastRenderedState:o},d.queue=_,d=ap.bind(null,lt,_),_.dispatch=d,_=br(!1);var C=Ru.bind(null,lt,!1,_.queue);return _=Hn(),x={state:o,dispatch:null,action:l,pending:null},_.queue=x,d=Jy.bind(null,lt,x,C,d),x.dispatch=d,_.memoizedState=l,[o,d,!1]}function eg(l){var o=tn();return Zc(o,Ut,l)}function Zc(l,o,d){o=yl(l,o,$y)[0],l=ml(Vn)[0],o=typeof o=="object"&&o!==null&&typeof o.then=="function"?fn(o):o;var _=tn(),x=_.queue,C=x.dispatch;return d!==_.memoizedState&&(lt.flags|=2048,qi(9,$d.bind(null,x,d),{destroy:void 0},null)),[o,C,l]}function $d(l,o){l.action=o}function js(l){var o=tn(),d=Ut;if(d!==null)return Zc(o,d,l);tn(),o=o.memoizedState,d=tn();var _=d.queue.dispatch;return d.memoizedState=l,[o,_,!1]}function qi(l,o,d,_){return l={tag:l,create:o,inst:d,deps:_,next:null},o=lt.updateQueue,o===null&&(o=dm(),lt.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=l.next=l:(_=d.next,d.next=l,l.next=_,o.lastEffect=l),l}function ho(){return tn().memoizedState}function gl(l,o,d,_){var x=Hn();lt.flags|=l,x.memoizedState=qi(1|o,d,{destroy:void 0},_===void 0?null:_)}function xr(l,o,d,_){var x=tn();_=_===void 0?null:_;var C=x.memoizedState.inst;Ut!==null&&_!==null&&Ls(_,Ut.memoizedState.deps)?x.memoizedState=qi(o,d,C,_):(lt.flags|=l,x.memoizedState=qi(1|o,d,C,_))}function fo(l,o){gl(8390656,8,l,o)}function Wc(l,o){xr(2048,8,l,o)}function tg(l,o){return xr(4,2,l,o)}function ep(l,o){return xr(4,4,l,o)}function Su(l,o){if(typeof o=="function"){l=l();var d=o(l);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return l=l(),o.current=l,function(){o.current=null}}function tp(l,o,d){d=d!=null?d.concat([l]):null,xr(4,4,Su.bind(null,o,l),d)}function Jc(){}function Tu(l,o){var d=tn();o=o===void 0?null:o;var _=d.memoizedState;return o!==null&&Ls(o,_[1])?_[0]:(d.memoizedState=[l,o],l)}function np(l,o){var d=tn();o=o===void 0?null:o;var _=d.memoizedState;if(o!==null&&Ls(o,_[1]))return _[0];if(_=l(),Pl){W(!0);try{l()}finally{W(!1)}}return d.memoizedState=[_,o],_}function $c(l,o,d){return d===void 0||(Lr&1073741824)!==0?l.memoizedState=o:(l.memoizedState=d,l=vp(),lt.lanes|=l,Xr|=l,d)}function ip(l,o,d,_){return xi(d,o)?d:Ho.current!==null?(l=$c(l,d,_),xi(l,o)||(On=!0),l):(Lr&42)===0?(On=!0,l.memoizedState=d):(l=vp(),lt.lanes|=l,Xr|=l,o)}function Mn(l,o,d,_,x){var C=Js();ai(C!==0&&8>C?C:8);var B=ke.T,H={};ke.T=H,Ru(l,!1,o,d);try{var I=x(),se=ke.S;if(se!==null&&se(H,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ge=ti(I,_);yo(l,o,ge,gi(l))}else yo(l,o,_,gi(l))}catch(Ae){yo(l,o,{then:function(){},status:"rejected",reason:Ae},gi())}finally{ai(C),ke.T=B}}function Eu(l){var o=l.memoizedState;if(o!==null)return o;o={memoizedState:Ml,baseState:Ml,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:Ml},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:d},next:null},l.memoizedState=o,l=l.alternate,l!==null&&(l.memoizedState=o),o}function po(){return Ln($s)}function mo(){return tn().memoizedState}function Cu(){return tn().memoizedState}function eh(l){for(var o=l.return;o!==null;){switch(o.tag){case 24:case 3:var d=gi();l=fi(d);var _=di(o,l,d);_!==null&&(jn(_,o,d),pi(_,o,d)),o={cache:ph()},l.payload=o;return}o=o.return}}function th(l,o,d){var _=gi();d={lane:_,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},go(l)?Ys(o,d):(d=Za(l,o,d,_),d!==null&&(jn(d,l,_),sp(d,o,_)))}function ap(l,o,d){var _=gi();yo(l,o,d,_)}function yo(l,o,d,_){var x={lane:_,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(go(l))Ys(o,x);else{var C=l.alternate;if(l.lanes===0&&(C===null||C.lanes===0)&&(C=o.lastRenderedReducer,C!==null))try{var B=o.lastRenderedState,H=C(B,d);if(x.hasEagerState=!0,x.eagerState=H,xi(H,B))return ei(l,o,x,0),Ht===null&&$n(),!1}catch{}finally{}if(d=Za(l,o,x,_),d!==null)return jn(d,l,_),sp(d,o,_),!0}return!1}function Ru(l,o,d,_){if(_={lane:2,revertLane:ro(),action:_,hasEagerState:!1,eagerState:null,next:null},go(l)){if(o)throw Error(r(479))}else o=Za(l,d,_,2),o!==null&&jn(o,l,2)}function go(l){var o=l.alternate;return l===lt||o!==null&&o===lt}function Ys(l,o){Vo=pf=!0;var d=l.pending;d===null?o.next=o:(o.next=d.next,d.next=o),l.pending=o}function sp(l,o,d){if((d&4194176)!==0){var _=o.lanes;_&=l.pendingLanes,d|=_,o.lanes=d,je(l,d)}}function ts(l,o,d,_){o=l.memoizedState,d=d(_,o),d=d==null?o:Is({},o,d),l.memoizedState=d,l.lanes===0&&(l.updateQueue.baseState=d)}function ns(l,o,d,_,x,C,B){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(_,C,B):o.prototype&&o.prototype.isPureReactComponent?!xe(d,_)||!xe(x,C):!0}function Au(l,o,d,_){l=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,_),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,_),o.state!==l&&pm.enqueueReplaceState(o,o.state,null)}function Ke(l,o){var d=o;if("ref"in o){d={};for(var _ in o)_!=="ref"&&(d[_]=o[_])}if(l=l.defaultProps){d===o&&(d=Is({},d));for(var x in l)d[x]===void 0&&(d[x]=l[x])}return d}function ue(l,o){try{var d=l.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(_){setTimeout(function(){throw _})}}function _l(l,o,d){try{var _=l.onCaughtError;_(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function _o(l,o,d){return d=fi(d),d.tag=3,d.payload={element:null},d.callback=function(){ue(l,o)},d}function nn(l){return l=fi(l),l.tag=3,l}function nh(l,o,d,_){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var C=_.value;l.payload=function(){return x(C)},l.callback=function(){_l(o,d,_)}}var B=d.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(l.callback=function(){_l(o,d,_),typeof x!="function"&&(xs===null?xs=new Set([this]):xs.add(this));var H=_.stack;this.componentDidCatch(_.value,{componentStack:H!==null?H:""})})}function rp(l,o,d,_,x){if(d.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){if(o=d.alternate,o!==null&&bo(o,d,x,!0),d=ri.current,d!==null){switch(d.tag){case 13:return ys===null?Na():d.alternate===null&&$t===0&&($t=3),d.flags&=-257,d.flags|=65536,d.lanes=x,_===ff?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([_]):o.add(_),Vh(l,_,x)),!1;case 22:return d.flags|=65536,_===ff?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([_])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([_]):d.add(_)),Vh(l,_,x)),!1}throw Error(r(435,d.tag))}return Vh(l,_,x),Na(),!1}if(_t)return o=ri.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=x,_!==Wu&&(l=Error(r(422),{cause:_}),Jn(oe(l,d)))):(_!==Wu&&(o=Error(r(423),{cause:_}),Jn(oe(o,d))),l=l.current.alternate,l.flags|=65536,x&=-x,l.lanes|=x,_=oe(_,d),x=_o(l.stateNode,_,x),Xi(l,x),$t!==4&&($t=2)),!1;var C=Error(r(520),{cause:_});if(C=oe(C,d),gn===null?gn=[C]:gn.push(C),$t!==4&&($t=2),o===null)return!0;_=oe(_,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,l=x&-x,d.lanes|=l,l=_o(d.stateNode,_,l),Xi(d,l),!1;case 1:if(o=d.type,C=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(xs===null||!xs.has(C))))return d.flags|=65536,x&=-x,d.lanes|=x,x=nn(x),nh(x,l,d,_),Xi(d,x),!1}d=d.return}while(d!==null);return!1}function Dn(l,o,d,_){o.child=l===null?Lg(o,null,d,_):ya(o,l.child,d,_)}function ih(l,o,d,_,x){d=d.render;var C=o.ref;if("ref"in _){var B={};for(var H in _)H!=="ref"&&(B[H]=_[H])}else B=_;return Tr(o),_=qc(l,o,d,B,C,x),H=pl(),l!==null&&!On?(Fc(l,o,x),is(l,o,x)):(_t&&H&&k(o),o.flags|=1,Dn(l,o,_,x),o.child)}function ng(l,o,d,_,x){if(l===null){var C=d.type;return typeof C=="function"&&!Co(C)&&C.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=C,ah(l,o,C,_,x)):(l=Lh(d.type,null,_,o,o.mode,x),l.ref=o.ref,l.return=o,o.child=l)}if(C=l.child,!oh(l,x)){var B=C.memoizedProps;if(d=d.compare,d=d!==null?d:xe,d(B,_)&&l.ref===o.ref)return is(l,o,x)}return o.flags|=1,l=ca(C,_),l.ref=o.ref,l.return=o,o.child=l}function ah(l,o,d,_,x){if(l!==null){var C=l.memoizedProps;if(xe(C,_)&&l.ref===o.ref)if(On=!1,o.pendingProps=_=C,oh(l,x))(l.flags&131072)!==0&&(On=!0);else return o.lanes=l.lanes,is(l,o,x)}return Tt(l,o,d,_,x)}function sh(l,o,d){var _=o.pendingProps,x=_.children,C=(o.stateNode._pendingVisibility&2)!==0,B=l!==null?l.memoizedState:null;if(Un(l,o),_.mode==="hidden"||C){if((o.flags&128)!==0){if(_=B!==null?B.baseLanes|d:d,l!==null){for(x=o.child=l.child,C=0;x!==null;)C=C|x.lanes|x.childLanes,x=x.sibling;o.childLanes=C&~_}else o.childLanes=0,o.child=null;return rh(l,o,_,d)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},l!==null&&xl(o,B!==null?B.cachePool:null),B!==null?dl(o,B):gu(),kd(o);else return o.lanes=o.childLanes=536870912,rh(l,o,B!==null?B.baseLanes|d:d,d)}else B!==null?(xl(o,B.cachePool),dl(o,B),Ja(),o.memoizedState=null):(l!==null&&xl(o,null),gu(),Ja());return Dn(l,o,x,d),o.child}function rh(l,o,d,_){var x=Er();return x=x===null?null:{parent:hs?sn._currentValue:sn._currentValue2,pool:x},o.memoizedState={baseLanes:d,cachePool:x},l!==null&&xl(o,null),gu(),kd(o),l!==null&&bo(l,o,_,!0),null}function Un(l,o){var d=o.ref;if(d===null)l!==null&&l.ref!==null&&(o.flags|=2097664);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(l===null||l.ref!==d)&&(o.flags|=2097664)}}function Tt(l,o,d,_,x){return Tr(o),d=qc(l,o,d,_,void 0,x),_=pl(),l!==null&&!On?(Fc(l,o,x),is(l,o,x)):(_t&&_&&k(o),o.flags|=1,Dn(l,o,d,x),o.child)}function vo(l,o,d,_,x,C){return Tr(o),o.updateQueue=null,d=oo(o,_,d,x),Id(l),_=pl(),l!==null&&!On?(Fc(l,o,C),is(l,o,C)):(_t&&_&&k(o),o.flags|=1,Dn(l,o,d,C),o.child)}function Xs(l,o,d,_,x){if(Tr(o),o.stateNode===null){var C=zr,B=d.contextType;typeof B=="object"&&B!==null&&(C=Ln(B)),C=new d(_,C),o.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=pm,o.stateNode=C,C._reactInternals=o,C=o.stateNode,C.props=_,C.state=o.memoizedState,C.refs={},la(o),B=d.contextType,C.context=typeof B=="object"&&B!==null?Ln(B):zr,C.state=o.memoizedState,B=d.getDerivedStateFromProps,typeof B=="function"&&(ts(o,d,B,_),C.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(B=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),B!==C.state&&pm.enqueueReplaceState(C,C.state,null),D(o,_,C,x),Ni(),C.state=o.memoizedState),typeof C.componentDidMount=="function"&&(o.flags|=4194308),_=!0}else if(l===null){C=o.stateNode;var H=o.memoizedProps,I=Ke(d,H);C.props=I;var se=C.context,ge=d.contextType;B=zr,typeof ge=="object"&&ge!==null&&(B=Ln(ge));var Ae=d.getDerivedStateFromProps;ge=typeof Ae=="function"||typeof C.getSnapshotBeforeUpdate=="function",H=o.pendingProps!==H,ge||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(H||se!==B)&&Au(o,C,_,B),Vr=!1;var Ee=o.memoizedState;C.state=Ee,D(o,_,C,x),Ni(),se=o.memoizedState,H||Ee!==se||Vr?(typeof Ae=="function"&&(ts(o,d,Ae,_),se=o.memoizedState),(I=Vr||ns(o,d,I,_,Ee,se,B))?(ge||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=_,o.memoizedState=se),C.props=_,C.state=se,C.context=B,_=I):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),_=!1)}else{C=o.stateNode,Vs(l,o),B=o.memoizedProps,ge=Ke(d,B),C.props=ge,Ae=o.pendingProps,Ee=C.context,se=d.contextType,I=zr,typeof se=="object"&&se!==null&&(I=Ln(se)),H=d.getDerivedStateFromProps,(se=typeof H=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(B!==Ae||Ee!==I)&&Au(o,C,_,I),Vr=!1,Ee=o.memoizedState,C.state=Ee,D(o,_,C,x),Ni();var Pe=o.memoizedState;B!==Ae||Ee!==Pe||Vr||l!==null&&l.dependencies!==null&&fh(l.dependencies)?(typeof H=="function"&&(ts(o,d,H,_),Pe=o.memoizedState),(ge=Vr||ns(o,d,ge,_,Ee,Pe,I)||l!==null&&l.dependencies!==null&&fh(l.dependencies))?(se||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(_,Pe,I),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(_,Pe,I)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||B===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=1024),o.memoizedProps=_,o.memoizedState=Pe),C.props=_,C.state=Pe,C.context=I,_=ge):(typeof C.componentDidUpdate!="function"||B===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=1024),_=!1)}return C=_,Un(l,o),_=(o.flags&128)!==0,C||_?(C=o.stateNode,d=_&&typeof d.getDerivedStateFromError!="function"?null:C.render(),o.flags|=1,l!==null&&_?(o.child=ya(o,l.child,null,x),o.child=ya(o,null,d,x)):Dn(l,o,d,x),o.memoizedState=C.state,l=o.child):l=is(l,o,x),l}function Sr(l,o,d,_){return hn(),o.flags|=256,Dn(l,o,d,_),o.child}function Fi(l){return{baseLanes:l,cachePool:op()}}function Mu(l,o,d){return l=l!==null?l.childLanes&~d:0,o&&(l|=ea),l}function vl(l,o,d){var _=o.pendingProps,x=!1,C=(o.flags&128)!==0,B;if((B=C)||(B=l!==null&&l.memoizedState===null?!1:(Tn.current&2)!==0),B&&(x=!0,o.flags&=-129),B=(o.flags&32)!==0,o.flags&=-33,l===null){if(_t){if(x?vr(o):Ja(),_t){var H=Sn,I;(I=H)&&(H=ob(H,ds),H!==null?(o.memoizedState={dehydrated:H,treeContext:ma!==null?{id:tr,overflow:nr}:null,retryLane:536870912},I=t(18,null,null,0),I.stateNode=H,I.return=o,o.child=I,si=o,Sn=null,I=!0):I=!1),I||At(o)}if(H=o.memoizedState,H!==null&&(H=H.dehydrated,H!==null))return Jh(H)?o.lanes=16:o.lanes=536870912,null;$a(o)}return H=_.children,_=_.fallback,x?(Ja(),x=o.mode,H=bl({mode:"hidden",children:H},x),_=El(_,x,d,null),H.return=o,_.return=o,H.sibling=_,o.child=H,x=o.child,x.memoizedState=Fi(d),x.childLanes=Mu(l,B,d),o.memoizedState=yf,_):(vr(o),Du(o,H))}if(I=l.memoizedState,I!==null&&(H=I.dehydrated,H!==null)){if(C)o.flags&256?(vr(o),o.flags&=-257,o=Uu(l,o,d)):o.memoizedState!==null?(Ja(),o.child=l.child,o.flags|=128,o=null):(Ja(),x=_.fallback,H=o.mode,_=bl({mode:"visible",children:_.children},H),x=El(x,H,d,null),x.flags|=2,_.return=o,x.return=o,_.sibling=x,o.child=_,ya(o,l.child,null,d),_=o.child,_.memoizedState=Fi(d),_.childLanes=Mu(l,B,d),o.memoizedState=yf,o=x);else if(vr(o),Jh(H))B=Rg(H).digest,_=Error(r(419)),_.stack="",_.digest=B,Jn({value:_,source:null,stack:null}),o=Uu(l,o,d);else if(On||bo(l,o,d,!1),B=(d&l.childLanes)!==0,On||B){if(B=Ht,B!==null){if(_=d&-d,(_&42)!==0)_=1;else switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=64;break;case 268435456:_=134217728;break;default:_=0}if(_=(_&(B.suspendedLanes|d))!==0?0:_,_!==0&&_!==I.retryLane)throw I.retryLane=_,jt(l,_),jn(B,l,_),ym}Fu(H)||Na(),o=Uu(l,o,d)}else Fu(H)?(o.flags|=128,o.child=l.child,o=og.bind(null,l),Ag(H,o),o=null):(l=I.treeContext,vi&&(Sn=Dg(H),si=o,_t=!0,za=null,ds=!1,l!==null&&(pa[Ji++]=tr,pa[Ji++]=nr,pa[Ji++]=ma,tr=l.id,nr=l.overflow,ma=o)),o=Du(o,_.children),o.flags|=4096);return o}return x?(Ja(),x=_.fallback,H=o.mode,I=l.child,C=I.sibling,_=ca(I,{mode:"hidden",children:_.children}),_.subtreeFlags=I.subtreeFlags&31457280,C!==null?x=ca(C,x):(x=El(x,H,d,null),x.flags|=2),x.return=o,_.return=o,_.sibling=x,o.child=_,_=x,x=o.child,H=l.child.memoizedState,H===null?H=Fi(d):(I=H.cachePool,I!==null?(C=hs?sn._currentValue:sn._currentValue2,I=I.parent!==C?{parent:C,pool:C}:I):I=op(),H={baseLanes:H.baseLanes|d,cachePool:I}),x.memoizedState=H,x.childLanes=Mu(l,B,d),o.memoizedState=yf,_):(vr(o),d=l.child,l=d.sibling,d=ca(d,{mode:"visible",children:_.children}),d.return=o,d.sibling=null,l!==null&&(B=o.deletions,B===null?(o.deletions=[l],o.flags|=16):B.push(l)),o.child=d,o.memoizedState=null,d)}function Du(l,o){return o=bl({mode:"visible",children:o},l.mode),o.return=l,l.child=o}function bl(l,o){return Mp(l,o,0,null)}function Uu(l,o,d){return ya(o,l.child,null,d),l=Du(o,o.pendingProps.children),l.flags|=2,o.memoizedState=null,l}function Bu(l,o,d){l.lanes|=o;var _=l.alternate;_!==null&&(_.lanes|=o),ch(l.return,o,d)}function lh(l,o,d,_,x){var C=l.memoizedState;C===null?l.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:_,tail:d,tailMode:x}:(C.isBackwards=o,C.rendering=null,C.renderingStartTime=0,C.last=_,C.tail=d,C.tailMode=x)}function lp(l,o,d){var _=o.pendingProps,x=_.revealOrder,C=_.tail;if(Dn(l,o,_.children,d),_=Tn.current,(_&2)!==0)_=_&1|2,o.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=o.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Bu(l,d,o);else if(l.tag===19)Bu(l,d,o);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}switch(P(Tn,_),x){case"forwards":for(d=o.child,x=null;d!==null;)l=d.alternate,l!==null&&es(l)===null&&(x=d),d=d.sibling;d=x,d===null?(x=o.child,o.child=null):(x=d.sibling,d.sibling=null),lh(o,!1,x,d,C);break;case"backwards":for(d=null,x=o.child,o.child=null;x!==null;){if(l=x.alternate,l!==null&&es(l)===null){o.child=x;break}l=x.sibling,x.sibling=d,d=x,x=l}lh(o,!0,d,null,C);break;case"together":lh(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function is(l,o,d){if(l!==null&&(o.dependencies=l.dependencies),Xr|=o.lanes,(d&o.childLanes)===0)if(l!==null){if(bo(l,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(l!==null&&o.child!==l.child)throw Error(r(153));if(o.child!==null){for(l=o.child,d=ca(l,l.pendingProps),o.child=d,d.return=o;l.sibling!==null;)l=l.sibling,d=d.sibling=ca(l,l.pendingProps),d.return=o;d.sibling=null}return o.child}function oh(l,o){return(l.lanes&o)!==0?!0:(l=l.dependencies,!!(l!==null&&fh(l)))}function ig(l,o,d){switch(o.tag){case 3:ye(o,o.stateNode.containerInfo),as(o,sn,l.memoizedState.cache),hn();break;case 27:case 5:Xe(o);break;case 4:ye(o,o.stateNode.containerInfo);break;case 10:as(o,o.type,o.memoizedProps.value);break;case 13:var _=o.memoizedState;if(_!==null)return _.dehydrated!==null?(vr(o),o.flags|=128,null):(d&o.child.childLanes)!==0?vl(l,o,d):(vr(o),l=is(l,o,d),l!==null?l.sibling:null);vr(o);break;case 19:var x=(l.flags&128)!==0;if(_=(d&o.childLanes)!==0,_||(bo(l,o,d,!1),_=(d&o.childLanes)!==0),x){if(_)return lp(l,o,d);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),P(Tn,Tn.current),_)break;return null;case 22:case 23:return o.lanes=0,sh(l,o,d);case 24:as(o,sn,l.memoizedState.cache)}return is(l,o,d)}function uh(l,o,d){if(l!==null)if(l.memoizedProps!==o.pendingProps)On=!0;else{if(!oh(l,d)&&(o.flags&128)===0)return On=!1,ig(l,o,d);On=(l.flags&131072)!==0}else On=!1,_t&&(o.flags&1048576)!==0&&O(o,cf,o.index);switch(o.lanes=0,o.tag){case 16:e:{l=o.pendingProps;var _=o.elementType,x=_._init;if(_=x(_._payload),o.type=_,typeof _=="function")Co(_)?(l=Ke(_,l),o.tag=1,o=Xs(null,o,_,l,d)):(o.tag=0,o=Tt(null,o,_,l,d));else{if(_!=null){if(x=_.$$typeof,x===Pp){o.tag=11,o=ih(null,o,_,l,d);break e}else if(x===kh){o.tag=14,o=ng(null,o,_,l,d);break e}}throw o=h(_)||_,Error(r(306,o,""))}}return o;case 0:return Tt(l,o,o.type,o.pendingProps,d);case 1:return _=o.type,x=Ke(_,o.pendingProps),Xs(l,o,_,x,d);case 3:e:{if(ye(o,o.stateNode.containerInfo),l===null)throw Error(r(387));var C=o.pendingProps;x=o.memoizedState,_=x.element,Vs(l,o),D(o,C,null,d);var B=o.memoizedState;if(C=B.cache,as(o,sn,C),C!==x.cache&&hh(o,[sn],d,!0),Ni(),C=B.element,vi&&x.isDehydrated)if(x={element:C,isDehydrated:!1,cache:B.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=Sr(l,o,C,d);break e}else if(C!==_){_=oe(Error(r(424)),o),Jn(_),o=Sr(l,o,C,d);break e}else for(vi&&(Sn=em(o.stateNode.containerInfo),si=o,_t=!0,za=null,ds=!0),d=Lg(o,null,C,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(hn(),C===_){o=is(l,o,d);break e}Dn(l,o,C,d)}o=o.child}return o;case 26:if(Zi)return Un(l,o),l===null?(d=rm(o.type,null,o.pendingProps,null))?o.memoizedState=d:_t||(o.stateNode=hb(o.type,o.pendingProps,Hr.current,o)):o.memoizedState=rm(o.type,l.memoizedProps,o.pendingProps,l.memoizedState),null;case 27:if(an)return Xe(o),l===null&&an&&_t&&(_=o.stateNode=Bl(o.type,o.pendingProps,Hr.current,Fn.current,!1),si=o,ds=!0,Sn=Pr(_)),_=o.pendingProps.children,l!==null||_t?Dn(l,o,_,d):o.child=ya(o,null,_,d),Un(l,o),o.child;case 5:return l===null&&_t&&(ub(o.type,o.pendingProps,Fn.current),(x=_=Sn)&&(_=Ug(_,o.type,o.pendingProps,ds),_!==null?(o.stateNode=_,si=o,Sn=Pr(_),ds=!1,x=!0):x=!1),x||At(o)),Xe(o),x=o.type,C=o.pendingProps,B=l!==null?l.memoizedProps:null,_=C.children,Zs(x,C)?_=null:B!==null&&Zs(x,B)&&(o.flags|=32),o.memoizedState!==null&&(x=qc(l,o,_u,null,null,d),hs?$s._currentValue=x:$s._currentValue2=x),Un(l,o),Dn(l,o,_,d),o.child;case 6:return l===null&&_t&&(Ng(o.pendingProps,Fn.current),(l=d=Sn)&&(d=tm(d,o.pendingProps,ds),d!==null?(o.stateNode=d,si=o,Sn=null,l=!0):l=!1),l||At(o)),null;case 13:return vl(l,o,d);case 4:return ye(o,o.stateNode.containerInfo),_=o.pendingProps,l===null?o.child=ya(o,null,_,d):Dn(l,o,_,d),o.child;case 11:return ih(l,o,o.type,o.pendingProps,d);case 7:return Dn(l,o,o.pendingProps,d),o.child;case 8:return Dn(l,o,o.pendingProps.children,d),o.child;case 12:return Dn(l,o,o.pendingProps.children,d),o.child;case 10:return _=o.pendingProps,as(o,o.type,_.value),Dn(l,o,_.children,d),o.child;case 9:return x=o.type._context,_=o.pendingProps.children,Tr(o),x=Ln(x),_=_(x),o.flags|=1,Dn(l,o,_,d),o.child;case 14:return ng(l,o,o.type,o.pendingProps,d);case 15:return ah(l,o,o.type,o.pendingProps,d);case 19:return lp(l,o,d);case 22:return sh(l,o,d);case 24:return Tr(o),_=Ln(sn),l===null?(x=Er(),x===null&&(x=Ht,C=ph(),x.pooledCache=C,C.refCount++,C!==null&&(x.pooledCacheLanes|=d),x=C),o.memoizedState={parent:_,cache:x},la(o),as(o,sn,x)):((l.lanes&d)!==0&&(Vs(l,o),D(o,null,null,d),Ni()),x=l.memoizedState,C=o.memoizedState,x.parent!==_?(x={parent:_,cache:_},o.memoizedState=x,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=x),as(o,sn,_)):(_=C.cache,as(o,sn,_),_!==x.cache&&hh(o,[sn],d,!0))),Dn(l,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function as(l,o,d){hs?(P(tc,o._currentValue),o._currentValue=d):(P(tc,o._currentValue2),o._currentValue2=d)}function Da(l){var o=tc.current;hs?l._currentValue=o:l._currentValue2=o,G(tc)}function ch(l,o,d){for(;l!==null;){var _=l.alternate;if((l.childLanes&o)!==o?(l.childLanes|=o,_!==null&&(_.childLanes|=o)):_!==null&&(_.childLanes&o)!==o&&(_.childLanes|=o),l===d)break;l=l.return}}function hh(l,o,d,_){var x=l.child;for(x!==null&&(x.return=l);x!==null;){var C=x.dependencies;if(C!==null){var B=x.child;C=C.firstContext;e:for(;C!==null;){var H=C;C=x;for(var I=0;I<o.length;I++)if(H.context===o[I]){C.lanes|=d,H=C.alternate,H!==null&&(H.lanes|=d),ch(C.return,d,l),_||(B=null);break e}C=H.next}}else if(x.tag===18){if(B=x.return,B===null)throw Error(r(341));B.lanes|=d,C=B.alternate,C!==null&&(C.lanes|=d),ch(B,d,l),B=null}else B=x.child;if(B!==null)B.return=x;else for(B=x;B!==null;){if(B===l){B=null;break}if(x=B.sibling,x!==null){x.return=B.return,B=x;break}B=B.return}x=B}}function bo(l,o,d,_){l=null;for(var x=o,C=!1;x!==null;){if(!C){if((x.flags&524288)!==0)C=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var B=x.alternate;if(B===null)throw Error(r(387));if(B=B.memoizedProps,B!==null){var H=x.type;xi(x.pendingProps.value,B.value)||(l!==null?l.push(H):l=[H])}}else if(x===No.current){if(B=x.alternate,B===null)throw Error(r(387));B.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(l!==null?l.push($s):l=[$s])}x=x.return}l!==null&&hh(o,l,d,_),o.flags|=262144}function fh(l){for(l=l.firstContext;l!==null;){var o=l.context;if(!xi(hs?o._currentValue:o._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function Tr(l){Yr=l,Ha=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Ln(l){return dh(Yr,l)}function Ou(l,o){return Yr===null&&Tr(l),dh(l,o)}function dh(l,o){var d=hs?o._currentValue:o._currentValue2;if(o={context:o,memoizedValue:d,next:null},Ha===null){if(l===null)throw Error(r(308));Ha=o,l.dependencies={lanes:0,firstContext:o},l.flags|=524288}else Ha=Ha.next=o;return d}function ph(){return{controller:new gm,data:new Map,refCount:0}}function xo(l){l.refCount--,l.refCount===0&&pb(mb,function(){l.controller.abort()})}function Er(){var l=sr.current;return l!==null?l:Ht.pooledCache}function xl(l,o){o===null?P(sr,sr.current):P(sr,o.pool)}function op(){var l=Er();return l===null?null:{parent:hs?sn._currentValue:sn._currentValue2,pool:l}}function ki(l){l.flags|=4}function Nu(l,o){if(l!==null&&l.child===o.child)return!1;if((o.flags&16)!==0)return!0;for(l=o.child;l!==null;){if((l.flags&13878)!==0||(l.subtreeFlags&13878)!==0)return!0;l=l.sibling}return!1}function Cr(l,o,d,_){if(dn)for(d=o.child;d!==null;){if(d.tag===5||d.tag===6)cs(l,d.stateNode);else if(!(d.tag===4||an&&d.tag===27)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else if(Ws)for(var x=o.child;x!==null;){if(x.tag===5){var C=x.stateNode;d&&_&&(C=Eg(C,x.type,x.memoizedProps)),cs(l,C)}else if(x.tag===6)C=x.stateNode,d&&_&&(C=Cg(C,x.memoizedProps)),cs(l,C);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)C=x.child,C!==null&&(C.return=x),Cr(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===o)break;for(;x.sibling===null;){if(x.return===null||x.return===o)return;x=x.return}x.sibling.return=x.return,x=x.sibling}}function mh(l,o,d,_){if(Ws)for(var x=o.child;x!==null;){if(x.tag===5){var C=x.stateNode;d&&_&&(C=Eg(C,x.type,x.memoizedProps)),Wh(l,C)}else if(x.tag===6)C=x.stateNode,d&&_&&(C=Cg(C,x.memoizedProps)),Wh(l,C);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)C=x.child,C!==null&&(C.return=x),mh(l,x,!(x.memoizedProps!==null&&x.memoizedProps.mode==="manual"),!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===o)break;for(;x.sibling===null;){if(x.return===null||x.return===o)return;x=x.return}x.sibling.return=x.return,x=x.sibling}}function Rr(l,o){if(Ws&&Nu(l,o)){l=o.stateNode;var d=l.containerInfo,_=Et();mh(_,o,!1,!1),l.pendingChildren=_,ki(o),rb(d,_)}}function ni(l,o,d,_){if(dn)l.memoizedProps!==_&&ki(o);else if(Ws){var x=l.stateNode,C=l.memoizedProps;if((l=Nu(l,o))||C!==_){var B=Fn.current;C=Tg(x,d,C,_,!l,null),C===x?o.stateNode=x:(Yp(C,d,_,B)&&ki(o),o.stateNode=C,l?Cr(C,o,!1,!1):ki(o))}else o.stateNode=x}}function So(l,o,d){if($0(o,d)){if(l.flags|=16777216,!kp(o,d))if(Ph())l.flags|=8192;else throw wo=ff,ar}else l.flags&=-16777217}function yh(l,o){if(Yn(o)){if(l.flags|=16777216,!Pg(o))if(Ph())l.flags|=8192;else throw wo=ff,ar}else l.flags&=-16777217}function Gu(l,o){o!==null&&(l.flags|=4),l.flags&16384&&(o=l.tag!==22?me():536870912,l.lanes|=o,Yo|=o)}function Sl(l,o){if(!_t)switch(l.tailMode){case"hidden":o=l.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?l.tail=null:d.sibling=null;break;case"collapsed":d=l.tail;for(var _=null;d!==null;)d.alternate!==null&&(_=d),d=d.sibling;_===null?o||l.tail===null?l.tail=null:l.tail.sibling=null:_.sibling=null}}function zt(l){var o=l.alternate!==null&&l.alternate.child===l.child,d=0,_=0;if(o)for(var x=l.child;x!==null;)d|=x.lanes|x.childLanes,_|=x.subtreeFlags&31457280,_|=x.flags&31457280,x.return=l,x=x.sibling;else for(x=l.child;x!==null;)d|=x.lanes|x.childLanes,_|=x.subtreeFlags,_|=x.flags,x.return=l,x=x.sibling;return l.subtreeFlags|=_,l.childLanes=d,o}function up(l,o,d){var _=o.pendingProps;switch(_e(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(o),null;case 1:return zt(o),null;case 3:return d=o.stateNode,_=null,l!==null&&(_=l.memoizedState.cache),o.memoizedState.cache!==_&&(o.flags|=2048),Da(sn),Ue(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(l===null||l.child===null)&&(Oi(o)?ki(o):l===null||l.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,za!==null&&(zu(za),za=null))),Rr(l,o),zt(o),null;case 26:if(Zi){d=o.type;var x=o.memoizedState;return l===null?(ki(o),x!==null?(zt(o),yh(o,x)):(zt(o),So(o,d,_))):x?x!==l.memoizedState?(ki(o),zt(o),yh(o,x)):(zt(o),o.flags&=-16777217):(dn?l.memoizedProps!==_&&ki(o):ni(l,o,d,_),zt(o),So(o,d,_)),null}case 27:if(an){if(Be(o),d=Hr.current,x=o.type,l!==null&&o.stateNode!=null)dn?l.memoizedProps!==_&&ki(o):ni(l,o,x,_);else{if(!_){if(o.stateNode===null)throw Error(r(166));return zt(o),null}l=Fn.current,Oi(o)?St(o,l):(l=Bl(x,_,d,l,!0),o.stateNode=l,ki(o))}return zt(o),null}case 5:if(Be(o),d=o.type,l!==null&&o.stateNode!=null)ni(l,o,d,_);else{if(!_){if(o.stateNode===null)throw Error(r(166));return zt(o),null}l=Fn.current,Oi(o)?St(o,l):(x=jp(d,_,Hr.current,l,o),Cr(x,o,!1,!1),o.stateNode=x,Yp(x,d,_,l)&&ki(o))}return zt(o),So(o,o.type,o.pendingProps),null;case 6:if(l&&o.stateNode!=null)d=l.memoizedProps,dn?d!==_&&ki(o):Ws&&(d!==_?(o.stateNode=Xp(_,Hr.current,Fn.current,o),ki(o)):o.stateNode=l.stateNode);else{if(typeof _!="string"&&o.stateNode===null)throw Error(r(166));if(l=Hr.current,d=Fn.current,Oi(o)){if(!vi)throw Error(r(176));if(l=o.stateNode,d=o.memoizedProps,_=null,x=si,x!==null)switch(x.tag){case 27:case 5:_=x.memoizedProps}wr(l,d,o,_)||At(o)}else o.stateNode=Xp(_,l,d,o)}return zt(o),null;case 13:if(_=o.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(x=Oi(o),_!==null&&_.dehydrated!==null){if(l===null){if(!x)throw Error(r(318));if(!vi)throw Error(r(344));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));Bg(x,o)}else hn(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;zt(o),x=!1}else za!==null&&(zu(za),za=null),x=!0;if(!x)return o.flags&256?($a(o),o):($a(o),null)}if($a(o),(o.flags&128)!==0)return o.lanes=d,o;if(d=_!==null,l=l!==null&&l.memoizedState!==null,d){_=o.child,x=null,_.alternate!==null&&_.alternate.memoizedState!==null&&_.alternate.memoizedState.cachePool!==null&&(x=_.alternate.memoizedState.cachePool.pool);var C=null;_.memoizedState!==null&&_.memoizedState.cachePool!==null&&(C=_.memoizedState.cachePool.pool),C!==x&&(_.flags|=2048)}return d!==l&&d&&(o.child.flags|=8192),Gu(o,o.updateQueue),zt(o),null;case 4:return Ue(),Rr(l,o),l===null&&dg(o.stateNode.containerInfo),zt(o),null;case 10:return Da(o.type),zt(o),null;case 19:if(G(Tn),x=o.memoizedState,x===null)return zt(o),null;if(_=(o.flags&128)!==0,C=x.rendering,C===null)if(_)Sl(x,!1);else{if($t!==0||l!==null&&(l.flags&128)!==0)for(l=o.child;l!==null;){if(C=es(l),C!==null){for(o.flags|=128,Sl(x,!1),l=C.updateQueue,o.updateQueue=l,Gu(o,l),o.subtreeFlags=0,l=d,d=o.child;d!==null;)Xt(d,l),d=d.sibling;return P(Tn,Tn.current&1|2),o.child}l=l.sibling}x.tail!==null&&da()>ac&&(o.flags|=128,_=!0,Sl(x,!1),o.lanes=4194304)}else{if(!_)if(l=es(C),l!==null){if(o.flags|=128,_=!0,l=l.updateQueue,o.updateQueue=l,Gu(o,l),Sl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!C.alternate&&!_t)return zt(o),null}else 2*da()-x.renderingStartTime>ac&&d!==536870912&&(o.flags|=128,_=!0,Sl(x,!1),o.lanes=4194304);x.isBackwards?(C.sibling=o.child,o.child=C):(l=x.last,l!==null?l.sibling=C:o.child=C,x.last=C)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=da(),o.sibling=null,l=Tn.current,P(Tn,_?l&1|2:l&1),o):(zt(o),null);case 22:case 23:return $a(o),Fd(),_=o.memoizedState!==null,l!==null?l.memoizedState!==null!==_&&(o.flags|=8192):_&&(o.flags|=8192),_?(d&536870912)!==0&&(o.flags&128)===0&&(zt(o),o.subtreeFlags&6&&(o.flags|=8192)):zt(o),d=o.updateQueue,d!==null&&Gu(o,d.retryQueue),d=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),_=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(_=o.memoizedState.cachePool.pool),_!==d&&(o.flags|=2048),l!==null&&G(sr),null;case 24:return d=null,l!==null&&(d=l.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),Da(sn),zt(o),null;case 25:return null}throw Error(r(156,o.tag))}function gh(l,o){switch(_e(o),o.tag){case 1:return l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 3:return Da(sn),Ue(),l=o.flags,(l&65536)!==0&&(l&128)===0?(o.flags=l&-65537|128,o):null;case 26:case 27:case 5:return Be(o),null;case 13:if($a(o),l=o.memoizedState,l!==null&&l.dehydrated!==null){if(o.alternate===null)throw Error(r(340));hn()}return l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 19:return G(Tn),null;case 4:return Ue(),null;case 10:return Da(o.type),null;case 22:case 23:return $a(o),Fd(),l!==null&&G(sr),l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 24:return Da(sn),null;case 25:return null;default:return null}}function _h(l,o){switch(_e(o),o.tag){case 3:Da(sn),Ue();break;case 26:case 27:case 5:Be(o);break;case 4:Ue();break;case 13:$a(o);break;case 19:G(Tn);break;case 10:Da(o.type);break;case 22:case 23:$a(o),Fd(),l!==null&&G(sr);break;case 24:Da(sn)}}function Ar(l,o){try{var d=o.updateQueue,_=d!==null?d.lastEffect:null;if(_!==null){var x=_.next;d=x;do{if((d.tag&l)===l){_=void 0;var C=d.create,B=d.inst;_=C(),B.destroy=_}d=d.next}while(d!==x)}}catch(H){tt(o,o.return,H)}}function ss(l,o,d){try{var _=o.updateQueue,x=_!==null?_.lastEffect:null;if(x!==null){var C=x.next;_=C;do{if((_.tag&l)===l){var B=_.inst,H=B.destroy;if(H!==void 0){B.destroy=void 0,x=o;var I=d;try{H()}catch(se){tt(x,I,se)}}}_=_.next}while(_!==C)}}catch(se){tt(o,o.return,se)}}function cp(l){var o=l.updateQueue;if(o!==null){var d=l.stateNode;try{ce(o,d)}catch(_){tt(l,l.return,_)}}}function hp(l,o,d){d.props=Ke(l.type,l.memoizedProps),d.state=l.memoizedState;try{d.componentWillUnmount()}catch(_){tt(l,o,_)}}function qs(l,o){try{var d=l.ref;if(d!==null){var _=l.stateNode;switch(l.tag){case 26:case 27:case 5:var x=Mo(_);break;default:x=_}typeof d=="function"?l.refCleanup=d(x):d.current=x}}catch(C){tt(l,o,C)}}function Pi(l,o){var d=l.ref,_=l.refCleanup;if(d!==null)if(typeof _=="function")try{_()}catch(x){tt(l,o,x)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){tt(l,o,x)}else d.current=null}function fp(l){var o=l.type,d=l.memoizedProps,_=l.stateNode;try{nb(_,o,d,l)}catch(x){tt(l,l.return,x)}}function dp(l,o,d){try{bg(l.stateNode,l.type,d,o,l)}catch(_){tt(l,l.return,_)}}function vh(l){return l.tag===5||l.tag===3||(Zi?l.tag===26:!1)||(an?l.tag===27:!1)||l.tag===4}function bh(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||vh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&(!an||l.tag!==27)&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function xh(l,o,d){var _=l.tag;if(_===5||_===6)l=l.stateNode,o?ib(d,l,o):vg(d,l);else if(!(_===4||an&&_===27)&&(l=l.child,l!==null))for(xh(l,o,d),l=l.sibling;l!==null;)xh(l,o,d),l=l.sibling}function rs(l,o,d){var _=l.tag;if(_===5||_===6)l=l.stateNode,o?xg(d,l,o):Zp(d,l);else if(!(_===4||an&&_===27)&&(l=l.child,l!==null))for(rs(l,o,d),l=l.sibling;l!==null;)rs(l,o,d),l=l.sibling}function Sh(l,o,d){l=l.containerInfo;try{$p(l,d)}catch(_){tt(o,o.return,_)}}function pp(l,o){for(Qs(l.containerInfo),Nn=o;Nn!==null;)if(l=Nn,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Nn=o;else for(;Nn!==null;){l=Nn;var d=l.alternate;switch(o=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&d!==null){o=void 0;var _=l,x=d.memoizedProps;d=d.memoizedState;var C=_.stateNode;try{var B=Ke(_.type,x,_.elementType===_.type);o=C.getSnapshotBeforeUpdate(B,d),C.__reactInternalSnapshotBeforeUpdate=o}catch(H){tt(_,_.return,H)}}break;case 3:(o&1024)!==0&&dn&&Gr(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Nn=o;break}Nn=l.return}return B=qg,qg=!1,B}function ag(l,o,d){var _=d.flags;switch(d.tag){case 0:case 11:case 15:ls(l,d),_&4&&Ar(5,d);break;case 1:if(ls(l,d),_&4)if(l=d.stateNode,o===null)try{l.componentDidMount()}catch(H){tt(d,d.return,H)}else{var x=Ke(d.type,o.memoizedProps);o=o.memoizedState;try{l.componentDidUpdate(x,o,l.__reactInternalSnapshotBeforeUpdate)}catch(H){tt(d,d.return,H)}}_&64&&cp(d),_&512&&qs(d,d.return);break;case 3:if(ls(l,d),_&64&&(_=d.updateQueue,_!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=Mo(d.child.stateNode);break;case 1:l=d.child.stateNode}try{ce(_,l)}catch(H){tt(d,d.return,H)}}break;case 26:if(Zi){ls(l,d),_&512&&qs(d,d.return);break}case 27:case 5:ls(l,d),o===null&&_&4&&fp(d),_&512&&qs(d,d.return);break;case 12:ls(l,d);break;case 13:ls(l,d),_&4&&Th(l,d);break;case 22:if(x=d.memoizedState!==null||_s,!x){o=o!==null&&o.memoizedState!==null||rn;var C=_s,B=rn;_s=x,(rn=o)&&!B?Ua(l,d,(d.subtreeFlags&8772)!==0):ls(l,d),_s=C,rn=B}_&512&&(d.memoizedProps.mode==="manual"?qs(d,d.return):Pi(d,d.return));break;default:ls(l,d)}}function sg(l){var o=l.alternate;o!==null&&(l.alternate=null,sg(o)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(o=l.stateNode,o!==null&&Qh(o)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function oa(l,o,d){for(d=d.child;d!==null;)Tl(l,o,d),d=d.sibling}function Tl(l,o,d){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(Ol,d)}catch{}switch(d.tag){case 26:if(Zi){rn||Pi(d,o),oa(l,o,d),d.memoizedState?nf(d.memoizedState):d.stateNode&&ut(d.stateNode);break}case 27:if(an){rn||Pi(d,o);var _=yn,x=$i;yn=d.stateNode,oa(l,o,d),fb(d.stateNode),yn=_,$i=x;break}case 5:rn||Pi(d,o);case 6:if(dn){if(_=yn,x=$i,yn=null,oa(l,o,d),yn=_,$i=x,yn!==null)if($i)try{Zh(yn,d.stateNode)}catch(C){tt(d,o,C)}else try{Oo(yn,d.stateNode)}catch(C){tt(d,o,C)}}else oa(l,o,d);break;case 18:dn&&yn!==null&&($i?am(yn,d.stateNode):Og(yn,d.stateNode));break;case 4:dn?(_=yn,x=$i,yn=d.stateNode.containerInfo,$i=!0,oa(l,o,d),yn=_,$i=x):(Ws&&Sh(d.stateNode,d,Et()),oa(l,o,d));break;case 0:case 11:case 14:case 15:rn||ss(2,d,o),rn||ss(4,d,o),oa(l,o,d);break;case 1:rn||(Pi(d,o),_=d.stateNode,typeof _.componentWillUnmount=="function"&&hp(d,o,_)),oa(l,o,d);break;case 21:oa(l,o,d);break;case 22:rn||Pi(d,o),rn=(_=rn)||d.memoizedState!==null,oa(l,o,d),rn=_;break;default:oa(l,o,d)}}function Th(l,o){if(vi&&o.memoizedState===null&&(l=o.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Dl(l)}catch(d){tt(o,o.return,d)}}function Eh(l){switch(l.tag){case 13:case 19:var o=l.stateNode;return o===null&&(o=l.stateNode=new Xg),o;case 22:return l=l.stateNode,o=l._retryCache,o===null&&(o=l._retryCache=new Xg),o;default:throw Error(r(435,l.tag))}}function Ch(l,o){var d=Eh(l);o.forEach(function(_){var x=Rp.bind(null,l,_);d.has(_)||(d.add(_),_.then(x,x))})}function mi(l,o){var d=o.deletions;if(d!==null)for(var _=0;_<d.length;_++){var x=d[_],C=l,B=o;if(dn){var H=B;e:for(;H!==null;){switch(H.tag){case 27:case 5:yn=H.stateNode,$i=!1;break e;case 3:yn=H.stateNode.containerInfo,$i=!0;break e;case 4:yn=H.stateNode.containerInfo,$i=!0;break e}H=H.return}if(yn===null)throw Error(r(160));Tl(C,B,x),yn=null,$i=!1}else Tl(C,B,x);C=x.alternate,C!==null&&(C.return=null),x.return=null}if(o.subtreeFlags&13878)for(o=o.child;o!==null;)Rh(o,l),o=o.sibling}function Rh(l,o){var d=l.alternate,_=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:mi(o,l),yi(l),_&4&&(ss(3,l,l.return),Ar(3,l),ss(5,l,l.return));break;case 1:mi(o,l),yi(l),_&512&&(rn||d===null||Pi(d,d.return)),_&64&&_s&&(l=l.updateQueue,l!==null&&(_=l.callbacks,_!==null&&(d=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=d===null?_:d.concat(_))));break;case 26:if(Zi){var x=Va;mi(o,l),yi(l),_&512&&(rn||d===null||Pi(d,d.return)),_&4&&(_=d!==null?d.memoizedState:null,o=l.memoizedState,d===null?o===null?l.stateNode===null?l.stateNode=cb(x,l.type,l.memoizedProps,l):Gg(x,l.type,l.stateNode):l.stateNode=lm(x,o,l.memoizedProps):_!==o?(_===null?d.stateNode!==null&&ut(d.stateNode):nf(_),o===null?Gg(x,l.type,l.stateNode):lm(x,o,l.memoizedProps)):o===null&&l.stateNode!==null&&dp(l,l.memoizedProps,d.memoizedProps));break}case 27:if(an&&_&4&&l.alternate===null){x=l.stateNode;var C=l.memoizedProps;try{af(x),om(l.type,C,x,l)}catch(ge){tt(l,l.return,ge)}}case 5:if(mi(o,l),yi(l),_&512&&(rn||d===null||Pi(d,d.return)),dn){if(l.flags&32){o=l.stateNode;try{Wp(o)}catch(ge){tt(l,l.return,ge)}}_&4&&l.stateNode!=null&&(o=l.memoizedProps,dp(l,o,d!==null?d.memoizedProps:o)),_&1024&&(_m=!0)}break;case 6:if(mi(o,l),yi(l),_&4&&dn){if(l.stateNode===null)throw Error(r(162));_=l.memoizedProps,d=d!==null?d.memoizedProps:_,o=l.stateNode;try{tb(o,d,_)}catch(ge){tt(l,l.return,ge)}}break;case 3:if(Zi?(wi(),x=Va,Va=tf(o.containerInfo),mi(o,l),Va=x):mi(o,l),yi(l),_&4){if(dn&&vi&&d!==null&&d.memoizedState.isDehydrated)try{$h(o.containerInfo)}catch(ge){tt(l,l.return,ge)}if(Ws){_=o.containerInfo,d=o.pendingChildren;try{$p(_,d)}catch(ge){tt(l,l.return,ge)}}}_m&&(_m=!1,mp(l));break;case 4:Zi?(d=Va,Va=tf(l.stateNode.containerInfo),mi(o,l),yi(l),Va=d):(mi(o,l),yi(l)),_&4&&Ws&&Sh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:mi(o,l),yi(l);break;case 13:mi(o,l),yi(l),l.child.flags&8192&&l.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Sm=da()),_&4&&(_=l.updateQueue,_!==null&&(l.updateQueue=null,Ch(l,_)));break;case 22:_&512&&(rn||d===null||Pi(d,d.return)),x=l.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,H=_s,I=rn;if(_s=H||x,rn=I||B,mi(o,l),rn=I,_s=H,yi(l),o=l.stateNode,o._current=l,o._visibility&=-3,o._visibility|=o._pendingVisibility&2,_&8192&&(o._visibility=x?o._visibility&-2:o._visibility|1,x&&(o=_s||rn,d===null||B||o||ua(l)),dn&&(l.memoizedProps===null||l.memoizedProps.mode!=="manual"))){e:if(d=null,dn)for(o=l;;){if(o.tag===5||Zi&&o.tag===26||an&&o.tag===27){if(d===null){B=d=o;try{C=B.stateNode,x?Jp(C):sb(B.stateNode,B.memoizedProps)}catch(ge){tt(B,B.return,ge)}}}else if(o.tag===6){if(d===null){B=o;try{var se=B.stateNode;x?ab(se):Sg(se,B.memoizedProps)}catch(ge){tt(B,B.return,ge)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===l)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}}_&4&&(_=l.updateQueue,_!==null&&(d=_.retryQueue,d!==null&&(_.retryQueue=null,Ch(l,d))));break;case 19:mi(o,l),yi(l),_&4&&(_=l.updateQueue,_!==null&&(l.updateQueue=null,Ch(l,_)));break;case 21:break;default:mi(o,l),yi(l)}}function yi(l){var o=l.flags;if(o&2){try{if(dn&&(!an||l.tag!==27)){e:{for(var d=l.return;d!==null;){if(vh(d)){var _=d;break e}d=d.return}throw Error(r(160))}switch(_.tag){case 27:if(an){var x=_.stateNode,C=bh(l);rs(l,C,x);break}case 5:var B=_.stateNode;_.flags&32&&(Wp(B),_.flags&=-33);var H=bh(l);rs(l,H,B);break;case 3:case 4:var I=_.stateNode.containerInfo,se=bh(l);xh(l,se,I);break;default:throw Error(r(161))}}}catch(ge){tt(l,l.return,ge)}l.flags&=-3}o&4096&&(l.flags&=-4097)}function mp(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var o=l;mp(o),o.tag===5&&o.flags&1024&&mg(o.stateNode),l=l.sibling}}function ls(l,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ag(l,o.alternate,o),o=o.sibling}function ua(l){for(l=l.child;l!==null;){var o=l;switch(o.tag){case 0:case 11:case 14:case 15:ss(4,o,o.return),ua(o);break;case 1:Pi(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&hp(o,o.return,d),ua(o);break;case 26:case 27:case 5:Pi(o,o.return),ua(o);break;case 22:Pi(o,o.return),o.memoizedState===null&&ua(o);break;default:ua(o)}l=l.sibling}}function Ua(l,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var _=o.alternate,x=l,C=o,B=C.flags;switch(C.tag){case 0:case 11:case 15:Ua(x,C,d),Ar(4,C);break;case 1:if(Ua(x,C,d),_=C,x=_.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){tt(_,_.return,se)}if(_=C,x=_.updateQueue,x!==null){var H=_.stateNode;try{var I=x.shared.hiddenCallbacks;if(I!==null)for(x.shared.hiddenCallbacks=null,x=0;x<I.length;x++)X(I[x],H)}catch(se){tt(_,_.return,se)}}d&&B&64&&cp(C),qs(C,C.return);break;case 26:case 27:case 5:Ua(x,C,d),d&&_===null&&B&4&&fp(C),qs(C,C.return);break;case 12:Ua(x,C,d);break;case 13:Ua(x,C,d),d&&B&4&&Th(x,C);break;case 22:C.memoizedState===null&&Ua(x,C,d),qs(C,C.return);break;default:Ua(x,C,d)}o=o.sibling}}function Ah(l,o){var d=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),l=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(l=o.memoizedState.cachePool.pool),l!==d&&(l!=null&&l.refCount++,d!=null&&xo(d))}function Pu(l,o){l=null,o.alternate!==null&&(l=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==l&&(o.refCount++,l!=null&&xo(l))}function os(l,o,d,_){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Mh(l,o,d,_),o=o.sibling}function Mh(l,o,d,_){var x=o.flags;switch(o.tag){case 0:case 11:case 15:os(l,o,d,_),x&2048&&Ar(9,o);break;case 3:os(l,o,d,_),x&2048&&(l=null,o.alternate!==null&&(l=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==l&&(o.refCount++,l!=null&&xo(l)));break;case 12:if(x&2048){os(l,o,d,_),l=o.stateNode;try{var C=o.memoizedProps,B=C.id,H=C.onPostCommit;typeof H=="function"&&H(B,o.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(I){tt(o,o.return,I)}}else os(l,o,d,_);break;case 23:break;case 22:C=o.stateNode,o.memoizedState!==null?C._visibility&4?os(l,o,d,_):on(l,o):C._visibility&4?os(l,o,d,_):(C._visibility|=4,To(l,o,d,_,(o.subtreeFlags&10256)!==0)),x&2048&&Ah(o.alternate,o);break;case 24:os(l,o,d,_),x&2048&&Pu(o.alternate,o);break;default:os(l,o,d,_)}}function To(l,o,d,_,x){for(x=x&&(o.subtreeFlags&10256)!==0,o=o.child;o!==null;){var C=l,B=o,H=d,I=_,se=B.flags;switch(B.tag){case 0:case 11:case 15:To(C,B,H,I,x),Ar(8,B);break;case 23:break;case 22:var ge=B.stateNode;B.memoizedState!==null?ge._visibility&4?To(C,B,H,I,x):on(C,B):(ge._visibility|=4,To(C,B,H,I,x)),x&&se&2048&&Ah(B.alternate,B);break;case 24:To(C,B,H,I,x),x&&se&2048&&Pu(B.alternate,B);break;default:To(C,B,H,I,x)}o=o.sibling}}function on(l,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=l,_=o,x=_.flags;switch(_.tag){case 22:on(d,_),x&2048&&Ah(_.alternate,_);break;case 24:on(d,_),x&2048&&Pu(_.alternate,_);break;default:on(d,_)}o=o.sibling}}function Mr(l){if(l.subtreeFlags&Hl)for(l=l.child;l!==null;)yp(l),l=l.sibling}function yp(l){switch(l.tag){case 26:Mr(l),l.flags&Hl&&(l.memoizedState!==null?Ul(Va,l.memoizedState,l.memoizedProps):Ip(l.type,l.memoizedProps));break;case 5:Mr(l),l.flags&Hl&&Ip(l.type,l.memoizedProps);break;case 3:case 4:if(Zi){var o=Va;Va=tf(l.stateNode.containerInfo),Mr(l),Va=o}else Mr(l);break;case 22:l.memoizedState===null&&(o=l.alternate,o!==null&&o.memoizedState!==null?(o=Hl,Hl=16777216,Mr(l),Hl=o):Mr(l));break;default:Mr(l)}}function gp(l){var o=l.alternate;if(o!==null&&(l=o.child,l!==null)){o.child=null;do o=l.sibling,l.sibling=null,l=o;while(l!==null)}}function Eo(l){var o=l.deletions;if((l.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var _=o[d];Nn=_,Dh(_,l)}gp(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)_p(l),l=l.sibling}function _p(l){switch(l.tag){case 0:case 11:case 15:Eo(l),l.flags&2048&&ss(9,l,l.return);break;case 3:Eo(l);break;case 12:Eo(l);break;case 22:var o=l.stateNode;l.memoizedState!==null&&o._visibility&4&&(l.return===null||l.return.tag!==13)?(o._visibility&=-5,Dr(l)):Eo(l);break;default:Eo(l)}}function Dr(l){var o=l.deletions;if((l.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var _=o[d];Nn=_,Dh(_,l)}gp(l)}for(l=l.child;l!==null;){switch(o=l,o.tag){case 0:case 11:case 15:ss(8,o,o.return),Dr(o);break;case 22:d=o.stateNode,d._visibility&4&&(d._visibility&=-5,Dr(o));break;default:Dr(o)}l=l.sibling}}function Dh(l,o){for(;Nn!==null;){var d=Nn;switch(d.tag){case 0:case 11:case 15:ss(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var _=d.memoizedState.cachePool.pool;_!=null&&_.refCount++}break;case 24:xo(d.memoizedState.cache)}if(_=d.child,_!==null)_.return=d,Nn=_;else e:for(d=l;Nn!==null;){_=Nn;var x=_.sibling,C=_.return;if(sg(_),_===d){Nn=null;break e}if(x!==null){x.return=C,Nn=x;break e}Nn=C}}}function Uh(l){var o=qp(l);if(o!=null){if(typeof o.memoizedProps["data-testname"]!="string")throw Error(r(364));return o}if(l=Kp(l),l===null)throw Error(r(362));return l.stateNode.current}function Bh(l,o){var d=l.tag;switch(o.$$typeof){case gf:if(l.type===o.value)return!0;break;case _f:e:{for(o=o.value,l=[l,0],d=0;d<l.length;){var _=l[d++],x=_.tag,C=l[d++],B=o[C];if(x!==5&&x!==26&&x!==27||!Bo(_)){for(;B!=null&&Bh(_,B);)C++,B=o[C];if(C===o.length){o=!0;break e}else for(_=_.child;_!==null;)l.push(_,C),_=_.sibling}}o=!1}return o;case vf:if((d===5||d===26||d===27)&&gg(l.stateNode,o.value))return!0;break;case ic:if((d===5||d===6||d===26||d===27)&&(l=yg(l),l!==null&&0<=l.indexOf(o.value)))return!0;break;case nc:if((d===5||d===26||d===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===o.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Oh(l){switch(l.$$typeof){case gf:return"<"+(h(l.value)||"Unknown")+">";case _f:return":has("+(Oh(l)||"")+")";case vf:return'[role="'+l.value+'"]';case ic:return'"'+l.value+'"';case nc:return'[data-testname="'+l.value+'"]';default:throw Error(r(365))}}function Nh(l,o){var d=[];l=[l,0];for(var _=0;_<l.length;){var x=l[_++],C=x.tag,B=l[_++],H=o[B];if(C!==5&&C!==26&&C!==27||!Bo(x)){for(;H!=null&&Bh(x,H);)B++,H=o[B];if(B===o.length)d.push(x);else for(x=x.child;x!==null;)l.push(x,B),x=x.sibling}}return d}function wu(l,o){if(!Nr)throw Error(r(363));l=Uh(l),l=Nh(l,o),o=[],l=Array.from(l);for(var d=0;d<l.length;){var _=l[d++],x=_.tag;if(x===5||x===26||x===27)Bo(_)||o.push(_.stateNode);else for(_=_.child;_!==null;)l.push(_),_=_.sibling}return o}function gi(){if((Bt&2)!==0&&pt!==0)return pt&-pt;if(ke.T!==null){var l=Po;return l!==0?l:ro()}return Fp()}function vp(){ea===0&&(ea=(pt&536870912)===0||_t?Te():536870912);var l=ri.current;return l!==null&&(l.flags|=32),ea}function jn(l,o,d){(l===Ht&&Ot===2||l.cancelPendingCommit!==null)&&(Ur(l,0),Ba(l,pt,ea,!1)),le(l,d),((Bt&2)===0||l!==Ht)&&(l===Ht&&((Bt&2)===0&&(Ll|=d),$t===4&&Ba(l,pt,ea,!1)),Ye(l))}function Gh(l,o,d){if((Bt&6)!==0)throw Error(r(327));var _=!d&&(o&60)===0&&(o&l.expiredLanes)===0||ie(l,o),x=_?Lu(l,o):Vu(l,o,!0),C=_;do{if(x===0){Vl&&!_&&Ba(l,o,0,!1);break}else if(x===6)Ba(l,o,0,!vs);else{if(d=l.current.alternate,C&&!rg(d)){x=Vu(l,o,!1),C=!1;continue}if(x===2){if(C=o,l.errorRecoveryDisabledLanes&C)var B=0;else B=l.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){o=B;e:{var H=l;x=gn;var I=vi&&H.current.memoizedState.isDehydrated;if(I&&(Ur(H,B).flags|=256),B=Vu(H,B,!1),B!==2){if(vm&&!I){H.errorRecoveryDisabledLanes|=C,Ll|=C,x=4;break e}C=La,La=x,C!==null&&zu(C)}x=B}if(C=!1,x!==2)continue}}if(x===1){Ur(l,0),Ba(l,o,0,!0);break}e:{switch(_=l,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Ba(_,o,ea,!vs);break e}break;case 2:La=null;break;case 3:case 5:break;default:throw Error(r(329))}if(_.finishedWork=d,_.finishedLanes=o,(o&62914560)===o&&(C=Sm+300-da(),10<C)){if(Ba(_,o,ea,!vs),ne(_,0)!==0)break e;_.timeoutHandle=qu(bp.bind(null,_,d,La,sc,xm,o,ea,Ll,Yo,vs,2,-0,0),C);break e}bp(_,d,La,sc,xm,o,ea,Ll,Yo,vs,0,-0,0)}}break}while(!0);Ye(l)}function zu(l){La===null?La=l:La.push.apply(La,l)}function bp(l,o,d,_,x,C,B,H,I,se,ge,Ae,Ee){var Pe=o.subtreeFlags;if((Pe&8192||(Pe&16785408)===16785408)&&(Qi(),yp(o),o=Jt(),o!==null)){l.cancelPendingCommit=o(Or.bind(null,l,d,_,x,B,H,I,1,Ae,Ee)),Ba(l,C,B,!se);return}Or(l,d,_,x,B,H,I,ge,Ae,Ee)}function rg(l){for(var o=l;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var _=0;_<d.length;_++){var x=d[_],C=x.getSnapshot;x=x.value;try{if(!xi(C(),x))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===l)break;for(;o.sibling===null;){if(o.return===null||o.return===l)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ba(l,o,d,_){o&=~bm,o&=~Ll,l.suspendedLanes|=o,l.pingedLanes&=~o,_&&(l.warmLanes|=o),_=l.expirationTimes;for(var x=o;0<x;){var C=31-bi(x),B=1<<C;_[C]=-1,x&=~B}d!==0&&ae(l,d,o)}function xp(){return(Bt&6)===0?(yt(0),!1):!0}function Oa(){if(Fe!==null){if(Ot===0)var l=Fe.return;else l=Fe,Ha=Yr=null,uo(l),zo=null,$u=0,l=Fe;for(;l!==null;)_h(l.alternate,l),l=l.return;Fe=null}}function Ur(l,o){l.finishedWork=null,l.finishedLanes=0;var d=l.timeoutHandle;d!==Kh&&(l.timeoutHandle=Kh,Al(d)),d=l.cancelPendingCommit,d!==null&&(l.cancelPendingCommit=null,d()),Oa(),Ht=l,Fe=d=ca(l.current,null),pt=o,Ot=0,Hi=null,vs=!1,Vl=ie(l,o),vm=!1,Yo=ea=bm=Ll=Xr=$t=0,La=gn=null,xm=!1,(o&8)!==0&&(o|=o&32);var _=l.entangledLanes;if(_!==0)for(l=l.entanglements,_&=o;0<_;){var x=31-bi(_),C=1<<x;o|=l[x],_&=~C}return bs=o,$n(),d}function lg(l,o){lt=null,ke.H=gs,o===ms?(o=ft(),Ot=3):o===ar?(o=ft(),Ot=4):Ot=o===ym?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Hi=o,Fe===null&&($t=1,ue(l,oe(o,l.current)))}function Ph(){var l=ri.current;return l===null?!0:(pt&4194176)===pt?ys===null:(pt&62914560)===pt||(pt&536870912)!==0?l===ys:!1}function Hu(){var l=ke.H;return ke.H=gs,l===null?gs:l}function Fs(){var l=ke.A;return ke.A=yb,l}function Na(){$t=4,vs||(pt&4194176)!==pt&&ri.current!==null||(Vl=!0),(Xr&134217727)===0&&(Ll&134217727)===0||Ht===null||Ba(Ht,pt,ea,!1)}function Vu(l,o,d){var _=Bt;Bt|=2;var x=Hu(),C=Fs();(Ht!==l||pt!==o)&&(sc=null,Ur(l,o)),o=!1;var B=$t;e:do try{if(Ot!==0&&Fe!==null){var H=Fe,I=Hi;switch(Ot){case 8:Oa(),B=6;break e;case 3:case 2:case 6:ri.current===null&&(o=!0);var se=Ot;if(Ot=0,Hi=null,ks(l,H,I,se),d&&Vl){B=0;break e}break;default:se=Ot,Ot=0,Hi=null,ks(l,H,I,se)}}Sp(),B=$t;break}catch(ge){lg(l,ge)}while(!0);return o&&l.shellSuspendCounter++,Ha=Yr=null,Bt=_,ke.H=x,ke.A=C,Fe===null&&(Ht=null,pt=0,$n()),B}function Sp(){for(;Fe!==null;)Br(Fe)}function Lu(l,o){var d=Bt;Bt|=2;var _=Hu(),x=Fs();Ht!==l||pt!==o?(sc=null,ac=da()+500,Ur(l,o)):Vl=ie(l,o);e:do try{if(Ot!==0&&Fe!==null){o=Fe;var C=Hi;t:switch(Ot){case 1:Ot=0,Hi=null,ks(l,o,C,1);break;case 2:if(Oe(C)){Ot=0,Hi=null,Yt(o);break}o=function(){Ot===2&&Ht===l&&(Ot=7),Ye(l)},C.then(o,o);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:Oe(C)?(Ot=0,Hi=null,Yt(o)):(Ot=0,Hi=null,ks(l,o,C,7));break;case 5:var B=null;switch(Fe.tag){case 26:B=Fe.memoizedState;case 5:case 27:var H=Fe,I=H.type,se=H.pendingProps;if(B?Pg(B):kp(I,se)){Ot=0,Hi=null;var ge=H.sibling;if(ge!==null)Fe=ge;else{var Ae=H.return;Ae!==null?(Fe=Ae,ju(Ae)):Fe=null}break t}}Ot=0,Hi=null,ks(l,o,C,5);break;case 6:Ot=0,Hi=null,ks(l,o,C,6);break;case 8:Oa(),$t=6;break e;default:throw Error(r(462))}}wh();break}catch(Ee){lg(l,Ee)}while(!0);return Ha=Yr=null,ke.H=_,ke.A=x,Bt=d,Fe!==null?0:(Ht=null,pt=0,$n(),$t)}function wh(){for(;Fe!==null&&!ee();)Br(Fe)}function Br(l){var o=uh(l.alternate,l,bs);l.memoizedProps=l.pendingProps,o===null?ju(l):Fe=o}function Yt(l){var o=l,d=o.alternate;switch(o.tag){case 15:case 0:o=vo(d,o,o.pendingProps,o.type,void 0,pt);break;case 11:o=vo(d,o,o.pendingProps,o.type.render,o.ref,pt);break;case 5:uo(o);default:_h(d,o),o=Fe=Xt(o,bs),o=uh(d,o,bs)}l.memoizedProps=l.pendingProps,o===null?ju(l):Fe=o}function ks(l,o,d,_){Ha=Yr=null,uo(o),zo=null,$u=0;var x=o.return;try{if(rp(l,x,o,d,pt)){$t=1,ue(l,oe(d,l.current)),Fe=null;return}}catch(C){if(x!==null)throw Fe=x,C;$t=1,ue(l,oe(d,l.current)),Fe=null;return}o.flags&32768?(_t||_===1?l=!0:Vl||(pt&536870912)!==0?l=!1:(vs=l=!0,(_===2||_===3||_===6)&&(_=ri.current,_!==null&&_.tag===13&&(_.flags|=16384))),zh(o,l)):ju(o)}function ju(l){var o=l;do{if((o.flags&32768)!==0){zh(o,vs);return}l=o.return;var d=up(o.alternate,o,bs);if(d!==null){Fe=d;return}if(o=o.sibling,o!==null){Fe=o;return}Fe=o=l}while(o!==null);$t===0&&($t=5)}function zh(l,o){do{var d=gh(l.alternate,l);if(d!==null){d.flags&=32767,Fe=d;return}if(d=l.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(l=l.sibling,l!==null)){Fe=l;return}Fe=l=d}while(l!==null);$t=6,Fe=null}function Or(l,o,d,_,x,C,B,H,I,se){var ge=ke.T,Ae=Js();try{ai(2),ke.T=null,Yu(l,o,d,_,Ae,x,C,B,H,I,se)}finally{ke.T=ge,ai(Ae)}}function Yu(l,o,d,_,x,C,B,H){do us();while(Ti!==null);if((Bt&6)!==0)throw Error(r(327));var I=l.finishedWork;if(_=l.finishedLanes,I===null)return null;if(l.finishedWork=null,l.finishedLanes=0,I===l.current)throw Error(r(177));l.callbackNode=null,l.callbackPriority=0,l.cancelPendingCommit=null;var se=I.lanes|I.childLanes;if(se|=ps,Ce(l,_,se,C,B,H),l===Ht&&(Fe=Ht=null,pt=0),(I.subtreeFlags&10256)===0&&(I.flags&10256)===0||Xo||(Xo=!0,In=se,Tm=d,Ap(of,function(){return us(),null})),d=(I.flags&15990)!==0,(I.subtreeFlags&15990)!==0||d?(d=ke.T,ke.T=null,C=Js(),ai(2),B=Bt,Bt|=4,pp(l,I),Rh(I,l),Lp(l.containerInfo),l.current=I,ag(l,I.alternate,I),Qu(),Bt=B,ai(C),ke.T=d):l.current=I,Xo?(Xo=!1,Ti=l,ga=_):Hh(l,se),se=l.pendingLanes,se===0&&(xs=null),V(I.stateNode),Ye(l),o!==null)for(x=l.onRecoverableError,I=0;I<o.length;I++)se=o[I],x(se.value,{componentStack:se.stack});return(ga&3)!==0&&us(),se=l.pendingLanes,(_&4194218)!==0&&(se&42)!==0?l===qo?rc++:(rc=0,qo=l):rc=0,yt(0),null}function Hh(l,o){(l.pooledCacheLanes&=o)===0&&(o=l.pooledCache,o!=null&&(l.pooledCache=null,xo(o)))}function us(){if(Ti!==null){var l=Ti,o=In;In=0;var d=Rt(ga),_=32>d?32:d;d=ke.T;var x=Js();try{if(ai(_),ke.T=null,Ti===null)var C=!1;else{_=Tm,Tm=null;var B=Ti,H=ga;if(Ti=null,ga=0,(Bt&6)!==0)throw Error(r(331));var I=Bt;if(Bt|=4,_p(B.current),Mh(B,B.current,H,_),Bt=I,yt(0,!1),zi&&typeof zi.onPostCommitFiberRoot=="function")try{zi.onPostCommitFiberRoot(Ol,B)}catch{}C=!0}return C}finally{ai(x),ke.T=d,Hh(l,o)}}return!1}function Tp(l,o,d){o=oe(d,o),o=_o(l.stateNode,o,2),l=di(l,o,2),l!==null&&(le(l,2),Ye(l))}function tt(l,o,d){if(l.tag===3)Tp(l,l,d);else for(;o!==null;){if(o.tag===3){Tp(o,l,d);break}else if(o.tag===1){var _=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(xs===null||!xs.has(_))){l=oe(d,l),d=nn(2),_=di(o,d,2),_!==null&&(nh(d,_,o,l),le(_,2),Ye(_));break}}o=o.return}}function Vh(l,o,d){var _=l.pingCache;if(_===null){_=l.pingCache=new Fg;var x=new Set;_.set(o,x)}else x=_.get(o),x===void 0&&(x=new Set,_.set(o,x));x.has(d)||(vm=!0,x.add(d),l=Ep.bind(null,l,o,d),o.then(l,l))}function Ep(l,o,d){var _=l.pingCache;_!==null&&_.delete(o),l.pingedLanes|=l.suspendedLanes&d,l.warmLanes&=~d,Ht===l&&(pt&d)===d&&($t===4||$t===3&&(pt&62914560)===pt&&300>da()-Sm?(Bt&2)===0&&Ur(l,0):bm|=d,Yo===pt&&(Yo=0)),Ye(l)}function Cp(l,o){o===0&&(o=me()),l=jt(l,o),l!==null&&(le(l,o),Ye(l))}function og(l){var o=l.memoizedState,d=0;o!==null&&(d=o.retryLane),Cp(l,d)}function Rp(l,o){var d=0;switch(l.tag){case 13:var _=l.stateNode,x=l.memoizedState;x!==null&&(d=x.retryLane);break;case 19:_=l.stateNode;break;case 22:_=l.stateNode._retryCache;break;default:throw Error(r(314))}_!==null&&_.delete(o),Cp(l,d)}function Ap(l,o){return Ku(l,o)}function ug(l,o,d,_){this.tag=l,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Co(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ca(l,o){var d=l.alternate;return d===null?(d=t(l.tag,o,l.key,l.mode),d.elementType=l.elementType,d.type=l.type,d.stateNode=l.stateNode,d.alternate=l,l.alternate=d):(d.pendingProps=o,d.type=l.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=l.flags&31457280,d.childLanes=l.childLanes,d.lanes=l.lanes,d.child=l.child,d.memoizedProps=l.memoizedProps,d.memoizedState=l.memoizedState,d.updateQueue=l.updateQueue,o=l.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=l.sibling,d.index=l.index,d.ref=l.ref,d.refCleanup=l.refCleanup,d}function Xt(l,o){l.flags&=31457282;var d=l.alternate;return d===null?(l.childLanes=0,l.lanes=o,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=d.childLanes,l.lanes=d.lanes,l.child=d.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=d.memoizedProps,l.memoizedState=d.memoizedState,l.updateQueue=d.updateQueue,l.type=d.type,o=d.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),l}function Lh(l,o,d,_,x,C){var B=0;if(_=l,typeof l=="function")Co(l)&&(B=1);else if(typeof l=="string")B=Zi&&an?sm(l,d,Fn.current)?26:sf(l)?27:5:Zi?sm(l,d,Fn.current)?26:5:an&&sf(l)?27:5;else e:switch(l){case Rl:return El(d.children,x,C,o);case Np:B=8,x|=24;break;case Xh:return l=t(12,d,o,x|2),l.elementType=Xh,l.lanes=C,l;case Fh:return l=t(13,d,o,x),l.elementType=Fh,l.lanes=C,l;case wp:return l=t(19,d,o,x),l.elementType=wp,l.lanes=C,l;case fa:return Mp(d,x,C,o);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Gp:case Ga:B=10;break e;case qh:B=9;break e;case Pp:B=11;break e;case kh:B=14;break e;case Ks:B=16,_=null;break e}B=29,d=Error(r(130,l===null?"null":typeof l,"")),_=null}return o=t(B,d,o,x),o.elementType=l,o.type=_,o.lanes=C,o}function El(l,o,d,_){return l=t(7,l,_,o),l.lanes=d,l}function Mp(l,o,d,_){l=t(22,l,_,o),l.elementType=fa,l.lanes=d;var x={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var C=x._current;if(C===null)throw Error(r(456));if((x._pendingVisibility&2)===0){var B=jt(C,2);B!==null&&(x._pendingVisibility|=2,jn(B,C,2))}},attach:function(){var C=x._current;if(C===null)throw Error(r(456));if((x._pendingVisibility&2)!==0){var B=jt(C,2);B!==null&&(x._pendingVisibility&=-3,jn(B,C,2))}}};return l.stateNode=x,l}function ha(l,o,d){return l=t(6,l,null,o),l.lanes=d,l}function jh(l,o,d){return o=t(4,l.children!==null?l.children:[],l.key,o),o.lanes=d,o.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},o}function Dp(l,o,d,_,x,C,B,H){this.tag=1,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Kh,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=fe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fe(0),this.hiddenUpdates=fe(null),this.identifierPrefix=_,this.onUncaughtError=x,this.onCaughtError=C,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function Ro(l,o,d,_,x,C,B,H,I,se,ge,Ae){return l=new Dp(l,o,d,B,H,I,se,Ae),o=1,C===!0&&(o|=24),C=t(3,null,null,o),l.current=C,C.stateNode=l,o=ph(),o.refCount++,l.pooledCache=o,o.refCount++,C.memoizedState={element:_,isDehydrated:d,cache:o},la(C),l}function Cl(l){return l?(l=zr,l):zr}function Up(l){var o=l._reactInternals;if(o===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=E(o),l=l!==null?A(l):null,l===null?null:Mo(l.stateNode)}function Yh(l,o,d,_,x,C){x=Cl(x),_.context===null?_.context=x:_.pendingContext=x,_=fi(o),_.payload={element:d},C=C===void 0?null:C,C!==null&&(_.callback=C),d=di(l,_,o),d!==null&&(jn(d,l,o),pi(d,l,o))}function Bp(l,o){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var d=l.retryLane;l.retryLane=d!==0&&d<o?d:o}}function Op(l,o){Bp(l,o),(l=l.alternate)&&Bp(l,o)}var ct={},cg=bc(),Ii=c2(),Is=Object.assign,Ki=Symbol.for("react.element"),Xu=Symbol.for("react.transitional.element"),Ao=Symbol.for("react.portal"),Rl=Symbol.for("react.fragment"),Np=Symbol.for("react.strict_mode"),Xh=Symbol.for("react.profiler"),Gp=Symbol.for("react.provider"),qh=Symbol.for("react.consumer"),Ga=Symbol.for("react.context"),Pp=Symbol.for("react.forward_ref"),Fh=Symbol.for("react.suspense"),wp=Symbol.for("react.suspense_list"),kh=Symbol.for("react.memo"),Ks=Symbol.for("react.lazy"),fa=Symbol.for("react.offscreen"),zp=Symbol.for("react.memo_cache_sentinel"),Hp=Symbol.iterator,W0=Symbol.for("react.client.reference"),ke=cg.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Vp,_i,Ih=!1,ii=Array.isArray,hg=e.rendererVersion,J0=e.rendererPackageName,Pa=e.extraDevToolsConfig,Mo=e.getPublicInstance,Do=e.getRootHostContext,fg=e.getChildHostContext,Qs=e.prepareForCommit,Lp=e.resetAfterCommit,jp=e.createInstance,cs=e.appendInitialChild,Yp=e.finalizeInitialChildren,Zs=e.shouldSetTextContent,Xp=e.createTextInstance,qu=e.scheduleTimeout,Al=e.cancelTimeout,Kh=e.noTimeout,hs=e.isPrimaryRenderer;e.warnsIfNotActing;var dn=e.supportsMutation,Ws=e.supportsPersistence,vi=e.supportsHydration,qp=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var dg=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ai=e.setCurrentUpdatePriority,Js=e.getCurrentUpdatePriority,Fp=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var pg=e.shouldAttemptEagerTransition,Qh=e.detachDeletedInstance;e.requestPostPaintCallback;var $0=e.maySuspendCommit,kp=e.preloadInstance,Qi=e.startSuspendingCommit,Ip=e.suspendInstance,Jt=e.waitForCommitToBeReady,Ml=e.NotPendingTransition,$s=e.HostTransitionContext,mg=e.resetFormInstance;e.bindToConsole;var eb=e.supportsMicrotasks,er=e.scheduleMicrotask,Nr=e.supportsTestSelectors,Kp=e.findFiberRoot,Uo=e.getBoundingRect,yg=e.getTextContent,Bo=e.isHiddenSubtree,gg=e.matchAccessibilityRole,_g=e.setFocusIfFocusable,Qp=e.setupIntersectionObserver,Zp=e.appendChild,vg=e.appendChildToContainer,tb=e.commitTextUpdate,nb=e.commitMount,bg=e.commitUpdate,xg=e.insertBefore,ib=e.insertInContainerBefore,Oo=e.removeChild,Zh=e.removeChildFromContainer,Wp=e.resetTextContent,Jp=e.hideInstance,ab=e.hideTextInstance,sb=e.unhideInstance,Sg=e.unhideTextInstance,Gr=e.clearContainer,Tg=e.cloneInstance,Et=e.createContainerChildSet,Wh=e.appendChildToContainerChildSet,rb=e.finalizeContainerChildren,$p=e.replaceContainerChildren,Eg=e.cloneHiddenInstance,Cg=e.cloneHiddenTextInstance,Fu=e.isSuspenseInstancePending,Jh=e.isSuspenseInstanceFallback,Rg=e.getSuspenseInstanceFallbackErrorDetails,Ag=e.registerSuspenseInstanceRetry,ku=e.canHydrateFormStateMarker,lb=e.isFormStateMarkerMatching,Mg=e.getNextHydratableSibling,Pr=e.getFirstHydratableChild,em=e.getFirstHydratableChildWithinContainer,Dg=e.getFirstHydratableChildWithinSuspenseInstance,Ug=e.canHydrateInstance,tm=e.canHydrateTextInstance,ob=e.canHydrateSuspenseInstance,nm=e.hydrateInstance,wr=e.hydrateTextInstance,Bg=e.hydrateSuspenseInstance,im=e.getNextHydratableInstanceAfterSuspenseInstance,$h=e.commitHydratedContainer,Dl=e.commitHydratedSuspenseInstance,Og=e.clearSuspenseBoundary,am=e.clearSuspenseBoundaryFromContainer,ef=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var ub=e.validateHydratableInstance,Ng=e.validateHydratableTextInstance,Zi=e.supportsResources,sm=e.isHostHoistableType,tf=e.getHoistableRoot,rm=e.getResource,lm=e.acquireResource,nf=e.releaseResource,cb=e.hydrateHoistable,Gg=e.mountHoistable,ut=e.unmountHoistable,hb=e.createHoistableInstance,wi=e.prepareToCommitHoistables,Yn=e.mayResourceSuspendCommit,Pg=e.preloadResource,Ul=e.suspendResource,an=e.supportsSingletons,Bl=e.resolveSingletonInstance,af=e.clearSingleton,om=e.acquireSingletonInstance,fb=e.releaseSingletonInstance,sf=e.isHostSingletonType,wa=[],fs=-1,zr={},bi=Math.clz32?Math.clz32:w,rf=Math.log,Wi=Math.LN2,Iu=128,lf=4194304,Ku=Ii.unstable_scheduleCallback,um=Ii.unstable_cancelCallback,ee=Ii.unstable_shouldYield,Qu=Ii.unstable_requestPaint,da=Ii.unstable_now,cm=Ii.unstable_ImmediatePriority,wg=Ii.unstable_UserBlockingPriority,of=Ii.unstable_NormalPriority,zg=Ii.unstable_IdlePriority,Hg=Ii.log,Vg=Ii.unstable_setDisableYieldValue,Ol=null,zi=null,xi=typeof Object.is=="function"?Object.is:de,uf=new WeakMap,Xn=[],qn=0,Bn=null,cf=0,pa=[],Ji=0,ma=null,tr=1,nr="",Fn=M(null),Zu=M(null),Hr=M(null),No=M(null),si=null,Sn=null,_t=!1,za=null,ds=!1,Wu=Error(r(519)),pn=[],un=0,ps=0,Si=null,Nl=null,hm=!1,kn=!1,ir=!1,Go=0,Ju=null,fm=0,Po=0,Gl=null,Vr=!1,hf=!1,db=Object.prototype.hasOwnProperty,ms=Error(r(460)),ar=Error(r(474)),ff={then:function(){}},wo=null,zo=null,$u=0,ya=_r(!0),Lg=_r(!1),Ho=M(null),df=M(0),ri=M(null),ys=null,Tn=M(0),Lr=0,lt=null,Ut=null,mn=null,pf=!1,Vo=!1,Pl=!1,mf=0,ec=0,Lo=null,jg=0,dm=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},gs={readContext:Ln,use:vu,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt};gs.useCacheRefresh=Wt,gs.useMemoCache=Wt,gs.useHostTransitionStatus=Wt,gs.useFormState=Wt,gs.useActionState=Wt,gs.useOptimistic=Wt;var wl={readContext:Ln,use:vu,useCallback:function(l,o){return Hn().memoizedState=[l,o===void 0?null:o],l},useContext:Ln,useEffect:fo,useImperativeHandle:function(l,o,d){d=d!=null?d.concat([l]):null,gl(4194308,4,Su.bind(null,o,l),d)},useLayoutEffect:function(l,o){return gl(4194308,4,l,o)},useInsertionEffect:function(l,o){gl(4,2,l,o)},useMemo:function(l,o){var d=Hn();o=o===void 0?null:o;var _=l();if(Pl){W(!0);try{l()}finally{W(!1)}}return d.memoizedState=[_,o],_},useReducer:function(l,o,d){var _=Hn();if(d!==void 0){var x=d(o);if(Pl){W(!0);try{d(o)}finally{W(!1)}}}else x=o;return _.memoizedState=_.baseState=x,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:x},_.queue=l,l=l.dispatch=th.bind(null,lt,l),[_.memoizedState,l]},useRef:function(l){var o=Hn();return l={current:l},o.memoizedState=l},useState:function(l){l=br(l);var o=l.queue,d=ap.bind(null,lt,o);return o.dispatch=d,[l.memoizedState,d]},useDebugValue:Jc,useDeferredValue:function(l,o){var d=Hn();return $c(d,l,o)},useTransition:function(){var l=br(!1);return l=Mn.bind(null,lt,l.queue,!0,!1),Hn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,o,d){var _=lt,x=Hn();if(_t){if(d===void 0)throw Error(r(407));d=d()}else{if(d=o(),Ht===null)throw Error(r(349));(pt&60)!==0||Kd(_,o,d)}x.memoizedState=d;var C={value:d,getSnapshot:o};return x.queue=C,fo(Aa.bind(null,_,C,l),[l]),_.flags|=2048,qi(9,Ra.bind(null,_,C,d,o),{destroy:void 0},null),d},useId:function(){var l=Hn(),o=Ht.identifierPrefix;if(_t){var d=nr,_=tr;d=(_&~(1<<32-bi(_)-1)).toString(32)+d,o=":"+o+"R"+d,d=mf++,0<d&&(o+="H"+d.toString(32)),o+=":"}else d=jg++,o=":"+o+"r"+d.toString(32)+":";return l.memoizedState=o},useCacheRefresh:function(){return Hn().memoizedState=eh.bind(null,lt)}};wl.useMemoCache=co,wl.useHostTransitionStatus=po,wl.useFormState=Jd,wl.useActionState=Jd,wl.useOptimistic=function(l){var o=Hn();o.memoizedState=o.baseState=l;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Ru.bind(null,lt,!0,d),d.dispatch=o,[l,o]};var jr={readContext:Ln,use:vu,useCallback:Tu,useContext:Ln,useEffect:Wc,useImperativeHandle:tp,useInsertionEffect:tg,useLayoutEffect:ep,useMemo:np,useReducer:ml,useRef:ho,useState:function(){return ml(Vn)},useDebugValue:Jc,useDeferredValue:function(l,o){var d=tn();return ip(d,Ut.memoizedState,l,o)},useTransition:function(){var l=ml(Vn)[0],o=tn().memoizedState;return[typeof l=="boolean"?l:fn(l),o]},useSyncExternalStore:kc,useId:mo};jr.useCacheRefresh=Cu,jr.useMemoCache=co,jr.useHostTransitionStatus=po,jr.useFormState=eg,jr.useActionState=eg,jr.useOptimistic=function(l,o){var d=tn();return Qd(d,Ut,l,o)};var zl={readContext:Ln,use:vu,useCallback:Tu,useContext:Ln,useEffect:Wc,useImperativeHandle:tp,useInsertionEffect:tg,useLayoutEffect:ep,useMemo:np,useReducer:bu,useRef:ho,useState:function(){return bu(Vn)},useDebugValue:Jc,useDeferredValue:function(l,o){var d=tn();return Ut===null?$c(d,l,o):ip(d,Ut.memoizedState,l,o)},useTransition:function(){var l=bu(Vn)[0],o=tn().memoizedState;return[typeof l=="boolean"?l:fn(l),o]},useSyncExternalStore:kc,useId:mo};zl.useCacheRefresh=Cu,zl.useMemoCache=co,zl.useHostTransitionStatus=po,zl.useFormState=js,zl.useActionState=js,zl.useOptimistic=function(l,o){var d=tn();return Ut!==null?Qd(d,Ut,l,o):(d.baseState=l,[l,d.queue.dispatch])};var pm={isMounted:function(l){return(l=l._reactInternals)?S(l)===l:!1},enqueueSetState:function(l,o,d){l=l._reactInternals;var _=gi(),x=fi(_);x.payload=o,d!=null&&(x.callback=d),o=di(l,x,_),o!==null&&(jn(o,l,_),pi(o,l,_))},enqueueReplaceState:function(l,o,d){l=l._reactInternals;var _=gi(),x=fi(_);x.tag=1,x.payload=o,d!=null&&(x.callback=d),o=di(l,x,_),o!==null&&(jn(o,l,_),pi(o,l,_))},enqueueForceUpdate:function(l,o){l=l._reactInternals;var d=gi(),_=fi(d);_.tag=2,o!=null&&(_.callback=o),o=di(l,_,d),o!==null&&(jn(o,l,d),pi(o,l,d))}},mm=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},ym=Error(r(461)),On=!1,yf={dehydrated:null,treeContext:null,retryLane:0},tc=M(null),Yr=null,Ha=null,gm=typeof AbortController<"u"?AbortController:function(){var l=[],o=this.signal={aborted:!1,addEventListener:function(d,_){l.push(_)}};this.abort=function(){o.aborted=!0,l.forEach(function(d){return d()})}},pb=Ii.unstable_scheduleCallback,mb=Ii.unstable_NormalPriority,sn={$$typeof:Ga,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Yg=ke.S;ke.S=function(l,o){typeof o=="object"&&o!==null&&typeof o.then=="function"&&gr(l,o),Yg!==null&&Yg(l,o)};var sr=M(null),_s=!1,rn=!1,_m=!1,Xg=typeof WeakSet=="function"?WeakSet:Set,Nn=null,qg=!1,yn=null,$i=!1,Va=null,Hl=8192,yb={getCacheForType:function(l){var o=Ln(sn),d=o.data.get(l);return d===void 0&&(d=l(),o.data.set(l,d)),d}},gf=0,_f=1,vf=2,nc=3,ic=4;if(typeof Symbol=="function"&&Symbol.for){var jo=Symbol.for;gf=jo("selector.component"),_f=jo("selector.has_pseudo_class"),vf=jo("selector.role"),nc=jo("selector.test_id"),ic=jo("selector.text")}var Fg=typeof WeakMap=="function"?WeakMap:Map,Bt=0,Ht=null,Fe=null,pt=0,Ot=0,Hi=null,vs=!1,Vl=!1,vm=!1,bs=0,$t=0,Xr=0,Ll=0,bm=0,ea=0,Yo=0,gn=null,La=null,xm=!1,Sm=0,ac=1/0,sc=null,xs=null,Xo=!1,Ti=null,ga=0,In=0,Tm=null,rc=0,qo=null;return ct.attemptContinuousHydration=function(l){if(l.tag===13){var o=jt(l,67108864);o!==null&&jn(o,l,67108864),Op(l,67108864)}},ct.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var o=gi(),d=jt(l,o);d!==null&&jn(d,l,o),Op(l,o)}},ct.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var o=z(l.pendingLanes);if(o!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var d=1<<31-bi(o);l.entanglements[1]|=d,o&=~d}Ye(l),(Bt&6)===0&&(ac=da()+500,yt(0))}}break;case 13:o=jt(l,2),o!==null&&jn(o,l,2),xp(),Op(l,2)}},ct.batchedUpdates=function(l,o){return l(o)},ct.createComponentSelector=function(l){return{$$typeof:gf,value:l}},ct.createContainer=function(l,o,d,_,x,C,B,H,I,se){return Ro(l,o,!1,null,d,_,C,B,H,I,se,null)},ct.createHasPseudoClassSelector=function(l){return{$$typeof:_f,value:l}},ct.createHydrationContainer=function(l,o,d,_,x,C,B,H,I,se,ge,Ae,Ee){return l=Ro(d,_,!0,l,x,C,H,I,se,ge,Ae,Ee),l.context=Cl(null),d=l.current,_=gi(),x=fi(_),x.callback=o??null,di(d,x,_),l.current.lanes=_,le(l,_),Ye(l),l},ct.createPortal=function(l,o,d){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ao,key:_==null?null:""+_,children:l,containerInfo:o,implementation:d}},ct.createRoleSelector=function(l){return{$$typeof:vf,value:l}},ct.createTestNameSelector=function(l){return{$$typeof:nc,value:l}},ct.createTextSelector=function(l){return{$$typeof:ic,value:l}},ct.defaultOnCaughtError=function(l){console.error(l)},ct.defaultOnRecoverableError=function(l){mm(l)},ct.defaultOnUncaughtError=function(l){mm(l)},ct.deferredUpdates=function(l){var o=ke.T,d=Js();try{return ai(32),ke.T=null,l()}finally{ai(d),ke.T=o}},ct.discreteUpdates=function(l,o,d,_,x){var C=ke.T,B=Js();try{return ai(2),ke.T=null,l(o,d,_,x)}finally{ai(B),ke.T=C,Bt===0&&(ac=da()+500)}},ct.findAllNodes=wu,ct.findBoundingRects=function(l,o){if(!Nr)throw Error(r(363));o=wu(l,o),l=[];for(var d=0;d<o.length;d++)l.push(Uo(o[d]));for(o=l.length-1;0<o;o--){d=l[o];for(var _=d.x,x=_+d.width,C=d.y,B=C+d.height,H=o-1;0<=H;H--)if(o!==H){var I=l[H],se=I.x,ge=se+I.width,Ae=I.y,Ee=Ae+I.height;if(_>=se&&C>=Ae&&x<=ge&&B<=Ee){l.splice(o,1);break}else if(_!==se||d.width!==I.width||Ee<C||Ae>B){if(!(C!==Ae||d.height!==I.height||ge<_||se>x)){se>_&&(I.width+=se-_,I.x=_),ge<x&&(I.width=x-se),l.splice(o,1);break}}else{Ae>C&&(I.height+=Ae-C,I.y=C),Ee<B&&(I.height=B-Ae),l.splice(o,1);break}}}return l},ct.findHostInstance=Up,ct.findHostInstanceWithNoPortals=function(l){return l=E(l),l=l!==null?U(l):null,l===null?null:Mo(l.stateNode)},ct.findHostInstanceWithWarning=function(l){return Up(l)},ct.flushPassiveEffects=us,ct.flushSyncFromReconciler=function(l){var o=Bt;Bt|=1;var d=ke.T,_=Js();try{if(ai(2),ke.T=null,l)return l()}finally{ai(_),ke.T=d,Bt=o,(Bt&6)===0&&yt(0)}},ct.flushSyncWork=xp,ct.focusWithin=function(l,o){if(!Nr)throw Error(r(363));for(l=Uh(l),o=Nh(l,o),o=Array.from(o),l=0;l<o.length;){var d=o[l++],_=d.tag;if(!Bo(d)){if((_===5||_===26||_===27)&&_g(d.stateNode))return!0;for(d=d.child;d!==null;)o.push(d),d=d.sibling}}return!1},ct.getFindAllNodesFailureDescription=function(l,o){if(!Nr)throw Error(r(363));var d=0,_=[];l=[Uh(l),0];for(var x=0;x<l.length;){var C=l[x++],B=C.tag,H=l[x++],I=o[H];if((B!==5&&B!==26&&B!==27||!Bo(C))&&(Bh(C,I)&&(_.push(Oh(I)),H++,H>d&&(d=H)),H<o.length))for(C=C.child;C!==null;)l.push(C,H),C=C.sibling}if(d<o.length){for(l=[];d<o.length;d++)l.push(Oh(o[d]));return`findAllNodes was able to match part of the selector:
1364
- `+(_.join(" > ")+`
1365
-
1366
- No matching component was found for:
1367
- `)+l.join(" > ")}return null},ct.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Mo(l.child.stateNode);default:return l.child.stateNode}},ct.injectIntoDevTools=function(){var l={bundleType:0,version:hg,rendererPackageName:J0,currentDispatcherRef:ke,findFiberByHostInstance:qp,reconcilerVersion:"19.0.0"};if(Pa!==null&&(l.rendererConfig=Pa),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(o.isDisabled||!o.supportsFiber)l=!0;else{try{Ol=o.inject(l),zi=o}catch{}l=!!o.checkDCE}}return l},ct.isAlreadyRendering=function(){return!1},ct.observeVisibleRects=function(l,o,d,_){if(!Nr)throw Error(r(363));l=wu(l,o);var x=Qp(l,d,_).disconnect;return{disconnect:function(){x()}}},ct.shouldError=function(){return null},ct.shouldSuspend=function(){return!1},ct.startHostTransition=function(l,o,d,_){if(l.tag!==5)throw Error(r(476));var x=Eu(l).queue;Mn(l,x,o,Ml,d===null?a:function(){var C=Eu(l).next.queue;return yo(l,C,{},gi()),d(_)})},ct.updateContainer=function(l,o,d,_){var x=o.current,C=gi();return Yh(x,C,l,o,d,_),C},ct.updateContainerSync=function(l,o,d,_){return o.tag===0&&us(),Yh(o.current,2,l,o,d,_),2},ct},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(y0)),y0.exports}var v0={exports:{}};/**
1368
- * @license React
1369
- * react-reconciler.development.js
1370
- *
1371
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1372
- *
1373
- * This source code is licensed under the MIT license found in the
1374
- * LICENSE file in the root directory of this source tree.
1375
- */var f2;function DO(){return f2||(f2=1,(function(n){process.env.NODE_ENV!=="production"&&(n.exports=function(e){function t(i,s){for(i=i.memoizedState;i!==null&&0<s;)i=i.next,s--;return i}function a(i,s,c,p){if(c>=s.length)return p;var g=s[c],b=Bn(i)?i.slice():Yn({},i);return b[g]=a(i[g],s,c+1,p),b}function r(i,s,c){if(s.length!==c.length)console.warn("copyWithRename() expects paths of the same length");else{for(var p=0;p<c.length-1;p++)if(s[p]!==c[p]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return u(i,s,c,0)}}function u(i,s,c,p){var g=s[p],b=Bn(i)?i.slice():Yn({},i);return p+1===s.length?(b[c[p]]=b[g],Bn(b)?b.splice(g,1):delete b[g]):b[g]=u(i[g],s,c,p+1),b}function h(i,s,c){var p=s[c],g=Bn(i)?i.slice():Yn({},i);return c+1===s.length?(Bn(g)?g.splice(p,1):delete g[p],g):(g[p]=h(i[p],s,c+1),g)}function f(){return!1}function m(){return null}function y(i,s,c,p){return new ob(i,s,c,p)}function v(i,s){i.context===ga&&(tf(s,i,null,null),Nr())}function S(i,s){if(Ms!==null){var c=s.staleFamilies;s=s.updatedFamilies,Gr(),tm(i.current,s,c),Nr()}}function T(i){Ms=i}function E(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function A(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function U(){}function M(){}function G(i){var s=[];return i.forEach(function(c){s.push(c)}),s.sort().join(", ")}function P(i){return i===null||typeof i!="object"?null:(i=Ku&&i[Ku]||i["@@iterator"],typeof i=="function"?i:null)}function w(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===um?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case Bl:return"Fragment";case an:return"Portal";case om:return"Profiler";case af:return"StrictMode";case zr:return"Suspense";case bi:return"SuspenseList"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case wa:return(i.displayName||"Context")+".Provider";case sf:return(i._context.displayName||"Context")+".Consumer";case fs:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case rf:return s=i.displayName||null,s!==null?s:w(i.type)||"Memo";case Wi:s=i._payload,i=i._init;try{return w(i(s))}catch{}}return null}function z(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s._context.displayName||"Context")+".Consumer";case 10:return(s.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return w(s);case 8:return s===af?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;break;case 29:if(s=i._debugInfo,s!=null){for(var c=s.length-1;0<=c;c--)if(typeof s[c].name=="string")return s[c].name}if(i.return!==null)return z(i.return)}return null}function ne(){}function ie(){if(Qu===0){da=console.log,cm=console.info,wg=console.warn,of=console.error,zg=console.group,Hg=console.groupCollapsed,Vg=console.groupEnd;var i={configurable:!0,enumerable:!0,value:ne,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}Qu++}function Z(){if(Qu--,Qu===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Yn({},i,{value:da}),info:Yn({},i,{value:cm}),warn:Yn({},i,{value:wg}),error:Yn({},i,{value:of}),group:Yn({},i,{value:zg}),groupCollapsed:Yn({},i,{value:Hg}),groupEnd:Yn({},i,{value:Vg})})}0>Qu&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Te(i){if(Ol===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);Ol=s&&s[1]||"",zi=-1<c.stack.indexOf(`
1376
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
1377
- `+Ol+i+zi}function me(i,s){if(!i||xi)return"";var c=uf.get(i);if(c!==void 0)return c;xi=!0,c=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var p=null;p=ee.H,ee.H=null,ie();try{var g={DetermineComponentFrameRoot:function(){try{if(s){var Me=function(){throw Error()};if(Object.defineProperty(Me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Me,[])}catch(Dt){var mt=Dt}Reflect.construct(i,[],Me)}else{try{Me.call()}catch(Dt){mt=Dt}i.call(Me.prototype)}}else{try{throw Error()}catch(Dt){mt=Dt}(Me=i())&&typeof Me.catch=="function"&&Me.catch(function(){})}}catch(Dt){if(Dt&&mt&&typeof Dt.stack=="string")return[Dt.stack,mt.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=g.DetermineComponentFrameRoot(),N=R[0],Y=R[1];if(N&&Y){var $=N.split(`
1378
- `),pe=Y.split(`
1379
- `);for(R=b=0;b<$.length&&!$[b].includes("DetermineComponentFrameRoot");)b++;for(;R<pe.length&&!pe[R].includes("DetermineComponentFrameRoot");)R++;if(b===$.length||R===pe.length)for(b=$.length-1,R=pe.length-1;1<=b&&0<=R&&$[b]!==pe[R];)R--;for(;1<=b&&0<=R;b--,R--)if($[b]!==pe[R]){if(b!==1||R!==1)do if(b--,R--,0>R||$[b]!==pe[R]){var Se=`
1380
- `+$[b].replace(" at new "," at ");return i.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",i.displayName)),typeof i=="function"&&uf.set(i,Se),Se}while(1<=b&&0<=R);break}}}finally{xi=!1,ee.H=p,Z(),Error.prepareStackTrace=c}return $=($=i?i.displayName||i.name:"")?Te($):"",typeof i=="function"&&uf.set(i,$),$}function fe(i){switch(i.tag){case 26:case 27:case 5:return Te(i.type);case 16:return Te("Lazy");case 13:return Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return i=me(i.type,!1),i;case 11:return i=me(i.type.render,!1),i;case 1:return i=me(i.type,!0),i;default:return""}}function le(i){try{var s="";do{s+=fe(i);var c=i._debugInfo;if(c)for(var p=c.length-1;0<=p;p--){var g=c[p];if(typeof g.name=="string"){var b=s,R=g.env,N=Te(g.name+(R?" ["+R+"]":""));s=b+N}}i=i.return}while(i);return s}catch(Y){return`
1381
- Error generating stack: `+Y.message+`
1382
- `+Y.stack}}function Ce(){return Xn===null?"":le(Xn)}function ae(i,s,c,p,g,b,R){var N=Xn;ee.getCurrentStack=i===null?null:Ce,qn=!1,Xn=i;try{return s(c,p,g,b,R)}finally{Xn=N}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function je(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function Rt(i){if(je(i)!==i)throw Error("Unable to find node on an unmounted component.")}function V(i){var s=i.alternate;if(!s){if(s=je(i),s===null)throw Error("Unable to find node on an unmounted component.");return s!==i?null:i}for(var c=i,p=s;;){var g=c.return;if(g===null)break;var b=g.alternate;if(b===null){if(p=g.return,p!==null){c=p;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===c)return Rt(g),i;if(b===p)return Rt(g),s;b=b.sibling}throw Error("Unable to find node on an unmounted component.")}if(c.return!==p.return)c=g,p=b;else{for(var R=!1,N=g.child;N;){if(N===c){R=!0,c=g,p=b;break}if(N===p){R=!0,p=g,c=b;break}N=N.sibling}if(!R){for(N=b.child;N;){if(N===c){R=!0,c=b,p=g;break}if(N===p){R=!0,p=b,c=g;break}N=N.sibling}if(!R)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(c.alternate!==p)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(c.tag!==3)throw Error("Unable to find node on an unmounted component.");return c.stateNode.current===c?i:s}function W(i){return i=V(i),i!==null?de(i):null}function de(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=de(i),s!==null)return s;i=i.sibling}return null}function oe(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(i.tag!==4&&(s=oe(i),s!==null))return s;i=i.sibling}return null}function Re(i){return{current:i}}function O(i,s){0>Ti?console.error("Unexpected pop."):(s!==Xo[Ti]&&console.error("Unexpected Fiber popped."),i.current=xs[Ti],xs[Ti]=null,Xo[Ti]=null,Ti--)}function k(i,s,c){Ti++,xs[Ti]=i.current,Xo[Ti]=c,i.current=s}function _e(i){return i>>>=0,i===0?32:31-(Tm(i)/rc|0)|0}function ye(i){if(i&1)return"SyncHydrationLane";if(i&2)return"Sync";if(i&4)return"InputContinuousHydration";if(i&8)return"InputContinuous";if(i&16)return"DefaultHydration";if(i&32)return"Default";if(i&64)return"TransitionHydration";if(i&4194176)return"Transition";if(i&62914560)return"Retry";if(i&67108864)return"SelectiveHydration";if(i&134217728)return"IdleHydration";if(i&268435456)return"Idle";if(i&536870912)return"Offscreen";if(i&1073741824)return"Deferred"}function Ue(i){var s=i&42;if(s!==0)return s;switch(i&-i){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: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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),i}}function Xe(i,s){var c=i.pendingLanes;if(c===0)return 0;var p=0,g=i.suspendedLanes,b=i.pingedLanes,R=i.warmLanes;i=i.finishedLanes!==0;var N=c&134217727;return N!==0?(c=N&~g,c!==0?p=Ue(c):(b&=N,b!==0?p=Ue(b):i||(R=N&~R,R!==0&&(p=Ue(R))))):(N=c&~g,N!==0?p=Ue(N):b!==0?p=Ue(b):i||(R=c&~R,R!==0&&(p=Ue(R)))),p===0?0:s!==0&&s!==p&&(s&g)===0&&(g=p&-p,R=s&-s,g>=R||g===32&&(R&4194176)!==0)?s:p}function Be(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function At(i,s){switch(i){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+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 console.error("Should have found matching lanes. This is a bug in React."),-1}}function St(){var i=qo;return qo<<=1,(qo&4194176)===0&&(qo=128),i}function Rn(){var i=l;return l<<=1,(l&62914560)===0&&(l=4194304),i}function Oi(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function hn(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Jn(i,s,c,p,g,b){var R=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var N=i.entanglements,Y=i.expirationTimes,$=i.hiddenUpdates;for(c=R&~c;0<c;){var pe=31-In(c),Se=1<<pe;N[pe]=0,Y[pe]=-1;var Me=$[pe];if(Me!==null)for($[pe]=null,pe=0;pe<Me.length;pe++){var mt=Me[pe];mt!==null&&(mt.lane&=-536870913)}c&=~Se}p!==0&&$n(i,p,0),b!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=b&~(R&~s))}function $n(i,s,c){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-In(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|c&4194218}function ei(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var p=31-In(c),g=1<<p;g&s|i[p]&s&&(i[p]|=s),c&=~g}}function Za(i,s,c){if(Kn)for(i=i.pendingUpdatersLaneMap;0<c;){var p=31-In(c),g=1<<p;i[p].add(s),c&=~g}}function jt(i,s){if(Kn)for(var c=i.pendingUpdatersLaneMap,p=i.memoizedUpdaters;0<s;){var g=31-In(s);i=1<<g,g=c[g],0<g.size&&(g.forEach(function(b){var R=b.alternate;R!==null&&p.has(R)||p.add(b)}),g.clear()),s&=~i}}function yr(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function fl(i){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{Ee=s.inject(i),Pe=s}catch(c){console.error("React instrumentation encountered an error: %s.",c)}return!!s.checkDCE}function Ye(i,s){if(Pe&&typeof Pe.onCommitFiberRoot=="function")try{var c=(i.current.flags&128)===128;switch(s){case 2:var p=B;break;case 8:p=H;break;case 32:p=I;break;case 268435456:p=se;break;default:p=I}Pe.onCommitFiberRoot(Ee,i,p,c)}catch(g){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",g))}}function yt(i){if(typeof ge=="function"&&Ae(i),Pe&&typeof Pe.setStrictMode=="function")try{Pe.setStrictMode(Ee,i)}catch(s){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",s))}}function Yc(i){be=i}function so(){be!==null&&typeof be.markCommitStopped=="function"&&be.markCommitStopped()}function Hs(i){be!==null&&typeof be.markComponentRenderStarted=="function"&&be.markComponentRenderStarted(i)}function Wa(){be!==null&&typeof be.markComponentRenderStopped=="function"&&be.markComponentRenderStopped()}function Xc(i){be!==null&&typeof be.markRenderStarted=="function"&&be.markRenderStarted(i)}function ro(){be!==null&&typeof be.markRenderStopped=="function"&&be.markRenderStopped()}function gr(i,s){be!==null&&typeof be.markStateUpdateScheduled=="function"&&be.markStateUpdateScheduled(i,s)}function yu(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}function ti(i,s){if(typeof i=="object"&&i!==null){var c=F.get(i);return c!==void 0?c:(s={value:i,source:s,stack:le(s)},F.set(i,s),s)}return{value:i,source:s,stack:le(s)}}function la(i,s){pi(),J[he++]=Nt,J[he++]=Ne,Ne=i,Nt=s}function Vs(i,s,c){pi(),Ge[Je++]=at,Ge[Je++]=li,Ge[Je++]=Kt,Kt=i;var p=at;i=li;var g=32-In(p)-1;p&=~(1<<g),c+=1;var b=32-In(s)+g;if(30<b){var R=g-g%5;b=(p&(1<<R)-1).toString(32),p>>=R,g-=R,at=1<<32-In(s)+g|c<<g|p,li=b+i}else at=1<<b|c<<g|p,li=i}function fi(i){pi(),i.return!==null&&(la(i,1),Vs(i,1,0))}function di(i){for(;i===Ne;)Ne=J[--he],J[he]=null,Nt=J[--he],J[he]=null;for(;i===Kt;)Kt=Ge[--Je],Ge[Je]=null,li=Ge[--Je],Ge[Je]=null,at=Ge[--Je],Ge[Je]=null}function pi(){vt||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Xi(i){return i===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),i}function Ni(i,s){k(Fo,s,i),k(Em,i,i),k(qr,null,i),s=tr(s),O(qr,i),k(qr,s,i)}function D(i){O(qr,i),O(Em,i),O(Fo,i)}function X(){return Xi(qr.current)}function ce(i){i.memoizedState!==null&&k(kg,i,i);var s=Xi(qr.current),c=nr(s,i.type);s!==c&&(k(Em,i,i),k(qr,c,i))}function xe(i){Em.current===i&&(O(qr,i),O(Em,i)),kg.current===i&&(O(kg,i),pn?ar._currentValue=ms:ar._currentValue2=ms)}function Oe(i,s){return i.serverProps===void 0&&i.serverTail.length===0&&i.children.length===1&&3<i.distanceFromLeaf&&i.distanceFromLeaf>15-s?Oe(i.children[0],s):i}function Le(i){return" "+" ".repeat(i)}function qe(i){return"+ "+" ".repeat(i)}function ft(i){return"- "+" ".repeat(i)}function We(i){switch(i.tag){case 26:case 27:case 5:return i.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return i=i.type,i.displayName||i.name||null;case 11:return i=i.type.render,i.displayName||i.name||null;case 1:return i=i.type,i.displayName||i.name||null;default:return null}}function An(i,s){return UC.test(i)?(i=JSON.stringify(i),i.length>s-2?8>s?'{"..."}':"{"+i.slice(0,s-7)+'..."}':"{"+i+"}"):i.length>s?5>s?'{"..."}':i.slice(0,s-3)+"...":i}function Gi(i,s,c){var p=120-2*c;if(s===null)return qe(c)+An(i,p)+`
1383
- `;if(typeof s=="string"){for(var g=0;g<s.length&&g<i.length&&s.charCodeAt(g)===i.charCodeAt(g);g++);return g>p-8&&10<g&&(i="..."+i.slice(g-8),s="..."+s.slice(g-8)),qe(c)+An(i,p)+`
1384
- `+ft(c)+An(s,p)+`
1385
- `}return Le(c)+An(i,p)+`
1386
- `}function lo(i){return Object.prototype.toString.call(i).replace(/^\[object (.*)\]$/,function(s,c){return c})}function _r(i,s){switch(typeof i){case"string":return i=JSON.stringify(i),i.length>s?5>s?'"..."':i.slice(0,s-4)+'..."':i;case"object":if(i===null)return"null";if(Bn(i))return"[...]";if(i.$$typeof===Ul)return(s=w(i.type))?"<"+s+">":"<...>";var c=lo(i);if(c==="Object"){c="",s-=2;for(var p in i)if(i.hasOwnProperty(p)){var g=JSON.stringify(p);if(g!=='"'+p+'"'&&(p=g),s-=p.length-2,g=_r(i[p],15>s?s:15),s-=g.length,0>s){c+=c===""?"...":", ...";break}c+=(c===""?"":",")+p+":"+g}return"{"+c+"}"}return c;case"function":return(s=i.displayName||i.name)?"function "+s:"function";default:return String(i)}}function dl(i,s){return typeof i!="string"||UC.test(i)?"{"+_r(i,s-2)+"}":i.length>s-2?5>s?'"..."':'"'+i.slice(0,s-5)+'..."':'"'+i+'"'}function gu(i,s,c){var p=120-c.length-i.length,g=[],b;for(b in s)if(s.hasOwnProperty(b)&&b!=="children"){var R=dl(s[b],120-c.length-b.length-1);p-=b.length+R.length+2,g.push(b+"="+R)}return g.length===0?c+"<"+i+`>
1387
- `:0<p?c+"<"+i+" "+g.join(" ")+`>
1388
- `:c+"<"+i+`
1389
- `+c+" "+g.join(`
1390
- `+c+" ")+`
1391
- `+c+`>
1392
- `}function Fd(i,s,c){var p="",g=Yn({},s),b;for(b in i)if(i.hasOwnProperty(b)){delete g[b];var R=120-2*c-b.length-2,N=_r(i[b],R);s.hasOwnProperty(b)?(R=_r(s[b],R),p+=qe(c)+b+": "+N+`
1393
- `,p+=ft(c)+b+": "+R+`
1394
- `):p+=qe(c)+b+": "+N+`
1395
- `}for(var Y in g)g.hasOwnProperty(Y)&&(i=_r(g[Y],120-2*c-Y.length-2),p+=ft(c)+Y+": "+i+`
1396
- `);return p}function vr(i,s,c,p){var g="",b=new Map;for($ in c)c.hasOwnProperty($)&&b.set($.toLowerCase(),$);if(b.size===1&&b.has("children"))g+=gu(i,s,Le(p));else{for(var R in s)if(s.hasOwnProperty(R)&&R!=="children"){var N=120-2*(p+1)-R.length-1,Y=b.get(R.toLowerCase());if(Y!==void 0){b.delete(R.toLowerCase());var $=s[R];Y=c[Y];var pe=dl($,N);N=dl(Y,N),typeof $=="object"&&$!==null&&typeof Y=="object"&&Y!==null&&lo($)==="Object"&&lo(Y)==="Object"&&(2<Object.keys($).length||2<Object.keys(Y).length||-1<pe.indexOf("...")||-1<N.indexOf("..."))?g+=Le(p+1)+R+`={{
1397
- `+Fd($,Y,p+2)+Le(p+1)+`}}
1398
- `:(g+=qe(p+1)+R+"="+pe+`
1399
- `,g+=ft(p+1)+R+"="+N+`
1400
- `)}else g+=Le(p+1)+R+"="+dl(s[R],N)+`
1401
- `}b.forEach(function(Se){if(Se!=="children"){var Me=120-2*(p+1)-Se.length-1;g+=ft(p+1)+Se+"="+dl(c[Se],Me)+`
1402
- `}}),g=g===""?Le(p)+"<"+i+`>
1403
- `:Le(p)+"<"+i+`
1404
- `+g+Le(p)+`>
1405
- `}return i=c.children,s=s.children,typeof i=="string"||typeof i=="number"||typeof i=="bigint"?(b="",(typeof s=="string"||typeof s=="number"||typeof s=="bigint")&&(b=""+s),g+=Gi(b,""+i,p+1)):(typeof s=="string"||typeof s=="number"||typeof s=="bigint")&&(g=i==null?g+Gi(""+s,null,p+1):g+Gi(""+s,void 0,p+1)),g}function kd(i,s){var c=We(i);if(c===null){for(c="",i=i.child;i;)c+=kd(i,s),i=i.sibling;return c}return Le(s)+"<"+c+`>
1406
- `}function Ja(i,s){var c=Oe(i,s);if(c!==i&&(i.children.length!==1||i.children[0]!==c))return Le(s)+`...
1407
- `+Ja(c,s+1);c="";var p=i.fiber._debugInfo;if(p)for(var g=0;g<p.length;g++){var b=p[g].name;typeof b=="string"&&(c+=Le(s)+"<"+b+`>
1408
- `,s++)}if(p="",g=i.fiber.pendingProps,i.fiber.tag===6)p=Gi(g,i.serverProps,s),s++;else if(b=We(i.fiber),b!==null)if(i.serverProps===void 0){p=s;var R=120-2*p-b.length-2,N="";for($ in g)if(g.hasOwnProperty($)&&$!=="children"){var Y=dl(g[$],15);if(R-=$.length+Y.length+2,0>R){N+=" ...";break}N+=" "+$+"="+Y}p=Le(p)+"<"+b+N+`>
1409
- `,s++}else i.serverProps===null?(p=gu(b,g,qe(s)),s++):typeof i.serverProps=="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(p=vr(b,g,i.serverProps,s),s++);var $="";for(g=i.fiber.child,b=0;g&&b<i.children.length;)R=i.children[b],R.fiber===g?($+=Ja(R,s),b++):$+=kd(g,s),g=g.sibling;for(g&&0<i.children.length&&($+=Le(s)+`...
1410
- `),g=i.serverTail,i.serverProps===null&&s--,i=0;i<g.length;i++)b=g[i],$=typeof b=="string"?$+(ft(s)+An(b,120-2*s)+`
1411
- `):$+gu(b.type,b.props,ft(s));return c+p+$}function $a(i){try{return`
1412
-
1413
- `+Ja(i,0)}catch{return""}}function es(i,s){if(i.return===null){if(Ss===null)Ss={fiber:i,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:s};else{if(Ss.fiber!==i)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");Ss.distanceFromLeaf>s&&(Ss.distanceFromLeaf=s)}return Ss}var c=es(i.return,s+1).children;return 0<c.length&&c[c.length-1].fiber===i?(c=c[c.length-1],c.distanceFromLeaf>s&&(c.distanceFromLeaf=s),c):(s={fiber:i,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:s},c.push(s),s)}function Wt(i,s){jl||(i=es(i,0),i.serverProps=null,s!==null&&(s=Fg(s),i.serverTail.push(s)))}function Ls(i){var s="",c=Ss;throw c!==null&&(Ss=null,s=$a(c)),pl(ti(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
1414
-
1415
- - A server/client branch \`if (typeof window !== 'undefined')\`.
1416
- - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
1417
- - Date formatting in a user's locale which doesn't match the server.
1418
- - External changing data without sending a snapshot of it along with the HTML.
1419
- - Invalid HTML tag nesting.
1420
-
1421
- It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
1422
-
1423
- https://react.dev/link/hydration-mismatch`+s),i)),gb}function qc(i,s){if(!Si)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");yn(i.stateNode,i.type,i.memoizedProps,s,i)||Ls(i)}function Id(i){for(ta=i.return;ta;)switch(ta.tag){case 3:case 27:Fr=!0;return;case 5:case 13:Fr=!1;return;default:ta=ta.return}}function oo(i){if(!Si||i!==ta)return!1;if(!vt)return Id(i),vt=!0,!1;var s=!1;if(gn?i.tag!==3&&i.tag!==27&&(i.tag!==5||nc(i.type)&&!Sn(i.type,i.memoizedProps))&&(s=!0):i.tag!==3&&(i.tag!==5||nc(i.type)&&!Sn(i.type,i.memoizedProps))&&(s=!0),s&&Ei){for(s=Ei;s;){var c=es(i,0),p=Fg(s);c.serverTail.push(p),s=p.type==="Suspense"?Hl(s):sr(s)}Ls(i)}if(Id(i),i.tag===13){if(!Si)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Ei=Hl(i)}else Ei=ta?sr(i.stateNode):null;return!0}function _u(){Si&&(Ei=ta=null,jl=vt=!1)}function pl(i){rr===null?rr=[i]:rr.push(i)}function Fc(){var i=Ss;i!==null&&(Ss=null,i=$a(i),console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
1424
-
1425
- - A server/client branch \`if (typeof window !== 'undefined')\`.
1426
- - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
1427
- - Date formatting in a user's locale which doesn't match the server.
1428
- - External changing data without sending a snapshot of it along with the HTML.
1429
- - Invalid HTML tag nesting.
1430
-
1431
- It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
1432
-
1433
- %s%s`,"https://react.dev/link/hydration-mismatch",i))}function uo(){for(var i=bf,s=_b=bf=0;s<i;){var c=Ts[s];Ts[s++]=null;var p=Ts[s];Ts[s++]=null;var g=Ts[s];Ts[s++]=null;var b=Ts[s];if(Ts[s++]=null,p!==null&&g!==null){var R=p.pending;R===null?g.next=g:(g.next=R.next,R.next=g),p.pending=g}b!==0&&vu(c,g,b)}}function Hn(i,s,c,p){Ts[bf++]=i,Ts[bf++]=s,Ts[bf++]=c,Ts[bf++]=p,_b|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function tn(i,s,c,p){return Hn(i,s,c,p),co(i)}function fn(i,s){return Hn(i,null,null,s),co(i)}function vu(i,s,c){i.lanes|=c;var p=i.alternate;p!==null&&(p.lanes|=c);for(var g=!1,b=i.return;b!==null;)b.childLanes|=c,p=b.alternate,p!==null&&(p.childLanes|=c),b.tag===22&&(i=b.stateNode,i===null||i._visibility&1||(g=!0)),i=b,b=b.return;g&&s!==null&&i.tag===3&&(b=i.stateNode,g=31-In(c),b=b.hiddenUpdates,i=b[g],i===null?b[g]=[s]:i.push(s),s.lane=c|536870912)}function co(i){if(Fm>u5)throw vc=Fm=0,km=Qb=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");vc>c5&&(vc=0,km=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),i.alternate===null&&(i.flags&4098)!==0&&Ag(i);for(var s=i,c=s.return;c!==null;)s.alternate===null&&(s.flags&4098)!==0&&Ag(i),s=c,c=s.return;return s.tag===3?s.stateNode:null}function Vn(){var i=lc;return lc=0,i}function ml(i){var s=lc;return lc=i,s}function yl(i){var s=lc;return lc+=i,s}function bu(i){_a=xf(),0>i.actualStartTime&&(i.actualStartTime=_a)}function kc(i){if(0<=_a){var s=xf()-_a;i.actualDuration+=s,i.selfBaseDuration=s,_a=-1}}function Kd(i){if(0<=_a){var s=xf()-_a;i.actualDuration+=s,_a=-1}}function Ra(){if(0<=_a){var i=xf()-_a;_a=-1,lc+=i}}function Aa(){_a=xf()}function xu(i){for(var s=i.child;s;)i.actualDuration+=s.actualDuration,s=s.sibling}function Ma(i){i!==Sf&&i.next===null&&(Sf===null?Zg=Sf=i:Sf=Sf.next=i),Wg=!0,ee.actQueue!==null?bb||(bb=!0,Kc(Qd)):vb||(vb=!0,Kc(Qd))}function br(i,s){if(!xb&&Wg){xb=!0;do for(var c=!1,p=Zg;p!==null;){if(i!==0){var g=p.pendingLanes;if(g===0)var b=0;else{var R=p.suspendedLanes,N=p.pingedLanes;b=(1<<31-In(42|i)+1)-1,b&=g&~(R&~N),b=b&201326677?b&201326677|1:b?b|2:0}b!==0&&(c=!0,Wd(p,b))}else b=dt,b=Xe(p,p===qt?b:0),(b&3)===0||Be(p,b)||(c=!0,Wd(p,b));p=p.next}while(c);xb=!1}}function Qd(){Wg=bb=vb=!1;var i=0;Tf!==0&&(Ju()&&(i=Tf),Tf=0);for(var s=C(),c=null,p=Zg;p!==null;){var g=p.next,b=Jy(p,s);b===0?(p.next=null,c===null?Zg=g:c.next=g,g===null&&(Sf=c)):(c=p,(i!==0||(b&3)!==0)&&(Wg=!0)),p=g}br(i)}function Jy(i,s){for(var c=i.suspendedLanes,p=i.pingedLanes,g=i.expirationTimes,b=i.pendingLanes&-62914561;0<b;){var R=31-In(b),N=1<<R,Y=g[R];Y===-1?((N&c)===0||(N&p)!==0)&&(g[R]=At(N,s)):Y<=s&&(i.expiredLanes|=N),b&=~N}if(s=qt,c=dt,c=Xe(i,i===s?c:0),p=i.callbackNode,c===0||i===s&&Ft===yc||i.cancelPendingCommit!==null)return p!==null&&Ic(p),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Be(i,c)){if(s=c&-c,s!==i.callbackPriority||ee.actQueue!==null&&p!==Sb)Ic(p);else return s;switch(yr(c)){case 2:case 8:c=H;break;case 32:c=I;break;case 268435456:c=se;break;default:c=I}return p=Zd.bind(null,i),ee.actQueue!==null?(ee.actQueue.push(p),c=Sb):c=o(c,p),i.callbackPriority=s,i.callbackNode=c,s}return p!==null&&Ic(p),i.callbackPriority=2,i.callbackNode=null,2}function Zd(i,s){Qg=Kg=!1;var c=i.callbackNode;if(Gr()&&i.callbackNode!==c)return null;var p=dt;return p=Xe(i,i===qt?p:0),p===0?null:(Ml(i,p,s),Jy(i,C()),i.callbackNode!=null&&i.callbackNode===c?Zd.bind(null,i):null)}function Wd(i,s){if(Gr())return null;Kg=Qg,Qg=!1,Ml(i,s,!0)}function Ic(i){i!==Sb&&i!==null&&d(i)}function Kc(i){ee.actQueue!==null&&ee.actQueue.push(function(){return i(),null}),zo?$u(function(){(Gt&(Li|Kr))!==aa?o(B,i):i()}):o(B,i)}function Qc(){return Tf===0&&(Tf=St()),Tf}function $y(i,s){if(Cm===null){var c=Cm=[];Tb=0,oc=Qc(),Ef={status:"pending",value:void 0,then:function(p){c.push(p)}}}return Tb++,s.then(Jd,Jd),s}function Jd(){if(--Tb===0&&Cm!==null){Ef!==null&&(Ef.status="fulfilled");var i=Cm;Cm=null,oc=0,Ef=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function eg(i,s){var c=[],p={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var g=0;g<c.length;g++)(0,c[g])(s)},function(g){for(p.status="rejected",p.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),p}function Zc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function js(i){return{lane:i,tag:BC,payload:null,callback:null,next:null}}function qi(i,s,c){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,Cb===p&&!GC){var g=z(i);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.
1434
-
1435
- Please update the following component: %s`,g),GC=!0}return(Gt&Li)!==aa?(g=p.pending,g===null?s.next=s:(s.next=g.next,g.next=s),p.pending=s,s=co(i),vu(i,null,c),s):(Hn(i,p,s,c),co(i))}function ho(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194176)!==0)){var p=s.lanes;p&=i.pendingLanes,c|=p,s.lanes=c,ei(i,c)}}function gl(i,s){var c=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var g=null,b=null;if(c=c.firstBaseUpdate,c!==null){do{var R={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};b===null?g=b=R:b=b.next=R,c=c.next}while(c!==null);b===null?g=b=s:b=b.next=s}else g=b=s;c={baseState:p.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:p.shared,callbacks:p.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}function xr(){if(Rb){var i=Ef;if(i!==null)throw i}}function fo(i,s,c,p){Rb=!1;var g=i.updateQueue;ko=!1,Cb=g.shared;var b=g.firstBaseUpdate,R=g.lastBaseUpdate,N=g.shared.pending;if(N!==null){g.shared.pending=null;var Y=N,$=Y.next;Y.next=null,R===null?b=$:R.next=$,R=Y;var pe=i.alternate;pe!==null&&(pe=pe.updateQueue,N=pe.lastBaseUpdate,N!==R&&(N===null?pe.firstBaseUpdate=$:N.next=$,pe.lastBaseUpdate=Y))}if(b!==null){var Se=g.baseState;R=0,pe=$=Y=null,N=b;do{var Me=N.lane&-536870913,mt=Me!==N.lane;if(mt?(dt&Me)===Me:(p&Me)===Me){Me!==0&&Me===oc&&(Rb=!0),pe!==null&&(pe=pe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{Me=i;var Dt=N,Xf=s,qf=c;switch(Dt.tag){case OC:if(Dt=Dt.payload,typeof Dt=="function"){Gf=!0;var cr=Dt.call(qf,Se,Xf);if(Me.mode&8){yt(!0);try{Dt.call(qf,Se,Xf)}finally{yt(!1)}}Gf=!1,Se=cr;break e}Se=Dt;break e;case Eb:Me.flags=Me.flags&-65537|128;case BC:if(cr=Dt.payload,typeof cr=="function"){if(Gf=!0,Dt=cr.call(qf,Se,Xf),Me.mode&8){yt(!0);try{cr.call(qf,Se,Xf)}finally{yt(!1)}}Gf=!1}else Dt=cr;if(Dt==null)break e;Se=Yn({},Se,Dt);break e;case NC:ko=!0}}Me=N.callback,Me!==null&&(i.flags|=64,mt&&(i.flags|=8192),mt=g.callbacks,mt===null?g.callbacks=[Me]:mt.push(Me))}else mt={lane:Me,tag:N.tag,payload:N.payload,callback:N.callback,next:null},pe===null?($=pe=mt,Y=Se):pe=pe.next=mt,R|=Me;if(N=N.next,N===null){if(N=g.shared.pending,N===null)break;mt=N,N=mt.next,mt.next=null,g.lastBaseUpdate=mt,g.shared.pending=null}}while(!0);pe===null&&(Y=Se),g.baseState=Y,g.firstBaseUpdate=$,g.lastBaseUpdate=pe,b===null&&(g.shared.lanes=0),Jo|=R,i.lanes=R,i.memoizedState=Se}Cb=null}function Wc(i,s){if(typeof i!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+i);i.call(s)}function tg(i,s){var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Wc(c[i],s)}function ep(i,s){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)Wc(c[i],s)}function Su(i,s){if(K(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),p=Object.keys(s);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var g=c[p];if(!JG.call(s,g)||!K(i[g],s[g]))return!1}return!0}function tp(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function Jc(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Tu(){}function np(i,s,c){ee.actQueue!==null&&(ee.didUsePromise=!0);var p=i.thenables;switch(c=p[c],c===void 0?p.push(s):c!==s&&(i.didWarnAboutUncachedPromise||(i.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),s.then(Tu,Tu),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,ip(i),i;default:if(typeof s.status=="string")s.then(Tu,Tu);else{if(i=qt,i!==null&&100<i.shellSuspendCounter)throw Error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=g}},function(g){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,ip(i),i}throw Cf=s,t_=!0,$g}}function $c(){if(Cf===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var i=Cf;return Cf=null,t_=!1,i}function ip(i){if(i===$g)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function Mn(i){var s=ot;return i!=null&&(ot=s===null?i:s.concat(i)),s}function Eu(i,s,c){for(var p=Object.keys(i.props),g=0;g<p.length;g++){var b=p[g];if(b!=="children"&&b!=="key"){s===null&&(s=$h(i,c.mode,0),s._debugInfo=ot,s.return=c),ae(s,function(R){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R)},b);break}}}function po(i){var s=Om;return Om+=1,Rf===null&&(Rf=tp()),np(Rf,i,s)}function mo(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Cu(i,s){throw s.$$typeof===Pg?Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
1436
- - Multiple copies of the "react" package is used.
1437
- - A library pre-bundled an old copy of "react" or "react/jsx-runtime".
1438
- - A compiler tries to "inline" JSX instead of using the runtime.`):(i=Object.prototype.toString.call(s),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead."))}function eh(i,s){var c=z(i)||"Component";ZC[c]||(ZC[c]=!0,s=s.displayName||s.name||"Component",i.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
1439
- root.render(%s)`,s,s,s):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
1440
- <%s>{%s}</%s>`,s,s,c,s,c))}function th(i,s){var c=z(i)||"Component";WC[c]||(WC[c]=!0,s=String(s),i.tag===3?console.error(`Symbols are not valid as a React child.
1441
- root.render(%s)`,s):console.error(`Symbols are not valid as a React child.
1442
- <%s>%s</%s>`,c,s,c))}function ap(i){function s(j,L){if(i){var q=j.deletions;q===null?(j.deletions=[L],j.flags|=16):q.push(L)}}function c(j,L){if(!i)return null;for(;L!==null;)s(j,L),L=L.sibling;return null}function p(j){for(var L=new Map;j!==null;)j.key!==null?L.set(j.key,j):L.set(j.index,j),j=j.sibling;return L}function g(j,L){return j=wr(j,L),j.index=0,j.sibling=null,j}function b(j,L,q){return j.index=q,i?(q=j.alternate,q!==null?(q=q.index,q<L?(j.flags|=33554434,L):q):(j.flags|=33554434,L)):(j.flags|=1048576,L)}function R(j){return i&&j.alternate===null&&(j.flags|=33554434),j}function N(j,L,q,re){return L===null||L.tag!==6?(L=am(q,j.mode,re),L.return=j,L._debugOwner=j,L._debugInfo=ot,L):(L=g(L,q),L.return=j,L._debugInfo=ot,L)}function Y(j,L,q,re){var De=q.type;return De===Bl?(L=pe(j,L,q.props.children,re,q.key),Eu(q,L,j),L):L!==null&&(L.elementType===De||Dg(L,q)||typeof De=="object"&&De!==null&&De.$$typeof===Wi&&Io(De)===L.type)?(L=g(L,q.props),mo(L,q),L.return=j,L._debugOwner=q._owner,L._debugInfo=ot,L):(L=$h(q,j.mode,re),mo(L,q),L.return=j,L._debugInfo=ot,L)}function $(j,L,q,re){return L===null||L.tag!==4||L.stateNode.containerInfo!==q.containerInfo||L.stateNode.implementation!==q.implementation?(L=ef(q,j.mode,re),L.return=j,L._debugInfo=ot,L):(L=g(L,q.children||[]),L.return=j,L._debugInfo=ot,L)}function pe(j,L,q,re,De){return L===null||L.tag!==7?(L=Dl(q,j.mode,re,De),L.return=j,L._debugOwner=j,L._debugInfo=ot,L):(L=g(L,q),L.return=j,L._debugInfo=ot,L)}function Se(j,L,q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=am(""+L,j.mode,q),L.return=j,L._debugOwner=j,L._debugInfo=ot,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case Ul:return q=$h(L,j.mode,q),mo(q,L),q.return=j,j=Mn(L._debugInfo),q._debugInfo=ot,ot=j,q;case an:return L=ef(L,j.mode,q),L.return=j,L._debugInfo=ot,L;case Wi:var re=Mn(L._debugInfo);return L=Io(L),j=Se(j,L,q),ot=re,j}if(Bn(L)||P(L))return q=Dl(L,j.mode,q,null),q.return=j,q._debugOwner=j,j=Mn(L._debugInfo),q._debugInfo=ot,ot=j,q;if(typeof L.then=="function")return re=Mn(L._debugInfo),j=Se(j,po(L),q),ot=re,j;if(L.$$typeof===wa)return Se(j,ks(j,L),q);Cu(j,L)}return typeof L=="function"&&eh(j,L),typeof L=="symbol"&&th(j,L),null}function Me(j,L,q,re){var De=L!==null?L.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return De!==null?null:N(j,L,""+q,re);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case Ul:return q.key===De?(De=Mn(q._debugInfo),j=Y(j,L,q,re),ot=De,j):null;case an:return q.key===De?$(j,L,q,re):null;case Wi:return De=Mn(q._debugInfo),q=Io(q),j=Me(j,L,q,re),ot=De,j}if(Bn(q)||P(q))return De!==null?null:(De=Mn(q._debugInfo),j=pe(j,L,q,re,null),ot=De,j);if(typeof q.then=="function")return De=Mn(q._debugInfo),j=Me(j,L,po(q),re),ot=De,j;if(q.$$typeof===wa)return Me(j,L,ks(j,q),re);Cu(j,q)}return typeof q=="function"&&eh(j,q),typeof q=="symbol"&&th(j,q),null}function mt(j,L,q,re,De){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return j=j.get(q)||null,N(L,j,""+re,De);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case Ul:return q=j.get(re.key===null?q:re.key)||null,j=Mn(re._debugInfo),L=Y(L,q,re,De),ot=j,L;case an:return j=j.get(re.key===null?q:re.key)||null,$(L,j,re,De);case Wi:var bt=Mn(re._debugInfo);return re=Io(re),L=mt(j,L,q,re,De),ot=bt,L}if(Bn(re)||P(re))return q=j.get(q)||null,j=Mn(re._debugInfo),L=pe(L,q,re,De,null),ot=j,L;if(typeof re.then=="function")return bt=Mn(re._debugInfo),L=mt(j,L,q,po(re),De),ot=bt,L;if(re.$$typeof===wa)return mt(j,L,q,ks(L,re),De);Cu(L,re)}return typeof re=="function"&&eh(L,re),typeof re=="symbol"&&th(L,re),null}function Dt(j,L,q,re){if(typeof q!="object"||q===null)return re;switch(q.$$typeof){case Ul:case an:M(j,L,q);var De=q.key;if(typeof De!="string")break;if(re===null){re=new Set,re.add(De);break}if(!re.has(De)){re.add(De);break}ae(L,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",De)});break;case Wi:q=Io(q),Dt(j,L,q,re)}return re}function Xf(j,L,q,re){for(var De=null,bt=null,Ze=null,nt=L,st=L=0,en=null;nt!==null&&st<q.length;st++){nt.index>st?(en=nt,nt=null):en=nt.sibling;var En=Me(j,nt,q[st],re);if(En===null){nt===null&&(nt=en);break}De=Dt(j,En,q[st],De),i&&nt&&En.alternate===null&&s(j,nt),L=b(En,L,st),Ze===null?bt=En:Ze.sibling=En,Ze=En,nt=en}if(st===q.length)return c(j,nt),vt&&la(j,st),bt;if(nt===null){for(;st<q.length;st++)nt=Se(j,q[st],re),nt!==null&&(De=Dt(j,nt,q[st],De),L=b(nt,L,st),Ze===null?bt=nt:Ze.sibling=nt,Ze=nt);return vt&&la(j,st),bt}for(nt=p(nt);st<q.length;st++)en=mt(nt,j,st,q[st],re),en!==null&&(De=Dt(j,en,q[st],De),i&&en.alternate!==null&&nt.delete(en.key===null?st:en.key),L=b(en,L,st),Ze===null?bt=en:Ze.sibling=en,Ze=en);return i&&nt.forEach(function(Il){return s(j,Il)}),vt&&la(j,st),bt}function qf(j,L,q,re){if(q==null)throw Error("An iterable object provided no iterator.");for(var De=null,bt=null,Ze=L,nt=L=0,st=null,en=null,En=q.next();Ze!==null&&!En.done;nt++,En=q.next()){Ze.index>nt?(st=Ze,Ze=null):st=Ze.sibling;var Il=Me(j,Ze,En.value,re);if(Il===null){Ze===null&&(Ze=st);break}en=Dt(j,Il,En.value,en),i&&Ze&&Il.alternate===null&&s(j,Ze),L=b(Il,L,nt),bt===null?De=Il:bt.sibling=Il,bt=Il,Ze=st}if(En.done)return c(j,Ze),vt&&la(j,nt),De;if(Ze===null){for(;!En.done;nt++,En=q.next())Ze=Se(j,En.value,re),Ze!==null&&(en=Dt(j,Ze,En.value,en),L=b(Ze,L,nt),bt===null?De=Ze:bt.sibling=Ze,bt=Ze);return vt&&la(j,nt),De}for(Ze=p(Ze);!En.done;nt++,En=q.next())st=mt(Ze,j,nt,En.value,re),st!==null&&(en=Dt(j,st,En.value,en),i&&st.alternate!==null&&Ze.delete(st.key===null?nt:st.key),L=b(st,L,nt),bt===null?De=st:bt.sibling=st,bt=st);return i&&Ze.forEach(function(p5){return s(j,p5)}),vt&&la(j,nt),De}function cr(j,L,q,re){if(typeof q=="object"&&q!==null&&q.type===Bl&&q.key===null&&(Eu(q,null,j),q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case Ul:var De=Mn(q._debugInfo);e:{for(var bt=q.key;L!==null;){if(L.key===bt){if(bt=q.type,bt===Bl){if(L.tag===7){c(j,L.sibling),re=g(L,q.props.children),re.return=j,re._debugOwner=q._owner,re._debugInfo=ot,Eu(q,re,j),j=re;break e}}else if(L.elementType===bt||Dg(L,q)||typeof bt=="object"&&bt!==null&&bt.$$typeof===Wi&&Io(bt)===L.type){c(j,L.sibling),re=g(L,q.props),mo(re,q),re.return=j,re._debugOwner=q._owner,re._debugInfo=ot,j=re;break e}c(j,L);break}else s(j,L);L=L.sibling}q.type===Bl?(re=Dl(q.props.children,j.mode,re,q.key),re.return=j,re._debugOwner=j,re._debugInfo=ot,Eu(q,re,j),j=re):(re=$h(q,j.mode,re),mo(re,q),re.return=j,re._debugInfo=ot,j=re)}return j=R(j),ot=De,j;case an:e:{for(De=q,q=De.key;L!==null;){if(L.key===q)if(L.tag===4&&L.stateNode.containerInfo===De.containerInfo&&L.stateNode.implementation===De.implementation){c(j,L.sibling),re=g(L,De.children||[]),re.return=j,j=re;break e}else{c(j,L);break}else s(j,L);L=L.sibling}re=ef(De,j.mode,re),re.return=j,j=re}return R(j);case Wi:return De=Mn(q._debugInfo),q=Io(q),j=cr(j,L,q,re),ot=De,j}if(Bn(q))return De=Mn(q._debugInfo),j=Xf(j,L,q,re),ot=De,j;if(P(q)){if(De=Mn(q._debugInfo),bt=P(q),typeof bt!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var Ze=bt.call(q);return Ze===q?(j.tag!==0||Object.prototype.toString.call(j.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(Ze)!=="[object Generator]")&&(KC||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),KC=!0):q.entries!==bt||Ub||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ub=!0),j=qf(j,L,Ze,re),ot=De,j}if(typeof q.then=="function")return De=Mn(q._debugInfo),j=cr(j,L,po(q),re),ot=De,j;if(q.$$typeof===wa)return cr(j,L,ks(j,q),re);Cu(j,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(De=""+q,L!==null&&L.tag===6?(c(j,L.sibling),re=g(L,De),re.return=j,j=re):(c(j,L),re=am(De,j.mode,re),re.return=j,re._debugOwner=j,re._debugInfo=ot,j=re),R(j)):(typeof q=="function"&&eh(j,q),typeof q=="symbol"&&th(j,q),c(j,L))}return function(j,L,q,re){var De=ot;ot=null;try{Om=0;var bt=cr(j,L,q,re);return Rf=null,bt}catch(en){if(en===$g)throw en;var Ze=y(29,en,null,j.mode);Ze.lanes=re,Ze.return=j;var nt=Ze._debugInfo=ot;if(Ze._debugOwner=j._debugOwner,nt!=null){for(var st=nt.length-1;0<=st;st--)if(typeof nt[st].stack=="string"){Ze._debugOwner=nt[st];break}}return Ze}finally{ot=De}}}function yo(i,s){var c=Qr;k(n_,c,i),k(Af,s,i),Qr=c|s.baseLanes}function Ru(i){k(n_,Qr,i),k(Af,Af.current,i)}function go(i){Qr=n_.current,O(Af,i),O(n_,i)}function Ys(i){var s=i.alternate;k(Qn,Qn.current&Mf,i),k(Es,i,i),kr===null&&(s===null||Af.current!==null||s.memoizedState!==null)&&(kr=i)}function sp(i){if(i.tag===22){if(k(Qn,Qn.current,i),k(Es,i,i),kr===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(kr=i)}}else ts(i)}function ts(i){k(Qn,Qn.current,i),k(Es,Es.current,i)}function ns(i){O(Es,i),kr===i&&(kr=null),O(Qn,i)}function Au(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ha(c)||gm(c)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Ke(){var i=te;As===null?As=[i]:As.push(i)}function ue(){var i=te;if(As!==null&&(Xl++,As[Xl]!==i)){var s=z(Qe);if(!$C.has(s)&&($C.add(s),As!==null)){for(var c="",p=0;p<=Xl;p++){var g=As[p],b=p===Xl?i:g;for(g=p+1+". "+g;30>g.length;)g+=" ";g+=b+`
1443
- `,c+=g}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
1444
-
1445
- Previous render Next render
1446
- ------------------------------------------------------
1447
- %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1448
- `,s,c)}}}function _l(i){i==null||Bn(i)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",te,typeof i)}function _o(){var i=z(Qe);tR.has(i)||(tR.add(i),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",i))}function nn(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1449
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
1450
- 2. You might be breaking the Rules of Hooks
1451
- 3. You might have more than one copy of React in the same app
1452
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function nh(i,s){if(Pm)return!1;if(s===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",te),!1;i.length!==s.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
1453
-
1454
- Previous: %s
1455
- Incoming: %s`,te,"["+s.join(", ")+"]","["+i.join(", ")+"]");for(var c=0;c<s.length&&c<i.length;c++)if(!K(i[c],s[c]))return!1;return!0}function rp(i,s,c,p,g,b){Ko=b,Qe=s,As=i!==null?i._debugHookTypes:null,Xl=-1,Pm=i!==null&&i.type!==s.type,(Object.prototype.toString.call(c)==="[object AsyncFunction]"||Object.prototype.toString.call(c)==="[object AsyncGeneratorFunction]")&&(b=z(Qe),Bb.has(b)||(Bb.add(b),console.error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."))),s.memoizedState=null,s.updateQueue=null,s.lanes=0,ee.H=i!==null&&i.memoizedState!==null?Zo:As!==null?fc:Qo,hc=b=(s.mode&8)!==Qt;var R=Mb(c,p,g);if(hc=!1,Uf&&(R=ih(s,c,p,g)),b){yt(!0);try{R=ih(s,c,p,g)}finally{yt(!1)}}return Dn(i,s),R}function Dn(i,s){s._debugHookTypes=As,s.dependencies===null?Yl!==null&&(s.dependencies={lanes:0,firstContext:null,_debugThenableState:Yl}):s.dependencies._debugThenableState=Yl,ee.H=Ir;var c=Vt!==null&&Vt.next!==null;if(Ko=0,As=te=Gn=Vt=Qe=null,Xl=-1,i!==null&&(i.flags&31457280)!==(s.flags&31457280)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),i_=!1,Gm=0,Yl=null,c)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");i===null||oi||(i=i.dependencies,i!==null&&wh(i)&&(oi=!0)),t_?(t_=!1,i=!0):i=!1,i&&(s=z(s)||"Unknown",eR.has(s)||Bb.has(s)||(eR.add(s),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function ih(i,s,c,p){Qe=i;var g=0;do{if(Uf&&(Yl=null),Gm=0,Uf=!1,g>=i5)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(g+=1,Pm=!1,Gn=Vt=null,i.updateQueue!=null){var b=i.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}Xl=-1,ee.H=dc,b=Mb(s,c,p)}while(Uf);return b}function ng(){var i=ee.H,s=i.useState()[0];return s=typeof s.then=="function"?vo(s):s,i=i.useState()[0],(Vt!==null?Vt.memoizedState:null)!==i&&(Qe.flags|=1024),s}function ah(){var i=a_!==0;return a_=0,i}function sh(i,s,c){s.updateQueue=i.updateQueue,s.flags=(s.mode&16)!==Qt?s.flags&-201328645:s.flags&-2053,i.lanes&=~c}function rh(i){if(i_){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}i_=!1}Ko=0,As=Gn=Vt=Qe=null,Xl=-1,te=null,Uf=!1,Gm=a_=0,Yl=null}function Un(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?Qe.memoizedState=Gn=i:Gn=Gn.next=i,Gn}function Tt(){if(Vt===null){var i=Qe.alternate;i=i!==null?i.memoizedState:null}else i=Vt.next;var s=Gn===null?Qe.memoizedState:Gn.next;if(s!==null)Gn=s,Vt=i;else{if(i===null)throw Qe.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");Vt=i,i={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Gn===null?Qe.memoizedState=Gn=i:Gn=Gn.next=i}return Gn}function vo(i){var s=Gm;return Gm+=1,Yl===null&&(Yl=tp()),i=np(Yl,i,s),s=Qe,(Gn===null?s.memoizedState:Gn.next)===null&&(s=s.alternate,ee.H=s!==null&&s.memoizedState!==null?Zo:Qo),i}function Xs(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return vo(i);if(i.$$typeof===wa)return Yt(i)}throw Error("An unsupported type was passed to use(): "+String(i))}function Sr(i){var s=null,c=Qe.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var p=Qe.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Ob(),Qe.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0||Pm)for(c=s.data[s.index]=Array(i),p=0;p<i;p++)c[p]=lf;else c.length!==i&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",c.length,i);return s.index++,c}function Fi(i,s){return typeof s=="function"?s(i):s}function Mu(i,s,c){var p=Un();if(c!==void 0){var g=c(s);if(hc){yt(!0);try{c(s)}finally{yt(!1)}}}else g=s;return p.memoizedState=p.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},p.queue=i,i=i.dispatch=sg.bind(null,Qe,i),[p.memoizedState,i]}function vl(i){var s=Tt();return Du(s,Vt,i)}function Du(i,s,c){var p=i.queue;if(p===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");p.lastRenderedReducer=c;var g=i.baseQueue,b=p.pending;if(b!==null){if(g!==null){var R=g.next;g.next=b.next,b.next=R}s.baseQueue!==g&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),s.baseQueue=g=b,p.pending=null}if(b=i.baseState,g===null)i.memoizedState=b;else{s=g.next;var N=R=null,Y=null,$=s,pe=!1;do{var Se=$.lane&-536870913;if(Se!==$.lane?(dt&Se)===Se:(Ko&Se)===Se){var Me=$.revertLane;if(Me===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),Se===oc&&(pe=!0);else if((Ko&Me)===Me){$=$.next,Me===oc&&(pe=!0);continue}else Se={lane:0,revertLane:$.revertLane,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},Y===null?(N=Y=Se,R=b):Y=Y.next=Se,Qe.lanes|=Me,Jo|=Me;Se=$.action,hc&&c(b,Se),b=$.hasEagerState?$.eagerState:c(b,Se)}else Me={lane:Se,revertLane:$.revertLane,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null},Y===null?(N=Y=Me,R=b):Y=Y.next=Me,Qe.lanes|=Se,Jo|=Se;$=$.next}while($!==null&&$!==s);if(Y===null?R=b:Y.next=N,!K(b,i.memoizedState)&&(oi=!0,pe&&(c=Ef,c!==null)))throw c;i.memoizedState=b,i.baseState=R,i.baseQueue=Y,p.lastRenderedState=b}return g===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function bl(i){var s=Tt(),c=s.queue;if(c===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");c.lastRenderedReducer=i;var p=c.dispatch,g=c.pending,b=s.memoizedState;if(g!==null){c.pending=null;var R=g=g.next;do b=i(b,R.action),R=R.next;while(R!==g);K(b,s.memoizedState)||(oi=!0),s.memoizedState=b,s.baseQueue===null&&(s.baseState=b),c.lastRenderedState=b}return[b,p]}function Uu(i,s,c){var p=Qe,g=Un();if(vt){if(c===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var b=c();Df||b===c()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),Df=!0)}else{if(b=s(),Df||(c=s(),K(b,c)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Df=!0)),qt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(dt&60)!==0||lh(p,s,b)}return g.memoizedState=b,c={value:b,getSnapshot:s},g.queue=c,So(is.bind(null,p,c,i),[i]),p.flags|=2048,Cr(Rs|Zn,lp.bind(null,p,c,b,s),{destroy:void 0},null),b}function Bu(i,s,c){var p=Qe,g=Tt(),b=vt;if(b){if(c===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");c=c()}else if(c=s(),!Df){var R=s();K(c,R)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Df=!0)}(R=!K((Vt||g).memoizedState,c))&&(g.memoizedState=c,oi=!0),g=g.queue;var N=is.bind(null,p,g,i);if(ni(2048,Zn,N,[i]),g.getSnapshot!==s||R||Gn!==null&&Gn.memoizedState.tag&Rs){if(p.flags|=2048,Cr(Rs|Zn,lp.bind(null,p,g,c,s),{destroy:void 0},null),qt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");b||(Ko&60)!==0||lh(p,s,c)}return c}function lh(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=Qe.updateQueue,s===null?(s=Ob(),Qe.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function lp(i,s,c,p){s.value=c,s.getSnapshot=p,oh(s)&&ig(i)}function is(i,s,c){return c(function(){oh(s)&&ig(i)})}function oh(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!K(i,c)}catch{return!0}}function ig(i){var s=fn(i,2);s!==null&&Jt(s,i,2)}function uh(i){var s=Un();if(typeof i=="function"){var c=i;if(i=c(),hc){yt(!0);try{c()}finally{yt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},s}function as(i){i=uh(i);var s=i.queue,c=oa.bind(null,Qe,s);return s.dispatch=c,[i.memoizedState,c]}function Da(i){var s=Un();s.memoizedState=s.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Th.bind(null,Qe,!0,c),c.dispatch=s,[i,s]}function ch(i,s){var c=Tt();return hh(c,Vt,i,s)}function hh(i,s,c,p){return i.baseState=c,Du(i,Vt,typeof p=="function"?p:Fi)}function bo(i,s){var c=Tt();return Vt!==null?hh(c,Vt,i,s):(c.baseState=i,[i,c.queue.dispatch])}function fh(i,s,c,p,g){if(Eh(i))throw Error("Cannot update form state while rendering.");if(i=s.action,i!==null){var b={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){b.listeners.push(R)}};ee.T!==null?c(!0):b.isTransition=!1,p(b),c=s.pending,c===null?(b.next=s.pending=b,Tr(s,b)):(b.next=c.next,s.pending=c.next=b)}}function Tr(i,s){var c=s.action,p=s.payload,g=i.state;if(s.isTransition){var b=ee.T,R={};ee.T=R,ee.T._updatedFibers=new Set;try{var N=c(g,p),Y=ee.S;Y!==null&&Y(R,N),Ln(i,s,N)}catch($){dh(i,s,$)}finally{ee.T=b,b===null&&R._updatedFibers&&(i=R._updatedFibers.size,R._updatedFibers.clear(),10<i&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{R=c(g,p),Ln(i,s,R)}catch($){dh(i,s,$)}}function Ln(i,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?(c.then(function(p){Ou(i,s,p)},function(p){return dh(i,s,p)}),s.isTransition||console.error("An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`")):Ou(i,s,c)}function Ou(i,s,c){s.status="fulfilled",s.value=c,ph(s),i.state=c,s=i.pending,s!==null&&(c=s.next,c===s?i.pending=null:(c=c.next,s.next=c,Tr(i,c)))}function dh(i,s,c){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=c,ph(s),s=s.next;while(s!==p)}i.action=null}function ph(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function xo(i,s){return s}function Er(i,s){if(vt){var c=qt.formState;if(c!==null){e:{var p=Qe;if(vt){if(Ei){var g=sn(Ei,Fr);if(g){Ei=sr(g),p=Yg(g);break e}}Ls(p)}p=!1}p&&(s=c[0])}}c=Un(),c.memoizedState=c.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:s},c.queue=p,c=oa.bind(null,Qe,p),p.dispatch=c,p=uh(!1);var b=Th.bind(null,Qe,!1,p.queue);return p=Un(),g={state:s,dispatch:null,action:i,pending:null},p.queue=g,c=fh.bind(null,Qe,g,b,c),g.dispatch=c,p.memoizedState=i,[s,c,!1]}function xl(i){var s=Tt();return op(s,Vt,i)}function op(i,s,c){s=Du(i,s,xo)[0],i=vl(Fi)[0],s=typeof s=="object"&&s!==null&&typeof s.then=="function"?vo(s):s;var p=Tt(),g=p.queue,b=g.dispatch;return c!==p.memoizedState&&(Qe.flags|=2048,Cr(Rs|Zn,ki.bind(null,g,c),{destroy:void 0},null)),[s,b,i]}function ki(i,s){i.action=s}function Nu(i){var s=Tt(),c=Vt;if(c!==null)return op(s,c,i);Tt(),s=s.memoizedState,c=Tt();var p=c.queue.dispatch;return c.memoizedState=i,[s,p,!1]}function Cr(i,s,c,p){return i={tag:i,create:s,inst:c,deps:p,next:null},s=Qe.updateQueue,s===null&&(s=Ob(),Qe.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=i.next=i:(p=c.next,c.next=i,i.next=p,s.lastEffect=i),i}function mh(i){var s=Un();return i={current:i},s.memoizedState=i}function Rr(i,s,c,p){var g=Un();Qe.flags|=i,g.memoizedState=Cr(Rs|s,c,{destroy:void 0},p===void 0?null:p)}function ni(i,s,c,p){var g=Tt();p=p===void 0?null:p;var b=g.memoizedState.inst;Vt!==null&&p!==null&&nh(p,Vt.memoizedState.deps)?g.memoizedState=Cr(s,c,b,p):(Qe.flags|=i,g.memoizedState=Cr(Rs|s,c,b,p))}function So(i,s){(Qe.mode&16)!==Qt&&(Qe.mode&64)===Qt?Rr(142608384,Zn,i,s):Rr(8390656,Zn,i,s)}function yh(i,s){var c=4194308;return(Qe.mode&16)!==Qt&&(c|=67108864),Rr(c,Ci,i,s)}function Gu(i,s){if(typeof s=="function"){i=i();var c=s(i);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return s.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(s).join(", ")+"}"),i=i(),s.current=i,function(){s.current=null}}function Sl(i,s,c){typeof s!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null"),c=c!=null?c.concat([i]):null;var p=4194308;(Qe.mode&16)!==Qt&&(p|=67108864),Rr(p,Ci,Gu.bind(null,s,i),c)}function zt(i,s,c){typeof s!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null"),c=c!=null?c.concat([i]):null,ni(4,Ci,Gu.bind(null,s,i),c)}function up(i,s){return Un().memoizedState=[i,s===void 0?null:s],i}function gh(i,s){var c=Tt();s=s===void 0?null:s;var p=c.memoizedState;return s!==null&&nh(s,p[1])?p[0]:(c.memoizedState=[i,s],i)}function _h(i,s){var c=Un();s=s===void 0?null:s;var p=i();if(hc){yt(!0);try{i()}finally{yt(!1)}}return c.memoizedState=[p,s],p}function Ar(i,s){var c=Tt();s=s===void 0?null:s;var p=c.memoizedState;if(s!==null&&nh(s,p[1]))return p[0];if(p=i(),hc){yt(!0);try{i()}finally{yt(!1)}}return c.memoizedState=[p,s],p}function ss(i,s){var c=Un();return qs(c,i,s)}function cp(i,s){var c=Tt();return Pi(c,Vt.memoizedState,i,s)}function hp(i,s){var c=Tt();return Vt===null?qs(c,i,s):Pi(c,Vt.memoizedState,i,s)}function qs(i,s,c){return c===void 0||(Ko&1073741824)!==0?i.memoizedState=s:(i.memoizedState=c,i=Ip(),Qe.lanes|=i,Jo|=i,c)}function Pi(i,s,c,p){return K(c,s)?c:Af.current!==null?(i=qs(i,c,p),K(i,s)||(oi=!0),i):(Ko&42)===0?(oi=!0,i.memoizedState=c):(i=Ip(),Qe.lanes|=i,Jo|=i,s)}function fp(i,s,c,p,g){var b=ir();kn(b!==0&&8>b?b:8);var R=ee.T,N={};ee.T=N,Th(i,!1,s,c),N._updatedFibers=new Set;try{var Y=g(),$=ee.S;if($!==null&&$(N,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var pe=eg(Y,p);Tl(i,s,pe,Qi(i))}else Tl(i,s,p,Qi(i))}catch(Se){Tl(i,s,{then:function(){},status:"rejected",reason:Se},Qi(i))}finally{kn(b),ee.T=R,R===null&&N._updatedFibers&&(i=N._updatedFibers.size,N._updatedFibers.clear(),10<i&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function dp(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:ms,baseState:ms,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:ms},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:c},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function vh(){var i=uh(!1);return i=fp.bind(null,Qe,i.queue,!0,!1),Un().memoizedState=i,[!1,i]}function bh(){var i=vl(Fi)[0],s=Tt().memoizedState;return[typeof i=="boolean"?i:vo(i),s]}function xh(){var i=bl(Fi)[0],s=Tt().memoizedState;return[typeof i=="boolean"?i:vo(i),s]}function rs(){return Yt(ar)}function Sh(){var i=Un(),s=qt.identifierPrefix;if(vt){var c=li,p=at;c=(p&~(1<<32-In(p)-1)).toString(32)+c,s=":"+s+"R"+c,c=a_++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=n5++,s=":"+s+"r"+c.toString(32)+":";return i.memoizedState=s}function pp(){return Un().memoizedState=ag.bind(null,Qe)}function ag(i,s){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var p=Qi(c);i=js(p);var g=qi(c,i,p);g!==null&&(Jt(g,c,p),ho(g,c,p)),c=zh(),s!=null&&g!==null&&console.error("The seed argument is not enabled outside experimental channels."),i.payload={cache:c};return}c=c.return}}function sg(i,s,c,p){typeof p=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),p=Qi(i),c={lane:p,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Eh(i)?Ch(s,c):(c=tn(i,s,c,p),c!==null&&(Jt(c,i,p),mi(c,s,p))),gr(i,p)}function oa(i,s,c,p){typeof p=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),p=Qi(i),Tl(i,s,c,p),gr(i,p)}function Tl(i,s,c,p){var g={lane:p,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Eh(i))Ch(s,g);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null)){var R=ee.H;ee.H=ia;try{var N=s.lastRenderedState,Y=b(N,c);if(g.hasEagerState=!0,g.eagerState=Y,K(Y,N))return Hn(i,s,g,0),qt===null&&uo(),!1}catch{}finally{ee.H=R}}if(c=tn(i,s,g,p),c!==null)return Jt(c,i,p),mi(c,s,p),!0}return!1}function Th(i,s,c,p){if(ee.T===null&&oc===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),p={lane:2,revertLane:Qc(),action:p,hasEagerState:!1,eagerState:null,next:null},Eh(i)){if(s)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else s=tn(i,c,p,2),s!==null&&Jt(s,i,2);gr(i,2)}function Eh(i){var s=i.alternate;return i===Qe||s!==null&&s===Qe}function Ch(i,s){Uf=i_=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function mi(i,s,c){if((c&4194176)!==0){var p=s.lanes;p&=i.pendingLanes,c|=p,s.lanes=c,ei(i,c)}}function Rh(i){if(i!==null&&typeof i!="function"){var s=String(i);fR.has(s)||(fR.add(s),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",i))}}function yi(i,s,c,p){var g=i.memoizedState,b=c(p,g);if(i.mode&8){yt(!0);try{b=c(p,g)}finally{yt(!1)}}b===void 0&&(s=w(s)||"Component",oR.has(s)||(oR.add(s),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",s))),g=b==null?g:Yn({},g,b),i.memoizedState=g,i.lanes===0&&(i.updateQueue.baseState=g)}function mp(i,s,c,p,g,b,R){var N=i.stateNode;if(typeof N.shouldComponentUpdate=="function"){if(c=N.shouldComponentUpdate(p,b,R),i.mode&8){yt(!0);try{c=N.shouldComponentUpdate(p,b,R)}finally{yt(!1)}}return c===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",w(s)||"Component"),c}return s.prototype&&s.prototype.isPureReactComponent?!Su(c,p)||!Su(g,b):!0}function ls(i,s,c,p){var g=s.state;typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,p),s.state!==g&&(i=z(i)||"Component",iR.has(i)||(iR.add(i),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",i)),Nb.enqueueReplaceState(s,s.state,null))}function ua(i,s){var c=s;if("ref"in s){c={};for(var p in s)p!=="ref"&&(c[p]=s[p])}if(i=i.defaultProps){c===s&&(c=Yn({},c));for(var g in i)c[g]===void 0&&(c[g]=i[g])}return c}function Ua(i,s){try{Bf=s.source?z(s.source):null,Gb=null;var c=s.value;if(ee.actQueue!==null)ee.thrownErrors.push(c);else{var p=i.onUncaughtError;p(c,{componentStack:s.stack})}}catch(g){setTimeout(function(){throw g})}}function Ah(i,s,c){try{Bf=c.source?z(c.source):null,Gb=z(s);var p=i.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Pu(i,s,c){return c=js(c),c.tag=Eb,c.payload={element:null},c.callback=function(){ae(s.source,Ua,i,s)},c}function os(i){return i=js(i),i.tag=Eb,i}function Mh(i,s,c,p){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var b=p.value;i.payload=function(){return g(b)},i.callback=function(){Ug(c),ae(p.source,Ah,s,c,p)}}var R=c.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(i.callback=function(){Ug(c),ae(p.source,Ah,s,c,p),typeof g!="function"&&(eu===null?eu=new Set([this]):eu.add(this)),$G(this,p),typeof g=="function"||(c.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",z(c)||"Unknown")})}function To(i,s,c,p,g){if(c.flags|=32768,Kn&&ku(i,g),p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=c.alternate,s!==null&&Lu(s,c,g,!0),vt&&(jl=!0),c=Es.current,c!==null){switch(c.tag){case 13:return kr===null?Qp():c.alternate===null&&bn===Fl&&(bn=Lb),c.flags&=-257,c.flags|=65536,c.lanes=g,p===e_?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([p]):s.add(p),Wh(i,p,g)),!1;case 22:return c.flags|=65536,p===e_?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([p]):c.add(p)),Wh(i,p,g)),!1}throw Error("Unexpected Suspense handler tag ("+c.tag+"). This is a bug in React.")}return Wh(i,p,g),Qp(),!1}if(vt)return jl=!0,s=Es.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,p!==gb&&pl(ti(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:p}),c))):(p!==gb&&pl(ti(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:p}),c)),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,p=ti(p,c),g=Pu(i.stateNode,p,g),gl(i,g),bn!==mc&&(bn=Hf)),!1;var b=ti(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:p}),c);if(jm===null?jm=[b]:jm.push(b),bn!==mc&&(bn=Hf),s===null)return!0;p=ti(p,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,i=g&-g,c.lanes|=i,i=Pu(c.stateNode,p,i),gl(c,i),!1;case 1:if(s=c.type,b=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(eu===null||!eu.has(b))))return c.flags|=65536,g&=-g,c.lanes|=g,g=os(g),Mh(g,i,c,p),gl(c,g),!1}c=c.return}while(c!==null);return!1}function on(i,s,c,p){s.child=i===null?JC(s,null,c,p):cc(s,i.child,c,p)}function Mr(i,s,c,p,g){c=c.render;var b=s.ref;if("ref"in p){var R={};for(var N in p)N!=="ref"&&(R[N]=p[N])}else R=p;return Br(s),Hs(s),p=rp(i,s,c,R,b,g),N=ah(),Wa(),i!==null&&!oi?(sh(i,s,g),Oa(i,s,g)):(vt&&N&&fi(s),s.flags|=1,on(i,s,p,g),s.child)}function yp(i,s,c,p,g){if(i===null){var b=c.type;return typeof b=="function"&&!nm(b)&&b.defaultProps===void 0&&c.compare===null?(c=Pr(b),s.tag=15,s.type=c,Nh(s,b),gp(i,s,c,p,g)):(i=im(c.type,null,p,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(b=i.child,!Ur(i,g)){var R=b.memoizedProps;if(c=c.compare,c=c!==null?c:Su,c(R,p)&&i.ref===s.ref)return Oa(i,s,g)}return s.flags|=1,i=wr(b,p),i.ref=s.ref,i.return=s,s.child=i}function gp(i,s,c,p,g){if(i!==null){var b=i.memoizedProps;if(Su(b,p)&&i.ref===s.ref&&s.type===i.type)if(oi=!1,s.pendingProps=p=b,Ur(i,g))(i.flags&131072)!==0&&(oi=!0);else return s.lanes=i.lanes,Oa(i,s,g)}return Dh(i,s,c,p,g)}function Eo(i,s,c){var p=s.pendingProps,g=p.children,b=(s.stateNode._pendingVisibility&2)!==0,R=i!==null?i.memoizedState:null;if(Dr(i,s),p.mode==="hidden"||b){if((s.flags&128)!==0){if(p=R!==null?R.baseLanes|c:c,i!==null){for(g=s.child=i.child,b=0;g!==null;)b=b|g.lanes|g.childLanes,g=g.sibling;s.childLanes=b&~p}else s.childLanes=0,s.child=null;return _p(i,s,p,c)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&us(s,R!==null?R.cachePool:null),R!==null?yo(s,R):Ru(s),sp(s);else return s.lanes=s.childLanes=536870912,_p(i,s,R!==null?R.baseLanes|c:c,c)}else R!==null?(us(s,R.cachePool),yo(s,R),ts(s),s.memoizedState=null):(i!==null&&us(s,null),Ru(s),ts(s));return on(i,s,g,c),s.child}function _p(i,s,c,p){var g=Hh();return g=g===null?null:{parent:pn?_n._currentValue:_n._currentValue2,pool:g},s.memoizedState={baseLanes:c,cachePool:g},i!==null&&us(s,null),Ru(s),sp(s),i!==null&&Lu(i,s,p,!0),null}function Dr(i,s){var c=s.ref;if(c===null)i!==null&&i.ref!==null&&(s.flags|=2097664);else{if(typeof c!="function"&&typeof c!="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");(i===null||i.ref!==c)&&(s.flags|=2097664)}}function Dh(i,s,c,p,g){if(c.prototype&&typeof c.prototype.render=="function"){var b=w(c)||"Unknown";mR[b]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",b,b),mR[b]=!0)}return s.mode&8&&lr.recordLegacyContextWarning(s,null),i===null&&(Nh(s,s.type),c.contextTypes&&(b=w(c)||"Unknown",gR[b]||(gR[b]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",b)))),Br(s),Hs(s),c=rp(i,s,c,p,void 0,g),p=ah(),Wa(),i!==null&&!oi?(sh(i,s,g),Oa(i,s,g)):(vt&&p&&fi(s),s.flags|=1,on(i,s,c,g),s.child)}function Uh(i,s,c,p,g,b){return Br(s),Hs(s),Xl=-1,Pm=i!==null&&i.type!==s.type,s.updateQueue=null,c=ih(s,p,c,g),Dn(i,s),p=ah(),Wa(),i!==null&&!oi?(sh(i,s,b),Oa(i,s,b)):(vt&&p&&fi(s),s.flags|=1,on(i,s,c,b),s.child)}function Bh(i,s,c,p,g){switch(m(s)){case!1:var b=s.stateNode,R=new s.type(s.memoizedProps,b.context).state;b.updater.enqueueSetState(b,R,null);break;case!0:s.flags|=128,s.flags|=65536,b=Error("Simulated error coming from DevTools");var N=g&-g;if(s.lanes|=N,R=qt,R===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");N=os(N),Mh(N,R,s,ti(b,s)),gl(s,N)}if(Br(s),s.stateNode===null){if(R=ga,b=c.contextType,"contextType"in c&&b!==null&&(b===void 0||b.$$typeof!==wa)&&!hR.has(c)&&(hR.add(c),N=b===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof b!="object"?" However, it is set to a "+typeof b+".":b.$$typeof===sf?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(b).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",w(c)||"Component",N)),typeof b=="object"&&b!==null&&(R=Yt(b)),b=new c(p,R),s.mode&8){yt(!0);try{b=new c(p,R)}finally{yt(!1)}}if(R=s.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Nb,s.stateNode=b,b._reactInternals=s,b._reactInternalInstance=nR,typeof c.getDerivedStateFromProps=="function"&&R===null&&(R=w(c)||"Component",aR.has(R)||(aR.add(R),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",R,b.state===null?"null":"undefined",R))),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"){var Y=N=R=null;if(typeof b.componentWillMount=="function"&&b.componentWillMount.__suppressDeprecationWarning!==!0?R="componentWillMount":typeof b.UNSAFE_componentWillMount=="function"&&(R="UNSAFE_componentWillMount"),typeof b.componentWillReceiveProps=="function"&&b.componentWillReceiveProps.__suppressDeprecationWarning!==!0?N="componentWillReceiveProps":typeof b.UNSAFE_componentWillReceiveProps=="function"&&(N="UNSAFE_componentWillReceiveProps"),typeof b.componentWillUpdate=="function"&&b.componentWillUpdate.__suppressDeprecationWarning!==!0?Y="componentWillUpdate":typeof b.UNSAFE_componentWillUpdate=="function"&&(Y="UNSAFE_componentWillUpdate"),R!==null||N!==null||Y!==null){b=w(c)||"Component";var $=typeof c.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";rR.has(b)||(rR.add(b),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
1456
-
1457
- %s uses %s but also contains the following legacy lifecycles:%s%s%s
1458
-
1459
- The above lifecycles should be removed. Learn more about this warning here:
1460
- https://react.dev/link/unsafe-component-lifecycles`,b,$,R!==null?`
1461
- `+R:"",N!==null?`
1462
- `+N:"",Y!==null?`
1463
- `+Y:""))}}b=s.stateNode,R=w(c)||"Component",b.render||(c.prototype&&typeof c.prototype.render=="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",R):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",R)),!b.getInitialState||b.getInitialState.isReactClassApproved||b.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",R),b.getDefaultProps&&!b.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",R),b.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",R),c.childContextTypes&&!cR.has(c)&&(cR.add(c),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",R)),c.contextTypes&&!uR.has(c)&&(uR.add(c),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",R)),typeof b.componentShouldUpdate=="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",R),c.prototype&&c.prototype.isPureReactComponent&&typeof b.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",w(c)||"A pure component"),typeof b.componentDidUnmount=="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",R),typeof b.componentDidReceiveProps=="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",R),typeof b.componentWillRecieveProps=="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",R),typeof b.UNSAFE_componentWillRecieveProps=="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",R),N=b.props!==p,b.props!==void 0&&N&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",R),b.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",R,R),typeof b.getSnapshotBeforeUpdate!="function"||typeof b.componentDidUpdate=="function"||sR.has(c)||(sR.add(c),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",w(c))),typeof b.getDerivedStateFromProps=="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",R),typeof b.getDerivedStateFromError=="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",R),typeof c.getSnapshotBeforeUpdate=="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",R),(N=b.state)&&(typeof N!="object"||Bn(N))&&console.error("%s.state: must be set to an object or null",R),typeof b.getChildContext=="function"&&typeof c.childContextTypes!="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",R),b=s.stateNode,b.props=p,b.state=s.memoizedState,b.refs={},Zc(s),R=c.contextType,b.context=typeof R=="object"&&R!==null?Yt(R):ga,b.state===p&&(R=w(c)||"Component",lR.has(R)||(lR.add(R),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",R))),s.mode&8&&lr.recordLegacyContextWarning(s,b),lr.recordUnsafeLifecycleWarnings(s,b),b.state=s.memoizedState,R=c.getDerivedStateFromProps,typeof R=="function"&&(yi(s,c,R,p),b.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(R=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),R!==b.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",z(s)||"Component"),Nb.enqueueReplaceState(b,b.state,null)),fo(s,p,b,g),xr(),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==Qt&&(s.flags|=67108864),b=!0}else if(i===null){b=s.stateNode;var pe=s.memoizedProps;N=ua(c,pe),b.props=N;var Se=b.context;Y=c.contextType,R=ga,typeof Y=="object"&&Y!==null&&(R=Yt(Y)),$=c.getDerivedStateFromProps,Y=typeof $=="function"||typeof b.getSnapshotBeforeUpdate=="function",pe=s.pendingProps!==pe,Y||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(pe||Se!==R)&&ls(s,b,p,R),ko=!1;var Me=s.memoizedState;b.state=Me,fo(s,p,b,g),xr(),Se=s.memoizedState,pe||Me!==Se||ko?(typeof $=="function"&&(yi(s,c,$,p),Se=s.memoizedState),(N=ko||mp(s,c,N,p,Me,Se,R))?(Y||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==Qt&&(s.flags|=67108864)):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==Qt&&(s.flags|=67108864),s.memoizedProps=p,s.memoizedState=Se),b.props=p,b.state=Se,b.context=R,b=N):(typeof b.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==Qt&&(s.flags|=67108864),b=!1)}else{b=s.stateNode,$d(i,s),R=s.memoizedProps,Y=ua(c,R),b.props=Y,$=s.pendingProps,Me=b.context,Se=c.contextType,N=ga,typeof Se=="object"&&Se!==null&&(N=Yt(Se)),pe=c.getDerivedStateFromProps,(Se=typeof pe=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(R!==$||Me!==N)&&ls(s,b,p,N),ko=!1,Me=s.memoizedState,b.state=Me,fo(s,p,b,g),xr();var mt=s.memoizedState;R!==$||Me!==mt||ko||i!==null&&i.dependencies!==null&&wh(i.dependencies)?(typeof pe=="function"&&(yi(s,c,pe,p),mt=s.memoizedState),(Y=ko||mp(s,c,Y,p,Me,mt,N)||i!==null&&i.dependencies!==null&&wh(i.dependencies))?(Se||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(p,mt,N),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(p,mt,N)),typeof b.componentDidUpdate=="function"&&(s.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof b.componentDidUpdate!="function"||R===i.memoizedProps&&Me===i.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Me===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=mt),b.props=p,b.state=mt,b.context=N,b=Y):(typeof b.componentDidUpdate!="function"||R===i.memoizedProps&&Me===i.memoizedState||(s.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Me===i.memoizedState||(s.flags|=1024),b=!1)}if(N=b,Dr(i,s),R=(s.flags&128)!==0,N||R){if(N=s.stateNode,ee.getCurrentStack=s===null?null:Ce,qn=!1,Xn=s,R&&typeof c.getDerivedStateFromError!="function")c=null,_a=-1;else{if(Hs(s),c=HC(N),s.mode&8){yt(!0);try{HC(N)}finally{yt(!1)}}Wa()}s.flags|=1,i!==null&&R?(s.child=cc(s,i.child,null,g),s.child=cc(s,null,c,g)):on(i,s,c,g),s.memoizedState=N.state,i=s.child}else i=Oa(i,s,g);return g=s.stateNode,b&&g.props!==p&&(Of||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",z(s)||"a component"),Of=!0),i}function Oh(i,s,c,p){return _u(),s.flags|=256,on(i,s,c,p),s.child}function Nh(i,s){s&&s.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
1464
- %s.childContextTypes = ...`,s.displayName||s.name||"Component"),typeof s.getDerivedStateFromProps=="function"&&(i=w(s)||"Unknown",_R[i]||(console.error("%s: Function components do not support getDerivedStateFromProps.",i),_R[i]=!0)),typeof s.contextType=="object"&&s.contextType!==null&&(s=w(s)||"Unknown",yR[s]||(console.error("%s: Function components do not support contextType.",s),yR[s]=!0))}function wu(i){return{baseLanes:i,cachePool:Tp()}}function gi(i,s,c){return i=i!==null?i.childLanes&~c:0,s&&(i|=Xa),i}function vp(i,s,c){var p=s.pendingProps;f(s)&&(s.flags|=128);var g=!1,b=(s.flags&128)!==0,R;if((R=b)||(R=i!==null&&i.memoizedState===null?!1:(Qn.current&Nm)!==0),R&&(g=!0,s.flags&=-129),R=(s.flags&32)!==0,s.flags&=-33,i===null){if(vt){if(g?Ys(s):ts(s),vt){var N=Ei,Y;(Y=!N)||(Y=qg(N,Fr),Y!==null?(pi(),s.memoizedState={dehydrated:Y,treeContext:Kt!==null?{id:at,overflow:li}:null,retryLane:536870912},b=y(18,null,null,Qt),b.stateNode=Y,b.return=s,s.child=b,ta=s,Ei=null,Y=!0):Y=!1,Y=!Y),Y&&(Wt(s,N),Ls(s))}if(N=s.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return gm(N)?s.lanes=16:s.lanes=536870912,null;ns(s)}return N=p.children,p=p.fallback,g?(ts(s),g=s.mode,N=Gh({mode:"hidden",children:N},g),p=Dl(p,g,c,null),N.return=s,p.return=s,N.sibling=p,s.child=N,g=s.child,g.memoizedState=wu(c),g.childLanes=gi(i,R,c),s.memoizedState=wb,p):(Ys(s),jn(s,N))}if(Y=i.memoizedState,Y!==null&&(N=Y.dehydrated,N!==null)){if(b)s.flags&256?(Ys(s),s.flags&=-257,s=zu(i,s,c)):s.memoizedState!==null?(ts(s),s.child=i.child,s.flags|=128,s=null):(ts(s),g=p.fallback,N=s.mode,p=Gh({mode:"visible",children:p.children},N),g=Dl(g,N,c,null),g.flags|=2,p.return=s,g.return=s,p.sibling=g,s.child=p,cc(s,i.child,null,c),p=s.child,p.memoizedState=wu(c),p.childLanes=gi(i,R,c),s.memoizedState=wb,s=g);else if(Ys(s),vt&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),gm(N))N=pb(N),R=N.digest,g=N.message,p=N.stack,N=N.componentStack,g=Error(g||"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),g.stack=p||"",g.digest=R,R=N===void 0?null:N,p={value:g,source:null,stack:R},typeof R=="string"&&F.set(g,p),pl(p),s=zu(i,s,c);else if(oi||Lu(i,s,c,!1),R=(c&i.childLanes)!==0,oi||R){if(R=qt,R!==null){if(p=c&-c,(p&42)!==0)p=1;else switch(p){case 2:p=1;break;case 8:p=4;break;case 32:p=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:p=64;break;case 268435456:p=134217728;break;default:p=0}if(p=(p&(R.suspendedLanes|c))!==0?0:p,p!==0&&p!==Y.retryLane)throw Y.retryLane=p,fn(i,p),Jt(R,i,p),pR}Ha(N)||Qp(),s=zu(i,s,c)}else Ha(N)?(s.flags|=128,s.child=i.child,s=Eg.bind(null,i),mb(N,s),s=null):(i=Y.treeContext,Si&&(Ei=_m(N),ta=s,vt=!0,rr=null,jl=!1,Ss=null,Fr=!1,i!==null&&(pi(),Ge[Je++]=at,Ge[Je++]=li,Ge[Je++]=Kt,at=i.id,li=i.overflow,Kt=s)),s=jn(s,p.children),s.flags|=4096);return s}return g?(ts(s),g=p.fallback,N=s.mode,Y=i.child,b=Y.sibling,p=wr(Y,{mode:"hidden",children:p.children}),p.subtreeFlags=Y.subtreeFlags&31457280,b!==null?g=wr(b,g):(g=Dl(g,N,c,null),g.flags|=2),g.return=s,p.return=s,p.sibling=g,s.child=p,p=g,g=s.child,N=i.child.memoizedState,N===null?N=wu(c):(Y=N.cachePool,Y!==null?(b=pn?_n._currentValue:_n._currentValue2,Y=Y.parent!==b?{parent:b,pool:b}:Y):Y=Tp(),N={baseLanes:N.baseLanes|c,cachePool:Y}),g.memoizedState=N,g.childLanes=gi(i,R,c),s.memoizedState=wb,p):(Ys(s),c=i.child,i=c.sibling,c=wr(c,{mode:"visible",children:p.children}),c.return=s,c.sibling=null,i!==null&&(R=s.deletions,R===null?(s.deletions=[i],s.flags|=16):R.push(i)),s.child=c,s.memoizedState=null,c)}function jn(i,s){return s=Gh({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Gh(i,s){return Og(i,s,0,null)}function zu(i,s,c){return cc(s,i.child,null,c),i=jn(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function bp(i,s,c){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Vu(i.return,s,c)}function rg(i,s){var c=Bn(i);return i=!c&&typeof P(i)=="function",c||i?(c=c?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",c,s,c),!1):!0}function Ba(i,s,c,p,g){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:g}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=p,b.tail=c,b.tailMode=g)}function xp(i,s,c){var p=s.pendingProps,g=p.revealOrder,b=p.tail;if(p=p.children,g!==void 0&&g!=="forwards"&&g!=="backwards"&&g!=="together"&&!vR[g])if(vR[g]=!0,typeof g=="string")switch(g.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',g,g.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',g,g.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',g)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',g);b===void 0||Pb[b]||(b!=="collapsed"&&b!=="hidden"?(Pb[b]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',b)):g!=="forwards"&&g!=="backwards"&&(Pb[b]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',b)));e:if((g==="forwards"||g==="backwards")&&p!==void 0&&p!==null&&p!==!1)if(Bn(p)){for(var R=0;R<p.length;R++)if(!rg(p[R],R))break e}else if(R=P(p),typeof R=="function"){if(R=R.call(p))for(var N=R.next(),Y=0;!N.done;N=R.next()){if(!rg(N.value,Y))break e;Y++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',g);if(on(i,s,p,c),p=Qn.current,(p&Nm)!==0)p=p&Mf|Nm,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&bp(i,c,s);else if(i.tag===19)bp(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}p&=Mf}switch(k(Qn,p,s),g){case"forwards":for(c=s.child,g=null;c!==null;)i=c.alternate,i!==null&&Au(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=s.child,s.child=null):(g=c.sibling,c.sibling=null),Ba(s,!1,g,c,b);break;case"backwards":for(c=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Au(i)===null){s.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}Ba(s,!0,c,null,b);break;case"together":Ba(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Oa(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),_a=-1,Jo|=s.lanes,(c&s.childLanes)===0)if(i!==null){if(Lu(i,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error("Resuming work not yet implemented.");if(s.child!==null){for(i=s.child,c=wr(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=wr(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function Ur(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&wh(i)))}function lg(i,s,c){switch(s.tag){case 3:Ni(s,s.stateNode.containerInfo),Fs(s,_n,i.memoizedState.cache),_u();break;case 27:case 5:ce(s);break;case 4:Ni(s,s.stateNode.containerInfo);break;case 10:Fs(s,s.type,s.memoizedProps.value);break;case 12:(c&s.childLanes)!==0&&(s.flags|=4),s.flags|=2048;var p=s.stateNode;p.effectDuration=-0,p.passiveEffectDuration=-0;break;case 13:if(p=s.memoizedState,p!==null)return p.dehydrated!==null?(Ys(s),s.flags|=128,null):(c&s.child.childLanes)!==0?vp(i,s,c):(Ys(s),i=Oa(i,s,c),i!==null?i.sibling:null);Ys(s);break;case 19:var g=(i.flags&128)!==0;if(p=(c&s.childLanes)!==0,p||(Lu(i,s,c,!1),p=(c&s.childLanes)!==0),g){if(p)return xp(i,s,c);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),k(Qn,Qn.current,s),p)break;return null;case 22:case 23:return s.lanes=0,Eo(i,s,c);case 24:Fs(s,_n,i.memoizedState.cache)}return Oa(i,s,c)}function Ph(i,s,c){if(s._debugNeedsRemount&&i!==null){c=im(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes);var p=s.return;if(p===null)throw Error("Cannot swap the root fiber.");if(i.alternate=null,s.alternate=null,c.index=s.index,c.sibling=s.sibling,c.return=s.return,c.ref=s.ref,c._debugInfo=s._debugInfo,s===p.child)p.child=c;else{var g=p.child;if(g===null)throw Error("Expected parent to have a child.");for(;g.sibling!==s;)if(g=g.sibling,g===null)throw Error("Expected to find the previous sibling.");g.sibling=c}return s=p.deletions,s===null?(p.deletions=[i],p.flags|=16):s.push(i),c.flags|=2,c}if(i!==null)if(i.memoizedProps!==s.pendingProps||s.type!==i.type)oi=!0;else{if(!Ur(i,c)&&(s.flags&128)===0)return oi=!1,lg(i,s,c);oi=(i.flags&131072)!==0}else oi=!1,(p=vt)&&(pi(),p=(s.flags&1048576)!==0),p&&(p=s.index,pi(),Vs(s,Nt,p));switch(s.lanes=0,s.tag){case 16:e:if(p=s.pendingProps,i=Io(s.elementType),s.type=i,typeof i=="function")nm(i)?(p=ua(i,p),s.tag=1,s.type=i=Pr(i),s=Bh(null,s,i,p,c)):(s.tag=0,Nh(s,i),s.type=i=Pr(i),s=Dh(null,s,i,p,c));else{if(i!=null){if(g=i.$$typeof,g===fs){s.tag=11,s.type=i=em(i),s=Mr(null,s,i,p,c);break e}else if(g===rf){s.tag=14,s=yp(null,s,i,p,c);break e}}throw s="",i!==null&&typeof i=="object"&&i.$$typeof===Wi&&(s=" Did you wrap a component in React.lazy() more than once?"),i=w(i)||i,Error("Element type is invalid. Received a promise that resolves to: "+i+". Lazy element type must resolve to a class or function."+s)}return s;case 0:return Dh(i,s,s.type,s.pendingProps,c);case 1:return p=s.type,g=ua(p,s.pendingProps),Bh(i,s,p,g,c);case 3:e:{if(Ni(s,s.stateNode.containerInfo),i===null)throw Error("Should have a current fiber. This is a bug in React.");var b=s.pendingProps;g=s.memoizedState,p=g.element,$d(i,s),fo(s,b,null,c);var R=s.memoizedState;if(b=R.cache,Fs(s,_n,b),b!==g.cache&&Sp(s,[_n],c,!0),xr(),b=R.element,Si&&g.isDehydrated)if(g={element:b,isDehydrated:!1,cache:R.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=Oh(i,s,b,c);break e}else if(b!==p){p=ti(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),s),pl(p),s=Oh(i,s,b,c);break e}else for(Si&&(Ei=rn(s.stateNode.containerInfo),ta=s,vt=!0,rr=null,jl=!1,Ss=null,Fr=!0),i=JC(s,null,b,c),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(_u(),b===p){s=Oa(i,s,c);break e}on(i,s,b,c)}s=s.child}return s;case 26:if(Fe)return Dr(i,s),i===null?(i=Hi(s.type,null,s.pendingProps,null))?s.memoizedState=i:vt||(s.stateNode=Xr(s.type,s.pendingProps,Xi(Fo.current),s)):s.memoizedState=Hi(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:if(gn)return ce(s),i===null&&gn&&vt&&(g=Xi(Fo.current),p=X(),g=s.stateNode=La(s.type,s.pendingProps,g,p,!1),jl||(p=ic(g,s.type,s.pendingProps,p),p!==null&&(es(s,0).serverProps=p)),ta=s,Fr=!0,Ei=_s(g)),p=s.pendingProps.children,i!==null||vt?on(i,s,p,c):s.child=cc(s,null,p,c),Dr(i,s),s.child;case 5:return i===null&&vt&&(b=X(),p=Bt(s.type,s.pendingProps,b),g=Ei,(R=!g)||(R=Xg(g,s.type,s.pendingProps,Fr),R!==null?(s.stateNode=R,jl||(b=ic(R,s.type,s.pendingProps,b),b!==null&&(es(s,0).serverProps=b)),ta=s,Ei=_s(R),Fr=!1,b=!0):b=!1,R=!b),R&&(p&&Wt(s,g),Ls(s))),ce(s),g=s.type,b=s.pendingProps,R=i!==null?i.memoizedProps:null,p=b.children,Sn(g,b)?p=null:R!==null&&Sn(g,R)&&(s.flags|=32),s.memoizedState!==null&&(g=rp(i,s,ng,null,null,c),pn?ar._currentValue=g:ar._currentValue2=g),Dr(i,s),on(i,s,p,c),s.child;case 6:return i===null&&vt&&(i=s.pendingProps,c=X(),i=Ht(i,c),c=Ei,(p=!c)||(p=Nn(c,s.pendingProps,Fr),p!==null?(s.stateNode=p,ta=s,Ei=null,p=!0):p=!1,p=!p),p&&(i&&Wt(s,c),Ls(s))),null;case 13:return vp(i,s,c);case 4:return Ni(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=cc(s,null,p,c):on(i,s,p,c),s.child;case 11:return Mr(i,s,s.type,s.pendingProps,c);case 7:return on(i,s,s.pendingProps,c),s.child;case 8:return on(i,s,s.pendingProps.children,c),s.child;case 12:return s.flags|=4,s.flags|=2048,p=s.stateNode,p.effectDuration=-0,p.passiveEffectDuration=-0,on(i,s,s.pendingProps.children,c),s.child;case 10:return p=s.type,g=s.pendingProps,b=g.value,"value"in g||bR||(bR=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),Fs(s,p,b),on(i,s,g.children,c),s.child;case 9:return g=s.type._context,p=s.pendingProps.children,typeof p!="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Br(s),g=Yt(g),Hs(s),p=Mb(p,g,void 0),Wa(),s.flags|=1,on(i,s,p,c),s.child;case 14:return yp(i,s,s.type,s.pendingProps,c);case 15:return gp(i,s,s.type,s.pendingProps,c);case 19:return xp(i,s,c);case 22:return Eo(i,s,c);case 24:return Br(s),p=Yt(_n),i===null?(g=Hh(),g===null&&(g=qt,b=zh(),g.pooledCache=b,Or(b),b!==null&&(g.pooledCacheLanes|=c),g=b),s.memoizedState={parent:p,cache:g},Zc(s),Fs(s,_n,g)):((i.lanes&c)!==0&&($d(i,s),fo(s,null,null,c),xr()),g=i.memoizedState,b=s.memoizedState,g.parent!==p?(g={parent:p,cache:p},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),Fs(s,_n,p)):(p=b.cache,Fs(s,_n,p),p!==g.cache&&Sp(s,[_n],c,!0))),on(i,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Hu(){Nf=l_=null,Gf=!1}function Fs(i,s,c){pn?(k(s_,s._currentValue,i),s._currentValue=c,k(zb,s._currentRenderer,i),s._currentRenderer!==void 0&&s._currentRenderer!==null&&s._currentRenderer!==r_&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),s._currentRenderer=r_):(k(s_,s._currentValue2,i),s._currentValue2=c,k(Hb,s._currentRenderer2,i),s._currentRenderer2!==void 0&&s._currentRenderer2!==null&&s._currentRenderer2!==r_&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),s._currentRenderer2=r_)}function Na(i,s){var c=s_.current;pn?(i._currentValue=c,c=zb.current,O(zb,s),i._currentRenderer=c):(i._currentValue2=c,c=Hb.current,O(Hb,s),i._currentRenderer2=c),O(s_,s)}function Vu(i,s,c){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===c)break;i=i.return}i!==c&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Sp(i,s,c,p){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var b=g.dependencies;if(b!==null){var R=g.child;b=b.firstContext;e:for(;b!==null;){var N=b;b=g;for(var Y=0;Y<s.length;Y++)if(N.context===s[Y]){b.lanes|=c,N=b.alternate,N!==null&&(N.lanes|=c),Vu(b.return,c,i),p||(R=null);break e}b=N.next}}else if(g.tag===18){if(R=g.return,R===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");R.lanes|=c,b=R.alternate,b!==null&&(b.lanes|=c),Vu(R,c,i),R=null}else R=g.child;if(R!==null)R.return=g;else for(R=g;R!==null;){if(R===i){R=null;break}if(g=R.sibling,g!==null){g.return=R.return,R=g;break}R=R.return}g=R}}function Lu(i,s,c,p){i=null;for(var g=s,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var R=g.alternate;if(R===null)throw Error("Should have a current fiber. This is a bug in React.");if(R=R.memoizedProps,R!==null){var N=g.type;K(g.pendingProps.value,R.value)||(i!==null?i.push(N):i=[N])}}else if(g===kg.current){if(R=g.alternate,R===null)throw Error("Should have a current fiber. This is a bug in React.");R.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(ar):i=[ar])}g=g.return}i!==null&&Sp(s,i,c,p),s.flags|=262144}function wh(i){for(i=i.firstContext;i!==null;){var s=i.context;if(!K(pn?s._currentValue:s._currentValue2,i.memoizedValue))return!0;i=i.next}return!1}function Br(i){l_=i,Nf=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Yt(i){return Gf&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),ju(l_,i)}function ks(i,s){return l_===null&&Br(i),ju(i,s)}function ju(i,s){var c=pn?s._currentValue:s._currentValue2;if(s={context:s,memoizedValue:c,next:null},Nf===null){if(i===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Nf=s,i.dependencies={lanes:0,firstContext:s,_debugThenableState:null},i.flags|=524288}else Nf=Nf.next=s;return c}function zh(){return{controller:new a5,data:new Map,refCount:0}}function Or(i){i.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),i.refCount++}function Yu(i){i.refCount--,0>i.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),i.refCount===0&&s5(r5,function(){i.controller.abort()})}function Hh(){var i=pc.current;return i!==null?i:qt.pooledCache}function us(i,s){s===null?k(pc,pc.current,i):k(pc,s.pool,i)}function Tp(){var i=Hh();return i===null?null:{parent:pn?_n._currentValue:_n._currentValue2,pool:i}}function tt(i){i.flags|=4}function Vh(i,s){if(i!==null&&i.child===s.child)return!1;if((s.flags&16)!==0)return!0;for(i=s.child;i!==null;){if((i.flags&13878)!==0||(i.subtreeFlags&13878)!==0)return!0;i=i.sibling}return!1}function Ep(i,s,c,p){if(un)for(c=s.child;c!==null;){if(c.tag===5||c.tag===6)No(i,c.stateNode);else if(!(c.tag===4||gn&&c.tag===27)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return;c=c.return}c.sibling.return=c.return,c=c.sibling}else if(ps)for(var g=s.child;g!==null;){if(g.tag===5){var b=g.stateNode;c&&p&&(b=tc(b,g.type,g.memoizedProps)),No(i,b)}else if(g.tag===6)b=g.stateNode,c&&p&&(b=Yr(b,g.memoizedProps)),No(i,b);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)b=g.child,b!==null&&(b.return=g),Ep(i,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===s)break;for(;g.sibling===null;){if(g.return===null||g.return===s)return;g=g.return}g.sibling.return=g.return,g=g.sibling}}function Cp(i,s,c,p){if(ps)for(var g=s.child;g!==null;){if(g.tag===5){var b=g.stateNode;c&&p&&(b=tc(b,g.type,g.memoizedProps)),ym(i,b)}else if(g.tag===6)b=g.stateNode,c&&p&&(b=Yr(b,g.memoizedProps)),ym(i,b);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)b=g.child,b!==null&&(b.return=g),Cp(i,g,!(g.memoizedProps!==null&&g.memoizedProps.mode==="manual"),!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===s)break;for(;g.sibling===null;){if(g.return===null||g.return===s)return;g=g.return}g.sibling.return=g.return,g=g.sibling}}function og(i,s){if(ps&&Vh(i,s)){i=s.stateNode;var c=i.containerInfo,p=mm();Cp(p,s,!1,!1),i.pendingChildren=p,tt(s),On(c,p)}}function Rp(i,s,c,p){if(un)i.memoizedProps!==p&&tt(s);else if(ps){var g=i.stateNode,b=i.memoizedProps;if((i=Vh(i,s))||b!==p){var R=X();b=pm(g,c,b,p,!i,null),b===g?s.stateNode=g:(si(b,c,p,R)&&tt(s),s.stateNode=b,i?Ep(b,s,!1,!1):tt(s))}else s.stateNode=g}}function Ap(i,s,c){if(Po(s,c)){if(i.flags|=16777216,!Gl(s,c))if(Bo())i.flags|=8192;else throw Cf=e_,Ab}else i.flags&=-16777217}function ug(i,s){if(bm(s)){if(i.flags|=16777216,!ea(s))if(Bo())i.flags|=8192;else throw Cf=e_,Ab}else i.flags&=-16777217}function Co(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Rn():536870912,i.lanes|=s,gc|=s)}function ca(i,s){if(!vt)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,p=0;if(s)if((i.mode&2)!==Qt){for(var g=i.selfBaseDuration,b=i.child;b!==null;)c|=b.lanes|b.childLanes,p|=b.subtreeFlags&31457280,p|=b.flags&31457280,g+=b.treeBaseDuration,b=b.sibling;i.treeBaseDuration=g}else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,p|=g.subtreeFlags&31457280,p|=g.flags&31457280,g.return=i,g=g.sibling;else if((i.mode&2)!==Qt){g=i.actualDuration,b=i.selfBaseDuration;for(var R=i.child;R!==null;)c|=R.lanes|R.childLanes,p|=R.subtreeFlags,p|=R.flags,g+=R.actualDuration,b+=R.treeBaseDuration,R=R.sibling;i.actualDuration=g,i.treeBaseDuration=b}else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,p|=g.subtreeFlags,p|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=p,i.childLanes=c,s}function Lh(i,s,c){var p=s.pendingProps;switch(di(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return Xt(s),null;case 3:return c=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Na(_n,s),D(s),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(oo(s)?(Fc(),tt(s)):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,rr!==null&&($s(rr),rr=null))),og(i,s),Xt(s),null;case 26:if(Fe){c=s.type;var g=s.memoizedState;return i===null?(tt(s),g!==null?(Xt(s),ug(s,g)):(Xt(s),Ap(s,c,p))):g?g!==i.memoizedState?(tt(s),Xt(s),ug(s,g)):(Xt(s),s.flags&=-16777217):(un?i.memoizedProps!==p&&tt(s):Rp(i,s,c,p),Xt(s),Ap(s,c,p)),null}case 27:if(gn){if(xe(s),c=Xi(Fo.current),g=s.type,i!==null&&s.stateNode!=null)un?i.memoizedProps!==p&&tt(s):Rp(i,s,g,p);else{if(!p){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Xt(s),null}i=X(),oo(s)?qc(s,i):(i=La(g,p,c,i,!0),s.stateNode=i,tt(s))}return Xt(s),null}case 5:if(xe(s),c=s.type,i!==null&&s.stateNode!=null)Rp(i,s,c,p);else{if(!p){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Xt(s),null}i=X(),oo(s)?qc(s,i):(g=Xi(Fo.current),g=Hr(c,p,g,i,s),Ep(g,s,!1,!1),s.stateNode=g,si(g,c,p,i)&&tt(s))}return Xt(s),Ap(s,s.type,s.pendingProps),null;case 6:if(i&&s.stateNode!=null)c=i.memoizedProps,un?c!==p&&tt(s):ps&&(c!==p?(i=Xi(Fo.current),c=X(),s.stateNode=_t(p,i,c,s),tt(s)):s.stateNode=i.stateNode);else{if(typeof p!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(i=Xi(Fo.current),c=X(),oo(s)){if(!Si)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");i=s.stateNode,c=s.memoizedProps,g=!jl,p=null;var b=ta;if(b!==null)switch(b.tag){case 3:g&&(g=jo(i,c,p),g!==null&&(es(s,0).serverProps=g));break;case 27:case 5:p=b.memoizedProps,g&&(g=jo(i,c,p),g!==null&&(es(s,0).serverProps=g))}$i(i,c,s,p)||Ls(s)}else s.stateNode=_t(p,i,c,s)}return Xt(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=oo(s),p!==null&&p.dehydrated!==null){if(i===null){if(!g)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(!Si)throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Va(g,s),Xt(s),(s.mode&2)!==Qt&&p!==null&&(g=s.child,g!==null&&(s.treeBaseDuration-=g.treeBaseDuration))}else Fc(),_u(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4,Xt(s),(s.mode&2)!==Qt&&p!==null&&(g=s.child,g!==null&&(s.treeBaseDuration-=g.treeBaseDuration));g=!1}else rr!==null&&($s(rr),rr=null),g=!0;if(!g)return s.flags&256?(ns(s),s):(ns(s),null)}return ns(s),(s.flags&128)!==0?(s.lanes=c,(s.mode&2)!==Qt&&xu(s),s):(c=p!==null,i=i!==null&&i.memoizedState!==null,c&&(p=s.child,g=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(g=p.alternate.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==g&&(p.flags|=2048)),c!==i&&c&&(s.child.flags|=8192),Co(s,s.updateQueue),Xt(s),(s.mode&2)!==Qt&&c&&(i=s.child,i!==null&&(s.treeBaseDuration-=i.treeBaseDuration)),null);case 4:return D(s),og(i,s),i===null&&hm(s.stateNode.containerInfo),Xt(s),null;case 10:return Na(s.type,s),Xt(s),null;case 19:if(O(Qn,s),g=s.memoizedState,g===null)return Xt(s),null;if(p=(s.flags&128)!==0,b=g.rendering,b===null)if(p)ca(g,!1);else{if(bn!==Fl||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(b=Au(i),b!==null){for(s.flags|=128,ca(g,!1),i=b.updateQueue,s.updateQueue=i,Co(s,i),s.subtreeFlags=0,i=c,c=s.child;c!==null;)Bg(c,i),c=c.sibling;return k(Qn,Qn.current&Mf|Nm,s),s.child}i=i.sibling}g.tail!==null&&C()>Ym&&(s.flags|=128,p=!0,ca(g,!1),s.lanes=4194304)}else{if(!p)if(i=Au(b),i!==null){if(s.flags|=128,p=!0,i=i.updateQueue,s.updateQueue=i,Co(s,i),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!b.alternate&&!vt)return Xt(s),null}else 2*C()-g.renderingStartTime>Ym&&c!==536870912&&(s.flags|=128,p=!0,ca(g,!1),s.lanes=4194304);g.isBackwards?(b.sibling=s.child,s.child=b):(i=g.last,i!==null?i.sibling=b:s.child=b,g.last=b)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=C(),i.sibling=null,c=Qn.current,c=p?c&Mf|Nm:c&Mf,k(Qn,c,s),i):(Xt(s),null);case 22:case 23:return ns(s),go(s),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(c&536870912)!==0&&(s.flags&128)===0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),c=s.updateQueue,c!==null&&Co(s,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==c&&(s.flags|=2048),i!==null&&O(pc,s),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),Na(_n,s),Xt(s),null;case 25:return null}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function El(i,s){switch(di(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==Qt&&xu(s),s):null;case 3:return Na(_n,s),D(s),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return xe(s),null;case 13:if(ns(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");_u()}return i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==Qt&&xu(s),s):null;case 19:return O(Qn,s),null;case 4:return D(s),null;case 10:return Na(s.type,s),null;case 22:case 23:return ns(s),go(s),i!==null&&O(pc,s),i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==Qt&&xu(s),s):null;case 24:return Na(_n,s),null;case 25:return null;default:return null}}function Mp(i,s){switch(di(s),s.tag){case 3:Na(_n,s),D(s);break;case 26:case 27:case 5:xe(s);break;case 4:D(s);break;case 13:ns(s);break;case 19:O(Qn,s);break;case 10:Na(s.type,s);break;case 22:case 23:ns(s),go(s),i!==null&&O(pc,s);break;case 24:Na(_n,s)}}function ha(i){return(i.mode&2)!==Qt}function jh(i,s){ha(i)?(Aa(),Ro(s,i),Ra()):Ro(s,i)}function Dp(i,s,c){ha(i)?(Aa(),Cl(c,i,s),Ra()):Cl(c,i,s)}function Ro(i,s){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&i)===i&&((i&Zn)!==Cs?be!==null&&typeof be.markComponentPassiveEffectMountStarted=="function"&&be.markComponentPassiveEffectMountStarted(s):(i&Ci)!==Cs&&be!==null&&typeof be.markComponentLayoutEffectMountStarted=="function"&&be.markComponentLayoutEffectMountStarted(s),p=void 0,(i&na)!==Cs&&(jf=!0),p=ae(s,e5,c),(i&na)!==Cs&&(jf=!1),(i&Zn)!==Cs?be!==null&&typeof be.markComponentPassiveEffectMountStopped=="function"&&be.markComponentPassiveEffectMountStopped():(i&Ci)!==Cs&&be!==null&&typeof be.markComponentLayoutEffectMountStopped=="function"&&be.markComponentLayoutEffectMountStopped(),p!==void 0&&typeof p!="function")){var b=void 0;b=(c.tag&Ci)!==0?"useLayoutEffect":(c.tag&na)!==0?"useInsertionEffect":"useEffect";var R=void 0;R=p===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof p.then=="function"?`
1465
-
1466
- It looks like you wrote `+b+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
1467
-
1468
- `+b+`(() => {
1469
- async function fetchData() {
1470
- // You can await here
1471
- const response = await MyAPI.getData(someId);
1472
- // ...
1473
- }
1474
- fetchData();
1475
- }, [someId]); // Or [] if effect doesn't need props or state
1476
-
1477
- Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+p,ae(s,function(N,Y){console.error("%s must not return anything besides a function, which is used for clean-up.%s",N,Y)},b,R)}c=c.next}while(c!==g)}}catch(N){Et(s,s.return,N)}}function Cl(i,s,c){try{var p=s.updateQueue,g=p!==null?p.lastEffect:null;if(g!==null){var b=g.next;p=b;do{if((p.tag&i)===i){var R=p.inst,N=R.destroy;N!==void 0&&(R.destroy=void 0,(i&Zn)!==Cs?be!==null&&typeof be.markComponentPassiveEffectUnmountStarted=="function"&&be.markComponentPassiveEffectUnmountStarted(s):(i&Ci)!==Cs&&be!==null&&typeof be.markComponentLayoutEffectUnmountStarted=="function"&&be.markComponentLayoutEffectUnmountStarted(s),(i&na)!==Cs&&(jf=!0),ae(s,t5,s,c,N),(i&na)!==Cs&&(jf=!1),(i&Zn)!==Cs?be!==null&&typeof be.markComponentPassiveEffectUnmountStopped=="function"&&be.markComponentPassiveEffectUnmountStopped():(i&Ci)!==Cs&&be!==null&&typeof be.markComponentLayoutEffectUnmountStopped=="function"&&be.markComponentLayoutEffectUnmountStopped())}p=p.next}while(p!==b)}}catch(Y){Et(s,s.return,Y)}}function Up(i,s){ha(i)?(Aa(),Ro(s,i),Ra()):Ro(s,i)}function Yh(i,s,c){ha(i)?(Aa(),Cl(c,i,s),Ra()):Cl(c,i,s)}function Bp(i){var s=i.updateQueue;if(s!==null){var c=i.stateNode;i.type.defaultProps||"ref"in i.memoizedProps||Of||(c.props!==i.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(i)||"instance"),c.state!==i.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(i)||"instance"));try{ae(i,ep,s,c)}catch(p){Et(i,i.return,p)}}}function Op(i,s,c){return i.getSnapshotBeforeUpdate(s,c)}function ct(i,s){var c=s.memoizedProps,p=s.memoizedState;s=i.stateNode,i.type.defaultProps||"ref"in i.memoizedProps||Of||(s.props!==i.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(i)||"instance"),s.state!==i.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(i)||"instance"));try{var g=ua(i.type,c,i.elementType===i.type),b=ae(i,Op,s,g,p);c=SR,b!==void 0||c.has(i.type)||(c.add(i.type),ae(i,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",z(i))})),s.__reactInternalSnapshotBeforeUpdate=b}catch(R){Et(i,i.return,R)}}function cg(i,s,c){c.props=ua(i.type,i.memoizedProps),c.state=i.memoizedState,ha(i)?(Aa(),ae(i,qC,i,s,c),Ra()):ae(i,qC,i,s,c)}function Ii(i){var s=i.ref;if(s!==null){var c=i.stateNode;switch(i.tag){case 26:case 27:case 5:c=ma(c)}if(typeof s=="function")if(ha(i))try{Aa(),i.refCleanup=s(c)}finally{Ra()}else i.refCleanup=s(c);else typeof s=="string"?console.error("String refs are no longer supported."):s.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",z(i)),s.current=c}}function Is(i,s){try{ae(i,Ii,i)}catch(c){Et(i,s,c)}}function Ki(i,s){var c=i.ref,p=i.refCleanup;if(c!==null)if(typeof p=="function")try{if(ha(i))try{Aa(),ae(i,p)}finally{Ra(i)}else ae(i,p)}catch(g){Et(i,s,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{if(ha(i))try{Aa(),ae(i,c,null)}finally{Ra(i)}else ae(i,c,null)}catch(g){Et(i,s,g)}else c.current=null}function Xu(i,s,c,p){var g=i.memoizedProps,b=g.id,R=g.onCommit;g=g.onRender,s=s===null?"mount":"update",Kg&&(s="nested-update"),typeof g=="function"&&g(b,s,i.actualDuration,i.treeBaseDuration,i.actualStartTime,c),typeof R=="function"&&R(i.memoizedProps.id,s,p,c)}function Ao(i,s,c,p){var g=i.memoizedProps;i=g.id,g=g.onPostCommit,s=s===null?"mount":"update",Kg&&(s="nested-update"),typeof g=="function"&&g(i,s,p,c)}function Rl(i){var s=i.type,c=i.memoizedProps,p=i.stateNode;try{ae(i,pf,p,s,c,i)}catch(g){Et(i,i.return,g)}}function Np(i,s,c){try{ae(i,Vo,i.stateNode,i.type,c,s,i)}catch(p){Et(i,i.return,p)}}function Xh(i){return i.tag===5||i.tag===3||(Fe?i.tag===26:!1)||(gn?i.tag===27:!1)||i.tag===4}function Gp(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Xh(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&(!gn||i.tag!==27)&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function qh(i,s,c){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?mf(c,i,s):Ut(c,i);else if(!(p===4||gn&&p===27)&&(i=i.child,i!==null))for(qh(i,s,c),i=i.sibling;i!==null;)qh(i,s,c),i=i.sibling}function Ga(i,s,c){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?Pl(c,i,s):lt(c,i);else if(!(p===4||gn&&p===27)&&(i=i.child,i!==null))for(Ga(i,s,c),i=i.sibling;i!==null;)Ga(i,s,c),i=i.sibling}function Pp(i){if(un&&(!gn||i.tag!==27)){e:{for(var s=i.return;s!==null;){if(Xh(s)){var c=s;break e}s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}switch(c.tag){case 27:if(gn){s=c.stateNode,c=Gp(i),Ga(i,c,s);break}case 5:s=c.stateNode,c.flags&32&&(jg(s),c.flags&=-33),c=Gp(i),Ga(i,c,s);break;case 3:case 4:s=c.stateNode.containerInfo,c=Gp(i),qh(i,c,s);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function Fh(i,s,c){i=i.containerInfo;try{ae(s,yf,i,c)}catch(p){Et(s,s.return,p)}}function wp(i,s){for(Fn(i.containerInfo),ui=s;ui!==null;)if(i=ui,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,ui=s;else for(;ui!==null;){s=i=ui;var c=s.alternate,p=s.flags;switch(s.tag){case 0:break;case 11:case 15:break;case 1:(p&1024)!==0&&c!==null&&ct(s,c);break;case 3:(p&1024)!==0&&un&&zl(s.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((p&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(s=i.sibling,s!==null){s.return=i.return,ui=s;break}ui=i.return}return i=ER,ER=!1,i}function kh(i,s,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:Pa(i,c),p&4&&jh(c,Ci|Rs);break;case 1:if(Pa(i,c),p&4)if(i=c.stateNode,s===null)c.type.defaultProps||"ref"in c.memoizedProps||Of||(i.props!==c.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(c)||"instance"),i.state!==c.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(c)||"instance")),ha(c)?(Aa(),ae(c,Db,c,i),Ra()):ae(c,Db,c,i);else{var g=ua(c.type,s.memoizedProps);s=s.memoizedState,c.type.defaultProps||"ref"in c.memoizedProps||Of||(i.props!==c.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(c)||"instance"),i.state!==c.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(c)||"instance")),ha(c)?(Aa(),ae(c,jC,c,i,g,s,i.__reactInternalSnapshotBeforeUpdate),Ra()):ae(c,jC,c,i,g,s,i.__reactInternalSnapshotBeforeUpdate)}p&64&&Bp(c),p&512&&Is(c,c.return);break;case 3:if(s=Vn(),Pa(i,c),p&64&&(p=c.updateQueue,p!==null)){if(g=null,c.child!==null)switch(c.child.tag){case 27:case 5:g=ma(c.child.stateNode);break;case 1:g=c.child.stateNode}try{ae(c,ep,p,g)}catch(N){Et(c,c.return,N)}}i.effectDuration+=ml(s);break;case 26:if(Fe){Pa(i,c),p&512&&Is(c,c.return);break}case 27:case 5:Pa(i,c),s===null&&p&4&&Rl(c),p&512&&Is(c,c.return);break;case 12:if(p&4){p=Vn(),Pa(i,c),i=c.stateNode,i.effectDuration+=yl(p);try{ae(c,Xu,c,s,Ig,i.effectDuration)}catch(N){Et(c,c.return,N)}}else Pa(i,c);break;case 13:Pa(i,c),p&4&&Hp(i,c);break;case 22:if(g=c.memoizedState!==null||ql,!g){s=s!==null&&s.memoizedState!==null||vn;var b=ql,R=vn;ql=g,(vn=s)&&!R?Qs(i,c,(c.subtreeFlags&8772)!==0):Pa(i,c),ql=b,vn=R}p&512&&(c.memoizedProps.mode==="manual"?Is(c,c.return):Ki(c,c.return));break;default:Pa(i,c)}}function Ks(i){var s=i.alternate;s!==null&&(i.alternate=null,Ks(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&fm(s)),i.stateNode=null,i._debugOwner=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function fa(i,s,c){for(c=c.child;c!==null;)zp(i,s,c),c=c.sibling}function zp(i,s,c){if(Pe&&typeof Pe.onCommitFiberUnmount=="function")try{Pe.onCommitFiberUnmount(Ee,c)}catch(b){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",b))}switch(c.tag){case 26:if(Fe){vn||Ki(c,s),fa(i,s,c),c.memoizedState?Vl(c.memoizedState):c.stateNode&&$t(c.stateNode);break}case 27:if(gn){vn||Ki(c,s);var p=Pn,g=ja;Pn=c.stateNode,fa(i,s,c),ac(c.stateNode),Pn=p,ja=g;break}case 5:vn||Ki(c,s);case 6:if(un){if(p=Pn,g=ja,Pn=null,fa(i,s,c),Pn=p,ja=g,Pn!==null)if(ja)try{ae(c,Lo,Pn,c.stateNode)}catch(b){Et(c,s,b)}else try{ae(c,ec,Pn,c.stateNode)}catch(b){Et(c,s,b)}}else fa(i,s,c);break;case 18:un&&Pn!==null&&(ja?vf(Pn,c.stateNode):_f(Pn,c.stateNode));break;case 4:un?(p=Pn,g=ja,Pn=c.stateNode.containerInfo,ja=!0,fa(i,s,c),Pn=p,ja=g):(ps&&Fh(c.stateNode,c,mm()),fa(i,s,c));break;case 0:case 11:case 14:case 15:vn||Cl(na,c,s),vn||Dp(c,s,Ci),fa(i,s,c);break;case 1:vn||(Ki(c,s),p=c.stateNode,typeof p.componentWillUnmount=="function"&&cg(c,s,p)),fa(i,s,c);break;case 21:fa(i,s,c);break;case 22:vn||Ki(c,s),vn=(p=vn)||c.memoizedState!==null,fa(i,s,c),vn=p;break;default:fa(i,s,c)}}function Hp(i,s){if(Si&&s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ae(s,gf,i)}catch(c){Et(s,s.return,c)}}function W0(i){switch(i.tag){case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new TR),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new TR),s;default:throw Error("Unexpected Suspense handler tag ("+i.tag+"). This is a bug in React.")}}function ke(i,s){var c=W0(i);s.forEach(function(p){var g=Cg.bind(null,i,p);if(!c.has(p)){if(c.add(p),Kn)if(Pf!==null&&wf!==null)ku(wf,Pf);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");p.then(g,g)}})}function Vp(i,s,c){Pf=c,wf=i,Ih(s,i),wf=Pf=null}function _i(i,s){var c=s.deletions;if(c!==null)for(var p=0;p<c.length;p++){var g=i,b=s,R=c[p];if(un){var N=b;e:for(;N!==null;){switch(N.tag){case 27:case 5:Pn=N.stateNode,ja=!1;break e;case 3:Pn=N.stateNode.containerInfo,ja=!0;break e;case 4:Pn=N.stateNode.containerInfo,ja=!0;break e}N=N.return}if(Pn===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");zp(g,b,R),Pn=null,ja=!1}else zp(g,b,R);g=R,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)Ih(s,i),s=s.sibling}function Ih(i,s){var c=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:_i(s,i),ii(i),p&4&&(Cl(na|Rs,i,i.return),Ro(na|Rs,i),Dp(i,i.return,Ci|Rs));break;case 1:_i(s,i),ii(i),p&512&&(vn||c===null||Ki(c,c.return)),p&64&&ql&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:if(Fe){var g=or;_i(s,i),ii(i),p&512&&(vn||c===null||Ki(c,c.return)),p&4&&(p=c!==null?c.memoizedState:null,s=i.memoizedState,c===null?s===null?i.stateNode===null?i.stateNode=vm(g,i.type,i.memoizedProps,i):bs(g,i.type,i.stateNode):i.stateNode=vs(g,s,i.memoizedProps):p!==s?(p===null?c.stateNode!==null&&$t(c.stateNode):Vl(p),s===null?bs(g,i.type,i.stateNode):vs(g,s,i.memoizedProps)):s===null&&i.stateNode!==null&&Np(i,i.memoizedProps,c.memoizedProps));break}case 27:if(gn&&p&4&&i.alternate===null){g=i.stateNode;var b=i.memoizedProps;try{xm(g),ae(i,Sm,i.type,b,g,i)}catch(pe){Et(i,i.return,pe)}}case 5:if(_i(s,i),ii(i),p&512&&(vn||c===null||Ki(c,c.return)),un){if(i.flags&32){s=i.stateNode;try{ae(i,jg,s)}catch(pe){Et(i,i.return,pe)}}p&4&&i.stateNode!=null&&(s=i.memoizedProps,Np(i,s,c!==null?c.memoizedProps:s)),p&1024&&(Vb=!0,i.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}break;case 6:if(_i(s,i),ii(i),p&4&&un){if(i.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");p=i.memoizedProps,c=c!==null?c.memoizedProps:p,s=i.stateNode;try{ae(i,mn,s,c,p)}catch(pe){Et(i,i.return,pe)}}break;case 3:if(g=Vn(),Fe?(Ll(),b=or,or=Ot(s.containerInfo),_i(s,i),or=b):_i(s,i),ii(i),p&4){if(un&&Si&&c!==null&&c.memoizedState.isDehydrated)try{ae(i,yb,s.containerInfo)}catch(pe){Et(i,i.return,pe)}if(ps){p=s.containerInfo,c=s.pendingChildren;try{ae(i,yf,p,c)}catch(pe){Et(i,i.return,pe)}}}Vb&&(Vb=!1,hg(i)),s.effectDuration+=ml(g);break;case 4:Fe?(c=or,or=Ot(i.stateNode.containerInfo),_i(s,i),ii(i),or=c):(_i(s,i),ii(i)),p&4&&ps&&Fh(i.stateNode,i,i.stateNode.pendingChildren);break;case 12:p=Vn(),_i(s,i),ii(i),i.stateNode.effectDuration+=yl(p);break;case 13:_i(s,i),ii(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Fb=C()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,ke(i,p)));break;case 22:p&512&&(vn||c===null||Ki(c,c.return)),g=i.memoizedState!==null;var R=c!==null&&c.memoizedState!==null,N=ql,Y=vn;if(ql=N||g,vn=Y||R,_i(s,i),vn=Y,ql=N,ii(i),s=i.stateNode,s._current=i,s._visibility&=-3,s._visibility|=s._pendingVisibility&2,p&8192&&(s._visibility=g?s._visibility&-2:s._visibility|1,g&&(s=ql||vn,c===null||R||s||Do(i)),un&&(i.memoizedProps===null||i.memoizedProps.mode!=="manual"))){e:if(c=null,un)for(s=i;;){if(s.tag===5||Fe&&s.tag===26||gn&&s.tag===27){if(c===null){R=c=s;try{b=R.stateNode,g?ae(R,dm,b):ae(R,wl,R.stateNode,R.memoizedProps)}catch(pe){Et(R,R.return,pe)}}}else if(s.tag===6){if(c===null){R=s;try{var $=R.stateNode;g?ae(R,gs,$):ae(R,jr,$,R.memoizedProps)}catch(pe){Et(R,R.return,pe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}}p&4&&(p=i.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,ke(i,c))));break;case 19:_i(s,i),ii(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,ke(i,p)));break;case 21:break;default:_i(s,i),ii(i)}}function ii(i){var s=i.flags;if(s&2){try{ae(i,Pp,i)}catch(c){Et(i,i.return,c)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function hg(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;hg(s),s.tag===5&&s.flags&1024&&ff(s.stateNode),i=i.sibling}}function J0(i,s,c){Pf=c,wf=s,kh(s,i.alternate,i),wf=Pf=null}function Pa(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)kh(i,s.alternate,s),s=s.sibling}function Mo(i){switch(i.tag){case 0:case 11:case 14:case 15:Dp(i,i.return,Ci),Do(i);break;case 1:Ki(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&cg(i,i.return,s),Do(i);break;case 26:case 27:case 5:Ki(i,i.return),Do(i);break;case 22:Ki(i,i.return),i.memoizedState===null&&Do(i);break;default:Do(i)}}function Do(i){for(i=i.child;i!==null;)Mo(i),i=i.sibling}function fg(i,s,c,p){var g=c.flags;switch(c.tag){case 0:case 11:case 15:Qs(i,c,p),jh(c,Ci);break;case 1:if(Qs(i,c,p),s=c.stateNode,typeof s.componentDidMount=="function"&&ae(c,Db,c,s),s=c.updateQueue,s!==null){i=c.stateNode;try{ae(c,tg,s,i)}catch(b){Et(c,c.return,b)}}p&&g&64&&Bp(c),Is(c,c.return);break;case 26:case 27:case 5:Qs(i,c,p),p&&s===null&&g&4&&Rl(c),Is(c,c.return);break;case 12:if(p&&g&4){g=Vn(),Qs(i,c,p),p=c.stateNode,p.effectDuration+=yl(g);try{ae(c,Xu,c,s,Ig,p.effectDuration)}catch(b){Et(c,c.return,b)}}else Qs(i,c,p);break;case 13:Qs(i,c,p),p&&g&4&&Hp(i,c);break;case 22:c.memoizedState===null&&Qs(i,c,p),Is(c,c.return);break;default:Qs(i,c,p)}}function Qs(i,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;)fg(i,s.alternate,s,c),s=s.sibling}function Lp(i,s){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==c&&(i!=null&&Or(i),c!=null&&Yu(c))}function jp(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(Or(s),i!=null&&Yu(i))}function cs(i,s,c,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Yp(i,s,c,p),s=s.sibling}function Yp(i,s,c,p){var g=s.flags;switch(s.tag){case 0:case 11:case 15:cs(i,s,c,p),g&2048&&Up(s,Zn|Rs);break;case 3:var b=Vn();cs(i,s,c,p),g&2048&&(c=null,s.alternate!==null&&(c=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==c&&(Or(s),c!=null&&Yu(c))),i.passiveEffectDuration+=ml(b);break;case 12:if(g&2048){b=Vn(),cs(i,s,c,p),i=s.stateNode,i.passiveEffectDuration+=yl(b);try{ae(s,Ao,s,s.alternate,Ig,i.passiveEffectDuration)}catch(R){Et(s,s.return,R)}}else cs(i,s,c,p);break;case 23:break;case 22:b=s.stateNode,s.memoizedState!==null?b._visibility&4?cs(i,s,c,p):qu(i,s):b._visibility&4?cs(i,s,c,p):(b._visibility|=4,Zs(i,s,c,p,(s.subtreeFlags&10256)!==0)),g&2048&&Lp(s.alternate,s);break;case 24:cs(i,s,c,p),g&2048&&jp(s.alternate,s);break;default:cs(i,s,c,p)}}function Zs(i,s,c,p,g){for(g=g&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;)Xp(i,s,c,p,g),s=s.sibling}function Xp(i,s,c,p,g){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Zs(i,s,c,p,g),Up(s,Zn);break;case 23:break;case 22:var R=s.stateNode;s.memoizedState!==null?R._visibility&4?Zs(i,s,c,p,g):qu(i,s):(R._visibility|=4,Zs(i,s,c,p,g)),g&&b&2048&&Lp(s.alternate,s);break;case 24:Zs(i,s,c,p,g),g&&b&2048&&jp(s.alternate,s);break;default:Zs(i,s,c,p,g)}}function qu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=i,p=s,g=p.flags;switch(p.tag){case 22:qu(c,p),g&2048&&Lp(p.alternate,p);break;case 24:qu(c,p),g&2048&&jp(p.alternate,p);break;default:qu(c,p)}s=s.sibling}}function Al(i){if(i.subtreeFlags&zf)for(i=i.child;i!==null;)Kh(i),i=i.sibling}function Kh(i){switch(i.tag){case 26:Al(i),i.flags&zf&&(i.memoizedState!==null?Yo(or,i.memoizedState,i.memoizedProps):hf(i.type,i.memoizedProps));break;case 5:Al(i),i.flags&zf&&hf(i.type,i.memoizedProps);break;case 3:case 4:if(Fe){var s=or;or=Ot(i.stateNode.containerInfo),Al(i),or=s}else Al(i);break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=zf,zf=16777216,Al(i),zf=s):Al(i));break;default:Al(i)}}function hs(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function dn(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];ui=p,dg(p,i)}hs(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ws(i),i=i.sibling}function Ws(i){switch(i.tag){case 0:case 11:case 15:dn(i),i.flags&2048&&Yh(i,i.return,Zn|Rs);break;case 3:var s=Vn();dn(i),i.stateNode.passiveEffectDuration+=ml(s);break;case 12:s=Vn(),dn(i),i.stateNode.passiveEffectDuration+=yl(s);break;case 22:s=i.stateNode,i.memoizedState!==null&&s._visibility&4&&(i.return===null||i.return.tag!==13)?(s._visibility&=-5,vi(i)):dn(i);break;default:dn(i)}}function vi(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];ui=p,dg(p,i)}hs(i)}for(i=i.child;i!==null;)qp(i),i=i.sibling}function qp(i){switch(i.tag){case 0:case 11:case 15:Yh(i,i.return,Zn),vi(i);break;case 22:var s=i.stateNode;s._visibility&4&&(s._visibility&=-5,vi(i));break;default:vi(i)}}function dg(i,s){for(;ui!==null;){var c=ui,p=c;switch(p.tag){case 0:case 11:case 15:Yh(p,s,Zn);break;case 23:case 22:p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(p=p.memoizedState.cachePool.pool,p!=null&&Or(p));break;case 24:Yu(p.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,ui=p;else e:for(c=i;ui!==null;){p=ui;var g=p.sibling,b=p.return;if(Ks(p),p===c){ui=null;break e}if(g!==null){g.return=b,ui=g;break e}ui=b}}}function ai(i){var s=Nl(i);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}if(i=Lg(i),i===null)throw Error("Could not find React container within specified host subtree.");return i.stateNode.current}function Js(i,s){var c=i.tag;switch(s.$$typeof){case o_:if(i.type===s.value)return!0;break;case u_:e:{for(s=s.value,i=[i,0],c=0;c<i.length;){var p=i[c++],g=p.tag,b=i[c++],R=s[b];if(g!==5&&g!==26&&g!==27||!ri(p)){for(;R!=null&&Js(p,R);)b++,R=s[b];if(b===s.length){s=!0;break e}else for(p=p.child;p!==null;)i.push(p,b),p=p.sibling}}s=!1}return s;case c_:if((c===5||c===26||c===27)&&ys(i.stateNode,s.value))return!0;break;case f_:if((c===5||c===6||c===26||c===27)&&(i=df(i),i!==null&&0<=i.indexOf(s.value)))return!0;break;case h_:if((c===5||c===26||c===27)&&(i=i.memoizedProps["data-testname"],typeof i=="string"&&i.toLowerCase()===s.value.toLowerCase()))return!0;break;default:throw Error("Invalid selector type specified.")}return!1}function Fp(i){switch(i.$$typeof){case o_:return"<"+(w(i.value)||"Unknown")+">";case u_:return":has("+(Fp(i)||"")+")";case c_:return'[role="'+i.value+'"]';case f_:return'"'+i.value+'"';case h_:return'[data-testname="'+i.value+'"]';default:throw Error("Invalid selector type specified.")}}function pg(i,s){var c=[];i=[i,0];for(var p=0;p<i.length;){var g=i[p++],b=g.tag,R=i[p++],N=s[R];if(b!==5&&b!==26&&b!==27||!ri(g)){for(;N!=null&&Js(g,N);)R++,N=s[R];if(R===s.length)c.push(g);else for(g=g.child;g!==null;)i.push(g,R),g=g.sibling}}return c}function Qh(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");i=ai(i),i=pg(i,s),s=[],i=Array.from(i);for(var c=0;c<i.length;){var p=i[c++],g=p.tag;if(g===5||g===26||g===27)ri(p)||s.push(p.stateNode);else for(p=p.child;p!==null;)i.push(p),p=p.sibling}return s}function $0(){ya&&d_.forEach(function(i){return i()})}function kp(){var i=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return i||ee.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),i}function Qi(i){if((Gt&Li)!==aa&&dt!==0)return dt&-dt;var s=ee.T;return s!==null?(s._updatedFibers||(s._updatedFibers=new Set),s._updatedFibers.add(i),i=oc,i!==0?i:Qc()):Go()}function Ip(){Xa===0&&(Xa=(dt&536870912)===0||vt?St():536870912);var i=Es.current;return i!==null&&(i.flags|=32),Xa}function Jt(i,s,c){if(jf&&console.error("useInsertionEffect must not schedule updates."),Zb&&(g_=!0),(i===qt&&Ft===yc||i.cancelPendingCommit!==null)&&(Uo(i,0),er(i,dt,Xa,!1)),hn(i,c),(Gt&Li)!==0&&i===qt){if(qn)switch(s.tag){case 0:case 11:case 15:i=ht&&z(ht)||"Unknown",UR.has(i)||(UR.add(i),s=z(s)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",s,i,i));break;case 1:DR||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),DR=!0)}}else Kn&&Za(i,s,c),Mg(s),i===qt&&((Gt&Li)===aa&&($o|=c),bn===mc&&er(i,dt,Xa,!1)),Ma(i)}function Ml(i,s,c){if((Gt&(Li|Kr))!==aa)throw Error("Should not already be working.");var p=!c&&(s&60)===0&&(s&i.expiredLanes)===0||Be(i,s),g=p?tb(i,s):Zp(i,s,!0),b=p;do{if(g===Fl){Lf&&!p&&er(i,s,0,!1);break}else if(g===p_)er(i,s,0,!kl);else{if(c=i.current.alternate,b&&!eb(c)){g=Zp(i,s,!1),b=!1;continue}if(g===Hf){if(b=s,i.errorRecoveryDisabledLanes&b)var R=0;else R=i.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){s=R;e:{g=i;var N=R;R=jm;var Y=Si&&g.current.memoizedState.isDehydrated;if(Y&&(Uo(g,N).flags|=256),N=Zp(g,N,!1),N!==Hf){if(Xb&&!Y){g.errorRecoveryDisabledLanes|=b,$o|=b,g=mc;break e}g=ur,ur=R,g!==null&&$s(g)}g=N}if(b=!1,g!==Hf)continue}}if(g===zm){Uo(i,0),er(i,s,0,!0);break}e:{switch(p=i,g){case Fl:case zm:throw Error("Root did not complete. This is a bug in React.");case mc:if((s&4194176)===s){er(p,s,Xa,!kl);break e}break;case Hf:ur=null;break;case Lb:case CR:break;default:throw Error("Unknown root exit status.")}if(p.finishedWork=c,p.finishedLanes=s,ee.actQueue!==null)Jp(p,ur,Xm,m_,Xa,$o,gc,MR,-0,0);else{if((s&62914560)===s&&(g=Fb+AR-C(),10<g)){if(er(p,s,Xa,!kl),Xe(p,0)!==0)break e;p.timeoutHandle=za(mg.bind(null,p,c,ur,Xm,m_,s,Xa,$o,gc,kl,f5,-0,0),g);break e}mg(p,c,ur,Xm,m_,s,Xa,$o,gc,kl,MR,-0,0)}}}break}while(!0);Ma(i)}function $s(i){ur===null?ur=i:ur.push.apply(ur,i)}function mg(i,s,c,p,g,b,R,N,Y,$,pe,Se,Me){var mt=s.subtreeFlags;if((mt&8192||(mt&16785408)===16785408)&&(Vr(),Kh(s),s=db(),s!==null)){i.cancelPendingCommit=s(Jp.bind(null,i,c,p,g,R,N,Y,h5,Se,Me)),er(i,b,R,!$);return}Jp(i,c,p,g,R,N,Y,pe,Se,Me)}function eb(i){for(var s=i;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var g=c[p],b=g.getSnapshot;g=g.value;try{if(!K(b(),g))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function er(i,s,c,p){s&=~qb,s&=~$o,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var g=s;0<g;){var b=31-In(g),R=1<<b;p[b]=-1,g&=~R}c!==0&&$n(i,c,s)}function Nr(){return(Gt&(Li|Kr))===aa?(br(0),!1):!0}function Kp(){if(ht!==null){if(Ft===ba)var i=ht.return;else i=ht,Hu(),rh(i),Rf=null,Om=0,i=ht;for(;i!==null;)Mp(i.alternate,i),i=i.return;ht=null}}function Uo(i,s){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;c!==Wu&&(i.timeoutHandle=Wu,ds(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Kp(),qt=i,ht=c=wr(i.current,null),dt=s,Ft=ba,Ya=null,kl=!1,Lf=Be(i,s),Xb=!1,bn=Fl,gc=Xa=qb=$o=Jo=0,ur=jm=null,m_=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var g=31-In(p),b=1<<g;s|=i[g],p&=~b}return Qr=s,uo(),lr.discardPendingWarnings(),c}function yg(i,s){Qe=null,ee.H=Ir,ee.getCurrentStack=null,qn=!1,Xn=null,s===$g?(s=$c(),Ft=Vm):s===Ab?(s=$c(),Ft=RR):Ft=s===pR?Yb:s!==null&&typeof s=="object"&&typeof s.then=="function"?Vf:Hm,Ya=s;var c=ht;if(c===null)bn=zm,Ua(i,ti(s,i.current));else switch(c.mode&2&&kc(c),Wa(),Ft){case Hm:be!==null&&typeof be.markComponentErrored=="function"&&be.markComponentErrored(c,s,dt);break;case yc:case Vm:case Vf:case Lm:be!==null&&typeof be.markComponentSuspended=="function"&&be.markComponentSuspended(c,s,dt)}}function Bo(){var i=Es.current;return i===null?!0:(dt&4194176)===dt?kr===null:(dt&62914560)===dt||(dt&536870912)!==0?i===kr:!1}function gg(){var i=ee.H;return ee.H=Ir,i===null?Ir:i}function _g(){var i=ee.A;return ee.A=l5,i}function Qp(){bn=mc,kl||(dt&4194176)!==dt&&Es.current!==null||(Lf=!0),(Jo&134217727)===0&&($o&134217727)===0||qt===null||er(qt,dt,Xa,!1)}function Zp(i,s,c){var p=Gt;Gt|=Li;var g=gg(),b=_g();if(qt!==i||dt!==s){if(Kn){var R=i.memoizedUpdaters;0<R.size&&(ku(i,dt),R.clear()),jt(i,s)}Xm=null,Uo(i,s)}Xc(s),s=!1,R=bn;e:do try{if(Ft!==ba&&ht!==null){var N=ht,Y=Ya;switch(Ft){case Yb:Kp(),R=p_;break e;case Vm:case yc:case Vf:Es.current===null&&(s=!0);var $=Ft;if(Ft=ba,Ya=null,Oo(i,N,Y,$),c&&Lf){R=Fl;break e}break;default:$=Ft,Ft=ba,Ya=null,Oo(i,N,Y,$)}}vg(),R=bn;break}catch(pe){yg(i,pe)}while(!0);return s&&i.shellSuspendCounter++,Hu(),Gt=p,ee.H=g,ee.A=b,ro(),ht===null&&(qt=null,dt=0,uo()),R}function vg(){for(;ht!==null;)bg(ht)}function tb(i,s){var c=Gt;Gt|=Li;var p=gg(),g=_g();if(qt!==i||dt!==s){if(Kn){var b=i.memoizedUpdaters;0<b.size&&(ku(i,dt),b.clear()),jt(i,s)}Xm=null,Ym=C()+kb,Uo(i,s)}else Lf=Be(i,s);Xc(s);e:do try{if(Ft!==ba&&ht!==null)t:switch(s=ht,b=Ya,Ft){case Hm:Ft=ba,Ya=null,Oo(i,s,b,Hm);break;case yc:if(Jc(b)){Ft=ba,Ya=null,xg(s);break}s=function(){Ft===yc&&qt===i&&(Ft=Lm),Ma(i)},b.then(s,s);break e;case Vm:Ft=Lm;break e;case RR:Ft=jb;break e;case Lm:Jc(b)?(Ft=ba,Ya=null,xg(s)):(Ft=ba,Ya=null,Oo(i,s,b,Lm));break;case jb:var R=null;switch(ht.tag){case 26:R=ht.memoizedState;case 5:case 27:var N=ht,Y=N.type,$=N.pendingProps;if(R?ea(R):Gl(Y,$)){Ft=ba,Ya=null;var pe=N.sibling;if(pe!==null)ht=pe;else{var Se=N.return;Se!==null?(ht=Se,Zh(Se)):ht=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Ft=ba,Ya=null,Oo(i,s,b,jb);break;case Vf:Ft=ba,Ya=null,Oo(i,s,b,Vf);break;case Yb:Kp(),bn=p_;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}ee.actQueue!==null?vg():nb();break}catch(Me){yg(i,Me)}while(!0);return Hu(),ee.H=p,ee.A=g,Gt=c,ht!==null?(be!==null&&typeof be.markRenderYielded=="function"&&be.markRenderYielded(),Fl):(ro(),qt=null,dt=0,uo(),bn)}function nb(){for(;ht!==null&&!_();)bg(ht)}function bg(i){var s=i.alternate;(i.mode&2)!==Qt?(bu(i),s=ae(i,Ph,s,i,Qr),kc(i)):s=ae(i,Ph,s,i,Qr),i.memoizedProps=i.pendingProps,s===null?Zh(i):ht=s}function xg(i){var s=ae(i,ib,i);i.memoizedProps=i.pendingProps,s===null?Zh(i):ht=s}function ib(i){var s=i.alternate,c=(i.mode&2)!==Qt;switch(c&&bu(i),i.tag){case 15:case 0:s=Uh(s,i,i.pendingProps,i.type,void 0,dt);break;case 11:s=Uh(s,i,i.pendingProps,i.type.render,i.ref,dt);break;case 5:rh(i);default:Mp(s,i),i=ht=Bg(i,Qr),s=Ph(s,i,Qr)}return c&&kc(i),s}function Oo(i,s,c,p){Hu(),rh(s),Rf=null,Om=0;var g=s.return;try{if(To(i,g,s,c,dt)){bn=zm,Ua(i,ti(c,i.current)),ht=null;return}}catch(b){if(g!==null)throw ht=g,b;bn=zm,Ua(i,ti(c,i.current)),ht=null;return}s.flags&32768?(vt||p===Hm?i=!0:Lf||(dt&536870912)!==0?i=!1:(kl=i=!0,(p===yc||p===Vm||p===Vf)&&(p=Es.current,p!==null&&p.tag===13&&(p.flags|=16384))),Wp(s,i)):Zh(s)}function Zh(i){var s=i;do{if((s.flags&32768)!==0){Wp(s,kl);return}var c=s.alternate;if(i=s.return,bu(s),c=ae(s,Lh,c,s,Qr),(s.mode&2)!==Qt&&Kd(s),c!==null){ht=c;return}if(s=s.sibling,s!==null){ht=s;return}ht=s=i}while(s!==null);bn===Fl&&(bn=CR)}function Wp(i,s){do{var c=El(i.alternate,i);if(c!==null){c.flags&=32767,ht=c;return}if((i.mode&2)!==Qt){Kd(i),c=i.actualDuration;for(var p=i.child;p!==null;)c+=p.actualDuration,p=p.sibling;i.actualDuration=c}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(i=i.sibling,i!==null)){ht=i;return}ht=i=c}while(i!==null);bn=p_,ht=null}function Jp(i,s,c,p,g,b,R,N,Y,$){var pe=ee.T,Se=ir();try{kn(2),ee.T=null,ab(i,s,c,p,Se,g,b,R,N,Y,$)}finally{ee.T=pe,kn(Se)}}function ab(i,s,c,p,g,b,R,N){do Gr();while(_c!==null);if(lr.flushLegacyContextWarning(),lr.flushPendingUnsafeLifecycleWarnings(),(Gt&(Li|Kr))!==aa)throw Error("Should not already be working.");var Y=i.finishedWork;if(p=i.finishedLanes,be!==null&&typeof be.markCommitStarted=="function"&&be.markCommitStarted(p),Y===null)return so(),null;if(p===0&&console.error("root.finishedLanes should not be empty during a commit. This is a bug in React."),i.finishedWork=null,i.finishedLanes=0,Y===i.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");i.callbackNode=null,i.callbackPriority=0,i.cancelPendingCommit=null;var $=Y.lanes|Y.childLanes;if($|=_b,Jn(i,p,$,b,R,N),i===qt&&(ht=qt=null,dt=0),(Y.subtreeFlags&10256)===0&&(Y.flags&10256)===0||y_||(y_=!0,Ib=$,Kb=c,lb(I,function(){return Gr(),null})),Ig=xf(),c=(Y.flags&15990)!==0,(Y.subtreeFlags&15990)!==0||c?(c=ee.T,ee.T=null,b=ir(),kn(2),R=Gt,Gt|=Kr,wp(i,Y),Vp(i,Y,p),Zu(i.containerInfo),i.current=Y,be!==null&&typeof be.markLayoutEffectsStarted=="function"&&be.markLayoutEffectsStarted(p),J0(Y,i,p),be!==null&&typeof be.markLayoutEffectsStopped=="function"&&be.markLayoutEffectsStopped(),x(),Gt=R,kn(b),ee.T=c):i.current=Y,(c=y_)?(y_=!1,_c=i,qm=p):(Sg(i,$),vc=0,km=null),$=i.pendingLanes,$===0&&(eu=null),c||Rg(i),Ye(Y.stateNode,g),Kn&&i.memoizedUpdaters.clear(),$0(),Ma(i),s!==null)for(g=i.onRecoverableError,Y=0;Y<s.length;Y++)$=s[Y],c=sb($.stack),ae($.source,g,$.value,c);return(qm&3)!==0&&Gr(),$=i.pendingLanes,(p&4194218)!==0&&($&42)!==0?(Qg=!0,i===Qb?Fm++:(Fm=0,Qb=i)):Fm=0,br(0),so(),null}function sb(i){return i={componentStack:i},Object.defineProperty(i,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),i}function Sg(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Yu(s)))}function Gr(){if(_c!==null){var i=_c,s=Ib;Ib=0;var c=yr(qm),p=32>c?32:c;c=ee.T;var g=ir();try{if(kn(p),ee.T=null,_c===null)var b=!1;else{p=Kb,Kb=null;var R=_c,N=qm;if(_c=null,qm=0,(Gt&(Li|Kr))!==aa)throw Error("Cannot flush passive effects while already rendering.");Zb=!0,g_=!1,be!==null&&typeof be.markPassiveEffectsStarted=="function"&&be.markPassiveEffectsStarted(N);var Y=Gt;if(Gt|=Kr,Ws(R.current),Yp(R,R.current,N,p),be!==null&&typeof be.markPassiveEffectsStopped=="function"&&be.markPassiveEffectsStopped(),Rg(R),Gt=Y,br(0,!1),g_?R===km?vc++:(vc=0,km=R):vc=0,g_=Zb=!1,Pe&&typeof Pe.onPostCommitFiberRoot=="function")try{Pe.onPostCommitFiberRoot(Ee,R)}catch(pe){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",pe))}var $=R.current.stateNode;$.effectDuration=0,$.passiveEffectDuration=0,b=!0}return b}finally{kn(g),ee.T=c,Sg(i,s)}}return!1}function Tg(i,s,c){s=ti(c,s),s=Pu(i.stateNode,s,2),i=qi(i,s,2),i!==null&&(hn(i,2),Ma(i))}function Et(i,s,c){if(jf=!1,i.tag===3)Tg(i,i,c);else{for(;s!==null;){if(s.tag===3){Tg(s,i,c);return}if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(eu===null||!eu.has(p))){i=ti(c,i),c=os(2),p=qi(s,c,2),p!==null&&(Mh(c,p,s,i),hn(p,2),Ma(p));return}}s=s.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
1478
-
1479
- Error message:
1480
-
1481
- %s`,c)}}function Wh(i,s,c){var p=i.pingCache;if(p===null){p=i.pingCache=new o5;var g=new Set;p.set(s,g)}else g=p.get(s),g===void 0&&(g=new Set,p.set(s,g));g.has(c)||(Xb=!0,g.add(c),p=rb.bind(null,i,s,c),Kn&&ku(i,c),s.then(p,p))}function rb(i,s,c){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,kp()&&ee.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
1482
-
1483
- When testing, code that resolves suspended data should be wrapped into act(...):
1484
-
1485
- act(() => {
1486
- /* finish loading suspended data */
1487
- });
1488
- /* assert on the output */
1489
-
1490
- This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),qt===i&&(dt&c)===c&&(bn===mc||bn===Lb&&(dt&62914560)===dt&&C()-Fb<AR?(Gt&Li)===aa&&Uo(i,0):qb|=c,gc===dt&&(gc=0)),Ma(i)}function $p(i,s){s===0&&(s=Rn()),i=fn(i,s),i!==null&&(hn(i,s),Ma(i))}function Eg(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),$p(i,c)}function Cg(i,s){var c=0;switch(i.tag){case 13:var p=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}p!==null&&p.delete(s),$p(i,c)}function Fu(i,s,c){if((s.subtreeFlags&33562624)!==0)for(s=s.child;s!==null;){var p=i,g=s,b=g.type===af;b=c||b,g.tag!==22?g.flags&33554432?b&&ae(g,Jh,p,g,(g.mode&64)===Qt):Fu(p,g,b):g.memoizedState===null&&(b&&g.flags&8192?ae(g,Jh,p,g):g.subtreeFlags&33554432&&ae(g,Fu,p,g,b)),s=s.sibling}}function Jh(i,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;yt(!0);try{Mo(s),c&&qp(s),fg(i,s.alternate,s,!1),c&&Xp(i,s,0,null,!1)}finally{yt(!1)}}function Rg(i){var s=!0;i.current.mode&24||(s=!1),Fu(i,i.current,s)}function Ag(i){if((Gt&Li)===aa){var s=i.tag;if(s===3||s===1||s===0||s===11||s===14||s===15){if(s=z(i)||"ReactComponent",__!==null){if(__.has(s))return;__.add(s)}else __=new Set([s]);ae(i,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function ku(i,s){Kn&&i.memoizedUpdaters.forEach(function(c){Za(i,c,s)})}function lb(i,s){var c=ee.actQueue;return c!==null?(c.push(s),d5):o(i,s)}function Mg(i){kp()&&ee.actQueue===null&&ae(i,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
1491
-
1492
- When testing, code that causes React state updates should be wrapped into act(...):
1493
-
1494
- act(() => {
1495
- /* fire events that update state */
1496
- });
1497
- /* assert on the output */
1498
-
1499
- This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,z(i))})}function Pr(i){if(Ms===null)return i;var s=Ms(i);return s===void 0?i:s.current}function em(i){if(Ms===null)return i;var s=Ms(i);return s===void 0?i!=null&&typeof i.render=="function"&&(s=Pr(i.render),i.render!==s)?(s={$$typeof:fs,render:s},i.displayName!==void 0&&(s.displayName=i.displayName),s):i:s.current}function Dg(i,s){if(Ms===null)return!1;var c=i.elementType;s=s.type;var p=!1,g=typeof s=="object"&&s!==null?s.$$typeof:null;switch(i.tag){case 1:typeof s=="function"&&(p=!0);break;case 0:(typeof s=="function"||g===Wi)&&(p=!0);break;case 11:(g===fs||g===Wi)&&(p=!0);break;case 14:case 15:(g===rf||g===Wi)&&(p=!0);break;default:return!1}return!!(p&&(i=Ms(c),i!==void 0&&i===Ms(s)))}function Ug(i){Ms!==null&&typeof WeakSet=="function"&&(Yf===null&&(Yf=new WeakSet),Yf.add(i))}function tm(i,s,c){var p=i.alternate,g=i.child,b=i.sibling,R=i.tag,N=i.type,Y=null;switch(R){case 0:case 15:case 1:Y=N;break;case 11:Y=N.render}if(Ms===null)throw Error("Expected resolveFamily to be set during hot reload.");var $=!1;N=!1,Y!==null&&(Y=Ms(Y),Y!==void 0&&(c.has(Y)?N=!0:s.has(Y)&&(R===1?N=!0:$=!0))),Yf!==null&&(Yf.has(i)||p!==null&&Yf.has(p))&&(N=!0),N&&(i._debugNeedsRemount=!0),(N||$)&&(p=fn(i,2),p!==null&&Jt(p,i,2)),g===null||N||tm(g,s,c),b!==null&&tm(b,s,c)}function ob(i,s,c,p){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,BR||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function nm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function wr(i,s){var c=i.alternate;switch(c===null?(c=y(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c._debugOwner=i._debugOwner,c._debugHookTypes=i._debugHookTypes,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null,c.actualDuration=-0,c.actualStartTime=-1.1),c.flags=i.flags&31457280,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext,_debugThenableState:s._debugThenableState},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c.selfBaseDuration=i.selfBaseDuration,c.treeBaseDuration=i.treeBaseDuration,c._debugInfo=i._debugInfo,c._debugNeedsRemount=i._debugNeedsRemount,c.tag){case 0:case 15:c.type=Pr(i.type);break;case 1:c.type=Pr(i.type);break;case 11:c.type=em(i.type)}return c}function Bg(i,s){i.flags&=31457282;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null,i.selfBaseDuration=0,i.treeBaseDuration=0):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,s=c.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext,_debugThenableState:s._debugThenableState},i.selfBaseDuration=c.selfBaseDuration,i.treeBaseDuration=c.treeBaseDuration),i}function im(i,s,c,p,g,b){var R=0,N=i;if(typeof i=="function")nm(i)&&(R=1),N=Pr(N);else if(typeof i=="string")Fe&&gn?(R=X(),R=pt(i,c,R)?26:sc(i)?27:5):Fe?(R=X(),R=pt(i,c,R)?26:5):R=gn&&sc(i)?27:5;else e:switch(i){case Bl:return Dl(c.children,g,b,s);case af:R=8,g|=24;break;case om:return i=c,p=g,typeof i.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof i.id),s=y(12,i,s,p|2),s.elementType=om,s.lanes=b,s.stateNode={effectDuration:0,passiveEffectDuration:0},s;case zr:return s=y(13,c,s,g),s.elementType=zr,s.lanes=b,s;case bi:return s=y(19,c,s,g),s.elementType=bi,s.lanes=b,s;case Iu:return Og(c,g,b,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case fb:case wa:R=10;break e;case sf:R=9;break e;case fs:R=11,N=em(N);break e;case rf:R=14;break e;case Wi:R=16,N=null;break e}N="",(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i===null?c="null":Bn(i)?c="array":i!==void 0&&i.$$typeof===Ul?(c="<"+(w(i.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):c=typeof i,R=p?typeof p.tag=="number"?z(p):typeof p.name=="string"?p.name:null:null,R&&(N+=`
1500
-
1501
- Check the render method of \``+R+"`."),R=29,c=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(c+"."+N)),N=null}return s=y(R,c,s,g),s.elementType=i,s.type=N,s.lanes=b,s._debugOwner=p,s}function $h(i,s,c){return s=im(i.type,i.key,i.props,i._owner,s,c),s._debugOwner=i._owner,s}function Dl(i,s,c,p){return i=y(7,i,p,s),i.lanes=c,i}function Og(i,s,c,p){i=y(22,i,p,s),i.elementType=Iu,i.lanes=c;var g={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var b=g,R=b._current;if(R===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if((b._pendingVisibility&2)===0){var N=fn(R,2);N!==null&&(b._pendingVisibility|=2,Jt(N,R,2))}},attach:function(){var b=g,R=b._current;if(R===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if((b._pendingVisibility&2)!==0){var N=fn(R,2);N!==null&&(b._pendingVisibility&=-3,Jt(N,R,2))}}};return i.stateNode=g,i}function am(i,s,c){return i=y(6,i,null,s),i.lanes=c,i}function ef(i,s,c){return s=y(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function ub(i,s,c,p,g,b,R,N){for(this.tag=1,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Wu,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Oi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oi(0),this.hiddenUpdates=Oi(null),this.identifierPrefix=p,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,i=this.pendingUpdatersLaneMap=[],s=0;31>s;s++)i.push(new Set);this._debugRootType=c?"hydrateRoot()":"createRoot()"}function Ng(i,s,c,p,g,b,R,N,Y,$,pe,Se){return i=new ub(i,s,c,R,N,Y,$,Se),s=1,b===!0&&(s|=24),Kn&&(s|=2),b=y(3,null,null,s),i.current=b,b.stateNode=i,s=zh(),Or(s),i.pooledCache=s,Or(s),b.memoizedState={element:p,isDehydrated:c,cache:s},Zc(b),i}function Zi(i){return""+i}function sm(i){return i?(i=ga,i):ga}function tf(i,s,c,p){return s.tag===0&&Gr(),rm(s.current,2,i,s,c,p),2}function rm(i,s,c,p,g,b){if(Pe&&typeof Pe.onScheduleFiberRoot=="function")try{Pe.onScheduleFiberRoot(Ee,p,c)}catch(R){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",R))}be!==null&&typeof be.markRenderScheduled=="function"&&be.markRenderScheduled(s),g=sm(g),p.context===null?p.context=g:p.pendingContext=g,qn&&Xn!==null&&!NR&&(NR=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
1502
-
1503
- Check the render method of %s.`,z(Xn)||"Unknown")),p=js(s),p.payload={element:c},b=b===void 0?null:b,b!==null&&(typeof b!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",b),p.callback=b),c=qi(i,p,s),c!==null&&(Jt(c,i,s),ho(c,i,s))}function lm(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function nf(i,s){lm(i,s),(i=i.alternate)&&lm(i,s)}function cb(){return Xn}function Gg(){for(var i=new Map,s=1,c=0;31>c;c++){var p=ye(s);i.set(s,p),s*=2}return i}var ut={},hb=bc(),wi=c2(),Yn=Object.assign,Pg=Symbol.for("react.element"),Ul=Symbol.for("react.transitional.element"),an=Symbol.for("react.portal"),Bl=Symbol.for("react.fragment"),af=Symbol.for("react.strict_mode"),om=Symbol.for("react.profiler"),fb=Symbol.for("react.provider"),sf=Symbol.for("react.consumer"),wa=Symbol.for("react.context"),fs=Symbol.for("react.forward_ref"),zr=Symbol.for("react.suspense"),bi=Symbol.for("react.suspense_list"),rf=Symbol.for("react.memo"),Wi=Symbol.for("react.lazy"),Iu=Symbol.for("react.offscreen"),lf=Symbol.for("react.memo_cache_sentinel"),Ku=Symbol.iterator,um=Symbol.for("react.client.reference"),ee=hb.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qu=0,da,cm,wg,of,zg,Hg,Vg;ne.__reactDisabledLog=!0;var Ol,zi,xi=!1,uf=new(typeof WeakMap=="function"?WeakMap:Map),Xn=null,qn=!1,Bn=Array.isArray,cf=e.rendererVersion,pa=e.rendererPackageName,Ji=e.extraDevToolsConfig,ma=e.getPublicInstance,tr=e.getRootHostContext,nr=e.getChildHostContext,Fn=e.prepareForCommit,Zu=e.resetAfterCommit,Hr=e.createInstance,No=e.appendInitialChild,si=e.finalizeInitialChildren,Sn=e.shouldSetTextContent,_t=e.createTextInstance,za=e.scheduleTimeout,ds=e.cancelTimeout,Wu=e.noTimeout,pn=e.isPrimaryRenderer;e.warnsIfNotActing;var un=e.supportsMutation,ps=e.supportsPersistence,Si=e.supportsHydration,Nl=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var hm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var kn=e.setCurrentUpdatePriority,ir=e.getCurrentUpdatePriority,Go=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Ju=e.shouldAttemptEagerTransition,fm=e.detachDeletedInstance;e.requestPostPaintCallback;var Po=e.maySuspendCommit,Gl=e.preloadInstance,Vr=e.startSuspendingCommit,hf=e.suspendInstance,db=e.waitForCommitToBeReady,ms=e.NotPendingTransition,ar=e.HostTransitionContext,ff=e.resetFormInstance,wo=e.bindToConsole,zo=e.supportsMicrotasks,$u=e.scheduleMicrotask,ya=e.supportsTestSelectors,Lg=e.findFiberRoot,Ho=e.getBoundingRect,df=e.getTextContent,ri=e.isHiddenSubtree,ys=e.matchAccessibilityRole,Tn=e.setFocusIfFocusable,Lr=e.setupIntersectionObserver,lt=e.appendChild,Ut=e.appendChildToContainer,mn=e.commitTextUpdate,pf=e.commitMount,Vo=e.commitUpdate,Pl=e.insertBefore,mf=e.insertInContainerBefore,ec=e.removeChild,Lo=e.removeChildFromContainer,jg=e.resetTextContent,dm=e.hideInstance,gs=e.hideTextInstance,wl=e.unhideInstance,jr=e.unhideTextInstance,zl=e.clearContainer,pm=e.cloneInstance,mm=e.createContainerChildSet,ym=e.appendChildToContainerChildSet,On=e.finalizeContainerChildren,yf=e.replaceContainerChildren,tc=e.cloneHiddenInstance,Yr=e.cloneHiddenTextInstance,Ha=e.isSuspenseInstancePending,gm=e.isSuspenseInstanceFallback,pb=e.getSuspenseInstanceFallbackErrorDetails,mb=e.registerSuspenseInstanceRetry,sn=e.canHydrateFormStateMarker,Yg=e.isFormStateMarkerMatching,sr=e.getNextHydratableSibling,_s=e.getFirstHydratableChild,rn=e.getFirstHydratableChildWithinContainer,_m=e.getFirstHydratableChildWithinSuspenseInstance,Xg=e.canHydrateInstance,Nn=e.canHydrateTextInstance,qg=e.canHydrateSuspenseInstance,yn=e.hydrateInstance,$i=e.hydrateTextInstance,Va=e.hydrateSuspenseInstance,Hl=e.getNextHydratableInstanceAfterSuspenseInstance,yb=e.commitHydratedContainer,gf=e.commitHydratedSuspenseInstance,_f=e.clearSuspenseBoundary,vf=e.clearSuspenseBoundaryFromContainer,nc=e.shouldDeleteUnhydratedTailInstances,ic=e.diffHydratedPropsForDevWarnings,jo=e.diffHydratedTextForDevWarnings,Fg=e.describeHydratableInstanceForDevWarnings,Bt=e.validateHydratableInstance,Ht=e.validateHydratableTextInstance,Fe=e.supportsResources,pt=e.isHostHoistableType,Ot=e.getHoistableRoot,Hi=e.getResource,vs=e.acquireResource,Vl=e.releaseResource,vm=e.hydrateHoistable,bs=e.mountHoistable,$t=e.unmountHoistable,Xr=e.createHoistableInstance,Ll=e.prepareToCommitHoistables,bm=e.mayResourceSuspendCommit,ea=e.preloadResource,Yo=e.suspendResource,gn=e.supportsSingletons,La=e.resolveSingletonInstance,xm=e.clearSingleton,Sm=e.acquireSingletonInstance,ac=e.releaseSingletonInstance,sc=e.isHostSingletonType,xs=[],Xo=[],Ti=-1,ga={};Object.freeze(ga);var In=Math.clz32?Math.clz32:_e,Tm=Math.log,rc=Math.LN2,qo=128,l=4194304,o=wi.unstable_scheduleCallback,d=wi.unstable_cancelCallback,_=wi.unstable_shouldYield,x=wi.unstable_requestPaint,C=wi.unstable_now,B=wi.unstable_ImmediatePriority,H=wi.unstable_UserBlockingPriority,I=wi.unstable_NormalPriority,se=wi.unstable_IdlePriority,ge=wi.log,Ae=wi.unstable_setDisableYieldValue,Ee=null,Pe=null,be=null,Vi=!1,Kn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",K=typeof Object.is=="function"?Object.is:yu,F=new WeakMap,J=[],he=0,Ne=null,Nt=0,Ge=[],Je=0,Kt=null,at=1,li="",qr=Re(null),Em=Re(null),Fo=Re(null),kg=Re(null),UC=/["'&<>\n\t]|^\s|\s$/,ta=null,Ei=null,vt=!1,jl=!1,Ss=null,rr=null,Fr=!1,gb=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),Qt=0,Ts=[],bf=0,_b=0,xf=wi.unstable_now,Ig=-0,_a=-1.1,lc=-0,Kg=!1,Qg=!1,Zg=null,Sf=null,vb=!1,bb=!1,Wg=!1,xb=!1,Tf=0,Sb={},Cm=null,Tb=0,oc=0,Ef=null,BC=0,OC=1,NC=2,Eb=3,ko=!1,GC=!1,Cb=null,Rb=!1,JG=Object.prototype.hasOwnProperty,lr={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Rm=[],Am=[],Mm=[],Dm=[],Um=[],Bm=[],uc=new Set;lr.recordUnsafeLifecycleWarnings=function(i,s){uc.has(i.type)||(typeof s.componentWillMount=="function"&&s.componentWillMount.__suppressDeprecationWarning!==!0&&Rm.push(i),i.mode&8&&typeof s.UNSAFE_componentWillMount=="function"&&Am.push(i),typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Mm.push(i),i.mode&8&&typeof s.UNSAFE_componentWillReceiveProps=="function"&&Dm.push(i),typeof s.componentWillUpdate=="function"&&s.componentWillUpdate.__suppressDeprecationWarning!==!0&&Um.push(i),i.mode&8&&typeof s.UNSAFE_componentWillUpdate=="function"&&Bm.push(i))},lr.flushPendingUnsafeLifecycleWarnings=function(){var i=new Set;0<Rm.length&&(Rm.forEach(function(N){i.add(z(N)||"Component"),uc.add(N.type)}),Rm=[]);var s=new Set;0<Am.length&&(Am.forEach(function(N){s.add(z(N)||"Component"),uc.add(N.type)}),Am=[]);var c=new Set;0<Mm.length&&(Mm.forEach(function(N){c.add(z(N)||"Component"),uc.add(N.type)}),Mm=[]);var p=new Set;0<Dm.length&&(Dm.forEach(function(N){p.add(z(N)||"Component"),uc.add(N.type)}),Dm=[]);var g=new Set;0<Um.length&&(Um.forEach(function(N){g.add(z(N)||"Component"),uc.add(N.type)}),Um=[]);var b=new Set;if(0<Bm.length&&(Bm.forEach(function(N){b.add(z(N)||"Component"),uc.add(N.type)}),Bm=[]),0<s.size){var R=G(s);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
1504
-
1505
- * Move code with side effects to componentDidMount, and set initial state in the constructor.
1506
-
1507
- Please update the following components: %s`,R)}0<p.size&&(R=G(p),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
1508
-
1509
- * Move data fetching code or side effects to componentDidUpdate.
1510
- * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
1511
-
1512
- Please update the following components: %s`,R)),0<b.size&&(R=G(b),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
1513
-
1514
- * Move data fetching code or side effects to componentDidUpdate.
1515
-
1516
- Please update the following components: %s`,R)),0<i.size&&(R=G(i),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
1517
-
1518
- * Move code with side effects to componentDidMount, and set initial state in the constructor.
1519
- * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1520
-
1521
- Please update the following components: %s`,R)),0<c.size&&(R=G(c),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
1522
-
1523
- * Move data fetching code or side effects to componentDidUpdate.
1524
- * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
1525
- * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1526
-
1527
- Please update the following components: %s`,R)),0<g.size&&(R=G(g),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
1528
-
1529
- * Move data fetching code or side effects to componentDidUpdate.
1530
- * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
1531
-
1532
- Please update the following components: %s`,R))};var Jg=new Map,PC=new Set;lr.recordLegacyContextWarning=function(i,s){for(var c=null,p=i;p!==null;)p.mode&8&&(c=p),p=p.return;c===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!PC.has(i.type)&&(p=Jg.get(c),i.type.contextTypes!=null||i.type.childContextTypes!=null||s!==null&&typeof s.getChildContext=="function")&&(p===void 0&&(p=[],Jg.set(c,p)),p.push(i))},lr.flushLegacyContextWarning=function(){Jg.forEach(function(i){if(i.length!==0){var s=i[0],c=new Set;i.forEach(function(g){c.add(z(g)||"Component"),PC.add(g.type)});var p=G(c);ae(s,function(){console.error(`Legacy context API has been detected within a strict-mode tree.
1533
-
1534
- The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
1535
-
1536
- Please update the following components: %s
1537
-
1538
- Learn more about this warning here: https://react.dev/link/legacy-context`,p)})}})},lr.discardPendingWarnings=function(){Rm=[],Am=[],Mm=[],Dm=[],Um=[],Bm=[],Jg=new Map};var $g=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"),Ab=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),e_={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},Cf=null,t_=!1,wC={"react-stack-bottom-frame":function(i,s,c){var p=qn;qn=!0;try{return i(s,c)}finally{qn=p}}},Mb=wC["react-stack-bottom-frame"].bind(wC),zC={"react-stack-bottom-frame":function(i){var s=qn;qn=!0;try{return i.render()}finally{qn=s}}},HC=zC["react-stack-bottom-frame"].bind(zC),VC={"react-stack-bottom-frame":function(i,s){try{s.componentDidMount()}catch(c){Et(i,i.return,c)}}},Db=VC["react-stack-bottom-frame"].bind(VC),LC={"react-stack-bottom-frame":function(i,s,c,p,g){try{s.componentDidUpdate(c,p,g)}catch(b){Et(i,i.return,b)}}},jC=LC["react-stack-bottom-frame"].bind(LC),YC={"react-stack-bottom-frame":function(i,s){var c=s.stack;i.componentDidCatch(s.value,{componentStack:c!==null?c:""})}},$G=YC["react-stack-bottom-frame"].bind(YC),XC={"react-stack-bottom-frame":function(i,s,c){try{c.componentWillUnmount()}catch(p){Et(i,s,p)}}},qC=XC["react-stack-bottom-frame"].bind(XC),FC={"react-stack-bottom-frame":function(i){var s=i.create;return i=i.inst,s=s(),i.destroy=s}},e5=FC["react-stack-bottom-frame"].bind(FC),kC={"react-stack-bottom-frame":function(i,s,c){try{c()}catch(p){Et(i,s,p)}}},t5=kC["react-stack-bottom-frame"].bind(kC),IC={"react-stack-bottom-frame":function(i){var s=i._init;return s(i._payload)}},Io=IC["react-stack-bottom-frame"].bind(IC),Rf=null,Om=0,ot=null,Ub,KC=Ub=!1,QC={},ZC={},WC={};M=function(i,s,c){if(c!==null&&typeof c=="object"&&c._store&&(!c._store.validated&&c.key==null||c._store.validated===2)){if(typeof c._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");c._store.validated=1;var p=z(i),g=p||"null";if(!QC[g]){QC[g]=!0,c=c._owner,i=i._debugOwner;var b="";i&&typeof i.tag=="number"&&(g=z(i))&&(b=`
1539
-
1540
- Check the render method of \``+g+"`."),b||p&&(b=`
1541
-
1542
- Check the top-level render call using <`+p+">.");var R="";c!=null&&i!==c&&(p=null,typeof c.tag=="number"?p=z(c):typeof c.name=="string"&&(p=c.name),p&&(R=" It was passed a child from "+p+".")),ae(s,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',b,R)})}}};var cc=ap(!0),JC=ap(!1),Af=Re(null),n_=Re(0),Es=Re(null),kr=null,Mf=1,Nm=2,Qn=Re(0),Cs=0,Rs=1,na=2,Ci=4,Zn=8,Df,$C=new Set,eR=new Set,Bb=new Set,tR=new Set,Ko=0,Qe=null,Vt=null,Gn=null,i_=!1,Uf=!1,hc=!1,a_=0,Gm=0,Yl=null,n5=0,i5=25,te=null,As=null,Xl=-1,Pm=!1,Ob=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Ir={readContext:Yt,use:Xs,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useLayoutEffect:nn,useInsertionEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useSyncExternalStore:nn,useId:nn};Ir.useCacheRefresh=nn,Ir.useMemoCache=nn,Ir.useHostTransitionStatus=nn,Ir.useFormState=nn,Ir.useActionState=nn,Ir.useOptimistic=nn;var Qo=null,fc=null,Zo=null,dc=null,va=null,ia=null,Wo=null;Qo={readContext:function(i){return Yt(i)},use:Xs,useCallback:function(i,s){return te="useCallback",Ke(),_l(s),up(i,s)},useContext:function(i){return te="useContext",Ke(),Yt(i)},useEffect:function(i,s){return te="useEffect",Ke(),_l(s),So(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",Ke(),_l(c),Sl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",Ke(),_l(s),Rr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",Ke(),_l(s),yh(i,s)},useMemo:function(i,s){te="useMemo",Ke(),_l(s);var c=ee.H;ee.H=va;try{return _h(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",Ke();var p=ee.H;ee.H=va;try{return Mu(i,s,c)}finally{ee.H=p}},useRef:function(i){return te="useRef",Ke(),mh(i)},useState:function(i){te="useState",Ke();var s=ee.H;ee.H=va;try{return as(i)}finally{ee.H=s}},useDebugValue:function(){te="useDebugValue",Ke()},useDeferredValue:function(i,s){return te="useDeferredValue",Ke(),ss(i,s)},useTransition:function(){return te="useTransition",Ke(),vh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",Ke(),Uu(i,s,c)},useId:function(){return te="useId",Ke(),Sh()},useCacheRefresh:function(){return te="useCacheRefresh",Ke(),pp()}},Qo.useMemoCache=Sr,Qo.useHostTransitionStatus=rs,Qo.useFormState=function(i,s){return te="useFormState",Ke(),_o(),Er(i,s)},Qo.useActionState=function(i,s){return te="useActionState",Ke(),Er(i,s)},Qo.useOptimistic=function(i){return te="useOptimistic",Ke(),Da(i)},fc={readContext:function(i){return Yt(i)},use:Xs,useCallback:function(i,s){return te="useCallback",ue(),up(i,s)},useContext:function(i){return te="useContext",ue(),Yt(i)},useEffect:function(i,s){return te="useEffect",ue(),So(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),Sl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",ue(),Rr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),yh(i,s)},useMemo:function(i,s){te="useMemo",ue();var c=ee.H;ee.H=va;try{return _h(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=ee.H;ee.H=va;try{return Mu(i,s,c)}finally{ee.H=p}},useRef:function(i){return te="useRef",ue(),mh(i)},useState:function(i){te="useState",ue();var s=ee.H;ee.H=va;try{return as(i)}finally{ee.H=s}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),ss(i,s)},useTransition:function(){return te="useTransition",ue(),vh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Uu(i,s,c)},useId:function(){return te="useId",ue(),Sh()},useCacheRefresh:function(){return te="useCacheRefresh",ue(),pp()}},fc.useMemoCache=Sr,fc.useHostTransitionStatus=rs,fc.useFormState=function(i,s){return te="useFormState",ue(),_o(),Er(i,s)},fc.useActionState=function(i,s){return te="useActionState",ue(),Er(i,s)},fc.useOptimistic=function(i){return te="useOptimistic",ue(),Da(i)},Zo={readContext:function(i){return Yt(i)},use:Xs,useCallback:function(i,s){return te="useCallback",ue(),gh(i,s)},useContext:function(i){return te="useContext",ue(),Yt(i)},useEffect:function(i,s){te="useEffect",ue(),ni(2048,Zn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),zt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",ue();var c=ee.H;ee.H=ia;try{return Ar(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=ee.H;ee.H=ia;try{return vl(i,s,c)}finally{ee.H=p}},useRef:function(){return te="useRef",ue(),Tt().memoizedState},useState:function(){te="useState",ue();var i=ee.H;ee.H=ia;try{return vl(Fi)}finally{ee.H=i}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),cp(i,s)},useTransition:function(){return te="useTransition",ue(),bh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Bu(i,s,c)},useId:function(){return te="useId",ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState}},Zo.useMemoCache=Sr,Zo.useHostTransitionStatus=rs,Zo.useFormState=function(i){return te="useFormState",ue(),_o(),xl(i)},Zo.useActionState=function(i){return te="useActionState",ue(),xl(i)},Zo.useOptimistic=function(i,s){return te="useOptimistic",ue(),ch(i,s)},dc={readContext:function(i){return Yt(i)},use:Xs,useCallback:function(i,s){return te="useCallback",ue(),gh(i,s)},useContext:function(i){return te="useContext",ue(),Yt(i)},useEffect:function(i,s){te="useEffect",ue(),ni(2048,Zn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),zt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",ue();var c=ee.H;ee.H=Wo;try{return Ar(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=ee.H;ee.H=Wo;try{return bl(i,s,c)}finally{ee.H=p}},useRef:function(){return te="useRef",ue(),Tt().memoizedState},useState:function(){te="useState",ue();var i=ee.H;ee.H=Wo;try{return bl(Fi)}finally{ee.H=i}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),hp(i,s)},useTransition:function(){return te="useTransition",ue(),xh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Bu(i,s,c)},useId:function(){return te="useId",ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState}},dc.useMemoCache=Sr,dc.useHostTransitionStatus=rs,dc.useFormState=function(i){return te="useFormState",ue(),_o(),Nu(i)},dc.useActionState=function(i){return te="useActionState",ue(),Nu(i)},dc.useOptimistic=function(i,s){return te="useOptimistic",ue(),bo(i,s)},va={readContext:function(i){return A(),Yt(i)},use:function(i){return E(),Xs(i)},useCallback:function(i,s){return te="useCallback",E(),Ke(),up(i,s)},useContext:function(i){return te="useContext",E(),Ke(),Yt(i)},useEffect:function(i,s){return te="useEffect",E(),Ke(),So(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),Ke(),Sl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",E(),Ke(),Rr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),Ke(),yh(i,s)},useMemo:function(i,s){te="useMemo",E(),Ke();var c=ee.H;ee.H=va;try{return _h(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",E(),Ke();var p=ee.H;ee.H=va;try{return Mu(i,s,c)}finally{ee.H=p}},useRef:function(i){return te="useRef",E(),Ke(),mh(i)},useState:function(i){te="useState",E(),Ke();var s=ee.H;ee.H=va;try{return as(i)}finally{ee.H=s}},useDebugValue:function(){te="useDebugValue",E(),Ke()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),Ke(),ss(i,s)},useTransition:function(){return te="useTransition",E(),Ke(),vh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),Ke(),Uu(i,s,c)},useId:function(){return te="useId",E(),Ke(),Sh()},useCacheRefresh:function(){return te="useCacheRefresh",Ke(),pp()},useMemoCache:function(i){return E(),Sr(i)}},va.useHostTransitionStatus=rs,va.useFormState=function(i,s){return te="useFormState",E(),Ke(),Er(i,s)},va.useActionState=function(i,s){return te="useActionState",E(),Ke(),Er(i,s)},va.useOptimistic=function(i){return te="useOptimistic",E(),Ke(),Da(i)},ia={readContext:function(i){return A(),Yt(i)},use:function(i){return E(),Xs(i)},useCallback:function(i,s){return te="useCallback",E(),ue(),gh(i,s)},useContext:function(i){return te="useContext",E(),ue(),Yt(i)},useEffect:function(i,s){te="useEffect",E(),ue(),ni(2048,Zn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),ue(),zt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",E(),ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",E(),ue();var c=ee.H;ee.H=ia;try{return Ar(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",E(),ue();var p=ee.H;ee.H=ia;try{return vl(i,s,c)}finally{ee.H=p}},useRef:function(){return te="useRef",E(),ue(),Tt().memoizedState},useState:function(){te="useState",E(),ue();var i=ee.H;ee.H=ia;try{return vl(Fi)}finally{ee.H=i}},useDebugValue:function(){te="useDebugValue",E(),ue()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),ue(),cp(i,s)},useTransition:function(){return te="useTransition",E(),ue(),bh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),ue(),Bu(i,s,c)},useId:function(){return te="useId",E(),ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState},useMemoCache:function(i){return E(),Sr(i)}},ia.useHostTransitionStatus=rs,ia.useFormState=function(i){return te="useFormState",E(),ue(),xl(i)},ia.useActionState=function(i){return te="useActionState",E(),ue(),xl(i)},ia.useOptimistic=function(i,s){return te="useOptimistic",E(),ue(),ch(i,s)},Wo={readContext:function(i){return A(),Yt(i)},use:function(i){return E(),Xs(i)},useCallback:function(i,s){return te="useCallback",E(),ue(),gh(i,s)},useContext:function(i){return te="useContext",E(),ue(),Yt(i)},useEffect:function(i,s){te="useEffect",E(),ue(),ni(2048,Zn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),ue(),zt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",E(),ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",E(),ue();var c=ee.H;ee.H=ia;try{return Ar(i,s)}finally{ee.H=c}},useReducer:function(i,s,c){te="useReducer",E(),ue();var p=ee.H;ee.H=ia;try{return bl(i,s,c)}finally{ee.H=p}},useRef:function(){return te="useRef",E(),ue(),Tt().memoizedState},useState:function(){te="useState",E(),ue();var i=ee.H;ee.H=ia;try{return bl(Fi)}finally{ee.H=i}},useDebugValue:function(){te="useDebugValue",E(),ue()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),ue(),hp(i,s)},useTransition:function(){return te="useTransition",E(),ue(),xh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),ue(),Bu(i,s,c)},useId:function(){return te="useId",E(),ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState},useMemoCache:function(i){return E(),Sr(i)}},Wo.useHostTransitionStatus=rs,Wo.useFormState=function(i){return te="useFormState",E(),ue(),Nu(i)},Wo.useActionState=function(i){return te="useActionState",E(),ue(),Nu(i)},Wo.useOptimistic=function(i,s){return te="useOptimistic",E(),ue(),bo(i,s)};var nR={},iR=new Set,aR=new Set,sR=new Set,rR=new Set,lR=new Set,oR=new Set,uR=new Set,cR=new Set,hR=new Set,fR=new Set;Object.freeze(nR);var Nb={isMounted:function(i){var s=Xn;if(s!==null&&qn&&s.tag===1){var c=s.stateNode;c._warnedAboutRefsInRender||console.error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",z(s)||"A component"),c._warnedAboutRefsInRender=!0}return(i=i._reactInternals)?je(i)===i:!1},enqueueSetState:function(i,s,c){i=i._reactInternals;var p=Qi(i),g=js(p);g.payload=s,c!=null&&(Rh(c),g.callback=c),s=qi(i,g,p),s!==null&&(Jt(s,i,p),ho(s,i,p)),gr(i,p)},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var p=Qi(i),g=js(p);g.tag=OC,g.payload=s,c!=null&&(Rh(c),g.callback=c),s=qi(i,g,p),s!==null&&(Jt(s,i,p),ho(s,i,p)),gr(i,p)},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=Qi(i),p=js(c);p.tag=NC,s!=null&&(Rh(s),p.callback=s),s=qi(i,p,c),s!==null&&(Jt(s,i,c),ho(s,i,c)),be!==null&&typeof be.markForceUpdateScheduled=="function"&&be.markForceUpdateScheduled(i,c)}},dR=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Bf=null,Gb=null,pR=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),oi=!1,mR={},yR={},gR={},_R={},Of=!1,vR={},Pb={},wb={dehydrated:null,treeContext:null,retryLane:0},bR=!1,s_=Re(null),zb=Re(null),Hb=Re(null),r_={},l_=null,Nf=null,Gf=!1,a5=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(c,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(c){return c()})}},s5=wi.unstable_scheduleCallback,r5=wi.unstable_NormalPriority,_n={$$typeof:wa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},xR=ee.S;ee.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&$y(i,s),xR!==null&&xR(i,s)};var pc=Re(null),SR=null;SR=new Set;var ql=!1,vn=!1,Vb=!1,TR=typeof WeakSet=="function"?WeakSet:Set,ui=null,Pf=null,wf=null,ER=!1,Pn=null,ja=!1,or=null,zf=8192,l5={getCacheForType:function(i){var s=Yt(_n),c=s.data.get(i);return c===void 0&&(c=i(),s.data.set(i,c)),c},getOwner:function(){return Xn}},o_=0,u_=1,c_=2,h_=3,f_=4;if(typeof Symbol=="function"&&Symbol.for){var wm=Symbol.for;o_=wm("selector.component"),u_=wm("selector.has_pseudo_class"),c_=wm("selector.role"),h_=wm("selector.test_id"),f_=wm("selector.text")}var d_=[],o5=typeof WeakMap=="function"?WeakMap:Map,aa=0,Li=2,Kr=4,Fl=0,zm=1,Hf=2,Lb=3,mc=4,CR=5,p_=6,Gt=aa,qt=null,ht=null,dt=0,ba=0,Hm=1,yc=2,Vm=3,RR=4,jb=5,Vf=6,Lm=7,Yb=8,Ft=ba,Ya=null,kl=!1,Lf=!1,Xb=!1,Qr=0,bn=Fl,Jo=0,$o=0,qb=0,Xa=0,gc=0,jm=null,ur=null,m_=!1,Fb=0,AR=300,Ym=1/0,kb=500,Xm=null,eu=null,y_=!1,_c=null,qm=0,Ib=0,Kb=null,u5=50,Fm=0,Qb=null,Zb=!1,g_=!1,c5=50,vc=0,km=null,jf=!1,MR=0,h5=1,f5=2,__=null,DR=!1,UR=new Set,d5={},Ms=null,Yf=null,BR=!1;try{var OR=Object.preventExtensions({})}catch{BR=!0}var NR=!1,GR={},PR=null,wR=null,zR=null,HR=null,VR=null,LR=null,jR=null,YR=null,XR=null;return PR=function(i,s,c,p){s=t(i,s),s!==null&&(c=a(s.memoizedState,c,0,p),s.memoizedState=c,s.baseState=c,i.memoizedProps=Yn({},i.memoizedProps),c=fn(i,2),c!==null&&Jt(c,i,2))},wR=function(i,s,c){s=t(i,s),s!==null&&(c=h(s.memoizedState,c,0),s.memoizedState=c,s.baseState=c,i.memoizedProps=Yn({},i.memoizedProps),c=fn(i,2),c!==null&&Jt(c,i,2))},zR=function(i,s,c,p){s=t(i,s),s!==null&&(c=r(s.memoizedState,c,p),s.memoizedState=c,s.baseState=c,i.memoizedProps=Yn({},i.memoizedProps),c=fn(i,2),c!==null&&Jt(c,i,2))},HR=function(i,s,c){i.pendingProps=a(i.memoizedProps,s,0,c),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=fn(i,2),s!==null&&Jt(s,i,2)},VR=function(i,s){i.pendingProps=h(i.memoizedProps,s,0),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=fn(i,2),s!==null&&Jt(s,i,2)},LR=function(i,s,c){i.pendingProps=r(i.memoizedProps,s,c),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=fn(i,2),s!==null&&Jt(s,i,2)},jR=function(i){var s=fn(i,2);s!==null&&Jt(s,i,2)},YR=function(i){m=i},XR=function(i){f=i},ut.attemptContinuousHydration=function(i){if(i.tag===13){var s=fn(i,67108864);s!==null&&Jt(s,i,67108864),nf(i,67108864)}},ut.attemptHydrationAtCurrentPriority=function(i){if(i.tag===13){var s=Qi(i),c=fn(i,s);c!==null&&Jt(c,i,s),nf(i,s)}},ut.attemptSynchronousHydration=function(i){switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=Ue(i.pendingLanes);if(s!==0){for(i.pendingLanes|=2,i.entangledLanes|=2;s;){var c=1<<31-In(s);i.entanglements[1]|=c,s&=~c}Ma(i),(Gt&(Li|Kr))===aa&&(Ym=C()+kb,br(0))}}break;case 13:s=fn(i,2),s!==null&&Jt(s,i,2),Nr(),nf(i,2)}},ut.batchedUpdates=function(i,s){return i(s)},ut.createComponentSelector=function(i){return{$$typeof:o_,value:i}},ut.createContainer=function(i,s,c,p,g,b,R,N,Y,$){return Ng(i,s,!1,null,c,p,b,R,N,Y,$,null)},ut.createHasPseudoClassSelector=function(i){return{$$typeof:u_,value:i}},ut.createHydrationContainer=function(i,s,c,p,g,b,R,N,Y,$,pe,Se,Me){return i=Ng(c,p,!0,i,g,b,N,Y,$,pe,Se,Me),i.context=sm(null),c=i.current,p=Qi(c),g=js(p),g.callback=s??null,qi(c,g,p),i.current.lanes=p,hn(i,p),Ma(i),i},ut.createPortal=function(i,s,c){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Zi(p);var g=!1}catch{g=!0}return g&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object"),Zi(p)),{$$typeof:an,key:p==null?null:""+p,children:i,containerInfo:s,implementation:c}},ut.createRoleSelector=function(i){return{$$typeof:c_,value:i}},ut.createTestNameSelector=function(i){return{$$typeof:h_,value:i}},ut.createTextSelector=function(i){return{$$typeof:f_,value:i}},ut.defaultOnCaughtError=function(i,s){var c=Bf?"The above error occurred in the <"+Bf+"> component.":"The above error occurred in one of your React components.",p="React will try to recreate this component tree from scratch using the error boundary you provided, "+((Gb||"Anonymous")+"."),g=ee.getCurrentStack,b=s.componentStack!=null?s.componentStack:"";ee.getCurrentStack=function(){return b};try{typeof i=="object"&&i!==null&&typeof i.environmentName=="string"?wo("error",[`%o
1543
-
1544
- %s
1545
-
1546
- %s
1547
- `,i,c,p],i.environmentName)():console.error(`%o
1548
-
1549
- %s
1550
-
1551
- %s
1552
- `,i,c,p)}finally{ee.getCurrentStack=g}},ut.defaultOnRecoverableError=function(i){dR(i)},ut.defaultOnUncaughtError=function(i,s){dR(i),i=Bf?"An error occurred in the <"+Bf+"> component.":"An error occurred in one of your React components.";var c=ee.getCurrentStack,p=s.componentStack!=null?s.componentStack:"";ee.getCurrentStack=function(){return p};try{console.warn(`%s
1553
-
1554
- %s
1555
- `,i,`Consider adding an error boundary to your tree to customize error handling behavior.
1556
- Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}finally{ee.getCurrentStack=c}},ut.deferredUpdates=function(i){var s=ee.T,c=ir();try{return kn(32),ee.T=null,i()}finally{kn(c),ee.T=s}},ut.discreteUpdates=function(i,s,c,p,g){var b=ee.T,R=ir();try{return kn(2),ee.T=null,i(s,c,p,g)}finally{kn(R),ee.T=b,Gt===aa&&(Ym=C()+kb)}},ut.findAllNodes=Qh,ut.findBoundingRects=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");s=Qh(i,s),i=[];for(var c=0;c<s.length;c++)i.push(Ho(s[c]));for(s=i.length-1;0<s;s--){c=i[s];for(var p=c.x,g=p+c.width,b=c.y,R=b+c.height,N=s-1;0<=N;N--)if(s!==N){var Y=i[N],$=Y.x,pe=$+Y.width,Se=Y.y,Me=Se+Y.height;if(p>=$&&b>=Se&&g<=pe&&R<=Me){i.splice(s,1);break}else if(p!==$||c.width!==Y.width||Me<b||Se>R){if(!(b!==Se||c.height!==Y.height||pe<p||$>g)){$>p&&(Y.width+=$-p,Y.x=p),pe<g&&(Y.width=g-$),i.splice(s,1);break}}else{Se>b&&(Y.height+=Se-b,Y.y=b),Me<R&&(Y.height=R-Se),i.splice(s,1);break}}}return i},ut.findHostInstance=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):(i=Object.keys(i).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+i));return i=W(s),i===null?null:ma(i.stateNode)},ut.findHostInstanceWithNoPortals=function(i){return i=V(i),i=i!==null?oe(i):null,i===null?null:ma(i.stateNode)},ut.findHostInstanceWithWarning=function(i,s){var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):(i=Object.keys(i).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+i));if(i=W(c),i===null)return null;if(i.mode&8){var p=z(c)||"Component";GR[p]||(GR[p]=!0,ae(i,function(){c.mode&8?console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",s,s,p):console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",s,s,p)}))}return ma(i.stateNode)},ut.flushPassiveEffects=Gr,ut.flushSyncFromReconciler=function(i){var s=Gt;Gt|=1;var c=ee.T,p=ir();try{if(kn(2),ee.T=null,i)return i()}finally{kn(p),ee.T=c,Gt=s,(Gt&(Li|Kr))===aa&&br(0)}},ut.flushSyncWork=Nr,ut.focusWithin=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");for(i=ai(i),s=pg(i,s),s=Array.from(s),i=0;i<s.length;){var c=s[i++],p=c.tag;if(!ri(c)){if((p===5||p===26||p===27)&&Tn(c.stateNode))return!0;for(c=c.child;c!==null;)s.push(c),c=c.sibling}}return!1},ut.getFindAllNodesFailureDescription=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");var c=0,p=[];i=[ai(i),0];for(var g=0;g<i.length;){var b=i[g++],R=b.tag,N=i[g++],Y=s[N];if((R!==5&&R!==26&&R!==27||!ri(b))&&(Js(b,Y)&&(p.push(Fp(Y)),N++,N>c&&(c=N)),N<s.length))for(b=b.child;b!==null;)i.push(b,N),b=b.sibling}if(c<s.length){for(i=[];c<s.length;c++)i.push(Fp(s[c]));return`findAllNodes was able to match part of the selector:
1557
- `+(p.join(" > ")+`
1558
-
1559
- No matching component was found for:
1560
- `)+i.join(" > ")}return null},ut.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 27:case 5:return ma(i.child.stateNode);default:return i.child.stateNode}},ut.injectIntoDevTools=function(){var i={bundleType:1,version:cf,rendererPackageName:pa,currentDispatcherRef:ee,findFiberByHostInstance:Nl,reconcilerVersion:"19.0.0"};return Ji!==null&&(i.rendererConfig=Ji),i.overrideHookState=PR,i.overrideHookStateDeletePath=wR,i.overrideHookStateRenamePath=zR,i.overrideProps=HR,i.overridePropsDeletePath=VR,i.overridePropsRenamePath=LR,i.scheduleUpdate=jR,i.setErrorHandler=YR,i.setSuspenseHandler=XR,i.scheduleRefresh=S,i.scheduleRoot=v,i.setRefreshHandler=T,i.getCurrentFiber=cb,i.getLaneLabelMap=Gg,i.injectProfilingHooks=Yc,fl(i)},ut.isAlreadyRendering=function(){return(Gt&(Li|Kr))!==aa},ut.observeVisibleRects=function(i,s,c,p){function g(){var $=Qh(i,s);b.forEach(function(pe){0>$.indexOf(pe)&&Y(pe)}),$.forEach(function(pe){0>b.indexOf(pe)&&N(pe)})}if(!ya)throw Error("Test selector API is not supported by this renderer.");var b=Qh(i,s);c=Lr(b,c,p);var R=c.disconnect,N=c.observe,Y=c.unobserve;return d_.push(g),{disconnect:function(){var $=d_.indexOf(g);0<=$&&d_.splice($,1),R()}}},ut.shouldError=function(i){return m(i)},ut.shouldSuspend=function(i){return f(i)},ut.startHostTransition=function(i,s,c,p){if(i.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var g=dp(i).queue;fp(i,g,s,ms,c===null?U:function(){ee.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var b=dp(i).next.queue;return Tl(i,b,{},Qi(i)),c(p)})},ut.updateContainer=function(i,s,c,p){var g=s.current,b=Qi(g);return rm(g,b,i,s,c,p),b},ut.updateContainerSync=tf,ut},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0}))})(v0)),v0.exports}var d2;function UO(){return d2||(d2=1,process.env.NODE_ENV==="production"?Ny.exports=MO():Ny.exports=DO()),Ny.exports}var BO=UO();const OO=xa(BO);function NO(n,e,t,a){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function GO(){}function PO(){return!1}const p2={};function wO(n){return n??p2}function zO(){return eo.currentUpdatePriority}function HO(){return null}function VO(n){throw new Error("Not yet implemented.")}function LO(n){return n}function jO(){return p2}function YO(n){n instanceof zn?n.visible=!1:n instanceof nl&&(n.enabled=!1)}function XO(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function m2(n){if(n instanceof nl){const e=n.__pixireact.parent;if(e){const t=e.__pixireact.filters.indexOf(n);e.__pixireact.filters.splice(t,1),e.filters=e.__pixireact.filters}n.__pixireact.parent=null}}function b0(n,e,...t){if(process.env.NODE_ENV!=="production"&&!n){let a;if(e===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;a=new Error(e.replace(/%s/g,()=>String(t[r++]))),a.name="Invariant Violation"}throw a}}function y2(n,e,t){if(b0(e!==t,"Cannot insert node before itself"),e instanceof zn){const a=e,r=e,u=t;a.parent===n&&n.removeChild(r);const h=n.getChildIndex(u);n.addChildAt(r,h)}else if(e instanceof nl){const u=e.__pixireact.filters.indexOf(t);m2(e),JE(n,e,u)}}function qO(){return!1}function FO(){return!0}function kO(){return null}function IO(){}function KO(){}function g2(n,e){e instanceof nl&&m2(e),e.destroy()}function QO(n){}function ZO(){}function WO(){}function JO(){return-1.1}function $O(){return null}function eN(){var t;if(eo.currentUpdatePriority)return eo.currentUpdatePriority;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return Pc.DefaultEventPriority;switch((t=n.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Pc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Pc.ContinuousEventPriority;default:return Pc.DefaultEventPriority}}function tN(n){eo.currentUpdatePriority=n}function nN(){return!1}function iN(){return!1}function aN(){}function sN(){}function rN(){}function lN(n){n instanceof zn?n.visible=!0:n instanceof nl&&(n.enabled=!0)}function oN(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function uN(){return null}const Py=OO({isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:lO,appendChild:f0,appendChildToContainer:f0,appendInitialChild:f0,beforeActiveInstanceBlur:oO,cancelTimeout:clearTimeout,clearContainer:uO,commitUpdate:bO,createInstance:CO,createTextInstance:NO,hideTextInstance:XO,unhideTextInstance:oN,detachDeletedInstance:GO,finalizeInitialChildren:PO,getChildHostContext:wO,getCurrentUpdatePriority:zO,getInstanceFromNode:HO,getInstanceFromScope:VO,getPublicInstance:LO,getRootHostContext:jO,hideInstance:YO,insertBefore:y2,insertInContainerBefore:y2,maySuspendCommit:qO,preloadInstance:FO,prepareForCommit:kO,preparePortalMount:IO,prepareScopeUpdate:KO,removeChild:g2,removeChildFromContainer:g2,requestPostPaintCallback:QO,resetAfterCommit:ZO,resetFormInstance:WO,resolveEventTimeStamp:JO,resolveEventType:$O,resolveUpdatePriority:eN,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:nN,setCurrentUpdatePriority:tN,shouldSetTextContent:iN,startSuspendingCommit:aN,suspendInstance:sN,trackSchedulerEvent:rN,unhideInstance:lN,waitForCommitToBeReady:uN});Py.injectIntoDevTools({bundleType:process.env.NODE_ENV==="production"?0:1,rendererPackageName:"@pixi/react",version:rO.version});const wc=new Map;function cN(n,e={}){let t=wc.get(n),a=(t==null?void 0:t.applicationState)??{isInitialised:!1,isInitialising:!1};const r=(t==null?void 0:t.internalState)??{};t||(a.app=new lv,r.rootContainer=WE(a.app.stage));const u=(t==null?void 0:t.fiber)??Py.createContainer(r.rootContainer,Pc.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!t){let h;n instanceof HTMLCanvasElement&&(h=n),h||(h=document.createElement("canvas"),n.innerHTML="",n.appendChild(h)),r.canvas=h,t={applicationState:a,fiber:u,internalState:r,render:async(m,y)=>{var v;return!a.app.renderer&&!a.isInitialised&&!a.isInitialising&&(a.isInitialising=!0,await a.app.init({...y,canvas:h}),a.isInitialising=!1,a.isInitialised=!0,a={...a},(v=e.onInit)==null||v.call(e,a.app)),Object.entries(y).forEach(([S,T])=>{const E=S;QE(y,E)||(a.app[E]=T)}),Py.updateContainer(Ai.jsx(aO,{value:a,children:m}),u,null,()=>{}),a.app}},wc.set(h,t)}return t}function _2(n){eo.unmountQueue.delete(n);const e=n.fiber;e&&Py.updateContainer(null,e,null,()=>{n.applicationState.app&&n.applicationState.app.destroy(),wc.delete(n.internalState.canvas)})}function hN(){for(const n of eo.unmountQueue)_2(n)}function fN(n){const e=wc.get(n);e&&(e.applicationState.isInitialised?_2(e):eo.unmountQueue.add(e))}function dN(n){const e=wc.get(n);e&&eo.unmountQueue.delete(e)}const Rd=typeof window<"u"&&((MC=window.document)!=null&&MC.createElement||((DC=window.navigator)==null?void 0:DC.product)==="ReactNative")?Ve.useLayoutEffect:Ve.useEffect,pN={...sl.defaultTextStyle},mN=Ve.forwardRef(function(e,t){const{children:a,className:r,defaultTextStyle:u,extensions:h,onInit:f,resizeTo:m,...y}=e,v=EA(),S=Ve.useRef(null),T=Ve.useRef(null),E=Ve.useRef(new Set);Ve.useImperativeHandle(t,()=>({getApplication(){return S.current},getCanvas(){return T.current}}));const A=Ve.useCallback(()=>{const M=S.current;M&&(m?"current"in m?m.current instanceof HTMLElement&&(M.resizeTo=m.current):M.resizeTo=m:M.resizeTo=void 0)},[m]),U=Ve.useCallback(M=>{hN(),S.current=M,A(),f==null||f(M)},[f]);return Rd(()=>{if(h){const M=[...h],G=E.current;for(const P of G.values()){const w=M.indexOf(P);w===-1&&(Ie.remove(P),G.delete(P)),M.splice(w,1)}for(const P in M)Ie.add(P),G.add(P)}},[h]),Rd(()=>{const M=T.current;if(M){let G=wc.get(M);G||(G=cN(M,{onInit:U})),G.render(Ai.jsx(v,{children:a}),y)}},[y,a,U,m]),Rd(()=>{A()},[m]),Rd(()=>{u?Object.assign(sl.defaultTextStyle,u):Object.assign(sl.defaultTextStyle,pN)},[u]),Ve.useEffect(()=>{const M=T.current;if(M)return dN(M),()=>{fN(M)}},[]),Ai.jsx("canvas",{ref:T,className:r})}),yN=Ve.forwardRef(function(e,t){return Ai.jsx(px,{children:Ai.jsx(mN,{ref:t,...e})})});function gN(n){Object.assign(m0,n)}function v2(){const n=Ve.useContext(h0);return b0(n.app instanceof lv,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),n}function _N(n){const{app:e,isInitialised:t}=v2();let a,r,u=!0,h;typeof n=="function"?a=n:(a=n.callback,r=n.context,u=n.isEnabled??!0,h=n.priority),b0(typeof a=="function","`useTick` needs a callback function."),Rd(()=>{if(t){const f=e==null?void 0:e.ticker,m=u,y=r,v=a;return u&&f&&f.add(a,r,h),()=>{m&&(f==null||f.remove(v,y))}}},[e==null?void 0:e.ticker,a,r,u,t,h])}var x0=Md(),et=n=>Ad(n,x0),S0=Md();et.write=n=>Ad(n,S0);var wy=Md();et.onStart=n=>Ad(n,wy);var T0=Md();et.onFrame=n=>Ad(n,T0);var E0=Md();et.onFinish=n=>Ad(n,E0);var zc=[];et.setTimeout=(n,e)=>{const t=et.now()+e,a=()=>{const u=zc.findIndex(h=>h.cancel==a);~u&&zc.splice(u,1),no-=~u?1:0},r={time:t,handler:n,cancel:a};return zc.splice(b2(t),0,r),no+=1,x2(),r};var b2=n=>~(~zc.findIndex(e=>e.time>n)||~zc.length);et.cancel=n=>{wy.delete(n),T0.delete(n),E0.delete(n),x0.delete(n),S0.delete(n)},et.sync=n=>{R0=!0,et.batchedUpdates(n),R0=!1},et.throttle=n=>{let e;function t(){try{n(...e)}finally{e=null}}function a(...r){e=r,et.onStart(t)}return a.handler=n,a.cancel=()=>{wy.delete(t),e=null},a};var C0=typeof window<"u"?window.requestAnimationFrame:(()=>{});et.use=n=>C0=n,et.now=typeof performance<"u"?()=>performance.now():Date.now,et.batchedUpdates=n=>n(),et.catch=console.error,et.frameLoop="always",et.advance=()=>{et.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):T2()};var to=-1,no=0,R0=!1;function Ad(n,e){R0?(e.delete(n),n(0)):(e.add(n),x2())}function x2(){to<0&&(to=0,et.frameLoop!=="demand"&&C0(S2))}function vN(){to=-1}function S2(){~to&&(C0(S2),et.batchedUpdates(T2))}function T2(){const n=to;to=et.now();const e=b2(to);if(e&&(E2(zc.splice(0,e),t=>t.handler()),no-=e),!no){vN();return}wy.flush(),x0.flush(n?Math.min(64,to-n):16.667),T0.flush(),S0.flush(),E0.flush()}function Md(){let n=new Set,e=n;return{add(t){no+=e==n&&!n.has(t)?1:0,n.add(t)},delete(t){return no-=e==n&&n.has(t)?1:0,n.delete(t)},flush(t){e.size&&(n=new Set,no-=e.size,E2(e,a=>a(t)&&n.add(a)),no+=n.size,e=n)}}}function E2(n,e){n.forEach(t=>{try{e(t)}catch(a){et.catch(a)}})}var bN=Object.defineProperty,xN=(n,e)=>{for(var t in e)bN(n,t,{get:e[t],enumerable:!0})},Ps={};xN(Ps,{assign:()=>TN,colors:()=>io,createStringInterpolator:()=>D0,skipAnimation:()=>R2,to:()=>C2,willAdvance:()=>U0});function A0(){}var SN=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),ve={arr:Array.isArray,obj:n=>!!n&&n.constructor.name==="Object",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",und:n=>n===void 0};function hl(n,e){if(ve.arr(n)){if(!ve.arr(e)||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}return n===e}var gt=(n,e)=>n.forEach(e);function pr(n,e,t){if(ve.arr(n)){for(let a=0;a<n.length;a++)e.call(t,n[a],`${a}`);return}for(const a in n)n.hasOwnProperty(a)&&e.call(t,n[a],a)}var Ca=n=>ve.und(n)?[]:ve.arr(n)?n:[n];function Dd(n,e){if(n.size){const t=Array.from(n);n.clear(),gt(t,e)}}var Ud=(n,...e)=>Dd(n,t=>t(...e)),M0=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),D0,C2,io=null,R2=!1,U0=A0,TN=n=>{n.to&&(C2=n.to),n.now&&(et.now=n.now),n.colors!==void 0&&(io=n.colors),n.skipAnimation!=null&&(R2=n.skipAnimation),n.createStringInterpolator&&(D0=n.createStringInterpolator),n.requestAnimationFrame&&et.use(n.requestAnimationFrame),n.batchedUpdates&&(et.batchedUpdates=n.batchedUpdates),n.willAdvance&&(U0=n.willAdvance),n.frameLoop&&(et.frameLoop=n.frameLoop)},Bd=new Set,Ka=[],B0=[],zy=0,Hy={get idle(){return!Bd.size&&!Ka.length},start(n){zy>n.priority?(Bd.add(n),et.onStart(EN)):(A2(n),et(O0))},advance:O0,sort(n){if(zy)et.onFrame(()=>Hy.sort(n));else{const e=Ka.indexOf(n);~e&&(Ka.splice(e,1),M2(n))}},clear(){Ka=[],Bd.clear()}};function EN(){Bd.forEach(A2),Bd.clear(),et(O0)}function A2(n){Ka.includes(n)||M2(n)}function M2(n){Ka.splice(CN(Ka,e=>e.priority>n.priority),0,n)}function O0(n){const e=B0;for(let t=0;t<Ka.length;t++){const a=Ka[t];zy=a.priority,a.idle||(U0(a),a.advance(n),a.idle||e.push(a))}return zy=0,B0=Ka,B0.length=0,Ka=e,Ka.length>0}function CN(n,e){const t=n.findIndex(e);return t<0?n.length:t}var RN={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},ws="[-+]?\\d*\\.?\\d+",Vy=ws+"%";function Ly(...n){return"\\(\\s*("+n.join(")\\s*,\\s*(")+")\\s*\\)"}var AN=new RegExp("rgb"+Ly(ws,ws,ws)),MN=new RegExp("rgba"+Ly(ws,ws,ws,ws)),DN=new RegExp("hsl"+Ly(ws,Vy,Vy)),UN=new RegExp("hsla"+Ly(ws,Vy,Vy,ws)),BN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ON=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,NN=/^#([0-9a-fA-F]{6})$/,GN=/^#([0-9a-fA-F]{8})$/;function PN(n){let e;return typeof n=="number"?n>>>0===n&&n>=0&&n<=4294967295?n:null:(e=NN.exec(n))?parseInt(e[1]+"ff",16)>>>0:io&&io[n]!==void 0?io[n]:(e=AN.exec(n))?(Hc(e[1])<<24|Hc(e[2])<<16|Hc(e[3])<<8|255)>>>0:(e=MN.exec(n))?(Hc(e[1])<<24|Hc(e[2])<<16|Hc(e[3])<<8|B2(e[4]))>>>0:(e=BN.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=GN.exec(n))?parseInt(e[1],16)>>>0:(e=ON.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=DN.exec(n))?(D2(U2(e[1]),jy(e[2]),jy(e[3]))|255)>>>0:(e=UN.exec(n))?(D2(U2(e[1]),jy(e[2]),jy(e[3]))|B2(e[4]))>>>0:null}function N0(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function D2(n,e,t){const a=t<.5?t*(1+e):t+e-t*e,r=2*t-a,u=N0(r,a,n+1/3),h=N0(r,a,n),f=N0(r,a,n-1/3);return Math.round(u*255)<<24|Math.round(h*255)<<16|Math.round(f*255)<<8}function Hc(n){const e=parseInt(n,10);return e<0?0:e>255?255:e}function U2(n){return(parseFloat(n)%360+360)%360/360}function B2(n){const e=parseFloat(n);return e<0?0:e>1?255:Math.round(e*255)}function jy(n){const e=parseFloat(n);return e<0?0:e>100?1:e/100}function O2(n){let e=PN(n);if(e===null)return n;e=e||0;const t=(e&4278190080)>>>24,a=(e&16711680)>>>16,r=(e&65280)>>>8,u=(e&255)/255;return`rgba(${t}, ${a}, ${r}, ${u})`}var Od=(n,e,t)=>{if(ve.fun(n))return n;if(ve.arr(n))return Od({range:n,output:e,extrapolate:t});if(ve.str(n.output[0]))return D0(n);const a=n,r=a.output,u=a.range||[0,1],h=a.extrapolateLeft||a.extrapolate||"extend",f=a.extrapolateRight||a.extrapolate||"extend",m=a.easing||(y=>y);return y=>{const v=zN(y,u);return wN(y,u[v],u[v+1],r[v],r[v+1],m,h,f,a.map)}};function wN(n,e,t,a,r,u,h,f,m){let y=m?m(n):n;if(y<e){if(h==="identity")return y;h==="clamp"&&(y=e)}if(y>t){if(f==="identity")return y;f==="clamp"&&(y=t)}return a===r?a:e===t?n<=e?a:r:(e===-1/0?y=-y:t===1/0?y=y-e:y=(y-e)/(t-e),y=u(y),a===-1/0?y=-y:r===1/0?y=y+a:y=y*(r-a)+a,y)}function zN(n,e){for(var t=1;t<e.length-1&&!(e[t]>=n);++t);return t-1}var HN={linear:n=>n},Nd=Symbol.for("FluidValue.get"),Vc=Symbol.for("FluidValue.observers"),Qa=n=>!!(n&&n[Nd]),ra=n=>n&&n[Nd]?n[Nd]():n,N2=n=>n[Vc]||null;function VN(n,e){n.eventObserved?n.eventObserved(e):n(e)}function Gd(n,e){const t=n[Vc];t&&t.forEach(a=>{VN(a,e)})}var G2=class{constructor(n){if(!n&&!(n=this.get))throw Error("Unknown getter");LN(this,n)}},LN=(n,e)=>P2(n,Nd,e);function Lc(n,e){if(n[Nd]){let t=n[Vc];t||P2(n,Vc,t=new Set),t.has(e)||(t.add(e),n.observerAdded&&n.observerAdded(t.size,e))}return e}function Pd(n,e){const t=n[Vc];if(t&&t.has(e)){const a=t.size-1;a?t.delete(e):n[Vc]=null,n.observerRemoved&&n.observerRemoved(a,e)}}var P2=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),Yy=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,jN=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,w2=new RegExp(`(${Yy.source})(%|[a-z]+)`,"i"),YN=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Xy=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,z2=n=>{const[e,t]=XN(n);if(!e||M0())return n;const a=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(a)return a.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||n}else{if(t&&Xy.test(t))return z2(t);if(t)return t}return n},XN=n=>{const e=Xy.exec(n);if(!e)return[,];const[,t,a]=e;return[t,a]},G0,qN=(n,e,t,a,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(a)}, ${r})`,H2=n=>{G0||(G0=io?new RegExp(`(${Object.keys(io).join("|")})(?!\\w)`,"g"):/^\b$/);const e=n.output.map(u=>ra(u).replace(Xy,z2).replace(jN,O2).replace(G0,O2)),t=e.map(u=>u.match(Yy).map(Number)),r=t[0].map((u,h)=>t.map(f=>{if(!(h in f))throw Error('The arity of each "output" value must be equal');return f[h]})).map(u=>Od({...n,output:u}));return u=>{var m;const h=!w2.test(e[0])&&((m=e.find(y=>w2.test(y)))==null?void 0:m.replace(Yy,""));let f=0;return e[0].replace(Yy,()=>`${r[f++](u)}${h||""}`).replace(YN,qN)}},P0="react-spring: ",V2=n=>{const e=n;let t=!1;if(typeof e!="function")throw new TypeError(`${P0}once requires a function parameter`);return(...a)=>{t||(e(...a),t=!0)}},FN=V2(console.warn);function kN(){FN(`${P0}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var IN=V2(console.warn);function KN(){IN(`${P0}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function qy(n){return ve.str(n)&&(n[0]=="#"||/\d/.test(n)||!M0()&&Xy.test(n)||n in(io||{}))}var w0=M0()?Ve.useEffect:Ve.useLayoutEffect,QN=()=>{const n=Ve.useRef(!1);return w0(()=>(n.current=!0,()=>{n.current=!1}),[]),n};function L2(){const n=Ve.useState()[1],e=QN();return()=>{e.current&&n(Math.random())}}var j2=n=>Ve.useEffect(n,ZN),ZN=[];function Y2(n){const e=Ve.useRef(void 0);return Ve.useEffect(()=>{e.current=n}),e.current}var wd=Symbol.for("Animated:node"),WN=n=>!!n&&n[wd]===n,mr=n=>n&&n[wd],z0=(n,e)=>SN(n,wd,e),Fy=n=>n&&n[wd]&&n[wd].getPayload(),X2=class{constructor(){z0(this,this)}getPayload(){return this.payload||[]}},ky=class fA extends X2{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ve.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new fA(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ve.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,ve.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Iy=class dA extends ky{constructor(e){super(0),this._string=null,this._toString=Od({output:[e,e]})}static create(e){return new dA(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(ve.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Od({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ky={dependencies:null},Qy=class extends X2{constructor(n){super(),this.source=n,this.setValue(n)}getValue(n){const e={};return pr(this.source,(t,a)=>{WN(t)?e[a]=t.getValue(n):Qa(t)?e[a]=ra(t):n||(e[a]=t)}),e}setValue(n){this.source=n,this.payload=this._makePayload(n)}reset(){this.payload&&gt(this.payload,n=>n.reset())}_makePayload(n){if(n){const e=new Set;return pr(n,this._addToPayload,e),Array.from(e)}}_addToPayload(n){Ky.dependencies&&Qa(n)&&Ky.dependencies.add(n);const e=Fy(n);e&&gt(e,t=>this.add(t))}},JN=class pA extends Qy{constructor(e){super(e)}static create(e){return new pA(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((a,r)=>a.setValue(e[r])).some(Boolean):(super.setValue(e.map($N)),!0)}};function $N(n){return(qy(n)?Iy:ky).create(n)}function H0(n){const e=mr(n);return e?e.constructor:ve.arr(n)?JN:qy(n)?Iy:ky}var q2=(n,e)=>{const t=!ve.fun(n)||n.prototype&&n.prototype.isReactComponent;return Ve.forwardRef((a,r)=>{const u=Ve.useRef(null),h=t&&Ve.useCallback(A=>{u.current=nG(r,A)},[r]),[f,m]=tG(a,e),y=L2(),v=()=>{const A=u.current;if(t&&!A)return;(A?e.applyAnimatedValues(A,f.getValue(!0)):!1)===!1&&y()},S=new eG(v,m),T=Ve.useRef(void 0);w0(()=>(T.current=S,gt(m,A=>Lc(A,S)),()=>{T.current&&(gt(T.current.deps,A=>Pd(A,T.current)),et.cancel(T.current.update))})),Ve.useEffect(v,[]),j2(()=>()=>{const A=T.current;gt(A.deps,U=>Pd(U,A))});const E=e.getComponentProps(f.getValue());return Ve.createElement(n,{...E,ref:h})})},eG=class{constructor(n,e){this.update=n,this.deps=e}eventObserved(n){n.type=="change"&&et.write(this.update)}};function tG(n,e){const t=new Set;return Ky.dependencies=t,n.style&&(n={...n,style:e.createAnimatedStyle(n.style)}),n=new Qy(n),Ky.dependencies=null,[n,t]}function nG(n,e){return n&&(ve.fun(n)?n(e):n.current=e),e}var F2=Symbol.for("AnimatedComponent"),iG=(n,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new Qy(r),getComponentProps:a=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:a},u=h=>{const f=k2(h)||"Anonymous";return ve.str(h)?h=u[h]||(u[h]=q2(h,r)):h=h[F2]||(h[F2]=q2(h,r)),h.displayName=`Animated(${f})`,h};return pr(n,(h,f)=>{ve.arr(n)&&(f=k2(h)),u[f]=u(h)}),{animated:u}},k2=n=>ve.str(n)?n:n&&ve.str(n.displayName)?n.displayName:ve.fun(n)&&n.name||null;function pu(n,...e){return ve.fun(n)?n(...e):n}var zd=(n,e)=>n===!0||!!(e&&n&&(ve.fun(n)?n(e):Ca(n).includes(e))),I2=(n,e)=>ve.obj(n)?e&&n[e]:n,K2=(n,e)=>n.default===!0?n[e]:n.default?n.default[e]:void 0,aG=n=>n,V0=(n,e=aG)=>{let t=sG;n.default&&n.default!==!0&&(n=n.default,t=Object.keys(n));const a={};for(const r of t){const u=e(n[r],r);ve.und(u)||(a[r]=u)}return a},sG=["config","onProps","onStart","onChange","onPause","onResume","onRest"],rG={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function lG(n){const e={};let t=0;if(pr(n,(a,r)=>{rG[r]||(e[r]=a,t++)}),t)return e}function Q2(n){const e=lG(n);if(e){const t={to:e};return pr(n,(a,r)=>r in e||(t[r]=a)),t}return{...n}}function Hd(n){return n=ra(n),ve.arr(n)?n.map(Hd):qy(n)?Ps.createStringInterpolator({range:[0,1],output:[n,n]})(1):n}function oG(n){for(const e in n)return!0;return!1}function L0(n){return ve.fun(n)||ve.arr(n)&&ve.obj(n[0])}function uG(n,e){var t;(t=n.ref)==null||t.delete(n),e==null||e.delete(n)}function cG(n,e){var t;e&&n.ref!==e&&((t=n.ref)==null||t.delete(n),e.add(n),n.ref=e)}var hG={default:{tension:170,friction:26}},j0={...hG.default,mass:1,damping:1,easing:HN.linear,clamp:!1},fG=class{constructor(){this.velocity=0,Object.assign(this,j0)}};function dG(n,e,t){t&&(t={...t},Z2(t,e),e={...t,...e}),Z2(n,e),Object.assign(n,e);for(const h in j0)n[h]==null&&(n[h]=j0[h]);let{frequency:a,damping:r}=n;const{mass:u}=n;return ve.und(a)||(a<.01&&(a=.01),r<0&&(r=0),n.tension=Math.pow(2*Math.PI/a,2)*u,n.friction=4*Math.PI*r*u/a),n}function Z2(n,e){if(!ve.und(e.decay))n.duration=void 0;else{const t=!ve.und(e.tension)||!ve.und(e.friction);(t||!ve.und(e.frequency)||!ve.und(e.damping)||!ve.und(e.mass))&&(n.duration=void 0,n.decay=void 0),t&&(n.frequency=void 0)}}var W2=[],pG=class{constructor(){this.changed=!1,this.values=W2,this.toValues=null,this.fromValues=W2,this.config=new fG,this.immediate=!1}};function J2(n,{key:e,props:t,defaultProps:a,state:r,actions:u}){return new Promise((h,f)=>{let m,y,v=zd(t.cancel??(a==null?void 0:a.cancel),e);if(v)E();else{ve.und(t.pause)||(r.paused=zd(t.pause,e));let A=a==null?void 0:a.pause;A!==!0&&(A=r.paused||zd(A,e)),m=pu(t.delay||0,e),A?(r.resumeQueue.add(T),u.pause()):(u.resume(),T())}function S(){r.resumeQueue.add(T),r.timeouts.delete(y),y.cancel(),m=y.time-et.now()}function T(){m>0&&!Ps.skipAnimation?(r.delayed=!0,y=et.setTimeout(E,m),r.pauseQueue.add(S),r.timeouts.add(y)):E()}function E(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(S),r.timeouts.delete(y),n<=(r.cancelId||0)&&(v=!0);try{u.start({...t,callId:n,cancel:v},h)}catch(A){f(A)}}})}var Y0=(n,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?jc(n.get()):e.every(t=>t.noop)?$2(n.get()):zs(n.get(),e.every(t=>t.finished)),$2=n=>({value:n,noop:!0,finished:!0,cancelled:!1}),zs=(n,e,t=!1)=>({value:n,finished:e,cancelled:t}),jc=n=>({value:n,cancelled:!0,finished:!1});function eC(n,e,t,a){const{callId:r,parentId:u,onRest:h}=e,{asyncTo:f,promise:m}=t;return!u&&n===f&&!e.reset?m:t.promise=(async()=>{t.asyncId=r,t.asyncTo=n;const y=V0(e,(M,G)=>G==="onRest"?void 0:M);let v,S;const T=new Promise((M,G)=>(v=M,S=G)),E=M=>{const G=r<=(t.cancelId||0)&&jc(a)||r!==t.asyncId&&zs(a,!1);if(G)throw M.result=G,S(M),M},A=(M,G)=>{const P=new tC,w=new nC;return(async()=>{if(Ps.skipAnimation)throw Vd(t),w.result=zs(a,!1),S(w),w;E(P);const z=ve.obj(M)?{...M}:{...G,to:M};z.parentId=r,pr(y,(ie,Z)=>{ve.und(z[Z])&&(z[Z]=ie)});const ne=await a.start(z);return E(P),t.paused&&await new Promise(ie=>{t.resumeQueue.add(ie)}),ne})()};let U;if(Ps.skipAnimation)return Vd(t),zs(a,!1);try{let M;ve.arr(n)?M=(async G=>{for(const P of G)await A(P)})(n):M=Promise.resolve(n(A,a.stop.bind(a))),await Promise.all([M.then(v),T]),U=zs(a.get(),!0,!1)}catch(M){if(M instanceof tC)U=M.result;else if(M instanceof nC)U=M.result;else throw M}finally{r==t.asyncId&&(t.asyncId=u,t.asyncTo=u?f:void 0,t.promise=u?m:void 0)}return ve.fun(h)&&et.batchedUpdates(()=>{h(U,a,a.item)}),U})()}function Vd(n,e){Dd(n.timeouts,t=>t.cancel()),n.pauseQueue.clear(),n.resumeQueue.clear(),n.asyncId=n.asyncTo=n.promise=void 0,e&&(n.cancelId=e)}var tC=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},nC=class extends Error{constructor(){super("SkipAnimationSignal")}},X0=n=>n instanceof q0,mG=1,q0=class extends G2{constructor(){super(...arguments),this.id=mG++,this._priority=0}get priority(){return this._priority}set priority(n){this._priority!=n&&(this._priority=n,this._onPriorityChange(n))}get(){const n=mr(this);return n&&n.getValue()}to(...n){return Ps.to(this,n)}interpolate(...n){return kN(),Ps.to(this,n)}toJSON(){return this.get()}observerAdded(n){n==1&&this._attach()}observerRemoved(n){n==0&&this._detach()}_attach(){}_detach(){}_onChange(n,e=!1){Gd(this,{type:"change",parent:this,value:n,idle:e})}_onPriorityChange(n){this.idle||Hy.sort(this),Gd(this,{type:"priority",parent:this,priority:n})}},mu=Symbol.for("SpringPhase"),iC=1,F0=2,k0=4,I0=n=>(n[mu]&iC)>0,ao=n=>(n[mu]&F0)>0,Ld=n=>(n[mu]&k0)>0,aC=(n,e)=>e?n[mu]|=F0|iC:n[mu]&=~F0,sC=(n,e)=>e?n[mu]|=k0:n[mu]&=~k0,yG=class extends q0{constructor(n,e){if(super(),this.animation=new pG,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ve.und(n)||!ve.und(e)){const t=ve.obj(n)?{...n}:{...e,from:n};ve.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(ao(this)||this._state.asyncTo)||Ld(this)}get goal(){return ra(this.animation.to)}get velocity(){const n=mr(this);return n instanceof ky?n.lastVelocity||0:n.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return I0(this)}get isAnimating(){return ao(this)}get isPaused(){return Ld(this)}get isDelayed(){return this._state.delayed}advance(n){let e=!0,t=!1;const a=this.animation;let{toValues:r}=a;const{config:u}=a,h=Fy(a.to);!h&&Qa(a.to)&&(r=Ca(ra(a.to))),a.values.forEach((y,v)=>{if(y.done)return;const S=y.constructor==Iy?1:h?h[v].lastPosition:r[v];let T=a.immediate,E=S;if(!T){if(E=y.lastPosition,u.tension<=0){y.done=!0;return}let A=y.elapsedTime+=n;const U=a.fromValues[v],M=y.v0!=null?y.v0:y.v0=ve.arr(u.velocity)?u.velocity[v]:u.velocity;let G;const P=u.precision||(U==S?.005:Math.min(1,Math.abs(S-U)*.001));if(ve.und(u.duration))if(u.decay){const w=u.decay===!0?.998:u.decay,z=Math.exp(-(1-w)*A);E=U+M/(1-w)*(1-z),T=Math.abs(y.lastPosition-E)<=P,G=M*z}else{G=y.lastVelocity==null?M:y.lastVelocity;const w=u.restVelocity||P/10,z=u.clamp?0:u.bounce,ne=!ve.und(z),ie=U==S?y.v0>0:U<S;let Z,Te=!1;const me=1,fe=Math.ceil(n/me);for(let le=0;le<fe&&(Z=Math.abs(G)>w,!(!Z&&(T=Math.abs(S-E)<=P,T)));++le){ne&&(Te=E==S||E>S==ie,Te&&(G=-G*z,E=S));const Ce=-u.tension*1e-6*(E-S),ae=-u.friction*.001*G,je=(Ce+ae)/u.mass;G=G+je*me,E=E+G*me}}else{let w=1;u.duration>0&&(this._memoizedDuration!==u.duration&&(this._memoizedDuration=u.duration,y.durationProgress>0&&(y.elapsedTime=u.duration*y.durationProgress,A=y.elapsedTime+=n)),w=(u.progress||0)+A/this._memoizedDuration,w=w>1?1:w<0?0:w,y.durationProgress=w),E=U+u.easing(w)*(S-U),G=(E-y.lastPosition)/n,T=w==1}y.lastVelocity=G,Number.isNaN(E)&&(console.warn("Got NaN while animating:",this),T=!0)}h&&!h[v].done&&(T=!1),T?y.done=!0:e=!1,y.setValue(E,u.round)&&(t=!0)});const f=mr(this),m=f.getValue();if(e){const y=ra(a.to);(m!==y||t)&&!u.decay?(f.setValue(y),this._onChange(y)):t&&u.decay&&this._onChange(m),this._stop()}else t&&this._onChange(m)}set(n){return et.batchedUpdates(()=>{this._stop(),this._focus(n),this._set(n)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ao(this)){const{to:n,config:e}=this.animation;et.batchedUpdates(()=>{this._onStart(),e.decay||this._set(n,!1),this._stop()})}return this}update(n){return(this.queue||(this.queue=[])).push(n),this}start(n,e){let t;return ve.und(n)?(t=this.queue||[],this.queue=[]):t=[ve.obj(n)?n:{...e,to:n}],Promise.all(t.map(a=>this._update(a))).then(a=>Y0(this,a))}stop(n){const{to:e}=this.animation;return this._focus(this.get()),Vd(this._state,n&&this._lastCallId),et.batchedUpdates(()=>this._stop(e,n)),this}reset(){this._update({reset:!0})}eventObserved(n){n.type=="change"?this._start():n.type=="priority"&&(this.priority=n.priority+1)}_prepareNode(n){const e=this.key||"";let{to:t,from:a}=n;t=ve.obj(t)?t[e]:t,(t==null||L0(t))&&(t=void 0),a=ve.obj(a)?a[e]:a,a==null&&(a=void 0);const r={to:t,from:a};return I0(this)||(n.reverse&&([t,a]=[a,t]),a=ra(a),ve.und(a)?mr(this)||this._set(t):this._set(a)),r}_update({...n},e){const{key:t,defaultProps:a}=this;n.default&&Object.assign(a,V0(n,(h,f)=>/^on/.test(f)?I2(h,t):h)),oC(this,n,"onProps"),Xd(this,"onProps",n,this);const r=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const u=this._state;return J2(++this._lastCallId,{key:t,props:n,defaultProps:a,state:u,actions:{pause:()=>{Ld(this)||(sC(this,!0),Ud(u.pauseQueue),Xd(this,"onPause",zs(this,jd(this,this.animation.to)),this))},resume:()=>{Ld(this)&&(sC(this,!1),ao(this)&&this._resume(),Ud(u.resumeQueue),Xd(this,"onResume",zs(this,jd(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(h=>{if(n.loop&&h.finished&&!(e&&h.noop)){const f=rC(n);if(f)return this._update(f,!0)}return h})}_merge(n,e,t){if(e.cancel)return this.stop(!0),t(jc(this));const a=!ve.und(n.to),r=!ve.und(n.from);if(a||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(jc(this));const{key:u,defaultProps:h,animation:f}=this,{to:m,from:y}=f;let{to:v=m,from:S=y}=n;r&&!a&&(!e.default||ve.und(v))&&(v=S),e.reverse&&([v,S]=[S,v]);const T=!hl(S,y);T&&(f.from=S),S=ra(S);const E=!hl(v,m);E&&this._focus(v);const A=L0(e.to),{config:U}=f,{decay:M,velocity:G}=U;(a||r)&&(U.velocity=0),e.config&&!A&&dG(U,pu(e.config,u),e.config!==h.config?pu(h.config,u):void 0);let P=mr(this);if(!P||ve.und(v))return t(zs(this,!0));const w=ve.und(e.reset)?r&&!e.default:!ve.und(S)&&zd(e.reset,u),z=w?S:this.get(),ne=Hd(v),ie=ve.num(ne)||ve.arr(ne)||qy(ne),Z=!A&&(!ie||zd(h.immediate||e.immediate,u));if(E){const le=H0(v);if(le!==P.constructor)if(Z)P=this._set(ne);else throw Error(`Cannot animate between ${P.constructor.name} and ${le.name}, as the "to" prop suggests`)}const Te=P.constructor;let me=Qa(v),fe=!1;if(!me){const le=w||!I0(this)&&T;(E||le)&&(fe=hl(Hd(z),ne),me=!fe),(!hl(f.immediate,Z)&&!Z||!hl(U.decay,M)||!hl(U.velocity,G))&&(me=!0)}if(fe&&ao(this)&&(f.changed&&!w?me=!0:me||this._stop(m)),!A&&((me||Qa(m))&&(f.values=P.getPayload(),f.toValues=Qa(v)?null:Te==Iy?[1]:Ca(ne)),f.immediate!=Z&&(f.immediate=Z,!Z&&!w&&this._set(m)),me)){const{onRest:le}=f;gt(_G,ae=>oC(this,e,ae));const Ce=zs(this,jd(this,m));Ud(this._pendingCalls,Ce),this._pendingCalls.add(t),f.changed&&et.batchedUpdates(()=>{var ae;f.changed=!w,le==null||le(Ce,this),w?pu(h.onRest,Ce):(ae=f.onStart)==null||ae.call(f,Ce,this)})}w&&this._set(z),A?t(eC(e.to,e,this._state,this)):me?this._start():ao(this)&&!E?this._pendingCalls.add(t):t($2(z))}_focus(n){const e=this.animation;n!==e.to&&(N2(this)&&this._detach(),e.to=n,N2(this)&&this._attach())}_attach(){let n=0;const{to:e}=this.animation;Qa(e)&&(Lc(e,this),X0(e)&&(n=e.priority+1)),this.priority=n}_detach(){const{to:n}=this.animation;Qa(n)&&Pd(n,this)}_set(n,e=!0){const t=ra(n);if(!ve.und(t)){const a=mr(this);if(!a||!hl(t,a.getValue())){const r=H0(t);!a||a.constructor!=r?z0(this,r.create(t)):a.setValue(t),a&&et.batchedUpdates(()=>{this._onChange(t,e)})}}return mr(this)}_onStart(){const n=this.animation;n.changed||(n.changed=!0,Xd(this,"onStart",zs(this,jd(this,n.to)),this))}_onChange(n,e){e||(this._onStart(),pu(this.animation.onChange,n,this)),pu(this.defaultProps.onChange,n,this),super._onChange(n,e)}_start(){const n=this.animation;mr(this).reset(ra(n.to)),n.immediate||(n.fromValues=n.values.map(e=>e.lastPosition)),ao(this)||(aC(this,!0),Ld(this)||this._resume())}_resume(){Ps.skipAnimation?this.finish():Hy.start(this)}_stop(n,e){if(ao(this)){aC(this,!1);const t=this.animation;gt(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),Gd(this,{type:"idle",parent:this});const a=e?jc(this.get()):zs(this.get(),jd(this,n??t.to));Ud(this._pendingCalls,a),t.changed&&(t.changed=!1,Xd(this,"onRest",a,this))}}};function jd(n,e){const t=Hd(e),a=Hd(n.get());return hl(a,t)}function rC(n,e=n.loop,t=n.to){const a=pu(e);if(a){const r=a!==!0&&Q2(a),u=(r||n).reverse,h=!r||r.reset;return Yd({...n,loop:e,default:!1,pause:void 0,to:!u||L0(t)?t:void 0,from:h?n.from:void 0,reset:h,...r})}}function Yd(n){const{to:e,from:t}=n=Q2(n),a=new Set;return ve.obj(e)&&lC(e,a),ve.obj(t)&&lC(t,a),n.keys=a.size?Array.from(a):null,n}function gG(n){const e=Yd(n);return ve.und(e.default)&&(e.default=V0(e)),e}function lC(n,e){pr(n,(t,a)=>t!=null&&e.add(a))}var _G=["onStart","onRest","onChange","onPause","onResume"];function oC(n,e,t){n.animation[t]=e[t]!==K2(e,t)?I2(e[t],n.key):void 0}function Xd(n,e,...t){var a,r,u,h;(r=(a=n.animation)[e])==null||r.call(a,...t),(h=(u=n.defaultProps)[e])==null||h.call(u,...t)}var vG=["onStart","onChange","onRest"],bG=1,xG=class{constructor(n,e){this.id=bG++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),n&&this.start({default:!0,...n})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(n=>n.idle&&!n.isDelayed&&!n.isPaused)}get item(){return this._item}set item(n){this._item=n}get(){const n={};return this.each((e,t)=>n[t]=e.get()),n}set(n){for(const e in n){const t=n[e];ve.und(t)||this.springs[e].set(t)}}update(n){return n&&this.queue.push(Yd(n)),this}start(n){let{queue:e}=this;return n?e=Ca(n).map(Yd):this.queue=[],this._flush?this._flush(this,e):(pC(this,e),K0(this,e))}stop(n,e){if(n!==!!n&&(e=n),e){const t=this.springs;gt(Ca(e),a=>t[a].stop(!!n))}else Vd(this._state,this._lastAsyncId),this.each(t=>t.stop(!!n));return this}pause(n){if(ve.und(n))this.start({pause:!0});else{const e=this.springs;gt(Ca(n),t=>e[t].pause())}return this}resume(n){if(ve.und(n))this.start({pause:!1});else{const e=this.springs;gt(Ca(n),t=>e[t].resume())}return this}each(n){pr(this.springs,n)}_onFrame(){const{onStart:n,onChange:e,onRest:t}=this._events,a=this._active.size>0,r=this._changed.size>0;(a&&!this._started||r&&!this._started)&&(this._started=!0,Dd(n,([f,m])=>{m.value=this.get(),f(m,this,this._item)}));const u=!a&&this._started,h=r||u&&t.size?this.get():null;r&&e.size&&Dd(e,([f,m])=>{m.value=h,f(m,this,this._item)}),u&&(this._started=!1,Dd(t,([f,m])=>{m.value=h,f(m,this,this._item)}))}eventObserved(n){if(n.type=="change")this._changed.add(n.parent),n.idle||this._active.add(n.parent);else if(n.type=="idle")this._active.delete(n.parent);else return;et.onFrame(this._onFrame)}};function K0(n,e){return Promise.all(e.map(t=>uC(n,t))).then(t=>Y0(n,t))}async function uC(n,e,t){const{keys:a,to:r,from:u,loop:h,onRest:f,onResolve:m}=e,y=ve.obj(e.default)&&e.default;h&&(e.loop=!1),r===!1&&(e.to=null),u===!1&&(e.from=null);const v=ve.arr(r)||ve.fun(r)?r:void 0;v?(e.to=void 0,e.onRest=void 0,y&&(y.onRest=void 0)):gt(vG,U=>{const M=e[U];if(ve.fun(M)){const G=n._events[U];e[U]=({finished:P,cancelled:w})=>{const z=G.get(M);z?(P||(z.finished=!1),w&&(z.cancelled=!0)):G.set(M,{value:null,finished:P||!1,cancelled:w||!1})},y&&(y[U]=e[U])}});const S=n._state;e.pause===!S.paused?(S.paused=e.pause,Ud(e.pause?S.pauseQueue:S.resumeQueue)):S.paused&&(e.pause=!0);const T=(a||Object.keys(n.springs)).map(U=>n.springs[U].start(e)),E=e.cancel===!0||K2(e,"cancel")===!0;(v||E&&S.asyncId)&&T.push(J2(++n._lastAsyncId,{props:e,state:S,actions:{pause:A0,resume:A0,start(U,M){E?(Vd(S,n._lastAsyncId),M(jc(n))):(U.onRest=f,M(eC(v,U,S,n)))}}})),S.paused&&await new Promise(U=>{S.resumeQueue.add(U)});const A=Y0(n,await Promise.all(T));if(h&&A.finished&&!(t&&A.noop)){const U=rC(e,h,r);if(U)return pC(n,[U]),uC(n,U,!0)}return m&&et.batchedUpdates(()=>m(A,n,n.item)),A}function cC(n,e){const t={...n.springs};return e&&gt(Ca(e),a=>{ve.und(a.keys)&&(a=Yd(a)),ve.obj(a.to)||(a={...a,to:void 0}),dC(t,a,r=>fC(r))}),hC(n,t),t}function hC(n,e){pr(e,(t,a)=>{n.springs[a]||(n.springs[a]=t,Lc(t,n))})}function fC(n,e){const t=new yG;return t.key=n,e&&Lc(t,e),t}function dC(n,e,t){e.keys&&gt(e.keys,a=>{(n[a]||(n[a]=t(a)))._prepareNode(e)})}function pC(n,e){gt(e,t=>{dC(n.springs,t,a=>fC(a,n))})}var SG=Ve.createContext({pause:!1,immediate:!1}),TG=()=>{const n=[],e=function(a){KN();const r=[];return gt(n,(u,h)=>{if(ve.und(a))r.push(u.start());else{const f=t(a,u,h);f&&r.push(u.start(f))}}),r};e.current=n,e.add=function(a){n.includes(a)||n.push(a)},e.delete=function(a){const r=n.indexOf(a);~r&&n.splice(r,1)},e.pause=function(){return gt(n,a=>a.pause(...arguments)),this},e.resume=function(){return gt(n,a=>a.resume(...arguments)),this},e.set=function(a){gt(n,(r,u)=>{const h=ve.fun(a)?a(u,r):a;h&&r.set(h)})},e.start=function(a){const r=[];return gt(n,(u,h)=>{if(ve.und(a))r.push(u.start());else{const f=this._getProps(a,u,h);f&&r.push(u.start(f))}}),r},e.stop=function(){return gt(n,a=>a.stop(...arguments)),this},e.update=function(a){return gt(n,(r,u)=>r.update(this._getProps(a,r,u))),this};const t=function(a,r,u){return ve.fun(a)?a(u,r):a};return e._getProps=t,e};function EG(n,e,t){const a=ve.fun(e)&&e;a&&!t&&(t=[]);const r=Ve.useMemo(()=>a||arguments.length==3?TG():void 0,[]),u=Ve.useRef(0),h=L2(),f=Ve.useMemo(()=>({ctrls:[],queue:[],flush(G,P){const w=cC(G,P);return u.current>0&&!f.queue.length&&!Object.keys(w).some(ne=>!G.springs[ne])?K0(G,P):new Promise(ne=>{hC(G,w),f.queue.push(()=>{ne(K0(G,P))}),h()})}}),[]),m=Ve.useRef([...f.ctrls]),y=Ve.useRef([]),v=Y2(n)||0;Ve.useMemo(()=>{gt(m.current.slice(n,v),G=>{uG(G,r),G.stop(!0)}),m.current.length=n,S(v,n)},[n]),Ve.useMemo(()=>{S(0,Math.min(v,n))},t);function S(G,P){for(let w=G;w<P;w++){const z=m.current[w]||(m.current[w]=new xG(null,f.flush)),ne=a?a(w,z):e[w];ne&&(y.current[w]=gG(ne))}}const T=m.current.map((G,P)=>cC(G,y.current[P])),E=Ve.useContext(SG),A=Y2(E),U=E!==A&&oG(E);w0(()=>{u.current++,f.ctrls=m.current;const{queue:G}=f;G.length&&(f.queue=[],gt(G,P=>P())),gt(m.current,(P,w)=>{r==null||r.add(P),U&&P.start({default:E});const z=y.current[w];z&&(cG(P,z.ref),P.ref?P.queue.push(z):P.start(z))})}),j2(()=>()=>{gt(f.ctrls,G=>G.stop(!0))});const M=T.map(G=>({...G}));return r?[M,r]:M}function mC(n,e){const t=ve.fun(n),[[a],r]=EG(1,t?n:[n],t?[]:e);return t||arguments.length==2?[a,r]:a}var CG=class extends q0{constructor(n,e){super(),this.source=n,this.idle=!0,this._active=new Set,this.calc=Od(...e);const t=this._get(),a=H0(t);z0(this,a.create(t))}advance(n){const e=this._get(),t=this.get();hl(e,t)||(mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&yC(this._active)&&Q0(this)}_get(){const n=ve.arr(this.source)?this.source.map(ra):Ca(ra(this.source));return this.calc(...n)}_start(){this.idle&&!yC(this._active)&&(this.idle=!1,gt(Fy(this),n=>{n.done=!1}),Ps.skipAnimation?(et.batchedUpdates(()=>this.advance()),Q0(this)):Hy.start(this))}_attach(){let n=1;gt(Ca(this.source),e=>{Qa(e)&&Lc(e,this),X0(e)&&(e.idle||this._active.add(e),n=Math.max(n,e.priority+1))}),this.priority=n,this._start()}_detach(){gt(Ca(this.source),n=>{Qa(n)&&Pd(n,this)}),this._active.clear(),Q0(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=Ca(this.source).reduce((e,t)=>Math.max(e,(X0(t)?t.priority:0)+1),0))}};function RG(n){return n.idle!==!1}function yC(n){return!n.size||Array.from(n).every(RG)}function Q0(n){n.idle||(n.idle=!0,gt(Fy(n),e=>{e.done=!0}),Gd(n,{type:"idle",parent:n}))}Ps.assign({createStringInterpolator:H2,to:(n,e)=>new CG(n,e)});var Zy={exports:{}},Ui={};/**
1561
- * @license React
1562
- * react-dom.production.js
1563
- *
1564
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1565
- *
1566
- * This source code is licensed under the MIT license found in the
1567
- * LICENSE file in the root directory of this source tree.
1568
- */var gC;function AG(){if(gC)return Ui;gC=1;var n=bc();function e(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)y+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var a={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function u(m,y,v){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:S==null?null:""+S,children:m,containerInfo:y,implementation:v}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Ui.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Ui.createPortal=function(m,y){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(e(299));return u(m,y,null,v)},Ui.flushSync=function(m){var y=h.T,v=a.p;try{if(h.T=null,a.p=2,m)return m()}finally{h.T=y,a.p=v,a.d.f()}},Ui.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,a.d.C(m,y))},Ui.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Ui.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var v=y.as,S=f(v,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,E=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;v==="style"?a.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:S,integrity:T,fetchPriority:E}):v==="script"&&a.d.X(m,{crossOrigin:S,integrity:T,fetchPriority:E,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Ui.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var v=f(y.as,y.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&a.d.M(m)},Ui.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var v=y.as,S=f(v,y.crossOrigin);a.d.L(m,v,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Ui.preloadModule=function(m,y){if(typeof m=="string")if(y){var v=f(y.as,y.crossOrigin);a.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else a.d.m(m)},Ui.requestFormReset=function(m){a.d.r(m)},Ui.unstable_batchedUpdates=function(m,y){return m(y)},Ui.useFormState=function(m,y,v){return h.H.useFormState(m,y,v)},Ui.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ui.version="19.2.0",Ui}var Bi={};/**
1569
- * @license React
1570
- * react-dom.development.js
1571
- *
1572
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1573
- *
1574
- * This source code is licensed under the MIT license found in the
1575
- * LICENSE file in the root directory of this source tree.
1576
- */var _C;function MG(){return _C||(_C=1,process.env.NODE_ENV!=="production"&&(function(){function n(){}function e(S){return""+S}function t(S,T,E){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{e(A);var U=!1}catch{U=!0}return U&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object"),e(A)),{$$typeof:y,key:A==null?null:""+A,children:S,containerInfo:T,implementation:E}}function a(S,T){if(S==="font")return"";if(typeof T=="string")return T==="use-credentials"?T:""}function r(S){return S===null?"`null`":S===void 0?"`undefined`":S===""?"an empty string":'something with type "'+typeof S+'"'}function u(S){return S===null?"`null`":S===void 0?"`undefined`":S===""?"an empty string":typeof S=="string"?JSON.stringify(S):typeof S=="number"?"`"+S+"`":'something with type "'+typeof S+'"'}function h(){var S=v.H;return S===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1577
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
1578
- 2. You might be breaking the Rules of Hooks
1579
- 3. You might have more than one copy of React in the same app
1580
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),S}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var f=bc(),m={d:{f:n,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},y=Symbol.for("react.portal"),v=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Bi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=m,Bi.createPortal=function(S,T){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T||T.nodeType!==1&&T.nodeType!==9&&T.nodeType!==11)throw Error("Target container is not a DOM element.");return t(S,T,null,E)},Bi.flushSync=function(S){var T=v.T,E=m.p;try{if(v.T=null,m.p=2,S)return S()}finally{v.T=T,m.p=E,m.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},Bi.preconnect=function(S,T){typeof S=="string"&&S?T!=null&&typeof T!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",u(T)):T!=null&&typeof T.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",r(T.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S)),typeof S=="string"&&(T?(T=T.crossOrigin,T=typeof T=="string"?T==="use-credentials"?T:"":void 0):T=null,m.d.C(S,T))},Bi.prefetchDNS=function(S){if(typeof S!="string"||!S)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S));else if(1<arguments.length){var T=arguments[1];typeof T=="object"&&T.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(T)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(T))}typeof S=="string"&&m.d.D(S)},Bi.preinit=function(S,T){if(typeof S=="string"&&S?T==null||typeof T!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",u(T)):T.as!=="style"&&T.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',u(T.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S)),typeof S=="string"&&T&&typeof T.as=="string"){var E=T.as,A=a(E,T.crossOrigin),U=typeof T.integrity=="string"?T.integrity:void 0,M=typeof T.fetchPriority=="string"?T.fetchPriority:void 0;E==="style"?m.d.S(S,typeof T.precedence=="string"?T.precedence:void 0,{crossOrigin:A,integrity:U,fetchPriority:M}):E==="script"&&m.d.X(S,{crossOrigin:A,integrity:U,fetchPriority:M,nonce:typeof T.nonce=="string"?T.nonce:void 0})}},Bi.preinitModule=function(S,T){var E="";if(typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T!==void 0&&typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":T&&"as"in T&&T.as!=="script"&&(E+=" The `as` option encountered was "+u(T.as)+"."),E)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",E);else switch(E=T&&typeof T.as=="string"?T.as:"script",E){case"script":break;default:E=u(E),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',E,S)}typeof S=="string"&&(typeof T=="object"&&T!==null?(T.as==null||T.as==="script")&&(E=a(T.as,T.crossOrigin),m.d.M(S,{crossOrigin:E,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0})):T==null&&m.d.M(S))},Bi.preload=function(S,T){var E="";if(typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T==null||typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":typeof T.as=="string"&&T.as||(E+=" The `as` option encountered was "+r(T.as)+"."),E&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',E),typeof S=="string"&&typeof T=="object"&&T!==null&&typeof T.as=="string"){E=T.as;var A=a(E,T.crossOrigin);m.d.L(S,E,{crossOrigin:A,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0,type:typeof T.type=="string"?T.type:void 0,fetchPriority:typeof T.fetchPriority=="string"?T.fetchPriority:void 0,referrerPolicy:typeof T.referrerPolicy=="string"?T.referrerPolicy:void 0,imageSrcSet:typeof T.imageSrcSet=="string"?T.imageSrcSet:void 0,imageSizes:typeof T.imageSizes=="string"?T.imageSizes:void 0,media:typeof T.media=="string"?T.media:void 0})}},Bi.preloadModule=function(S,T){var E="";typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T!==void 0&&typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":T&&"as"in T&&typeof T.as!="string"&&(E+=" The `as` option encountered was "+r(T.as)+"."),E&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',E),typeof S=="string"&&(T?(E=a(T.as,T.crossOrigin),m.d.m(S,{as:typeof T.as=="string"&&T.as!=="script"?T.as:void 0,crossOrigin:E,integrity:typeof T.integrity=="string"?T.integrity:void 0})):m.d.m(S))},Bi.requestFormReset=function(S){m.d.r(S)},Bi.unstable_batchedUpdates=function(S,T){return S(T)},Bi.useFormState=function(S,T,E){return h().useFormState(S,T,E)},Bi.useFormStatus=function(){return h().useHostTransitionStatus()},Bi.version="19.2.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Bi}var vC;function DG(){if(vC)return Zy.exports;vC=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}}return process.env.NODE_ENV==="production"?(n(),Zy.exports=AG()):Zy.exports=MG(),Zy.exports}var UG=DG(),bC=/^--/;function BG(n,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!bC.test(n)&&!(qd.hasOwnProperty(n)&&qd[n])?e+"px":(""+e).trim()}var xC={};function OG(n,e){if(!n.nodeType||!n.setAttribute)return!1;const t=n.nodeName==="filter"||n.parentNode&&n.parentNode.nodeName==="filter",{className:a,style:r,children:u,scrollTop:h,scrollLeft:f,viewBox:m,...y}=e,v=Object.values(y),S=Object.keys(y).map(T=>t||n.hasAttribute(T)?T:xC[T]||(xC[T]=T.replace(/([A-Z])/g,E=>"-"+E.toLowerCase())));u!==void 0&&(n.textContent=u);for(const T in r)if(r.hasOwnProperty(T)){const E=BG(T,r[T]);bC.test(T)?n.style.setProperty(T,E):n.style[T]=E}S.forEach((T,E)=>{n.setAttribute(T,v[E])}),a!==void 0&&(n.className=a),h!==void 0&&(n.scrollTop=h),f!==void 0&&(n.scrollLeft=f),m!==void 0&&n.setAttribute("viewBox",m)}var qd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},NG=(n,e)=>n+e.charAt(0).toUpperCase()+e.substring(1),GG=["Webkit","Ms","Moz","O"];qd=Object.keys(qd).reduce((n,e)=>(GG.forEach(t=>n[NG(t,e)]=n[e]),n),qd);var PG=/^(matrix|translate|scale|rotate|skew)/,wG=/^(translate)/,zG=/^(rotate|skew)/,Z0=(n,e)=>ve.num(n)&&n!==0?n+e:n,Wy=(n,e)=>ve.arr(n)?n.every(t=>Wy(t,e)):ve.num(n)?n===e:parseFloat(n)===e,HG=class extends Qy{constructor({x:n,y:e,z:t,...a}){const r=[],u=[];(n||e||t)&&(r.push([n||0,e||0,t||0]),u.push(h=>[`translate3d(${h.map(f=>Z0(f,"px")).join(",")})`,Wy(h,0)])),pr(a,(h,f)=>{if(f==="transform")r.push([h||""]),u.push(m=>[m,m===""]);else if(PG.test(f)){if(delete a[f],ve.und(h))return;const m=wG.test(f)?"px":zG.test(f)?"deg":"";r.push(Ca(h)),u.push(f==="rotate3d"?([y,v,S,T])=>[`rotate3d(${y},${v},${S},${Z0(T,m)})`,Wy(T,0)]:y=>[`${f}(${y.map(v=>Z0(v,m)).join(",")})`,Wy(y,f.startsWith("scale")?1:0)])}}),r.length&&(a.transform=new VG(r,u)),super(a)}},VG=class extends G2{constructor(n,e){super(),this.inputs=n,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let n="",e=!0;return gt(this.inputs,(t,a)=>{const r=ra(t[0]),[u,h]=this.transforms[a](ve.arr(r)?r:t.map(ra));n+=" "+u,e=e&&h}),e?"none":n}observerAdded(n){n==1&&gt(this.inputs,e=>gt(e,t=>Qa(t)&&Lc(t,this)))}observerRemoved(n){n==0&&gt(this.inputs,e=>gt(e,t=>Qa(t)&&Pd(t,this)))}eventObserved(n){n.type=="change"&&(this._value=null),Gd(this,n)}},LG=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Ps.assign({batchedUpdates:UG.unstable_batchedUpdates,createStringInterpolator:H2,colors:RN});var jG=iG(LG,{applyAnimatedValues:OG,createAnimatedStyle:n=>new HG(n),getComponentProps:({scrollTop:n,scrollLeft:e,...t})=>t}),SC=jG.animated;const TC=Ve.createContext({}),YG=({children:n})=>{const{app:e}=v2(),t=Ve.useMemo(()=>{if(!e||!e.renderer)return null;const a=new hu;a.setFillStyle({color:"#1e1524"}),a.rect(0,0,1,1),a.fill();const r=e.renderer.generateTexture(a);return a.destroy(),r},[e==null?void 0:e.renderer]);return t?Ai.jsx(TC.Provider,{value:t,children:n}):null};class XG extends NE{constructor(t,a,r,u,h,f){super({texture:t,x:a,y:r,scaleX:u,scaleY:h,alpha:0});tu(this,"animationProgress",0);tu(this,"delayCounter",0);tu(this,"randomSpeed");tu(this,"randomDelayOffset");tu(this,"startScaleX");tu(this,"startScaleY");this.texture=t,this.x=a,this.y=r,this.scaleX=u,this.scaleY=h,this.curLevel=f,this.startScaleX=u,this.startScaleY=h,this.curLevel=f,this.randomSpeed=.04+Math.random()*.04,this.randomDelayOffset=Math.floor(Math.random()*150)}update(){if(this.delayCounter<this.curLevel*15+this.randomDelayOffset){this.delayCounter++;return}const t=1;this.animationProgress+=(t-this.animationProgress)*this.randomSpeed,this.alpha=this.animationProgress}}class qG{constructor(e,t){tu(this,"cells",[]);this.texture=e,this.particleContainerRefCurrent=t,this.texture=e}add(e,t,a,r,u){const h=new XG(this.texture,e,t,a,r,u);this.particleContainerRefCurrent.addParticle(h),this.cells.push(h)}updateAll(){for(const e of this.cells)e.update()}}const FG=({gridRows:n,gridCols:e,cellWidth:t,cellHeight:a,gridDepth:r})=>{const u=Ve.useContext(TC),h=Ve.useRef(null),f=Ve.useRef(null);Ve.useEffect(()=>{h.current&&(f.current=new qG(u,h.current),m(0,0,t,a,e,n,r,h.current))},[]),_N(()=>{var y;(y=f.current)==null||y.updateAll()});const m=(y,v,S,T,E,A,U,M)=>{var G;for(let P=0;P<A;P++)for(let w=0;w<E;w++){const z=y+w*S,ne=v+P*T;U<=0||Math.random()>.7&&U<r?Math.random()>.1&&((G=f.current)==null||G.add(z,ne,S-1,T-1,U)):m(z,ne,S/E,T/A,E,A,U-1)}};return Ai.jsx("pixiParticleContainer",{ref:h,dynamicProperties:{position:!0,vertex:!0,color:!0}})},kG=({cellWidth:n,cellHeight:e,gridRows:t,gridCols:a,gridDepth:r})=>Ai.jsx(YG,{children:Ai.jsx(FG,{cellWidth:n,cellHeight:e,gridCols:a,gridRows:t,gridDepth:r})}),IG=n=>Ai.jsx("svg",{viewBox:"10 0 489.935 489.935",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...n,children:Ai.jsx("path",{d:`M278.235,33.267c-116.7,0-211.6,95-211.6,211.7v0.7l-41.9-63.1c-4.1-6.2-12.5-7.9-18.7-3.8c-6.2,4.1-7.9,12.5-3.8,18.7 \r
22
+ <%s key={someKey} {...props} />`,k,C,ce,C),Mr[C+k]=!0)}if(C=null,T!==void 0&&(r(T),C=""+T),a(x)&&(r(x.key),C=""+x.key),"key"in x){T={};for(var Et in x)Et!=="key"&&(T[Et]=x[Et])}else T=x;return C&&u(T,typeof o=="function"?o.displayName||o.name||"Unknown":o),l(o,C,T,s(),We,Rt)}function f(o){h(o)?o._store&&(o._store.validated=1):typeof o=="object"&&o!==null&&o.$$typeof===O&&(o._payload.status==="fulfilled"?h(o._payload.value)&&o._payload.value._store&&(o._payload.value._store.validated=1):o._store&&(o._store.validated=1))}function h(o){return typeof o=="object"&&o!==null&&o.$$typeof===b}var p=_,b=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),R=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),$=Symbol.for("react.client.reference"),Y=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=Object.prototype.hasOwnProperty,xt=Array.isArray,At=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(o){return o()}};var $r,Dr={},qr=p.react_stack_bottom_frame.bind(p,i)(),Ur=At(n(i)),Mr={};fe.Fragment=S,fe.jsx=function(o,x,T){var k=1e4>Y.recentlyCreatedOwnerStacks++;return m(o,x,T,!1,k?Error("react-stack-top-frame"):qr,k?At(n(o)):Ur)},fe.jsxs=function(o,x,T){var k=1e4>Y.recentlyCreatedOwnerStacks++;return m(o,x,T,!0,k?Error("react-stack-top-frame"):qr,k?At(n(o)):Ur)}})()),fe}var It;function Hr(){return It||(It=1,process.env.NODE_ENV==="production"?Ie.exports=Wr():Ie.exports=Br()),Ie.exports}var U=Hr(),Be=me(),w=e=>he(e,Be),He=me();w.write=e=>he(e,He);var Oe=me();w.onStart=e=>he(e,Oe);var Xe=me();w.onFrame=e=>he(e,Xe);var Je=me();w.onFinish=e=>he(e,Je);var se=[];w.setTimeout=(e,t)=>{const r=w.now()+t,n=()=>{const i=se.findIndex(a=>a.cancel==n);~i&&se.splice(i,1),J-=~i?1:0},s={time:r,handler:e,cancel:n};return se.splice(Ot(r),0,s),J+=1,jt(),s};var Ot=e=>~(~se.findIndex(t=>t.time>e)||~se.length);w.cancel=e=>{Oe.delete(e),Xe.delete(e),Je.delete(e),Be.delete(e),He.delete(e)},w.sync=e=>{Ke=!0,w.batchedUpdates(e),Ke=!1},w.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...s){t=s,w.onStart(r)}return n.handler=e,n.cancel=()=>{Oe.delete(r),t=null},n};var Ze=typeof window<"u"?window.requestAnimationFrame:(()=>{});w.use=e=>Ze=e,w.now=typeof performance<"u"?()=>performance.now():Date.now,w.batchedUpdates=e=>e(),w.catch=console.error,w.frameLoop="always",w.advance=()=>{w.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Vt()};var X=-1,J=0,Ke=!1;function he(e,t){Ke?(t.delete(e),e(0)):(t.add(e),jt())}function jt(){X<0&&(X=0,w.frameLoop!=="demand"&&Ze(Ft))}function Xr(){X=-1}function Ft(){~X&&(Ze(Ft),w.batchedUpdates(Vt))}function Vt(){const e=X;X=w.now();const t=Ot(X);if(t&&(Nt(se.splice(0,t),r=>r.handler()),J-=t),!J){Xr();return}Oe.flush(),Be.flush(e?Math.min(64,X-e):16.667),Xe.flush(),He.flush(),Je.flush()}function me(){let e=new Set,t=e;return{add(r){J+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return J-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,J-=t.size,Nt(t,n=>n(r)&&e.add(n)),J+=e.size,t=e)}}}function Nt(e,t){e.forEach(r=>{try{t(r)}catch(n){w.catch(n)}})}var Jr=Object.defineProperty,Zr=(e,t)=>{for(var r in t)Jr(e,r,{get:t[r],enumerable:!0})},M={};Zr(M,{assign:()=>en,colors:()=>Z,createStringInterpolator:()=>rt,skipAnimation:()=>Dt,to:()=>$t,willAdvance:()=>nt});function et(){}var Kr=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),c={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function W(e,t){if(c.arr(e)){if(!c.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var A=(e,t)=>e.forEach(t);function G(e,t,r){if(c.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(const n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var N=e=>c.und(e)?[]:c.arr(e)?e:[e];function pe(e,t){if(e.size){const r=Array.from(e);e.clear(),A(r,t)}}var ge=(e,...t)=>pe(e,r=>r(...t)),tt=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),rt,$t,Z=null,Dt=!1,nt=et,en=e=>{e.to&&($t=e.to),e.now&&(w.now=e.now),e.colors!==void 0&&(Z=e.colors),e.skipAnimation!=null&&(Dt=e.skipAnimation),e.createStringInterpolator&&(rt=e.createStringInterpolator),e.requestAnimationFrame&&w.use(e.requestAnimationFrame),e.batchedUpdates&&(w.batchedUpdates=e.batchedUpdates),e.willAdvance&&(nt=e.willAdvance),e.frameLoop&&(w.frameLoop=e.frameLoop)},ve=new Set,D=[],st=[],je=0,Fe={get idle(){return!ve.size&&!D.length},start(e){je>e.priority?(ve.add(e),w.onStart(tn)):(qt(e),w(it))},advance:it,sort(e){if(je)w.onFrame(()=>Fe.sort(e));else{const t=D.indexOf(e);~t&&(D.splice(t,1),Ut(e))}},clear(){D=[],ve.clear()}};function tn(){ve.forEach(qt),ve.clear(),w(it)}function qt(e){D.includes(e)||Ut(e)}function Ut(e){D.splice(rn(D,t=>t.priority>e.priority),0,e)}function it(e){const t=st;for(let r=0;r<D.length;r++){const n=D[r];je=n.priority,n.idle||(nt(n),n.advance(e),n.idle||t.push(n))}return je=0,st=D,st.length=0,D=t,D.length>0}function rn(e,t){const r=e.findIndex(t);return r<0?e.length:r}var nn={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},z="[-+]?\\d*\\.?\\d+",Ve=z+"%";function Ne(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var sn=new RegExp("rgb"+Ne(z,z,z)),an=new RegExp("rgba"+Ne(z,z,z,z)),on=new RegExp("hsl"+Ne(z,Ve,Ve)),un=new RegExp("hsla"+Ne(z,Ve,Ve,z)),ln=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,cn=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,dn=/^#([0-9a-fA-F]{6})$/,fn=/^#([0-9a-fA-F]{8})$/;function hn(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=dn.exec(e))?parseInt(t[1]+"ff",16)>>>0:Z&&Z[e]!==void 0?Z[e]:(t=sn.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|255)>>>0:(t=an.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|Lt(t[4]))>>>0:(t=ln.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=fn.exec(e))?parseInt(t[1],16)>>>0:(t=cn.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=on.exec(e))?(Mt(zt(t[1]),$e(t[2]),$e(t[3]))|255)>>>0:(t=un.exec(e))?(Mt(zt(t[1]),$e(t[2]),$e(t[3]))|Lt(t[4]))>>>0:null}function at(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Mt(e,t,r){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n,i=at(s,n,e+1/3),a=at(s,n,e),u=at(s,n,e-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(u*255)<<8}function ie(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function zt(e){return(parseFloat(e)%360+360)%360/360}function Lt(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function $e(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Gt(e){let t=hn(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,n=(t&16711680)>>>16,s=(t&65280)>>>8,i=(t&255)/255;return`rgba(${r}, ${n}, ${s}, ${i})`}var ye=(e,t,r)=>{if(c.fun(e))return e;if(c.arr(e))return ye({range:e,output:t,extrapolate:r});if(c.str(e.output[0]))return rt(e);const n=e,s=n.output,i=n.range||[0,1],a=n.extrapolateLeft||n.extrapolate||"extend",u=n.extrapolateRight||n.extrapolate||"extend",d=n.easing||(l=>l);return l=>{const m=pn(l,i);return mn(l,i[m],i[m+1],s[m],s[m+1],d,a,u,n.map)}};function mn(e,t,r,n,s,i,a,u,d){let l=d?d(e):e;if(l<t){if(a==="identity")return l;a==="clamp"&&(l=t)}if(l>r){if(u==="identity")return l;u==="clamp"&&(l=r)}return n===s?n:t===r?e<=t?n:s:(t===-1/0?l=-l:r===1/0?l=l-t:l=(l-t)/(r-t),l=i(l),n===-1/0?l=-l:s===1/0?l=l+n:l=l*(s-n)+n,l)}function pn(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var gn={linear:e=>e},_e=Symbol.for("FluidValue.get"),ae=Symbol.for("FluidValue.observers"),q=e=>!!(e&&e[_e]),j=e=>e&&e[_e]?e[_e]():e,Qt=e=>e[ae]||null;function vn(e,t){e.eventObserved?e.eventObserved(t):e(t)}function be(e,t){const r=e[ae];r&&r.forEach(n=>{vn(n,t)})}var Yt=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");yn(this,e)}},yn=(e,t)=>Wt(e,_e,t);function oe(e,t){if(e[_e]){let r=e[ae];r||Wt(e,ae,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function we(e,t){const r=e[ae];if(r&&r.has(t)){const n=r.size-1;n?r.delete(t):e[ae]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Wt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),De=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_n=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Bt=new RegExp(`(${De.source})(%|[a-z]+)`,"i"),bn=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,qe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Ht=e=>{const[t,r]=wn(e);if(!t||tt())return e;const n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(r);return s||e}else{if(r&&qe.test(r))return Ht(r);if(r)return r}return e},wn=e=>{const t=qe.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]},ot,Sn=(e,t,r,n,s)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${s})`,Xt=e=>{ot||(ot=Z?new RegExp(`(${Object.keys(Z).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(i=>j(i).replace(qe,Ht).replace(_n,Gt).replace(ot,Gt)),r=t.map(i=>i.match(De).map(Number)),s=r[0].map((i,a)=>r.map(u=>{if(!(a in u))throw Error('The arity of each "output" value must be equal');return u[a]})).map(i=>ye({...e,output:i}));return i=>{var d;const a=!Bt.test(t[0])&&((d=t.find(l=>Bt.test(l)))==null?void 0:d.replace(De,""));let u=0;return t[0].replace(De,()=>`${s[u++](i)}${a||""}`).replace(bn,Sn)}},ut="react-spring: ",Jt=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${ut}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Pn=Jt(console.warn);function xn(){Pn(`${ut}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var An=Jt(console.warn);function Rn(){An(`${ut}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Ue(e){return c.str(e)&&(e[0]=="#"||/\d/.test(e)||!tt()&&qe.test(e)||e in(Z||{}))}var lt=tt()?_.useEffect:_.useLayoutEffect,En=()=>{const e=_.useRef(!1);return lt(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Zt(){const e=_.useState()[1],t=En();return()=>{t.current&&e(Math.random())}}var Kt=e=>_.useEffect(e,Tn),Tn=[];function er(e){const t=_.useRef(void 0);return _.useEffect(()=>{t.current=e}),t.current}var Se=Symbol.for("Animated:node"),kn=e=>!!e&&e[Se]===e,Q=e=>e&&e[Se],ct=(e,t)=>Kr(e,Se,t),Me=e=>e&&e[Se]&&e[Se].getPayload(),tr=class{constructor(){ct(this,this)}getPayload(){return this.payload||[]}},ze=class zr extends tr{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,c.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new zr(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,r){return c.num(t)&&(this.lastPosition=t,r&&(t=Math.round(t/r)*r,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,c.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Le=class Lr extends ze{constructor(t){super(0),this._string=null,this._toString=ye({output:[t,t]})}static create(t){return new Lr(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(c.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=ye({output:[this.getValue(),t]})),this._value=0,super.reset()}},Ge={dependencies:null},Qe=class extends tr{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return G(this.source,(r,n)=>{kn(r)?t[n]=r.getValue(e):q(r)?t[n]=j(r):e||(t[n]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&A(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return G(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ge.dependencies&&q(e)&&Ge.dependencies.add(e);const t=Me(e);t&&A(t,r=>this.add(r))}},Cn=class Gr extends Qe{constructor(t){super(t)}static create(t){return new Gr(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const r=this.getPayload();return t.length==r.length?r.map((n,s)=>n.setValue(t[s])).some(Boolean):(super.setValue(t.map(In)),!0)}};function In(e){return(Ue(e)?Le:ze).create(e)}function dt(e){const t=Q(e);return t?t.constructor:c.arr(e)?Cn:Ue(e)?Le:ze}var rr=(e,t)=>{const r=!c.fun(e)||e.prototype&&e.prototype.isReactComponent;return _.forwardRef((n,s)=>{const i=_.useRef(null),a=r&&_.useCallback(b=>{i.current=Fn(s,b)},[s]),[u,d]=jn(n,t),l=Zt(),m=()=>{const b=i.current;if(r&&!b)return;(b?t.applyAnimatedValues(b,u.getValue(!0)):!1)===!1&&l()},f=new On(m,d),h=_.useRef(void 0);lt(()=>(h.current=f,A(d,b=>oe(b,f)),()=>{h.current&&(A(h.current.deps,b=>we(b,h.current)),w.cancel(h.current.update))})),_.useEffect(m,[]),Kt(()=>()=>{const b=h.current;A(b.deps,v=>we(v,b))});const p=t.getComponentProps(u.getValue());return Tt.createElement(e,{...p,ref:a})})},On=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&w.write(this.update)}};function jn(e,t){const r=new Set;return Ge.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Qe(e),Ge.dependencies=null,[e,r]}function Fn(e,t){return e&&(c.fun(e)?e(t):e.current=t),t}var nr=Symbol.for("AnimatedComponent"),Vn=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=s=>new Qe(s),getComponentProps:n=s=>s}={})=>{const s={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=a=>{const u=sr(a)||"Anonymous";return c.str(a)?a=i[a]||(i[a]=rr(a,s)):a=a[nr]||(a[nr]=rr(a,s)),a.displayName=`Animated(${u})`,a};return G(e,(a,u)=>{c.arr(e)&&(u=sr(a)),i[u]=i(a)}),{animated:i}},sr=e=>c.str(e)?e:e&&c.str(e.displayName)?e.displayName:c.fun(e)&&e.name||null;function te(e,...t){return c.fun(e)?e(...t):e}var Pe=(e,t)=>e===!0||!!(t&&e&&(c.fun(e)?e(t):N(e).includes(t))),ir=(e,t)=>c.obj(e)?t&&e[t]:e,ar=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Nn=e=>e,ft=(e,t=Nn)=>{let r=$n;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const n={};for(const s of r){const i=t(e[s],s);c.und(i)||(n[s]=i)}return n},$n=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Dn={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function qn(e){const t={};let r=0;if(G(e,(n,s)=>{Dn[s]||(t[s]=n,r++)}),r)return t}function or(e){const t=qn(e);if(t){const r={to:t};return G(e,(n,s)=>s in t||(r[s]=n)),r}return{...e}}function xe(e){return e=j(e),c.arr(e)?e.map(xe):Ue(e)?M.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Un(e){for(const t in e)return!0;return!1}function ht(e){return c.fun(e)||c.arr(e)&&c.obj(e[0])}function Mn(e,t){var r;(r=e.ref)==null||r.delete(e),t==null||t.delete(e)}function zn(e,t){var r;t&&e.ref!==t&&((r=e.ref)==null||r.delete(e),t.add(e),e.ref=t)}var Ln={default:{tension:170,friction:26}},mt={...Ln.default,mass:1,damping:1,easing:gn.linear,clamp:!1},Gn=class{constructor(){this.velocity=0,Object.assign(this,mt)}};function Qn(e,t,r){r&&(r={...r},ur(r,t),t={...r,...t}),ur(e,t),Object.assign(e,t);for(const a in mt)e[a]==null&&(e[a]=mt[a]);let{frequency:n,damping:s}=e;const{mass:i}=e;return c.und(n)||(n<.01&&(n=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/n,2)*i,e.friction=4*Math.PI*s*i/n),e}function ur(e,t){if(!c.und(t.decay))e.duration=void 0;else{const r=!c.und(t.tension)||!c.und(t.friction);(r||!c.und(t.frequency)||!c.und(t.damping)||!c.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var lr=[],Yn=class{constructor(){this.changed=!1,this.values=lr,this.toValues=null,this.fromValues=lr,this.config=new Gn,this.immediate=!1}};function cr(e,{key:t,props:r,defaultProps:n,state:s,actions:i}){return new Promise((a,u)=>{let d,l,m=Pe(r.cancel??(n==null?void 0:n.cancel),t);if(m)p();else{c.und(r.pause)||(s.paused=Pe(r.pause,t));let b=n==null?void 0:n.pause;b!==!0&&(b=s.paused||Pe(b,t)),d=te(r.delay||0,t),b?(s.resumeQueue.add(h),i.pause()):(i.resume(),h())}function f(){s.resumeQueue.add(h),s.timeouts.delete(l),l.cancel(),d=l.time-w.now()}function h(){d>0&&!M.skipAnimation?(s.delayed=!0,l=w.setTimeout(p,d),s.pauseQueue.add(f),s.timeouts.add(l)):p()}function p(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(f),s.timeouts.delete(l),e<=(s.cancelId||0)&&(m=!0);try{i.start({...r,callId:e,cancel:m},a)}catch(b){u(b)}}})}var pt=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?ue(e.get()):t.every(r=>r.noop)?dr(e.get()):L(e.get(),t.every(r=>r.finished)),dr=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),L=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),ue=e=>({value:e,cancelled:!0,finished:!1});function fr(e,t,r,n){const{callId:s,parentId:i,onRest:a}=t,{asyncTo:u,promise:d}=r;return!i&&e===u&&!t.reset?d:r.promise=(async()=>{r.asyncId=s,r.asyncTo=e;const l=ft(t,(S,g)=>g==="onRest"?void 0:S);let m,f;const h=new Promise((S,g)=>(m=S,f=g)),p=S=>{const g=s<=(r.cancelId||0)&&ue(n)||s!==r.asyncId&&L(n,!1);if(g)throw S.result=g,f(S),S},b=(S,g)=>{const P=new hr,y=new mr;return(async()=>{if(M.skipAnimation)throw Ae(r),y.result=L(n,!1),f(y),y;p(P);const R=c.obj(S)?{...S}:{...g,to:S};R.parentId=s,G(l,(B,F)=>{c.und(R[F])&&(R[F]=B)});const E=await n.start(R);return p(P),r.paused&&await new Promise(B=>{r.resumeQueue.add(B)}),E})()};let v;if(M.skipAnimation)return Ae(r),L(n,!1);try{let S;c.arr(e)?S=(async g=>{for(const P of g)await b(P)})(e):S=Promise.resolve(e(b,n.stop.bind(n))),await Promise.all([S.then(m),h]),v=L(n.get(),!0,!1)}catch(S){if(S instanceof hr)v=S.result;else if(S instanceof mr)v=S.result;else throw S}finally{s==r.asyncId&&(r.asyncId=i,r.asyncTo=i?u:void 0,r.promise=i?d:void 0)}return c.fun(a)&&w.batchedUpdates(()=>{a(v,n,n.item)}),v})()}function Ae(e,t){pe(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var hr=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},mr=class extends Error{constructor(){super("SkipAnimationSignal")}},gt=e=>e instanceof vt,Wn=1,vt=class extends Yt{constructor(){super(...arguments),this.id=Wn++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Q(this);return e&&e.getValue()}to(...e){return M.to(this,e)}interpolate(...e){return xn(),M.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){be(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Fe.sort(this),be(this,{type:"priority",parent:this,priority:e})}},re=Symbol.for("SpringPhase"),pr=1,yt=2,_t=4,bt=e=>(e[re]&pr)>0,K=e=>(e[re]&yt)>0,Re=e=>(e[re]&_t)>0,gr=(e,t)=>t?e[re]|=yt|pr:e[re]&=~yt,vr=(e,t)=>t?e[re]|=_t:e[re]&=~_t,Bn=class extends vt{constructor(e,t){if(super(),this.animation=new Yn,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!c.und(e)||!c.und(t)){const r=c.obj(e)?{...e}:{...t,from:e};c.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(K(this)||this._state.asyncTo)||Re(this)}get goal(){return j(this.animation.to)}get velocity(){const e=Q(this);return e instanceof ze?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return bt(this)}get isAnimating(){return K(this)}get isPaused(){return Re(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const n=this.animation;let{toValues:s}=n;const{config:i}=n,a=Me(n.to);!a&&q(n.to)&&(s=N(j(n.to))),n.values.forEach((l,m)=>{if(l.done)return;const f=l.constructor==Le?1:a?a[m].lastPosition:s[m];let h=n.immediate,p=f;if(!h){if(p=l.lastPosition,i.tension<=0){l.done=!0;return}let b=l.elapsedTime+=e;const v=n.fromValues[m],S=l.v0!=null?l.v0:l.v0=c.arr(i.velocity)?i.velocity[m]:i.velocity;let g;const P=i.precision||(v==f?.005:Math.min(1,Math.abs(f-v)*.001));if(c.und(i.duration))if(i.decay){const y=i.decay===!0?.998:i.decay,R=Math.exp(-(1-y)*b);p=v+S/(1-y)*(1-R),h=Math.abs(l.lastPosition-p)<=P,g=S*R}else{g=l.lastVelocity==null?S:l.lastVelocity;const y=i.restVelocity||P/10,R=i.clamp?0:i.bounce,E=!c.und(R),B=v==f?l.v0>0:v<f;let F,le=!1;const O=1,ne=Math.ceil(e/O);for(let $=0;$<ne&&(F=Math.abs(g)>y,!(!F&&(h=Math.abs(f-p)<=P,h)));++$){E&&(le=p==f||p>f==B,le&&(g=-g*R,p=f));const Y=-i.tension*1e-6*(p-f),H=-i.friction*.001*g,xt=(Y+H)/i.mass;g=g+xt*O,p=p+g*O}}else{let y=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,l.durationProgress>0&&(l.elapsedTime=i.duration*l.durationProgress,b=l.elapsedTime+=e)),y=(i.progress||0)+b/this._memoizedDuration,y=y>1?1:y<0?0:y,l.durationProgress=y),p=v+i.easing(y)*(f-v),g=(p-l.lastPosition)/e,h=y==1}l.lastVelocity=g,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),h=!0)}a&&!a[m].done&&(h=!1),h?l.done=!0:t=!1,l.setValue(p,i.round)&&(r=!0)});const u=Q(this),d=u.getValue();if(t){const l=j(n.to);(d!==l||r)&&!i.decay?(u.setValue(l),this._onChange(l)):r&&i.decay&&this._onChange(d),this._stop()}else r&&this._onChange(d)}set(e){return w.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(K(this)){const{to:e,config:t}=this.animation;w.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return c.und(e)?(r=this.queue||[],this.queue=[]):r=[c.obj(e)?e:{...t,to:e}],Promise.all(r.map(n=>this._update(n))).then(n=>pt(this,n))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ae(this._state,e&&this._lastCallId),w.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:n}=e;r=c.obj(r)?r[t]:r,(r==null||ht(r))&&(r=void 0),n=c.obj(n)?n[t]:n,n==null&&(n=void 0);const s={to:r,from:n};return bt(this)||(e.reverse&&([r,n]=[n,r]),n=j(n),c.und(n)?Q(this)||this._set(r):this._set(n)),s}_update({...e},t){const{key:r,defaultProps:n}=this;e.default&&Object.assign(n,ft(e,(a,u)=>/^on/.test(u)?ir(a,r):a)),br(this,e,"onProps"),ke(this,"onProps",e,this);const s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return cr(++this._lastCallId,{key:r,props:e,defaultProps:n,state:i,actions:{pause:()=>{Re(this)||(vr(this,!0),ge(i.pauseQueue),ke(this,"onPause",L(this,Ee(this,this.animation.to)),this))},resume:()=>{Re(this)&&(vr(this,!1),K(this)&&this._resume(),ge(i.resumeQueue),ke(this,"onResume",L(this,Ee(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const u=yr(e);if(u)return this._update(u,!0)}return a})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(ue(this));const n=!c.und(e.to),s=!c.und(e.from);if(n||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(ue(this));const{key:i,defaultProps:a,animation:u}=this,{to:d,from:l}=u;let{to:m=d,from:f=l}=e;s&&!n&&(!t.default||c.und(m))&&(m=f),t.reverse&&([m,f]=[f,m]);const h=!W(f,l);h&&(u.from=f),f=j(f);const p=!W(m,d);p&&this._focus(m);const b=ht(t.to),{config:v}=u,{decay:S,velocity:g}=v;(n||s)&&(v.velocity=0),t.config&&!b&&Qn(v,te(t.config,i),t.config!==a.config?te(a.config,i):void 0);let P=Q(this);if(!P||c.und(m))return r(L(this,!0));const y=c.und(t.reset)?s&&!t.default:!c.und(f)&&Pe(t.reset,i),R=y?f:this.get(),E=xe(m),B=c.num(E)||c.arr(E)||Ue(E),F=!b&&(!B||Pe(a.immediate||t.immediate,i));if(p){const $=dt(m);if($!==P.constructor)if(F)P=this._set(E);else throw Error(`Cannot animate between ${P.constructor.name} and ${$.name}, as the "to" prop suggests`)}const le=P.constructor;let O=q(m),ne=!1;if(!O){const $=y||!bt(this)&&h;(p||$)&&(ne=W(xe(R),E),O=!ne),(!W(u.immediate,F)&&!F||!W(v.decay,S)||!W(v.velocity,g))&&(O=!0)}if(ne&&K(this)&&(u.changed&&!y?O=!0:O||this._stop(d)),!b&&((O||q(d))&&(u.values=P.getPayload(),u.toValues=q(m)?null:le==Le?[1]:N(E)),u.immediate!=F&&(u.immediate=F,!F&&!y&&this._set(d)),O)){const{onRest:$}=u;A(Xn,H=>br(this,t,H));const Y=L(this,Ee(this,d));ge(this._pendingCalls,Y),this._pendingCalls.add(r),u.changed&&w.batchedUpdates(()=>{var H;u.changed=!y,$==null||$(Y,this),y?te(a.onRest,Y):(H=u.onStart)==null||H.call(u,Y,this)})}y&&this._set(R),b?r(fr(t.to,t,this._state,this)):O?this._start():K(this)&&!p?this._pendingCalls.add(r):r(dr(R))}_focus(e){const t=this.animation;e!==t.to&&(Qt(this)&&this._detach(),t.to=e,Qt(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;q(t)&&(oe(t,this),gt(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;q(e)&&we(e,this)}_set(e,t=!0){const r=j(e);if(!c.und(r)){const n=Q(this);if(!n||!W(r,n.getValue())){const s=dt(r);!n||n.constructor!=s?ct(this,s.create(r)):n.setValue(r),n&&w.batchedUpdates(()=>{this._onChange(r,t)})}}return Q(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,ke(this,"onStart",L(this,Ee(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),te(this.animation.onChange,e,this)),te(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Q(this).reset(j(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),K(this)||(gr(this,!0),Re(this)||this._resume())}_resume(){M.skipAnimation?this.finish():Fe.start(this)}_stop(e,t){if(K(this)){gr(this,!1);const r=this.animation;A(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),be(this,{type:"idle",parent:this});const n=t?ue(this.get()):L(this.get(),Ee(this,e??r.to));ge(this._pendingCalls,n),r.changed&&(r.changed=!1,ke(this,"onRest",n,this))}}};function Ee(e,t){const r=xe(t),n=xe(e.get());return W(n,r)}function yr(e,t=e.loop,r=e.to){const n=te(t);if(n){const s=n!==!0&&or(n),i=(s||e).reverse,a=!s||s.reset;return Te({...e,loop:t,default:!1,pause:void 0,to:!i||ht(r)?r:void 0,from:a?e.from:void 0,reset:a,...s})}}function Te(e){const{to:t,from:r}=e=or(e),n=new Set;return c.obj(t)&&_r(t,n),c.obj(r)&&_r(r,n),e.keys=n.size?Array.from(n):null,e}function Hn(e){const t=Te(e);return c.und(t.default)&&(t.default=ft(t)),t}function _r(e,t){G(e,(r,n)=>r!=null&&t.add(n))}var Xn=["onStart","onRest","onChange","onPause","onResume"];function br(e,t,r){e.animation[r]=t[r]!==ar(t,r)?ir(t[r],e.key):void 0}function ke(e,t,...r){var n,s,i,a;(s=(n=e.animation)[t])==null||s.call(n,...r),(a=(i=e.defaultProps)[t])==null||a.call(i,...r)}var Jn=["onStart","onChange","onRest"],Zn=1,Kn=class{constructor(e,t){this.id=Zn++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(const t in e){const r=e[t];c.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(Te(e)),this}start(e){let{queue:t}=this;return e?t=N(e).map(Te):this.queue=[],this._flush?this._flush(this,t):(Rr(this,t),wt(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const r=this.springs;A(N(t),n=>r[n].stop(!!e))}else Ae(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(c.und(e))this.start({pause:!0});else{const t=this.springs;A(N(e),r=>t[r].pause())}return this}resume(e){if(c.und(e))this.start({pause:!1});else{const t=this.springs;A(N(e),r=>t[r].resume())}return this}each(e){G(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,s=this._changed.size>0;(n&&!this._started||s&&!this._started)&&(this._started=!0,pe(e,([u,d])=>{d.value=this.get(),u(d,this,this._item)}));const i=!n&&this._started,a=s||i&&r.size?this.get():null;s&&t.size&&pe(t,([u,d])=>{d.value=a,u(d,this,this._item)}),i&&(this._started=!1,pe(r,([u,d])=>{d.value=a,u(d,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;w.onFrame(this._onFrame)}};function wt(e,t){return Promise.all(t.map(r=>wr(e,r))).then(r=>pt(e,r))}async function wr(e,t,r){const{keys:n,to:s,from:i,loop:a,onRest:u,onResolve:d}=t,l=c.obj(t.default)&&t.default;a&&(t.loop=!1),s===!1&&(t.to=null),i===!1&&(t.from=null);const m=c.arr(s)||c.fun(s)?s:void 0;m?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):A(Jn,v=>{const S=t[v];if(c.fun(S)){const g=e._events[v];t[v]=({finished:P,cancelled:y})=>{const R=g.get(S);R?(P||(R.finished=!1),y&&(R.cancelled=!0)):g.set(S,{value:null,finished:P||!1,cancelled:y||!1})},l&&(l[v]=t[v])}});const f=e._state;t.pause===!f.paused?(f.paused=t.pause,ge(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);const h=(n||Object.keys(e.springs)).map(v=>e.springs[v].start(t)),p=t.cancel===!0||ar(t,"cancel")===!0;(m||p&&f.asyncId)&&h.push(cr(++e._lastAsyncId,{props:t,state:f,actions:{pause:et,resume:et,start(v,S){p?(Ae(f,e._lastAsyncId),S(ue(e))):(v.onRest=u,S(fr(m,v,f,e)))}}})),f.paused&&await new Promise(v=>{f.resumeQueue.add(v)});const b=pt(e,await Promise.all(h));if(a&&b.finished&&!(r&&b.noop)){const v=yr(t,a,s);if(v)return Rr(e,[v]),wr(e,v,!0)}return d&&w.batchedUpdates(()=>d(b,e,e.item)),b}function Sr(e,t){const r={...e.springs};return t&&A(N(t),n=>{c.und(n.keys)&&(n=Te(n)),c.obj(n.to)||(n={...n,to:void 0}),Ar(r,n,s=>xr(s))}),Pr(e,r),r}function Pr(e,t){G(t,(r,n)=>{e.springs[n]||(e.springs[n]=r,oe(r,e))})}function xr(e,t){const r=new Bn;return r.key=e,t&&oe(r,t),r}function Ar(e,t,r){t.keys&&A(t.keys,n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)})}function Rr(e,t){A(t,r=>{Ar(e.springs,r,n=>xr(n,e))})}var es=Tt.createContext({pause:!1,immediate:!1}),ts=()=>{const e=[],t=function(n){Rn();const s=[];return A(e,(i,a)=>{if(c.und(n))s.push(i.start());else{const u=r(n,i,a);u&&s.push(i.start(u))}}),s};t.current=e,t.add=function(n){e.includes(n)||e.push(n)},t.delete=function(n){const s=e.indexOf(n);~s&&e.splice(s,1)},t.pause=function(){return A(e,n=>n.pause(...arguments)),this},t.resume=function(){return A(e,n=>n.resume(...arguments)),this},t.set=function(n){A(e,(s,i)=>{const a=c.fun(n)?n(i,s):n;a&&s.set(a)})},t.start=function(n){const s=[];return A(e,(i,a)=>{if(c.und(n))s.push(i.start());else{const u=this._getProps(n,i,a);u&&s.push(i.start(u))}}),s},t.stop=function(){return A(e,n=>n.stop(...arguments)),this},t.update=function(n){return A(e,(s,i)=>s.update(this._getProps(n,s,i))),this};const r=function(n,s,i){return c.fun(n)?n(i,s):n};return t._getProps=r,t};function rs(e,t,r){const n=c.fun(t)&&t;n&&!r&&(r=[]);const s=_.useMemo(()=>n||arguments.length==3?ts():void 0,[]),i=_.useRef(0),a=Zt(),u=_.useMemo(()=>({ctrls:[],queue:[],flush(g,P){const y=Sr(g,P);return i.current>0&&!u.queue.length&&!Object.keys(y).some(E=>!g.springs[E])?wt(g,P):new Promise(E=>{Pr(g,y),u.queue.push(()=>{E(wt(g,P))}),a()})}}),[]),d=_.useRef([...u.ctrls]),l=_.useRef([]),m=er(e)||0;_.useMemo(()=>{A(d.current.slice(e,m),g=>{Mn(g,s),g.stop(!0)}),d.current.length=e,f(m,e)},[e]),_.useMemo(()=>{f(0,Math.min(m,e))},r);function f(g,P){for(let y=g;y<P;y++){const R=d.current[y]||(d.current[y]=new Kn(null,u.flush)),E=n?n(y,R):t[y];E&&(l.current[y]=Hn(E))}}const h=d.current.map((g,P)=>Sr(g,l.current[P])),p=_.useContext(es),b=er(p),v=p!==b&&Un(p);lt(()=>{i.current++,u.ctrls=d.current;const{queue:g}=u;g.length&&(u.queue=[],A(g,P=>P())),A(d.current,(P,y)=>{s==null||s.add(P),v&&P.start({default:p});const R=l.current[y];R&&(zn(P,R.ref),P.ref?P.queue.push(R):P.start(R))})}),Kt(()=>()=>{A(u.ctrls,g=>g.stop(!0))});const S=h.map(g=>({...g}));return s?[S,s]:S}function Er(e,t){const r=c.fun(e),[[n],s]=rs(1,r?e:[e],r?[]:t);return r||arguments.length==2?[n,s]:n}var ns=class extends vt{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=ye(...t);const r=this._get(),n=dt(r);ct(this,n.create(r))}advance(e){const t=this._get(),r=this.get();W(t,r)||(Q(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Tr(this._active)&&St(this)}_get(){const e=c.arr(this.source)?this.source.map(j):N(j(this.source));return this.calc(...e)}_start(){this.idle&&!Tr(this._active)&&(this.idle=!1,A(Me(this),e=>{e.done=!1}),M.skipAnimation?(w.batchedUpdates(()=>this.advance()),St(this)):Fe.start(this))}_attach(){let e=1;A(N(this.source),t=>{q(t)&&oe(t,this),gt(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){A(N(this.source),e=>{q(e)&&we(e,this)}),this._active.clear(),St(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=N(this.source).reduce((t,r)=>Math.max(t,(gt(r)?r.priority:0)+1),0))}};function ss(e){return e.idle!==!1}function Tr(e){return!e.size||Array.from(e).every(ss)}function St(e){e.idle||(e.idle=!0,A(Me(e),t=>{t.done=!0}),be(e,{type:"idle",parent:e}))}M.assign({createStringInterpolator:Xt,to:(e,t)=>new ns(e,t)});var kr=/^--/;function is(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!kr.test(e)&&!(Ce.hasOwnProperty(e)&&Ce[e])?t+"px":(""+t).trim()}var Cr={};function as(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:n,style:s,children:i,scrollTop:a,scrollLeft:u,viewBox:d,...l}=t,m=Object.values(l),f=Object.keys(l).map(h=>r||e.hasAttribute(h)?h:Cr[h]||(Cr[h]=h.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));i!==void 0&&(e.textContent=i);for(const h in s)if(s.hasOwnProperty(h)){const p=is(h,s[h]);kr.test(h)?e.style.setProperty(h,p):e.style[h]=p}f.forEach((h,p)=>{e.setAttribute(h,m[p])}),n!==void 0&&(e.className=n),a!==void 0&&(e.scrollTop=a),u!==void 0&&(e.scrollLeft=u),d!==void 0&&e.setAttribute("viewBox",d)}var Ce={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},os=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),us=["Webkit","Ms","Moz","O"];Ce=Object.keys(Ce).reduce((e,t)=>(us.forEach(r=>e[os(r,t)]=e[t]),e),Ce);var ls=/^(matrix|translate|scale|rotate|skew)/,cs=/^(translate)/,ds=/^(rotate|skew)/,Pt=(e,t)=>c.num(e)&&e!==0?e+t:e,Ye=(e,t)=>c.arr(e)?e.every(r=>Ye(r,t)):c.num(e)?e===t:parseFloat(e)===t,fs=class extends Qe{constructor({x:e,y:t,z:r,...n}){const s=[],i=[];(e||t||r)&&(s.push([e||0,t||0,r||0]),i.push(a=>[`translate3d(${a.map(u=>Pt(u,"px")).join(",")})`,Ye(a,0)])),G(n,(a,u)=>{if(u==="transform")s.push([a||""]),i.push(d=>[d,d===""]);else if(ls.test(u)){if(delete n[u],c.und(a))return;const d=cs.test(u)?"px":ds.test(u)?"deg":"";s.push(N(a)),i.push(u==="rotate3d"?([l,m,f,h])=>[`rotate3d(${l},${m},${f},${Pt(h,d)})`,Ye(h,0)]:l=>[`${u}(${l.map(m=>Pt(m,d)).join(",")})`,Ye(l,u.startsWith("scale")?1:0)])}}),s.length&&(n.transform=new hs(s,i)),super(n)}},hs=class extends Yt{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return A(this.inputs,(r,n)=>{const s=j(r[0]),[i,a]=this.transforms[n](c.arr(s)?s:r.map(j));e+=" "+i,t=t&&a}),t?"none":e}observerAdded(e){e==1&&A(this.inputs,t=>A(t,r=>q(r)&&oe(r,this)))}observerRemoved(e){e==0&&A(this.inputs,t=>A(t,r=>q(r)&&we(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),be(this,e)}},ms=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];M.assign({batchedUpdates:Qr.unstable_batchedUpdates,createStringInterpolator:Xt,colors:nn});var ps=Vn(ms,{applyAnimatedValues:as,createAnimatedStyle:e=>new fs(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r}),Ir=ps.animated;const Or=_.createContext({}),gs=({children:e})=>{const{app:t}=I.useApplication(),r=_.useMemo(()=>{if(!t||!t.renderer)return null;const n=new V.Graphics;n.setFillStyle({color:"#1e1524"}),n.rect(0,0,1,1),n.fill();const s=t.renderer.generateTexture(n);return n.destroy(),s},[t==null?void 0:t.renderer]);return r?U.jsx(Or.Provider,{value:r,children:e}):null};class vs extends V.Particle{constructor(r,n,s,i,a,u){super({texture:r,x:n,y:s,scaleX:i,scaleY:a,alpha:0});ee(this,"animationProgress",0);ee(this,"delayCounter",0);ee(this,"randomSpeed");ee(this,"randomDelayOffset");ee(this,"startScaleX");ee(this,"startScaleY");this.texture=r,this.x=n,this.y=s,this.scaleX=i,this.scaleY=a,this.curLevel=u,this.startScaleX=i,this.startScaleY=a,this.curLevel=u,this.randomSpeed=.04+Math.random()*.04,this.randomDelayOffset=Math.floor(Math.random()*150)}update(){if(this.delayCounter<this.curLevel*15+this.randomDelayOffset){this.delayCounter++;return}const r=1;this.animationProgress+=(r-this.animationProgress)*this.randomSpeed,this.alpha=this.animationProgress}}class ys{constructor(t,r){ee(this,"cells",[]);this.texture=t,this.particleContainerRefCurrent=r,this.texture=t}add(t,r,n,s,i){const a=new vs(this.texture,t,r,n,s,i);this.particleContainerRefCurrent.addParticle(a),this.cells.push(a)}updateAll(){for(const t of this.cells)t.update()}}const _s=({gridRows:e,gridCols:t,cellWidth:r,cellHeight:n,gridDepth:s})=>{const i=_.useContext(Or),a=_.useRef(null),u=_.useRef(null);_.useEffect(()=>{a.current&&(u.current=new ys(i,a.current),d(0,0,r,n,t,e,s,a.current))},[]),I.useTick(()=>{var l;(l=u.current)==null||l.updateAll()});const d=(l,m,f,h,p,b,v,S)=>{var g;for(let P=0;P<b;P++)for(let y=0;y<p;y++){const R=l+y*f,E=m+P*h;v<=0||Math.random()>.7&&v<s?Math.random()>.1&&((g=u.current)==null||g.add(R,E,f-1,h-1,v)):d(R,E,f/p,h/b,p,b,v-1)}};return U.jsx("pixiParticleContainer",{ref:a,dynamicProperties:{position:!0,vertex:!0,color:!0}})},bs=({cellWidth:e,cellHeight:t,gridRows:r,gridCols:n,gridDepth:s})=>U.jsx(gs,{children:U.jsx(_s,{cellWidth:e,cellHeight:t,gridCols:n,gridRows:r,gridDepth:s})}),ws=e=>U.jsx("svg",{viewBox:"10 0 489.935 489.935",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:U.jsx("path",{d:`M278.235,33.267c-116.7,0-211.6,95-211.6,211.7v0.7l-41.9-63.1c-4.1-6.2-12.5-7.9-18.7-3.8c-6.2,4.1-7.9,12.5-3.8,18.7 \r
1581
23
  l60.8,91.5c2.2,3.3,5.7,5.4,9.6,5.9c0.6,0.1,1.1,0.1,1.7,0.1c3.3,0,6.5-1.2,9-3.5l84.5-76.1c5.5-5,6-13.5,1-19.1 \r
1582
24
  c-5-5.5-13.5-6-19.1-1l-56.1,50.7v-1c0-101.9,82.8-184.7,184.6-184.7s184.7,82.8,184.7,184.7s-82.8,184.7-184.6,184.7 \r
1583
25
  c-49.3,0-95.7-19.2-130.5-54.1c-5.3-5.3-13.8-5.3-19.1,0c-5.3,5.3-5.3,13.8,0,19.1c40,40,93.1,62,149.6,62 \r
1584
- c116.6,0,211.6-94.9,211.6-211.7S394.935,33.267,278.235,33.267z`})});gN({ParticleContainer:AB,Particle:NE,Texture:He,Container:zn,Sprite:ru,Graphics:hu});const EC=2,CC=2,RC=225,AC=225,KG=5,QG=()=>{const[n,e]=Ve.useState(!1),[t,a]=Ve.useState(0),[r,u]=Ve.useState(0),h=mC({from:{rotate:0},to:{rotate:r*-360},config:{duration:500,easing:S=>1-Math.pow(1-S,3)}}),f=mC({opacity:n?1:0,scale:n?1:.5,config:{tension:150,friction:14}}),m=SC(IG),y=SC("button"),v=()=>{a(S=>S+1),u(S=>S+1)};return Ai.jsxs("div",{className:"flex flex-col items-center justify-center h-screen w-screen",children:[Ai.jsx(yN,{antialias:!1,width:RC*EC,height:AC*CC,className:"transition-all image-pixelated md:w-full max-w-max w-72 mb-8",backgroundAlpha:0,onInit:()=>e(!0),children:Ai.jsx(kG,{gridCols:EC,gridRows:CC,cellWidth:RC,cellHeight:AC,gridDepth:KG},t)}),n&&Ai.jsx(y,{style:f,className:"p-4",onClick:v,children:Ai.jsx(m,{width:36,height:36,className:"hover:opacity-100 opacity-25",style:{rotate:h.rotate.to(S=>`${S}deg`)}})})]})};Ie.add(NM),Ie.mixin(zn,GM),Ie.add(FS),Ie.add(kS),Ie.add(L1),Ie.mixin(zn,_U),Ie.add(V1),Ie.add(SE),Ie.add(Mv),Ie.add(CE),Ie.add(UE),Ie.add(BE),Ie.add(FE),Ie.add(qE),Ie.add(VE),Ie.add(XE),Ie.add(jE),Ie.add(HE),Ie.add(zE),Ie.add(q1),Ie.add(Y1);const ZG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),WG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));return QG}));
26
+ c116.6,0,211.6-94.9,211.6-211.7S394.935,33.267,278.235,33.267z`})});I.extend({ParticleContainer:V.ParticleContainer,Particle:V.Particle,Texture:V.Texture,Container:V.Container,Sprite:V.Sprite,Graphics:V.Graphics});const jr=2,Fr=2,Vr=225,Nr=225,Ss=5;return()=>{const[e,t]=_.useState(!1),[r,n]=_.useState(0),[s,i]=_.useState(0),a=Er({from:{rotate:0},to:{rotate:s*-360},config:{duration:500,easing:f=>1-Math.pow(1-f,3)}}),u=Er({opacity:e?1:0,scale:e?1:.5,config:{tension:150,friction:14}}),d=Ir(ws),l=Ir("button"),m=()=>{n(f=>f+1),i(f=>f+1)};return U.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full",children:[U.jsx(I.Application,{antialias:!1,width:Vr*jr,height:Nr*Fr,className:"transition-all image-pixelated md:w-full max-w-max w-72 mb-8",backgroundAlpha:0,onInit:()=>t(!0),children:U.jsx(bs,{gridCols:jr,gridRows:Fr,cellWidth:Vr,cellHeight:Nr,gridDepth:Ss},r)}),e&&U.jsx(l,{style:u,className:"p-4",onClick:m,children:U.jsx(d,{width:36,height:36,className:"hover:opacity-100 opacity-25",style:{rotate:a.rotate.to(f=>`${f}deg`)}})})]})}}));
1585
27
  //# sourceMappingURL=recursive-grid.umd.js.map