opencode-pixel-office 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1206 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function AS(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var CS={exports:{}},Nf={},PS={exports:{}},ze={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ih=Symbol.for("react.element"),$2=Symbol.for("react.portal"),W2=Symbol.for("react.fragment"),V2=Symbol.for("react.strict_mode"),X2=Symbol.for("react.profiler"),Y2=Symbol.for("react.provider"),Q2=Symbol.for("react.context"),K2=Symbol.for("react.forward_ref"),q2=Symbol.for("react.suspense"),Z2=Symbol.for("react.memo"),J2=Symbol.for("react.lazy"),rx=Symbol.iterator;function eP(t){return t===null||typeof t!="object"?null:(t=rx&&t[rx]||t["@@iterator"],typeof t=="function"?t:null)}var IS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RS=Object.assign,MS={};function yl(t,e,r){this.props=t,this.context=e,this.refs=MS,this.updater=r||IS}yl.prototype.isReactComponent={};yl.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yl.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function kS(){}kS.prototype=yl.prototype;function t0(t,e,r){this.props=t,this.context=e,this.refs=MS,this.updater=r||IS}var r0=t0.prototype=new kS;r0.constructor=t0;RS(r0,yl.prototype);r0.isPureReactComponent=!0;var nx=Array.isArray,NS=Object.prototype.hasOwnProperty,n0={current:null},DS={key:!0,ref:!0,__self:!0,__source:!0};function OS(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)NS.call(e,n)&&!DS.hasOwnProperty(n)&&(i[n]=e[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var h=Array(l),c=0;c<l;c++)h[c]=arguments[c+2];i.children=h}if(t&&t.defaultProps)for(n in l=t.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:ih,type:t,key:s,ref:o,props:i,_owner:n0.current}}function tP(t,e){return{$$typeof:ih,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function i0(t){return typeof t=="object"&&t!==null&&t.$$typeof===ih}function rP(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var ix=/\/+/g;function Rm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?rP(""+t.key):e.toString(36)}function fd(t,e,r,n,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case ih:case $2:o=!0}}if(o)return o=t,i=i(o),t=n===""?"."+Rm(o,0):n,nx(i)?(r="",t!=null&&(r=t.replace(ix,"$&/")+"/"),fd(i,e,r,"",function(c){return c})):i!=null&&(i0(i)&&(i=tP(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ix,"$&/")+"/")+t)),e.push(i)),1;if(o=0,n=n===""?".":n+":",nx(t))for(var l=0;l<t.length;l++){s=t[l];var h=n+Rm(s,l);o+=fd(s,e,r,h,i)}else if(h=eP(t),typeof h=="function")for(t=h.call(t),l=0;!(s=t.next()).done;)s=s.value,h=n+Rm(s,l++),o+=fd(s,e,r,h,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function gc(t,e,r){if(t==null)return t;var n=[],i=0;return fd(t,n,"","",function(s){return e.call(r,s,i++)}),n}function nP(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ir={current:null},pd={transition:null},iP={ReactCurrentDispatcher:Ir,ReactCurrentBatchConfig:pd,ReactCurrentOwner:n0};function FS(){throw Error("act(...) is not supported in production builds of React.")}ze.Children={map:gc,forEach:function(t,e,r){gc(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return gc(t,function(){e++}),e},toArray:function(t){return gc(t,function(e){return e})||[]},only:function(t){if(!i0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ze.Component=yl;ze.Fragment=W2;ze.Profiler=X2;ze.PureComponent=t0;ze.StrictMode=V2;ze.Suspense=q2;ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iP;ze.act=FS;ze.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=RS({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=n0.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(h in e)NS.call(e,h)&&!DS.hasOwnProperty(h)&&(n[h]=e[h]===void 0&&l!==void 0?l[h]:e[h])}var h=arguments.length-2;if(h===1)n.children=r;else if(1<h){l=Array(h);for(var c=0;c<h;c++)l[c]=arguments[c+2];n.children=l}return{$$typeof:ih,type:t.type,key:i,ref:s,props:n,_owner:o}};ze.createContext=function(t){return t={$$typeof:Q2,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Y2,_context:t},t.Consumer=t};ze.createElement=OS;ze.createFactory=function(t){var e=OS.bind(null,t);return e.type=t,e};ze.createRef=function(){return{current:null}};ze.forwardRef=function(t){return{$$typeof:K2,render:t}};ze.isValidElement=i0;ze.lazy=function(t){return{$$typeof:J2,_payload:{_status:-1,_result:t},_init:nP}};ze.memo=function(t,e){return{$$typeof:Z2,type:t,compare:e===void 0?null:e}};ze.startTransition=function(t){var e=pd.transition;pd.transition={};try{t()}finally{pd.transition=e}};ze.unstable_act=FS;ze.useCallback=function(t,e){return Ir.current.useCallback(t,e)};ze.useContext=function(t){return Ir.current.useContext(t)};ze.useDebugValue=function(){};ze.useDeferredValue=function(t){return Ir.current.useDeferredValue(t)};ze.useEffect=function(t,e){return Ir.current.useEffect(t,e)};ze.useId=function(){return Ir.current.useId()};ze.useImperativeHandle=function(t,e,r){return Ir.current.useImperativeHandle(t,e,r)};ze.useInsertionEffect=function(t,e){return Ir.current.useInsertionEffect(t,e)};ze.useLayoutEffect=function(t,e){return Ir.current.useLayoutEffect(t,e)};ze.useMemo=function(t,e){return Ir.current.useMemo(t,e)};ze.useReducer=function(t,e,r){return Ir.current.useReducer(t,e,r)};ze.useRef=function(t){return Ir.current.useRef(t)};ze.useState=function(t){return Ir.current.useState(t)};ze.useSyncExternalStore=function(t,e,r){return Ir.current.useSyncExternalStore(t,e,r)};ze.useTransition=function(){return Ir.current.useTransition()};ze.version="18.3.1";PS.exports=ze;var Ce=PS.exports;const Ti=kf(Ce);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its 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 sP=Ce,oP=Symbol.for("react.element"),aP=Symbol.for("react.fragment"),lP=Object.prototype.hasOwnProperty,uP=sP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hP={key:!0,ref:!0,__self:!0,__source:!0};function BS(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)lP.call(e,n)&&!hP.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:oP,type:t,key:s,ref:o,props:i,_owner:uP.current}}Nf.Fragment=aP;Nf.jsx=BS;Nf.jsxs=BS;CS.exports=Nf;var U=CS.exports,oy={},LS={exports:{}},nn={},US={exports:{}},zS={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its 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
+ */(function(t){function e(k,X){var O=k.length;k.push(X);e:for(;0<O;){var G=O-1>>>1,ie=k[G];if(0<i(ie,X))k[G]=X,k[O]=ie,O=G;else break e}}function r(k){return k.length===0?null:k[0]}function n(k){if(k.length===0)return null;var X=k[0],O=k.pop();if(O!==X){k[0]=O;e:for(var G=0,ie=k.length,q=ie>>>1;G<q;){var $=2*(G+1)-1,se=k[$],ce=$+1,ve=k[ce];if(0>i(se,O))ce<ie&&0>i(ve,se)?(k[G]=ve,k[ce]=O,G=ce):(k[G]=se,k[$]=O,G=$);else if(ce<ie&&0>i(ve,O))k[G]=ve,k[ce]=O,G=ce;else break e}}return X}function i(k,X){var O=k.sortIndex-X.sortIndex;return O!==0?O:k.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var h=[],c=[],f=1,m=null,p=3,v=!1,_=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(k){for(var X=r(c);X!==null;){if(X.callback===null)n(c);else if(X.startTime<=k)n(c),X.sortIndex=X.expirationTime,e(h,X);else break;X=r(c)}}function T(k){if(E=!1,w(k),!_)if(r(h)!==null)_=!0,fe(R);else{var X=r(c);X!==null&&ae(T,X.startTime-k)}}function R(k,X){_=!1,E&&(E=!1,S(M),M=-1),v=!0;var O=p;try{for(w(X),m=r(h);m!==null&&(!(m.expirationTime>X)||k&&!de());){var G=m.callback;if(typeof G=="function"){m.callback=null,p=m.priorityLevel;var ie=G(m.expirationTime<=X);X=t.unstable_now(),typeof ie=="function"?m.callback=ie:m===r(h)&&n(h),w(X)}else n(h);m=r(h)}if(m!==null)var q=!0;else{var $=r(c);$!==null&&ae(T,$.startTime-X),q=!1}return q}finally{m=null,p=O,v=!1}}var L=!1,D=null,M=-1,Y=5,j=-1;function de(){return!(t.unstable_now()-j<Y)}function re(){if(D!==null){var k=t.unstable_now();j=k;var X=!0;try{X=D(!0,k)}finally{X?F():(L=!1,D=null)}}else L=!1}var F;if(typeof b=="function")F=function(){b(re)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ne=V.port2;V.port1.onmessage=re,F=function(){ne.postMessage(null)}}else F=function(){A(re,0)};function fe(k){D=k,L||(L=!0,F())}function ae(k,X){M=A(function(){k(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,fe(R))},t.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<k?Math.floor(1e3/k):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(h)},t.unstable_next=function(k){switch(p){case 1:case 2:case 3:var X=3;break;default:X=p}var O=p;p=X;try{return k()}finally{p=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var O=p;p=k;try{return X()}finally{p=O}},t.unstable_scheduleCallback=function(k,X,O){var G=t.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?G+O:G):O=G,k){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=O+ie,k={id:f++,callback:X,priorityLevel:k,startTime:O,expirationTime:ie,sortIndex:-1},O>G?(k.sortIndex=O,e(c,k),r(h)===null&&k===r(c)&&(E?(S(M),M=-1):E=!0,ae(T,O-G))):(k.sortIndex=ie,e(h,k),_||v||(_=!0,fe(R))),k},t.unstable_shouldYield=de,t.unstable_wrapCallback=function(k){var X=p;return function(){var O=p;p=X;try{return k.apply(this,arguments)}finally{p=O}}}})(zS);US.exports=zS;var cP=US.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var dP=Ce,rn=cP;function J(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var GS=new Set,ku={};function Yo(t,e){al(t,e),al(t+"Capture",e)}function al(t,e){for(ku[t]=e,t=0;t<e.length;t++)GS.add(e[t])}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ay=Object.prototype.hasOwnProperty,fP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sx={},ox={};function pP(t){return ay.call(ox,t)?!0:ay.call(sx,t)?!1:fP.test(t)?ox[t]=!0:(sx[t]=!0,!1)}function mP(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function gP(t,e,r,n){if(e===null||typeof e>"u"||mP(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Rr(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var lr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){lr[t]=new Rr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];lr[e]=new Rr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){lr[t]=new Rr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){lr[t]=new Rr(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){lr[t]=new Rr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){lr[t]=new Rr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){lr[t]=new Rr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){lr[t]=new Rr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){lr[t]=new Rr(t,5,!1,t.toLowerCase(),null,!1,!1)});var s0=/[\-:]([a-z])/g;function o0(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(s0,o0);lr[e]=new Rr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(s0,o0);lr[e]=new Rr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(s0,o0);lr[e]=new Rr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){lr[t]=new Rr(t,1,!1,t.toLowerCase(),null,!1,!1)});lr.xlinkHref=new Rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){lr[t]=new Rr(t,1,!1,t.toLowerCase(),null,!0,!0)});function a0(t,e,r,n){var i=lr.hasOwnProperty(e)?lr[e]:null;(i!==null?i.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(gP(e,r,i,n)&&(r=null),n||i===null?pP(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):i.mustUseProperty?t[i.propertyName]=r===null?i.type===3?!1:"":r:(e=i.attributeName,n=i.attributeNamespace,r===null?t.removeAttribute(e):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var us=dP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,yc=Symbol.for("react.element"),Ma=Symbol.for("react.portal"),ka=Symbol.for("react.fragment"),l0=Symbol.for("react.strict_mode"),ly=Symbol.for("react.profiler"),HS=Symbol.for("react.provider"),jS=Symbol.for("react.context"),u0=Symbol.for("react.forward_ref"),uy=Symbol.for("react.suspense"),hy=Symbol.for("react.suspense_list"),h0=Symbol.for("react.memo"),Ms=Symbol.for("react.lazy"),$S=Symbol.for("react.offscreen"),ax=Symbol.iterator;function $l(t){return t===null||typeof t!="object"?null:(t=ax&&t[ax]||t["@@iterator"],typeof t=="function"?t:null)}var _t=Object.assign,Mm;function iu(t){if(Mm===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Mm=e&&e[1]||""}return`
34
+ `+Mm+t}var km=!1;function Nm(t,e){if(!t||km)return"";km=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var n=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){n=c}t.call(e.prototype)}else{try{throw Error()}catch(c){n=c}t()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
+ `),s=n.stack.split(`
36
+ `),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var h=`
37
+ `+i[o].replace(" at new "," at ");return t.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",t.displayName)),h}while(1<=o&&0<=l);break}}}finally{km=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?iu(t):""}function yP(t){switch(t.tag){case 5:return iu(t.type);case 16:return iu("Lazy");case 13:return iu("Suspense");case 19:return iu("SuspenseList");case 0:case 2:case 15:return t=Nm(t.type,!1),t;case 11:return t=Nm(t.type.render,!1),t;case 1:return t=Nm(t.type,!0),t;default:return""}}function cy(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ka:return"Fragment";case Ma:return"Portal";case ly:return"Profiler";case l0:return"StrictMode";case uy:return"Suspense";case hy:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case jS:return(t.displayName||"Context")+".Consumer";case HS:return(t._context.displayName||"Context")+".Provider";case u0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case h0:return e=t.displayName||null,e!==null?e:cy(t.type)||"Memo";case Ms:e=t._payload,t=t._init;try{return cy(t(e))}catch{}}return null}function vP(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cy(e);case 8:return e===l0?"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 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ks(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function WS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _P(t){var e=WS(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function vc(t){t._valueTracker||(t._valueTracker=_P(t))}function VS(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=WS(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ld(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function dy(t,e){var r=e.checked;return _t({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function lx(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ks(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function XS(t,e){e=e.checked,e!=null&&a0(t,"checked",e,!1)}function fy(t,e){XS(t,e);var r=Ks(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?py(t,e.type,r):e.hasOwnProperty("defaultValue")&&py(t,e.type,Ks(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ux(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function py(t,e,r){(e!=="number"||Ld(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var su=Array.isArray;function Xa(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i<r.length;i++)e["$"+r[i]]=!0;for(r=0;r<t.length;r++)i=e.hasOwnProperty("$"+t[r].value),t[r].selected!==i&&(t[r].selected=i),i&&n&&(t[r].defaultSelected=!0)}else{for(r=""+Ks(r),e=null,i=0;i<t.length;i++){if(t[i].value===r){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function my(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(J(91));return _t({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function hx(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(J(92));if(su(r)){if(1<r.length)throw Error(J(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Ks(r)}}function YS(t,e){var r=Ks(e.value),n=Ks(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function cx(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function QS(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gy(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?QS(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var _c,KS=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,i){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(_c=_c||document.createElement("div"),_c.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=_c.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Nu(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var yu={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},xP=["Webkit","ms","Moz","O"];Object.keys(yu).forEach(function(t){xP.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),yu[e]=yu[t]})});function qS(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||yu.hasOwnProperty(t)&&yu[t]?(""+e).trim():e+"px"}function ZS(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=qS(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var wP=_t({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yy(t,e){if(e){if(wP[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(J(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(J(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(J(61))}if(e.style!=null&&typeof e.style!="object")throw Error(J(62))}}function vy(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _y=null;function c0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xy=null,Ya=null,Qa=null;function dx(t){if(t=ah(t)){if(typeof xy!="function")throw Error(J(280));var e=t.stateNode;e&&(e=Lf(e),xy(t.stateNode,t.type,e))}}function JS(t){Ya?Qa?Qa.push(t):Qa=[t]:Ya=t}function eb(){if(Ya){var t=Ya,e=Qa;if(Qa=Ya=null,dx(t),e)for(t=0;t<e.length;t++)dx(e[t])}}function tb(t,e){return t(e)}function rb(){}var Dm=!1;function nb(t,e,r){if(Dm)return t(e,r);Dm=!0;try{return tb(t,e,r)}finally{Dm=!1,(Ya!==null||Qa!==null)&&(rb(),eb())}}function Du(t,e){var r=t.stateNode;if(r===null)return null;var n=Lf(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(J(231,e,typeof r));return r}var wy=!1;if(rs)try{var Wl={};Object.defineProperty(Wl,"passive",{get:function(){wy=!0}}),window.addEventListener("test",Wl,Wl),window.removeEventListener("test",Wl,Wl)}catch{wy=!1}function EP(t,e,r,n,i,s,o,l,h){var c=Array.prototype.slice.call(arguments,3);try{e.apply(r,c)}catch(f){this.onError(f)}}var vu=!1,Ud=null,zd=!1,Ey=null,SP={onError:function(t){vu=!0,Ud=t}};function bP(t,e,r,n,i,s,o,l,h){vu=!1,Ud=null,EP.apply(SP,arguments)}function TP(t,e,r,n,i,s,o,l,h){if(bP.apply(this,arguments),vu){if(vu){var c=Ud;vu=!1,Ud=null}else throw Error(J(198));zd||(zd=!0,Ey=c)}}function Qo(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function ib(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function fx(t){if(Qo(t)!==t)throw Error(J(188))}function AP(t){var e=t.alternate;if(!e){if(e=Qo(t),e===null)throw Error(J(188));return e!==t?null:t}for(var r=t,n=e;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return fx(i),t;if(s===n)return fx(i),e;s=s.sibling}throw Error(J(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o)throw Error(J(189))}}if(r.alternate!==n)throw Error(J(190))}if(r.tag!==3)throw Error(J(188));return r.stateNode.current===r?t:e}function sb(t){return t=AP(t),t!==null?ob(t):null}function ob(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=ob(t);if(e!==null)return e;t=t.sibling}return null}var ab=rn.unstable_scheduleCallback,px=rn.unstable_cancelCallback,CP=rn.unstable_shouldYield,PP=rn.unstable_requestPaint,Pt=rn.unstable_now,IP=rn.unstable_getCurrentPriorityLevel,d0=rn.unstable_ImmediatePriority,lb=rn.unstable_UserBlockingPriority,Gd=rn.unstable_NormalPriority,RP=rn.unstable_LowPriority,ub=rn.unstable_IdlePriority,Df=null,Ai=null;function MP(t){if(Ai&&typeof Ai.onCommitFiberRoot=="function")try{Ai.onCommitFiberRoot(Df,t,void 0,(t.current.flags&128)===128)}catch{}}var Xn=Math.clz32?Math.clz32:DP,kP=Math.log,NP=Math.LN2;function DP(t){return t>>>=0,t===0?32:31-(kP(t)/NP|0)|0}var xc=64,wc=4194304;function ou(t){switch(t&-t){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: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Hd(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=ou(l):(s&=o,s!==0&&(n=ou(s)))}else o=r&~i,o!==0?n=ou(o):s!==0&&(n=ou(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Xn(e),i=1<<r,n|=t[r],e&=~i;return n}function OP(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function FP(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Xn(s),l=1<<o,h=i[o];h===-1?(!(l&r)||l&n)&&(i[o]=OP(l,e)):h<=e&&(t.expiredLanes|=l),s&=~l}}function Sy(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function hb(){var t=xc;return xc<<=1,!(xc&4194240)&&(xc=64),t}function Om(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function sh(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Xn(e),t[e]=r}function BP(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var i=31-Xn(r),s=1<<i;e[i]=0,n[i]=-1,t[i]=-1,r&=~s}}function f0(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Xn(r),i=1<<n;i&e|t[n]&e&&(t[n]|=e),r&=~i}}var qe=0;function cb(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var db,p0,fb,pb,mb,by=!1,Ec=[],Gs=null,Hs=null,js=null,Ou=new Map,Fu=new Map,Ns=[],LP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function mx(t,e){switch(t){case"focusin":case"focusout":Gs=null;break;case"dragenter":case"dragleave":Hs=null;break;case"mouseover":case"mouseout":js=null;break;case"pointerover":case"pointerout":Ou.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fu.delete(e.pointerId)}}function Vl(t,e,r,n,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},e!==null&&(e=ah(e),e!==null&&p0(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function UP(t,e,r,n,i){switch(e){case"focusin":return Gs=Vl(Gs,t,e,r,n,i),!0;case"dragenter":return Hs=Vl(Hs,t,e,r,n,i),!0;case"mouseover":return js=Vl(js,t,e,r,n,i),!0;case"pointerover":var s=i.pointerId;return Ou.set(s,Vl(Ou.get(s)||null,t,e,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,Fu.set(s,Vl(Fu.get(s)||null,t,e,r,n,i)),!0}return!1}function gb(t){var e=No(t.target);if(e!==null){var r=Qo(e);if(r!==null){if(e=r.tag,e===13){if(e=ib(r),e!==null){t.blockedOn=e,mb(t.priority,function(){fb(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function md(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Ty(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);_y=n,r.target.dispatchEvent(n),_y=null}else return e=ah(r),e!==null&&p0(e),t.blockedOn=r,!1;e.shift()}return!0}function gx(t,e,r){md(t)&&r.delete(e)}function zP(){by=!1,Gs!==null&&md(Gs)&&(Gs=null),Hs!==null&&md(Hs)&&(Hs=null),js!==null&&md(js)&&(js=null),Ou.forEach(gx),Fu.forEach(gx)}function Xl(t,e){t.blockedOn===e&&(t.blockedOn=null,by||(by=!0,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,zP)))}function Bu(t){function e(i){return Xl(i,t)}if(0<Ec.length){Xl(Ec[0],t);for(var r=1;r<Ec.length;r++){var n=Ec[r];n.blockedOn===t&&(n.blockedOn=null)}}for(Gs!==null&&Xl(Gs,t),Hs!==null&&Xl(Hs,t),js!==null&&Xl(js,t),Ou.forEach(e),Fu.forEach(e),r=0;r<Ns.length;r++)n=Ns[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Ns.length&&(r=Ns[0],r.blockedOn===null);)gb(r),r.blockedOn===null&&Ns.shift()}var Ka=us.ReactCurrentBatchConfig,jd=!0;function GP(t,e,r,n){var i=qe,s=Ka.transition;Ka.transition=null;try{qe=1,m0(t,e,r,n)}finally{qe=i,Ka.transition=s}}function HP(t,e,r,n){var i=qe,s=Ka.transition;Ka.transition=null;try{qe=4,m0(t,e,r,n)}finally{qe=i,Ka.transition=s}}function m0(t,e,r,n){if(jd){var i=Ty(t,e,r,n);if(i===null)Wm(t,e,n,$d,r),mx(t,n);else if(UP(i,t,e,r,n))n.stopPropagation();else if(mx(t,n),e&4&&-1<LP.indexOf(t)){for(;i!==null;){var s=ah(i);if(s!==null&&db(s),s=Ty(t,e,r,n),s===null&&Wm(t,e,n,$d,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else Wm(t,e,n,null,r)}}var $d=null;function Ty(t,e,r,n){if($d=null,t=c0(n),t=No(t),t!==null)if(e=Qo(t),e===null)t=null;else if(r=e.tag,r===13){if(t=ib(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return $d=t,null}function yb(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(IP()){case d0:return 1;case lb:return 4;case Gd:case RP:return 16;case ub:return 536870912;default:return 16}default:return 16}}var Fs=null,g0=null,gd=null;function vb(){if(gd)return gd;var t,e=g0,r=e.length,n,i="value"in Fs?Fs.value:Fs.textContent,s=i.length;for(t=0;t<r&&e[t]===i[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===i[s-n];n++);return gd=i.slice(t,1<n?1-n:void 0)}function yd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Sc(){return!0}function yx(){return!1}function sn(t){function e(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Sc:yx,this.isPropagationStopped=yx,this}return _t(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Sc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Sc)},persist:function(){},isPersistent:Sc}),e}var vl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},y0=sn(vl),oh=_t({},vl,{view:0,detail:0}),jP=sn(oh),Fm,Bm,Yl,Of=_t({},oh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:v0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Yl&&(Yl&&t.type==="mousemove"?(Fm=t.screenX-Yl.screenX,Bm=t.screenY-Yl.screenY):Bm=Fm=0,Yl=t),Fm)},movementY:function(t){return"movementY"in t?t.movementY:Bm}}),vx=sn(Of),$P=_t({},Of,{dataTransfer:0}),WP=sn($P),VP=_t({},oh,{relatedTarget:0}),Lm=sn(VP),XP=_t({},vl,{animationName:0,elapsedTime:0,pseudoElement:0}),YP=sn(XP),QP=_t({},vl,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),KP=sn(QP),qP=_t({},vl,{data:0}),_x=sn(qP),ZP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tI(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=eI[t])?!!e[t]:!1}function v0(){return tI}var rI=_t({},oh,{key:function(t){if(t.key){var e=ZP[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=yd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?JP[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:v0,charCode:function(t){return t.type==="keypress"?yd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nI=sn(rI),iI=_t({},Of,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xx=sn(iI),sI=_t({},oh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:v0}),oI=sn(sI),aI=_t({},vl,{propertyName:0,elapsedTime:0,pseudoElement:0}),lI=sn(aI),uI=_t({},Of,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),hI=sn(uI),cI=[9,13,27,32],_0=rs&&"CompositionEvent"in window,_u=null;rs&&"documentMode"in document&&(_u=document.documentMode);var dI=rs&&"TextEvent"in window&&!_u,_b=rs&&(!_0||_u&&8<_u&&11>=_u),wx=" ",Ex=!1;function xb(t,e){switch(t){case"keyup":return cI.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wb(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Na=!1;function fI(t,e){switch(t){case"compositionend":return wb(e);case"keypress":return e.which!==32?null:(Ex=!0,wx);case"textInput":return t=e.data,t===wx&&Ex?null:t;default:return null}}function pI(t,e){if(Na)return t==="compositionend"||!_0&&xb(t,e)?(t=vb(),gd=g0=Fs=null,Na=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return _b&&e.locale!=="ko"?null:e.data;default:return null}}var mI={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!mI[t.type]:e==="textarea"}function Eb(t,e,r,n){JS(n),e=Wd(e,"onChange"),0<e.length&&(r=new y0("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var xu=null,Lu=null;function gI(t){Nb(t,0)}function Ff(t){var e=Fa(t);if(VS(e))return t}function yI(t,e){if(t==="change")return e}var Sb=!1;if(rs){var Um;if(rs){var zm="oninput"in document;if(!zm){var bx=document.createElement("div");bx.setAttribute("oninput","return;"),zm=typeof bx.oninput=="function"}Um=zm}else Um=!1;Sb=Um&&(!document.documentMode||9<document.documentMode)}function Tx(){xu&&(xu.detachEvent("onpropertychange",bb),Lu=xu=null)}function bb(t){if(t.propertyName==="value"&&Ff(Lu)){var e=[];Eb(e,Lu,t,c0(t)),nb(gI,e)}}function vI(t,e,r){t==="focusin"?(Tx(),xu=e,Lu=r,xu.attachEvent("onpropertychange",bb)):t==="focusout"&&Tx()}function _I(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ff(Lu)}function xI(t,e){if(t==="click")return Ff(e)}function wI(t,e){if(t==="input"||t==="change")return Ff(e)}function EI(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var qn=typeof Object.is=="function"?Object.is:EI;function Uu(t,e){if(qn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!ay.call(e,i)||!qn(t[i],e[i]))return!1}return!0}function Ax(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Cx(t,e){var r=Ax(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ax(r)}}function Tb(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Tb(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ab(){for(var t=window,e=Ld();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ld(t.document)}return e}function x0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function SI(t){var e=Ab(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Tb(r.ownerDocument.documentElement,r)){if(n!==null&&x0(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=Cx(r,s);var o=Cx(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var bI=rs&&"documentMode"in document&&11>=document.documentMode,Da=null,Ay=null,wu=null,Cy=!1;function Px(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Cy||Da==null||Da!==Ld(n)||(n=Da,"selectionStart"in n&&x0(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),wu&&Uu(wu,n)||(wu=n,n=Wd(Ay,"onSelect"),0<n.length&&(e=new y0("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Da)))}function bc(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Oa={animationend:bc("Animation","AnimationEnd"),animationiteration:bc("Animation","AnimationIteration"),animationstart:bc("Animation","AnimationStart"),transitionend:bc("Transition","TransitionEnd")},Gm={},Cb={};rs&&(Cb=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function Bf(t){if(Gm[t])return Gm[t];if(!Oa[t])return t;var e=Oa[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Cb)return Gm[t]=e[r];return t}var Pb=Bf("animationend"),Ib=Bf("animationiteration"),Rb=Bf("animationstart"),Mb=Bf("transitionend"),kb=new Map,Ix="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function to(t,e){kb.set(t,e),Yo(e,[t])}for(var Hm=0;Hm<Ix.length;Hm++){var jm=Ix[Hm],TI=jm.toLowerCase(),AI=jm[0].toUpperCase()+jm.slice(1);to(TI,"on"+AI)}to(Pb,"onAnimationEnd");to(Ib,"onAnimationIteration");to(Rb,"onAnimationStart");to("dblclick","onDoubleClick");to("focusin","onFocus");to("focusout","onBlur");to(Mb,"onTransitionEnd");al("onMouseEnter",["mouseout","mouseover"]);al("onMouseLeave",["mouseout","mouseover"]);al("onPointerEnter",["pointerout","pointerover"]);al("onPointerLeave",["pointerout","pointerover"]);Yo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),CI=new Set("cancel close invalid load scroll toggle".split(" ").concat(au));function Rx(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,TP(n,e,void 0,t),t.currentTarget=null}function Nb(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],i=n.event;n=n.listeners;e:{var s=void 0;if(e)for(var o=n.length-1;0<=o;o--){var l=n[o],h=l.instance,c=l.currentTarget;if(l=l.listener,h!==s&&i.isPropagationStopped())break e;Rx(i,l,c),s=h}else for(o=0;o<n.length;o++){if(l=n[o],h=l.instance,c=l.currentTarget,l=l.listener,h!==s&&i.isPropagationStopped())break e;Rx(i,l,c),s=h}}}if(zd)throw t=Ey,zd=!1,Ey=null,t}function nt(t,e){var r=e[ky];r===void 0&&(r=e[ky]=new Set);var n=t+"__bubble";r.has(n)||(Db(e,t,2,!1),r.add(n))}function $m(t,e,r){var n=0;e&&(n|=4),Db(r,t,n,e)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function zu(t){if(!t[Tc]){t[Tc]=!0,GS.forEach(function(r){r!=="selectionchange"&&(CI.has(r)||$m(r,!1,t),$m(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Tc]||(e[Tc]=!0,$m("selectionchange",!1,e))}}function Db(t,e,r,n){switch(yb(e)){case 1:var i=GP;break;case 4:i=HP;break;default:i=m0}r=i.bind(null,e,r,t),i=void 0,!wy||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,r,{capture:!0,passive:i}):t.addEventListener(e,r,!0):i!==void 0?t.addEventListener(e,r,{passive:i}):t.addEventListener(e,r,!1)}function Wm(t,e,r,n,i){var s=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var h=o.tag;if((h===3||h===4)&&(h=o.stateNode.containerInfo,h===i||h.nodeType===8&&h.parentNode===i))return;o=o.return}for(;l!==null;){if(o=No(l),o===null)return;if(h=o.tag,h===5||h===6){n=s=o;continue e}l=l.parentNode}}n=n.return}nb(function(){var c=s,f=c0(r),m=[];e:{var p=kb.get(t);if(p!==void 0){var v=y0,_=t;switch(t){case"keypress":if(yd(r)===0)break e;case"keydown":case"keyup":v=nI;break;case"focusin":_="focus",v=Lm;break;case"focusout":_="blur",v=Lm;break;case"beforeblur":case"afterblur":v=Lm;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=WP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=oI;break;case Pb:case Ib:case Rb:v=YP;break;case Mb:v=lI;break;case"scroll":v=jP;break;case"wheel":v=hI;break;case"copy":case"cut":case"paste":v=KP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=xx}var E=(e&4)!==0,A=!E&&t==="scroll",S=E?p!==null?p+"Capture":null:p;E=[];for(var b=c,w;b!==null;){w=b;var T=w.stateNode;if(w.tag===5&&T!==null&&(w=T,S!==null&&(T=Du(b,S),T!=null&&E.push(Gu(b,T,w)))),A)break;b=b.return}0<E.length&&(p=new v(p,_,null,r,f),m.push({event:p,listeners:E}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",v=t==="mouseout"||t==="pointerout",p&&r!==_y&&(_=r.relatedTarget||r.fromElement)&&(No(_)||_[ns]))break e;if((v||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,v?(_=r.relatedTarget||r.toElement,v=c,_=_?No(_):null,_!==null&&(A=Qo(_),_!==A||_.tag!==5&&_.tag!==6)&&(_=null)):(v=null,_=c),v!==_)){if(E=vx,T="onMouseLeave",S="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(E=xx,T="onPointerLeave",S="onPointerEnter",b="pointer"),A=v==null?p:Fa(v),w=_==null?p:Fa(_),p=new E(T,b+"leave",v,r,f),p.target=A,p.relatedTarget=w,T=null,No(f)===c&&(E=new E(S,b+"enter",_,r,f),E.target=w,E.relatedTarget=A,T=E),A=T,v&&_)t:{for(E=v,S=_,b=0,w=E;w;w=ya(w))b++;for(w=0,T=S;T;T=ya(T))w++;for(;0<b-w;)E=ya(E),b--;for(;0<w-b;)S=ya(S),w--;for(;b--;){if(E===S||S!==null&&E===S.alternate)break t;E=ya(E),S=ya(S)}E=null}else E=null;v!==null&&Mx(m,p,v,E,!1),_!==null&&A!==null&&Mx(m,A,_,E,!0)}}e:{if(p=c?Fa(c):window,v=p.nodeName&&p.nodeName.toLowerCase(),v==="select"||v==="input"&&p.type==="file")var R=yI;else if(Sx(p))if(Sb)R=wI;else{R=_I;var L=vI}else(v=p.nodeName)&&v.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(R=xI);if(R&&(R=R(t,c))){Eb(m,R,r,f);break e}L&&L(t,p,c),t==="focusout"&&(L=p._wrapperState)&&L.controlled&&p.type==="number"&&py(p,"number",p.value)}switch(L=c?Fa(c):window,t){case"focusin":(Sx(L)||L.contentEditable==="true")&&(Da=L,Ay=c,wu=null);break;case"focusout":wu=Ay=Da=null;break;case"mousedown":Cy=!0;break;case"contextmenu":case"mouseup":case"dragend":Cy=!1,Px(m,r,f);break;case"selectionchange":if(bI)break;case"keydown":case"keyup":Px(m,r,f)}var D;if(_0)e:{switch(t){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Na?xb(t,r)&&(M="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(M="onCompositionStart");M&&(_b&&r.locale!=="ko"&&(Na||M!=="onCompositionStart"?M==="onCompositionEnd"&&Na&&(D=vb()):(Fs=f,g0="value"in Fs?Fs.value:Fs.textContent,Na=!0)),L=Wd(c,M),0<L.length&&(M=new _x(M,t,null,r,f),m.push({event:M,listeners:L}),D?M.data=D:(D=wb(r),D!==null&&(M.data=D)))),(D=dI?fI(t,r):pI(t,r))&&(c=Wd(c,"onBeforeInput"),0<c.length&&(f=new _x("onBeforeInput","beforeinput",null,r,f),m.push({event:f,listeners:c}),f.data=D))}Nb(m,e)})}function Gu(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Wd(t,e){for(var r=e+"Capture",n=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Du(t,r),s!=null&&n.unshift(Gu(t,s,i)),s=Du(t,e),s!=null&&n.push(Gu(t,s,i))),t=t.return}return n}function ya(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Mx(t,e,r,n,i){for(var s=e._reactName,o=[];r!==null&&r!==n;){var l=r,h=l.alternate,c=l.stateNode;if(h!==null&&h===n)break;l.tag===5&&c!==null&&(l=c,i?(h=Du(r,s),h!=null&&o.unshift(Gu(r,h,l))):i||(h=Du(r,s),h!=null&&o.push(Gu(r,h,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var PI=/\r\n?/g,II=/\u0000|\uFFFD/g;function kx(t){return(typeof t=="string"?t:""+t).replace(PI,`
38
+ `).replace(II,"")}function Ac(t,e,r){if(e=kx(e),kx(t)!==e&&r)throw Error(J(425))}function Vd(){}var Py=null,Iy=null;function Ry(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var My=typeof setTimeout=="function"?setTimeout:void 0,RI=typeof clearTimeout=="function"?clearTimeout:void 0,Nx=typeof Promise=="function"?Promise:void 0,MI=typeof queueMicrotask=="function"?queueMicrotask:typeof Nx<"u"?function(t){return Nx.resolve(null).then(t).catch(kI)}:My;function kI(t){setTimeout(function(){throw t})}function Vm(t,e){var r=e,n=0;do{var i=r.nextSibling;if(t.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){t.removeChild(i),Bu(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Bu(e)}function $s(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Dx(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var _l=Math.random().toString(36).slice(2),wi="__reactFiber$"+_l,Hu="__reactProps$"+_l,ns="__reactContainer$"+_l,ky="__reactEvents$"+_l,NI="__reactListeners$"+_l,DI="__reactHandles$"+_l;function No(t){var e=t[wi];if(e)return e;for(var r=t.parentNode;r;){if(e=r[ns]||r[wi]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Dx(t);t!==null;){if(r=t[wi])return r;t=Dx(t)}return e}t=r,r=t.parentNode}return null}function ah(t){return t=t[wi]||t[ns],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Fa(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(J(33))}function Lf(t){return t[Hu]||null}var Ny=[],Ba=-1;function ro(t){return{current:t}}function st(t){0>Ba||(t.current=Ny[Ba],Ny[Ba]=null,Ba--)}function tt(t,e){Ba++,Ny[Ba]=t.current,t.current=e}var qs={},_r=ro(qs),Hr=ro(!1),Go=qs;function ll(t,e){var r=t.type.contextTypes;if(!r)return qs;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function jr(t){return t=t.childContextTypes,t!=null}function Xd(){st(Hr),st(_r)}function Ox(t,e,r){if(_r.current!==qs)throw Error(J(168));tt(_r,e),tt(Hr,r)}function Ob(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(J(108,vP(t)||"Unknown",i));return _t({},r,n)}function Yd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||qs,Go=_r.current,tt(_r,t),tt(Hr,Hr.current),!0}function Fx(t,e,r){var n=t.stateNode;if(!n)throw Error(J(169));r?(t=Ob(t,e,Go),n.__reactInternalMemoizedMergedChildContext=t,st(Hr),st(_r),tt(_r,t)):st(Hr),tt(Hr,r)}var Yi=null,Uf=!1,Xm=!1;function Fb(t){Yi===null?Yi=[t]:Yi.push(t)}function OI(t){Uf=!0,Fb(t)}function no(){if(!Xm&&Yi!==null){Xm=!0;var t=0,e=qe;try{var r=Yi;for(qe=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}Yi=null,Uf=!1}catch(i){throw Yi!==null&&(Yi=Yi.slice(t+1)),ab(d0,no),i}finally{qe=e,Xm=!1}}return null}var La=[],Ua=0,Qd=null,Kd=0,_n=[],xn=0,Ho=null,Qi=1,Ki="";function So(t,e){La[Ua++]=Kd,La[Ua++]=Qd,Qd=t,Kd=e}function Bb(t,e,r){_n[xn++]=Qi,_n[xn++]=Ki,_n[xn++]=Ho,Ho=t;var n=Qi;t=Ki;var i=32-Xn(n)-1;n&=~(1<<i),r+=1;var s=32-Xn(e)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Qi=1<<32-Xn(e)+i|r<<i|n,Ki=s+t}else Qi=1<<s|r<<i|n,Ki=t}function w0(t){t.return!==null&&(So(t,1),Bb(t,1,0))}function E0(t){for(;t===Qd;)Qd=La[--Ua],La[Ua]=null,Kd=La[--Ua],La[Ua]=null;for(;t===Ho;)Ho=_n[--xn],_n[xn]=null,Ki=_n[--xn],_n[xn]=null,Qi=_n[--xn],_n[xn]=null}var en=null,Jr=null,dt=!1,Hn=null;function Lb(t,e){var r=En(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function Bx(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,en=t,Jr=$s(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,en=t,Jr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Ho!==null?{id:Qi,overflow:Ki}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=En(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,en=t,Jr=null,!0):!1;default:return!1}}function Dy(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Oy(t){if(dt){var e=Jr;if(e){var r=e;if(!Bx(t,e)){if(Dy(t))throw Error(J(418));e=$s(r.nextSibling);var n=en;e&&Bx(t,e)?Lb(n,r):(t.flags=t.flags&-4097|2,dt=!1,en=t)}}else{if(Dy(t))throw Error(J(418));t.flags=t.flags&-4097|2,dt=!1,en=t}}}function Lx(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;en=t}function Cc(t){if(t!==en)return!1;if(!dt)return Lx(t),dt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ry(t.type,t.memoizedProps)),e&&(e=Jr)){if(Dy(t))throw Ub(),Error(J(418));for(;e;)Lb(t,e),e=$s(e.nextSibling)}if(Lx(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(J(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){Jr=$s(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}Jr=null}}else Jr=en?$s(t.stateNode.nextSibling):null;return!0}function Ub(){for(var t=Jr;t;)t=$s(t.nextSibling)}function ul(){Jr=en=null,dt=!1}function S0(t){Hn===null?Hn=[t]:Hn.push(t)}var FI=us.ReactCurrentBatchConfig;function Ql(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(J(309));var n=r.stateNode}if(!n)throw Error(J(147,t));var i=n,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(J(284));if(!r._owner)throw Error(J(290,t))}return t}function Pc(t,e){throw t=Object.prototype.toString.call(e),Error(J(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Ux(t){var e=t._init;return e(t._payload)}function zb(t){function e(S,b){if(t){var w=S.deletions;w===null?(S.deletions=[b],S.flags|=16):w.push(b)}}function r(S,b){if(!t)return null;for(;b!==null;)e(S,b),b=b.sibling;return null}function n(S,b){for(S=new Map;b!==null;)b.key!==null?S.set(b.key,b):S.set(b.index,b),b=b.sibling;return S}function i(S,b){return S=Ys(S,b),S.index=0,S.sibling=null,S}function s(S,b,w){return S.index=w,t?(w=S.alternate,w!==null?(w=w.index,w<b?(S.flags|=2,b):w):(S.flags|=2,b)):(S.flags|=1048576,b)}function o(S){return t&&S.alternate===null&&(S.flags|=2),S}function l(S,b,w,T){return b===null||b.tag!==6?(b=eg(w,S.mode,T),b.return=S,b):(b=i(b,w),b.return=S,b)}function h(S,b,w,T){var R=w.type;return R===ka?f(S,b,w.props.children,T,w.key):b!==null&&(b.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Ms&&Ux(R)===b.type)?(T=i(b,w.props),T.ref=Ql(S,b,w),T.return=S,T):(T=bd(w.type,w.key,w.props,null,S.mode,T),T.ref=Ql(S,b,w),T.return=S,T)}function c(S,b,w,T){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=tg(w,S.mode,T),b.return=S,b):(b=i(b,w.children||[]),b.return=S,b)}function f(S,b,w,T,R){return b===null||b.tag!==7?(b=Bo(w,S.mode,T,R),b.return=S,b):(b=i(b,w),b.return=S,b)}function m(S,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=eg(""+b,S.mode,w),b.return=S,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case yc:return w=bd(b.type,b.key,b.props,null,S.mode,w),w.ref=Ql(S,null,b),w.return=S,w;case Ma:return b=tg(b,S.mode,w),b.return=S,b;case Ms:var T=b._init;return m(S,T(b._payload),w)}if(su(b)||$l(b))return b=Bo(b,S.mode,w,null),b.return=S,b;Pc(S,b)}return null}function p(S,b,w,T){var R=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return R!==null?null:l(S,b,""+w,T);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case yc:return w.key===R?h(S,b,w,T):null;case Ma:return w.key===R?c(S,b,w,T):null;case Ms:return R=w._init,p(S,b,R(w._payload),T)}if(su(w)||$l(w))return R!==null?null:f(S,b,w,T,null);Pc(S,w)}return null}function v(S,b,w,T,R){if(typeof T=="string"&&T!==""||typeof T=="number")return S=S.get(w)||null,l(b,S,""+T,R);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case yc:return S=S.get(T.key===null?w:T.key)||null,h(b,S,T,R);case Ma:return S=S.get(T.key===null?w:T.key)||null,c(b,S,T,R);case Ms:var L=T._init;return v(S,b,w,L(T._payload),R)}if(su(T)||$l(T))return S=S.get(w)||null,f(b,S,T,R,null);Pc(b,T)}return null}function _(S,b,w,T){for(var R=null,L=null,D=b,M=b=0,Y=null;D!==null&&M<w.length;M++){D.index>M?(Y=D,D=null):Y=D.sibling;var j=p(S,D,w[M],T);if(j===null){D===null&&(D=Y);break}t&&D&&j.alternate===null&&e(S,D),b=s(j,b,M),L===null?R=j:L.sibling=j,L=j,D=Y}if(M===w.length)return r(S,D),dt&&So(S,M),R;if(D===null){for(;M<w.length;M++)D=m(S,w[M],T),D!==null&&(b=s(D,b,M),L===null?R=D:L.sibling=D,L=D);return dt&&So(S,M),R}for(D=n(S,D);M<w.length;M++)Y=v(D,S,M,w[M],T),Y!==null&&(t&&Y.alternate!==null&&D.delete(Y.key===null?M:Y.key),b=s(Y,b,M),L===null?R=Y:L.sibling=Y,L=Y);return t&&D.forEach(function(de){return e(S,de)}),dt&&So(S,M),R}function E(S,b,w,T){var R=$l(w);if(typeof R!="function")throw Error(J(150));if(w=R.call(w),w==null)throw Error(J(151));for(var L=R=null,D=b,M=b=0,Y=null,j=w.next();D!==null&&!j.done;M++,j=w.next()){D.index>M?(Y=D,D=null):Y=D.sibling;var de=p(S,D,j.value,T);if(de===null){D===null&&(D=Y);break}t&&D&&de.alternate===null&&e(S,D),b=s(de,b,M),L===null?R=de:L.sibling=de,L=de,D=Y}if(j.done)return r(S,D),dt&&So(S,M),R;if(D===null){for(;!j.done;M++,j=w.next())j=m(S,j.value,T),j!==null&&(b=s(j,b,M),L===null?R=j:L.sibling=j,L=j);return dt&&So(S,M),R}for(D=n(S,D);!j.done;M++,j=w.next())j=v(D,S,M,j.value,T),j!==null&&(t&&j.alternate!==null&&D.delete(j.key===null?M:j.key),b=s(j,b,M),L===null?R=j:L.sibling=j,L=j);return t&&D.forEach(function(re){return e(S,re)}),dt&&So(S,M),R}function A(S,b,w,T){if(typeof w=="object"&&w!==null&&w.type===ka&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case yc:e:{for(var R=w.key,L=b;L!==null;){if(L.key===R){if(R=w.type,R===ka){if(L.tag===7){r(S,L.sibling),b=i(L,w.props.children),b.return=S,S=b;break e}}else if(L.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Ms&&Ux(R)===L.type){r(S,L.sibling),b=i(L,w.props),b.ref=Ql(S,L,w),b.return=S,S=b;break e}r(S,L);break}else e(S,L);L=L.sibling}w.type===ka?(b=Bo(w.props.children,S.mode,T,w.key),b.return=S,S=b):(T=bd(w.type,w.key,w.props,null,S.mode,T),T.ref=Ql(S,b,w),T.return=S,S=T)}return o(S);case Ma:e:{for(L=w.key;b!==null;){if(b.key===L)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){r(S,b.sibling),b=i(b,w.children||[]),b.return=S,S=b;break e}else{r(S,b);break}else e(S,b);b=b.sibling}b=tg(w,S.mode,T),b.return=S,S=b}return o(S);case Ms:return L=w._init,A(S,b,L(w._payload),T)}if(su(w))return _(S,b,w,T);if($l(w))return E(S,b,w,T);Pc(S,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(r(S,b.sibling),b=i(b,w),b.return=S,S=b):(r(S,b),b=eg(w,S.mode,T),b.return=S,S=b),o(S)):r(S,b)}return A}var hl=zb(!0),Gb=zb(!1),qd=ro(null),Zd=null,za=null,b0=null;function T0(){b0=za=Zd=null}function A0(t){var e=qd.current;st(qd),t._currentValue=e}function Fy(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function qa(t,e){Zd=t,b0=za=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(zr=!0),t.firstContext=null)}function Cn(t){var e=t._currentValue;if(b0!==t)if(t={context:t,memoizedValue:e,next:null},za===null){if(Zd===null)throw Error(J(308));za=t,Zd.dependencies={lanes:0,firstContext:t}}else za=za.next=t;return e}var Do=null;function C0(t){Do===null?Do=[t]:Do.push(t)}function Hb(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,C0(e)):(r.next=i.next,i.next=r),e.interleaved=r,is(t,n)}function is(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var ks=!1;function P0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jb(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ji(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ws(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,je&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,is(t,r)}return i=n.interleaved,i===null?(e.next=e,C0(n)):(e.next=i.next,i.next=e),n.interleaved=e,is(t,r)}function vd(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,f0(t,r)}}function zx(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=e:s=s.next=e}else i=s=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Jd(t,e,r,n){var i=t.updateQueue;ks=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var h=l,c=h.next;h.next=null,o===null?s=c:o.next=c,o=h;var f=t.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=h))}if(s!==null){var m=i.baseState;o=0,f=c=h=null,l=s;do{var p=l.lane,v=l.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var _=t,E=l;switch(p=e,v=r,E.tag){case 1:if(_=E.payload,typeof _=="function"){m=_.call(v,m,p);break e}m=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=E.payload,p=typeof _=="function"?_.call(v,m,p):_,p==null)break e;m=_t({},m,p);break e;case 2:ks=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else v={eventTime:v,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=v,h=m):f=f.next=v,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(h=m),i.baseState=h,i.firstBaseUpdate=c,i.lastBaseUpdate=f,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);$o|=o,t.lanes=o,t.memoizedState=m}}function Gx(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(J(191,i));i.call(n)}}}var lh={},Ci=ro(lh),ju=ro(lh),$u=ro(lh);function Oo(t){if(t===lh)throw Error(J(174));return t}function I0(t,e){switch(tt($u,e),tt(ju,t),tt(Ci,lh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:gy(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=gy(e,t)}st(Ci),tt(Ci,e)}function cl(){st(Ci),st(ju),st($u)}function $b(t){Oo($u.current);var e=Oo(Ci.current),r=gy(e,t.type);e!==r&&(tt(ju,t),tt(Ci,r))}function R0(t){ju.current===t&&(st(Ci),st(ju))}var gt=ro(0);function ef(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ym=[];function M0(){for(var t=0;t<Ym.length;t++)Ym[t]._workInProgressVersionPrimary=null;Ym.length=0}var _d=us.ReactCurrentDispatcher,Qm=us.ReactCurrentBatchConfig,jo=0,vt=null,Bt=null,Xt=null,tf=!1,Eu=!1,Wu=0,BI=0;function gr(){throw Error(J(321))}function k0(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!qn(t[r],e[r]))return!1;return!0}function N0(t,e,r,n,i,s){if(jo=s,vt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,_d.current=t===null||t.memoizedState===null?GI:HI,t=r(n,i),Eu){s=0;do{if(Eu=!1,Wu=0,25<=s)throw Error(J(301));s+=1,Xt=Bt=null,e.updateQueue=null,_d.current=jI,t=r(n,i)}while(Eu)}if(_d.current=rf,e=Bt!==null&&Bt.next!==null,jo=0,Xt=Bt=vt=null,tf=!1,e)throw Error(J(300));return t}function D0(){var t=Wu!==0;return Wu=0,t}function yi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?vt.memoizedState=Xt=t:Xt=Xt.next=t,Xt}function Pn(){if(Bt===null){var t=vt.alternate;t=t!==null?t.memoizedState:null}else t=Bt.next;var e=Xt===null?vt.memoizedState:Xt.next;if(e!==null)Xt=e,Bt=t;else{if(t===null)throw Error(J(310));Bt=t,t={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Xt===null?vt.memoizedState=Xt=t:Xt=Xt.next=t}return Xt}function Vu(t,e){return typeof e=="function"?e(t):e}function Km(t){var e=Pn(),r=e.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=t;var n=Bt,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var l=o=null,h=null,c=s;do{var f=c.lane;if((jo&f)===f)h!==null&&(h=h.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:t(n,c.action);else{var m={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};h===null?(l=h=m,o=n):h=h.next=m,vt.lanes|=f,$o|=f}c=c.next}while(c!==null&&c!==s);h===null?o=n:h.next=l,qn(n,e.memoizedState)||(zr=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=h,r.lastRenderedState=n}if(t=r.interleaved,t!==null){i=t;do s=i.lane,vt.lanes|=s,$o|=s,i=i.next;while(i!==t)}else i===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function qm(t){var e=Pn(),r=e.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=t;var n=r.dispatch,i=r.pending,s=e.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);qn(s,e.memoizedState)||(zr=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),r.lastRenderedState=s}return[s,n]}function Wb(){}function Vb(t,e){var r=vt,n=Pn(),i=e(),s=!qn(n.memoizedState,i);if(s&&(n.memoizedState=i,zr=!0),n=n.queue,O0(Qb.bind(null,r,n,t),[t]),n.getSnapshot!==e||s||Xt!==null&&Xt.memoizedState.tag&1){if(r.flags|=2048,Xu(9,Yb.bind(null,r,n,i,e),void 0,null),Kt===null)throw Error(J(349));jo&30||Xb(r,e,i)}return i}function Xb(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function Yb(t,e,r,n){e.value=r,e.getSnapshot=n,Kb(e)&&qb(t)}function Qb(t,e,r){return r(function(){Kb(e)&&qb(t)})}function Kb(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!qn(t,r)}catch{return!0}}function qb(t){var e=is(t,1);e!==null&&Yn(e,t,1,-1)}function Hx(t){var e=yi();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vu,lastRenderedState:t},e.queue=t,t=t.dispatch=zI.bind(null,vt,t),[e.memoizedState,t]}function Xu(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function Zb(){return Pn().memoizedState}function xd(t,e,r,n){var i=yi();vt.flags|=t,i.memoizedState=Xu(1|e,r,void 0,n===void 0?null:n)}function zf(t,e,r,n){var i=Pn();n=n===void 0?null:n;var s=void 0;if(Bt!==null){var o=Bt.memoizedState;if(s=o.destroy,n!==null&&k0(n,o.deps)){i.memoizedState=Xu(e,r,s,n);return}}vt.flags|=t,i.memoizedState=Xu(1|e,r,s,n)}function jx(t,e){return xd(8390656,8,t,e)}function O0(t,e){return zf(2048,8,t,e)}function Jb(t,e){return zf(4,2,t,e)}function eT(t,e){return zf(4,4,t,e)}function tT(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function rT(t,e,r){return r=r!=null?r.concat([t]):null,zf(4,4,tT.bind(null,e,t),r)}function F0(){}function nT(t,e){var r=Pn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&k0(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function iT(t,e){var r=Pn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&k0(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function sT(t,e,r){return jo&21?(qn(r,e)||(r=hb(),vt.lanes|=r,$o|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,zr=!0),t.memoizedState=r)}function LI(t,e){var r=qe;qe=r!==0&&4>r?r:4,t(!0);var n=Qm.transition;Qm.transition={};try{t(!1),e()}finally{qe=r,Qm.transition=n}}function oT(){return Pn().memoizedState}function UI(t,e,r){var n=Xs(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},aT(t))lT(e,r);else if(r=Hb(t,e,r,n),r!==null){var i=Cr();Yn(r,t,n,i),uT(r,e,n)}}function zI(t,e,r){var n=Xs(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(aT(t))lT(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,qn(l,o)){var h=e.interleaved;h===null?(i.next=i,C0(e)):(i.next=h.next,h.next=i),e.interleaved=i;return}}catch{}finally{}r=Hb(t,e,i,n),r!==null&&(i=Cr(),Yn(r,t,n,i),uT(r,e,n))}}function aT(t){var e=t.alternate;return t===vt||e!==null&&e===vt}function lT(t,e){Eu=tf=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function uT(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,f0(t,r)}}var rf={readContext:Cn,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},GI={readContext:Cn,useCallback:function(t,e){return yi().memoizedState=[t,e===void 0?null:e],t},useContext:Cn,useEffect:jx,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,xd(4194308,4,tT.bind(null,e,t),r)},useLayoutEffect:function(t,e){return xd(4194308,4,t,e)},useInsertionEffect:function(t,e){return xd(4,2,t,e)},useMemo:function(t,e){var r=yi();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=yi();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=UI.bind(null,vt,t),[n.memoizedState,t]},useRef:function(t){var e=yi();return t={current:t},e.memoizedState=t},useState:Hx,useDebugValue:F0,useDeferredValue:function(t){return yi().memoizedState=t},useTransition:function(){var t=Hx(!1),e=t[0];return t=LI.bind(null,t[1]),yi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=vt,i=yi();if(dt){if(r===void 0)throw Error(J(407));r=r()}else{if(r=e(),Kt===null)throw Error(J(349));jo&30||Xb(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,jx(Qb.bind(null,n,s,t),[t]),n.flags|=2048,Xu(9,Yb.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=yi(),e=Kt.identifierPrefix;if(dt){var r=Ki,n=Qi;r=(n&~(1<<32-Xn(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Wu++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=BI++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},HI={readContext:Cn,useCallback:nT,useContext:Cn,useEffect:O0,useImperativeHandle:rT,useInsertionEffect:Jb,useLayoutEffect:eT,useMemo:iT,useReducer:Km,useRef:Zb,useState:function(){return Km(Vu)},useDebugValue:F0,useDeferredValue:function(t){var e=Pn();return sT(e,Bt.memoizedState,t)},useTransition:function(){var t=Km(Vu)[0],e=Pn().memoizedState;return[t,e]},useMutableSource:Wb,useSyncExternalStore:Vb,useId:oT,unstable_isNewReconciler:!1},jI={readContext:Cn,useCallback:nT,useContext:Cn,useEffect:O0,useImperativeHandle:rT,useInsertionEffect:Jb,useLayoutEffect:eT,useMemo:iT,useReducer:qm,useRef:Zb,useState:function(){return qm(Vu)},useDebugValue:F0,useDeferredValue:function(t){var e=Pn();return Bt===null?e.memoizedState=t:sT(e,Bt.memoizedState,t)},useTransition:function(){var t=qm(Vu)[0],e=Pn().memoizedState;return[t,e]},useMutableSource:Wb,useSyncExternalStore:Vb,useId:oT,unstable_isNewReconciler:!1};function zn(t,e){if(t&&t.defaultProps){e=_t({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function By(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:_t({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Gf={isMounted:function(t){return(t=t._reactInternals)?Qo(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Cr(),i=Xs(t),s=Ji(n,i);s.payload=e,r!=null&&(s.callback=r),e=Ws(t,s,i),e!==null&&(Yn(e,t,i,n),vd(e,t,i))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Cr(),i=Xs(t),s=Ji(n,i);s.tag=1,s.payload=e,r!=null&&(s.callback=r),e=Ws(t,s,i),e!==null&&(Yn(e,t,i,n),vd(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Cr(),n=Xs(t),i=Ji(r,n);i.tag=2,e!=null&&(i.callback=e),e=Ws(t,i,n),e!==null&&(Yn(e,t,n,r),vd(e,t,n))}};function $x(t,e,r,n,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,s,o):e.prototype&&e.prototype.isPureReactComponent?!Uu(r,n)||!Uu(i,s):!0}function hT(t,e,r){var n=!1,i=qs,s=e.contextType;return typeof s=="object"&&s!==null?s=Cn(s):(i=jr(e)?Go:_r.current,n=e.contextTypes,s=(n=n!=null)?ll(t,i):qs),e=new e(r,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Gf,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function Wx(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&Gf.enqueueReplaceState(e,e.state,null)}function Ly(t,e,r,n){var i=t.stateNode;i.props=r,i.state=t.memoizedState,i.refs={},P0(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Cn(s):(s=jr(e)?Go:_r.current,i.context=ll(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(By(t,e,s,r),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Gf.enqueueReplaceState(i,i.state,null),Jd(t,r,i,n),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function dl(t,e){try{var r="",n=e;do r+=yP(n),n=n.return;while(n);var i=r}catch(s){i=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:t,source:e,stack:i,digest:null}}function Zm(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Uy(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var $I=typeof WeakMap=="function"?WeakMap:Map;function cT(t,e,r){r=Ji(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){sf||(sf=!0,Qy=n),Uy(t,e)},r}function dT(t,e,r){r=Ji(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){Uy(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){Uy(t,e),typeof n!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function Vx(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new $I;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=iR.bind(null,t,e,r),e.then(t,t))}function Xx(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Yx(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Ji(-1,1),e.tag=2,Ws(r,e,1))),r.lanes|=1),t)}var WI=us.ReactCurrentOwner,zr=!1;function Tr(t,e,r,n){e.child=t===null?Gb(e,null,r,n):hl(e,t.child,r,n)}function Qx(t,e,r,n,i){r=r.render;var s=e.ref;return qa(e,i),n=N0(t,e,r,n,s,i),r=D0(),t!==null&&!zr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ss(t,e,i)):(dt&&r&&w0(e),e.flags|=1,Tr(t,e,n,i),e.child)}function Kx(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!$0(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,fT(t,e,s,n,i)):(t=bd(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:Uu,r(o,n)&&t.ref===e.ref)return ss(t,e,i)}return e.flags|=1,t=Ys(s,n),t.ref=e.ref,t.return=e,e.child=t}function fT(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(Uu(s,n)&&t.ref===e.ref)if(zr=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(zr=!0);else return e.lanes=t.lanes,ss(t,e,i)}return zy(t,e,r,n,i)}function pT(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},tt(Ha,Zr),Zr|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,tt(Ha,Zr),Zr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,tt(Ha,Zr),Zr|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,tt(Ha,Zr),Zr|=n;return Tr(t,e,i,r),e.child}function mT(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function zy(t,e,r,n,i){var s=jr(r)?Go:_r.current;return s=ll(e,s),qa(e,i),r=N0(t,e,r,n,s,i),n=D0(),t!==null&&!zr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ss(t,e,i)):(dt&&n&&w0(e),e.flags|=1,Tr(t,e,r,i),e.child)}function qx(t,e,r,n,i){if(jr(r)){var s=!0;Yd(e)}else s=!1;if(qa(e,i),e.stateNode===null)wd(t,e),hT(e,r,n),Ly(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var h=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cn(c):(c=jr(r)?Go:_r.current,c=ll(e,c));var f=r.getDerivedStateFromProps,m=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||h!==c)&&Wx(e,o,n,c),ks=!1;var p=e.memoizedState;o.state=p,Jd(e,n,o,i),h=e.memoizedState,l!==n||p!==h||Hr.current||ks?(typeof f=="function"&&(By(e,r,f,n),h=e.memoizedState),(l=ks||$x(e,r,l,n,p,h,c))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=h),o.props=n,o.state=h,o.context=c,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,jb(t,e),l=e.memoizedProps,c=e.type===e.elementType?l:zn(e.type,l),o.props=c,m=e.pendingProps,p=o.context,h=r.contextType,typeof h=="object"&&h!==null?h=Cn(h):(h=jr(r)?Go:_r.current,h=ll(e,h));var v=r.getDerivedStateFromProps;(f=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==m||p!==h)&&Wx(e,o,n,h),ks=!1,p=e.memoizedState,o.state=p,Jd(e,n,o,i);var _=e.memoizedState;l!==m||p!==_||Hr.current||ks?(typeof v=="function"&&(By(e,r,v,n),_=e.memoizedState),(c=ks||$x(e,r,c,n,p,_,h)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,_,h),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,_,h)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=_),o.props=n,o.state=_,o.context=h,n=c):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),n=!1)}return Gy(t,e,r,n,s,i)}function Gy(t,e,r,n,i,s){mT(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&Fx(e,r,!1),ss(t,e,s);n=e.stateNode,WI.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=hl(e,t.child,null,s),e.child=hl(e,null,l,s)):Tr(t,e,l,s),e.memoizedState=n.state,i&&Fx(e,r,!0),e.child}function gT(t){var e=t.stateNode;e.pendingContext?Ox(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Ox(t,e.context,!1),I0(t,e.containerInfo)}function Zx(t,e,r,n,i){return ul(),S0(i),e.flags|=256,Tr(t,e,r,n),e.child}var Hy={dehydrated:null,treeContext:null,retryLane:0};function jy(t){return{baseLanes:t,cachePool:null,transitions:null}}function yT(t,e,r){var n=e.pendingProps,i=gt.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),tt(gt,i&1),t===null)return Oy(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=$f(o,n,0,null),t=Bo(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=jy(r),e.memoizedState=Hy,t):B0(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return VI(t,e,o,n,l,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,l=i.sibling;var h={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=h,e.deletions=null):(n=Ys(i,h),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Ys(l,s):(s=Bo(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?jy(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=Hy,n}return s=t.child,t=s.sibling,n=Ys(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function B0(t,e){return e=$f({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ic(t,e,r,n){return n!==null&&S0(n),hl(e,t.child,null,r),t=B0(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function VI(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=Zm(Error(J(422))),Ic(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=$f({mode:"visible",children:n.children},i,0,null),s=Bo(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&hl(e,t.child,null,o),e.child.memoizedState=jy(o),e.memoizedState=Hy,s);if(!(e.mode&1))return Ic(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,s=Error(J(419)),n=Zm(s,n,void 0),Ic(t,e,o,n)}if(l=(o&t.childLanes)!==0,zr||l){if(n=Kt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,is(t,i),Yn(n,t,i,-1))}return j0(),n=Zm(Error(J(421))),Ic(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=sR.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Jr=$s(i.nextSibling),en=e,dt=!0,Hn=null,t!==null&&(_n[xn++]=Qi,_n[xn++]=Ki,_n[xn++]=Ho,Qi=t.id,Ki=t.overflow,Ho=e),e=B0(e,n.children),e.flags|=4096,e)}function Jx(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Fy(t.return,e,r)}function Jm(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function vT(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Tr(t,e,n.children,r),n=gt.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Jx(t,r,e);else if(t.tag===19)Jx(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(tt(gt,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&ef(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Jm(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&ef(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Jm(e,!0,r,null,s);break;case"together":Jm(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function wd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ss(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),$o|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(J(153));if(e.child!==null){for(t=e.child,r=Ys(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Ys(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function XI(t,e,r){switch(e.tag){case 3:gT(e),ul();break;case 5:$b(e);break;case 1:jr(e.type)&&Yd(e);break;case 4:I0(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;tt(qd,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(tt(gt,gt.current&1),e.flags|=128,null):r&e.child.childLanes?yT(t,e,r):(tt(gt,gt.current&1),t=ss(t,e,r),t!==null?t.sibling:null);tt(gt,gt.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return vT(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),tt(gt,gt.current),n)break;return null;case 22:case 23:return e.lanes=0,pT(t,e,r)}return ss(t,e,r)}var _T,$y,xT,wT;_T=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};$y=function(){};xT=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Oo(Ci.current);var s=null;switch(r){case"input":i=dy(t,i),n=dy(t,n),s=[];break;case"select":i=_t({},i,{value:void 0}),n=_t({},n,{value:void 0}),s=[];break;case"textarea":i=my(t,i),n=my(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Vd)}yy(r,n);var o;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ku.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in n){var h=n[c];if(l=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&h!==l&&(h!=null||l!=null))if(c==="style")if(l){for(o in l)!l.hasOwnProperty(o)||h&&h.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in h)h.hasOwnProperty(o)&&l[o]!==h[o]&&(r||(r={}),r[o]=h[o])}else r||(s||(s=[]),s.push(c,r)),r=h;else c==="dangerouslySetInnerHTML"?(h=h?h.__html:void 0,l=l?l.__html:void 0,h!=null&&l!==h&&(s=s||[]).push(c,h)):c==="children"?typeof h!="string"&&typeof h!="number"||(s=s||[]).push(c,""+h):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ku.hasOwnProperty(c)?(h!=null&&c==="onScroll"&&nt("scroll",t),s||l===h||(s=[])):(s=s||[]).push(c,h))}r&&(s=s||[]).push("style",r);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};wT=function(t,e,r,n){r!==n&&(e.flags|=4)};function Kl(t,e){if(!dt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function yr(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function YI(t,e,r){var n=e.pendingProps;switch(E0(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yr(e),null;case 1:return jr(e.type)&&Xd(),yr(e),null;case 3:return n=e.stateNode,cl(),st(Hr),st(_r),M0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Cc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Hn!==null&&(Zy(Hn),Hn=null))),$y(t,e),yr(e),null;case 5:R0(e);var i=Oo($u.current);if(r=e.type,t!==null&&e.stateNode!=null)xT(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(J(166));return yr(e),null}if(t=Oo(Ci.current),Cc(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[wi]=e,n[Hu]=s,t=(e.mode&1)!==0,r){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(i=0;i<au.length;i++)nt(au[i],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":lx(n,s),nt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},nt("invalid",n);break;case"textarea":hx(n,s),nt("invalid",n)}yy(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?n.textContent!==l&&(s.suppressHydrationWarning!==!0&&Ac(n.textContent,l,t),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&Ac(n.textContent,l,t),i=["children",""+l]):ku.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&nt("scroll",n)}switch(r){case"input":vc(n),ux(n,s,!0);break;case"textarea":vc(n),cx(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=Vd)}n=i,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=QS(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[wi]=e,t[Hu]=n,_T(t,e,!1,!1),e.stateNode=t;e:{switch(o=vy(r,n),r){case"dialog":nt("cancel",t),nt("close",t),i=n;break;case"iframe":case"object":case"embed":nt("load",t),i=n;break;case"video":case"audio":for(i=0;i<au.length;i++)nt(au[i],t);i=n;break;case"source":nt("error",t),i=n;break;case"img":case"image":case"link":nt("error",t),nt("load",t),i=n;break;case"details":nt("toggle",t),i=n;break;case"input":lx(t,n),i=dy(t,n),nt("invalid",t);break;case"option":i=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},i=_t({},n,{value:void 0}),nt("invalid",t);break;case"textarea":hx(t,n),i=my(t,n),nt("invalid",t);break;default:i=n}yy(r,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var h=l[s];s==="style"?ZS(t,h):s==="dangerouslySetInnerHTML"?(h=h?h.__html:void 0,h!=null&&KS(t,h)):s==="children"?typeof h=="string"?(r!=="textarea"||h!=="")&&Nu(t,h):typeof h=="number"&&Nu(t,""+h):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ku.hasOwnProperty(s)?h!=null&&s==="onScroll"&&nt("scroll",t):h!=null&&a0(t,s,h,o))}switch(r){case"input":vc(t),ux(t,n,!1);break;case"textarea":vc(t),cx(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Ks(n.value));break;case"select":t.multiple=!!n.multiple,s=n.value,s!=null?Xa(t,!!n.multiple,s,!1):n.defaultValue!=null&&Xa(t,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Vd)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return yr(e),null;case 6:if(t&&e.stateNode!=null)wT(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(J(166));if(r=Oo($u.current),Oo(Ci.current),Cc(e)){if(n=e.stateNode,r=e.memoizedProps,n[wi]=e,(s=n.nodeValue!==r)&&(t=en,t!==null))switch(t.tag){case 3:Ac(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ac(n.nodeValue,r,(t.mode&1)!==0)}s&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[wi]=e,e.stateNode=n}return yr(e),null;case 13:if(st(gt),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(dt&&Jr!==null&&e.mode&1&&!(e.flags&128))Ub(),ul(),e.flags|=98560,s=!1;else if(s=Cc(e),n!==null&&n.dehydrated!==null){if(t===null){if(!s)throw Error(J(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(J(317));s[wi]=e}else ul(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;yr(e),s=!1}else Hn!==null&&(Zy(Hn),Hn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||gt.current&1?Lt===0&&(Lt=3):j0())),e.updateQueue!==null&&(e.flags|=4),yr(e),null);case 4:return cl(),$y(t,e),t===null&&zu(e.stateNode.containerInfo),yr(e),null;case 10:return A0(e.type._context),yr(e),null;case 17:return jr(e.type)&&Xd(),yr(e),null;case 19:if(st(gt),s=e.memoizedState,s===null)return yr(e),null;if(n=(e.flags&128)!==0,o=s.rendering,o===null)if(n)Kl(s,!1);else{if(Lt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=ef(t),o!==null){for(e.flags|=128,Kl(s,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)s=r,t=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return tt(gt,gt.current&1|2),e.child}t=t.sibling}s.tail!==null&&Pt()>fl&&(e.flags|=128,n=!0,Kl(s,!1),e.lanes=4194304)}else{if(!n)if(t=ef(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Kl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!dt)return yr(e),null}else 2*Pt()-s.renderingStartTime>fl&&r!==1073741824&&(e.flags|=128,n=!0,Kl(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Pt(),e.sibling=null,r=gt.current,tt(gt,n?r&1|2:r&1),e):(yr(e),null);case 22:case 23:return H0(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Zr&1073741824&&(yr(e),e.subtreeFlags&6&&(e.flags|=8192)):yr(e),null;case 24:return null;case 25:return null}throw Error(J(156,e.tag))}function QI(t,e){switch(E0(e),e.tag){case 1:return jr(e.type)&&Xd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return cl(),st(Hr),st(_r),M0(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return R0(e),null;case 13:if(st(gt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(J(340));ul()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return st(gt),null;case 4:return cl(),null;case 10:return A0(e.type._context),null;case 22:case 23:return H0(),null;case 24:return null;default:return null}}var Rc=!1,vr=!1,KI=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Ga(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){St(t,e,n)}else r.current=null}function Wy(t,e,r){try{r()}catch(n){St(t,e,n)}}var ew=!1;function qI(t,e){if(Py=jd,t=Ab(),x0(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,h=-1,c=0,f=0,m=t,p=null;t:for(;;){for(var v;m!==r||i!==0&&m.nodeType!==3||(l=o+i),m!==s||n!==0&&m.nodeType!==3||(h=o+n),m.nodeType===3&&(o+=m.nodeValue.length),(v=m.firstChild)!==null;)p=m,m=v;for(;;){if(m===t)break t;if(p===r&&++c===i&&(l=o),p===s&&++f===n&&(h=o),(v=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=v}r=l===-1||h===-1?null:{start:l,end:h}}else r=null}r=r||{start:0,end:0}}else r=null;for(Iy={focusedElem:t,selectionRange:r},jd=!1,xe=e;xe!==null;)if(e=xe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xe=t;else for(;xe!==null;){e=xe;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var E=_.memoizedProps,A=_.memoizedState,S=e.stateNode,b=S.getSnapshotBeforeUpdate(e.elementType===e.type?E:zn(e.type,E),A);S.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(T){St(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,xe=t;break}xe=e.return}return _=ew,ew=!1,_}function Su(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Wy(e,r,s)}i=i.next}while(i!==n)}}function Hf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Vy(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function ET(t){var e=t.alternate;e!==null&&(t.alternate=null,ET(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[wi],delete e[Hu],delete e[ky],delete e[NI],delete e[DI])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ST(t){return t.tag===5||t.tag===3||t.tag===4}function tw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ST(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Xy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Vd));else if(n!==4&&(t=t.child,t!==null))for(Xy(t,e,r),t=t.sibling;t!==null;)Xy(t,e,r),t=t.sibling}function Yy(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Yy(t,e,r),t=t.sibling;t!==null;)Yy(t,e,r),t=t.sibling}var nr=null,Gn=!1;function Ts(t,e,r){for(r=r.child;r!==null;)bT(t,e,r),r=r.sibling}function bT(t,e,r){if(Ai&&typeof Ai.onCommitFiberUnmount=="function")try{Ai.onCommitFiberUnmount(Df,r)}catch{}switch(r.tag){case 5:vr||Ga(r,e);case 6:var n=nr,i=Gn;nr=null,Ts(t,e,r),nr=n,Gn=i,nr!==null&&(Gn?(t=nr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):nr.removeChild(r.stateNode));break;case 18:nr!==null&&(Gn?(t=nr,r=r.stateNode,t.nodeType===8?Vm(t.parentNode,r):t.nodeType===1&&Vm(t,r),Bu(t)):Vm(nr,r.stateNode));break;case 4:n=nr,i=Gn,nr=r.stateNode.containerInfo,Gn=!0,Ts(t,e,r),nr=n,Gn=i;break;case 0:case 11:case 14:case 15:if(!vr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Wy(r,e,o),i=i.next}while(i!==n)}Ts(t,e,r);break;case 1:if(!vr&&(Ga(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){St(r,e,l)}Ts(t,e,r);break;case 21:Ts(t,e,r);break;case 22:r.mode&1?(vr=(n=vr)||r.memoizedState!==null,Ts(t,e,r),vr=n):Ts(t,e,r);break;default:Ts(t,e,r)}}function rw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new KI),e.forEach(function(n){var i=oR.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function On(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:nr=l.stateNode,Gn=!1;break e;case 3:nr=l.stateNode.containerInfo,Gn=!0;break e;case 4:nr=l.stateNode.containerInfo,Gn=!0;break e}l=l.return}if(nr===null)throw Error(J(160));bT(s,o,i),nr=null,Gn=!1;var h=i.alternate;h!==null&&(h.return=null),i.return=null}catch(c){St(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)TT(e,t),e=e.sibling}function TT(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(On(e,t),hi(t),n&4){try{Su(3,t,t.return),Hf(3,t)}catch(E){St(t,t.return,E)}try{Su(5,t,t.return)}catch(E){St(t,t.return,E)}}break;case 1:On(e,t),hi(t),n&512&&r!==null&&Ga(r,r.return);break;case 5:if(On(e,t),hi(t),n&512&&r!==null&&Ga(r,r.return),t.flags&32){var i=t.stateNode;try{Nu(i,"")}catch(E){St(t,t.return,E)}}if(n&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=r!==null?r.memoizedProps:s,l=t.type,h=t.updateQueue;if(t.updateQueue=null,h!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&XS(i,s),vy(l,o);var c=vy(l,s);for(o=0;o<h.length;o+=2){var f=h[o],m=h[o+1];f==="style"?ZS(i,m):f==="dangerouslySetInnerHTML"?KS(i,m):f==="children"?Nu(i,m):a0(i,f,m,c)}switch(l){case"input":fy(i,s);break;case"textarea":YS(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var v=s.value;v!=null?Xa(i,!!s.multiple,v,!1):p!==!!s.multiple&&(s.defaultValue!=null?Xa(i,!!s.multiple,s.defaultValue,!0):Xa(i,!!s.multiple,s.multiple?[]:"",!1))}i[Hu]=s}catch(E){St(t,t.return,E)}}break;case 6:if(On(e,t),hi(t),n&4){if(t.stateNode===null)throw Error(J(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(E){St(t,t.return,E)}}break;case 3:if(On(e,t),hi(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Bu(e.containerInfo)}catch(E){St(t,t.return,E)}break;case 4:On(e,t),hi(t);break;case 13:On(e,t),hi(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(z0=Pt())),n&4&&rw(t);break;case 22:if(f=r!==null&&r.memoizedState!==null,t.mode&1?(vr=(c=vr)||f,On(e,t),vr=c):On(e,t),hi(t),n&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!f&&t.mode&1)for(xe=t,f=t.child;f!==null;){for(m=xe=f;xe!==null;){switch(p=xe,v=p.child,p.tag){case 0:case 11:case 14:case 15:Su(4,p,p.return);break;case 1:Ga(p,p.return);var _=p.stateNode;if(typeof _.componentWillUnmount=="function"){n=p,r=p.return;try{e=n,_.props=e.memoizedProps,_.state=e.memoizedState,_.componentWillUnmount()}catch(E){St(n,r,E)}}break;case 5:Ga(p,p.return);break;case 22:if(p.memoizedState!==null){iw(m);continue}}v!==null?(v.return=p,xe=v):iw(m)}f=f.sibling}e:for(f=null,m=t;;){if(m.tag===5){if(f===null){f=m;try{i=m.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=m.stateNode,h=m.memoizedProps.style,o=h!=null&&h.hasOwnProperty("display")?h.display:null,l.style.display=qS("display",o))}catch(E){St(t,t.return,E)}}}else if(m.tag===6){if(f===null)try{m.stateNode.nodeValue=c?"":m.memoizedProps}catch(E){St(t,t.return,E)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===t)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===t)break e;for(;m.sibling===null;){if(m.return===null||m.return===t)break e;f===m&&(f=null),m=m.return}f===m&&(f=null),m.sibling.return=m.return,m=m.sibling}}break;case 19:On(e,t),hi(t),n&4&&rw(t);break;case 21:break;default:On(e,t),hi(t)}}function hi(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(ST(r)){var n=r;break e}r=r.return}throw Error(J(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(Nu(i,""),n.flags&=-33);var s=tw(t);Yy(t,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=tw(t);Xy(t,l,o);break;default:throw Error(J(161))}}catch(h){St(t,t.return,h)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ZI(t,e,r){xe=t,AT(t)}function AT(t,e,r){for(var n=(t.mode&1)!==0;xe!==null;){var i=xe,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Rc;if(!o){var l=i.alternate,h=l!==null&&l.memoizedState!==null||vr;l=Rc;var c=vr;if(Rc=o,(vr=h)&&!c)for(xe=i;xe!==null;)o=xe,h=o.child,o.tag===22&&o.memoizedState!==null?sw(i):h!==null?(h.return=o,xe=h):sw(i);for(;s!==null;)xe=s,AT(s),s=s.sibling;xe=i,Rc=l,vr=c}nw(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,xe=s):nw(t)}}function nw(t){for(;xe!==null;){var e=xe;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:vr||Hf(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!vr)if(r===null)n.componentDidMount();else{var i=e.elementType===e.type?r.memoizedProps:zn(e.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Gx(e,s,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}Gx(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var h=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":h.autoFocus&&r.focus();break;case"img":h.src&&(r.src=h.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var m=f.dehydrated;m!==null&&Bu(m)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}vr||e.flags&512&&Vy(e)}catch(p){St(e,e.return,p)}}if(e===t){xe=null;break}if(r=e.sibling,r!==null){r.return=e.return,xe=r;break}xe=e.return}}function iw(t){for(;xe!==null;){var e=xe;if(e===t){xe=null;break}var r=e.sibling;if(r!==null){r.return=e.return,xe=r;break}xe=e.return}}function sw(t){for(;xe!==null;){var e=xe;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Hf(4,e)}catch(h){St(e,r,h)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var i=e.return;try{n.componentDidMount()}catch(h){St(e,i,h)}}var s=e.return;try{Vy(e)}catch(h){St(e,s,h)}break;case 5:var o=e.return;try{Vy(e)}catch(h){St(e,o,h)}}}catch(h){St(e,e.return,h)}if(e===t){xe=null;break}var l=e.sibling;if(l!==null){l.return=e.return,xe=l;break}xe=e.return}}var JI=Math.ceil,nf=us.ReactCurrentDispatcher,L0=us.ReactCurrentOwner,An=us.ReactCurrentBatchConfig,je=0,Kt=null,Mt=null,ar=0,Zr=0,Ha=ro(0),Lt=0,Yu=null,$o=0,jf=0,U0=0,bu=null,Lr=null,z0=0,fl=1/0,Vi=null,sf=!1,Qy=null,Vs=null,Mc=!1,Bs=null,of=0,Tu=0,Ky=null,Ed=-1,Sd=0;function Cr(){return je&6?Pt():Ed!==-1?Ed:Ed=Pt()}function Xs(t){return t.mode&1?je&2&&ar!==0?ar&-ar:FI.transition!==null?(Sd===0&&(Sd=hb()),Sd):(t=qe,t!==0||(t=window.event,t=t===void 0?16:yb(t.type)),t):1}function Yn(t,e,r,n){if(50<Tu)throw Tu=0,Ky=null,Error(J(185));sh(t,r,n),(!(je&2)||t!==Kt)&&(t===Kt&&(!(je&2)&&(jf|=r),Lt===4&&Ds(t,ar)),$r(t,n),r===1&&je===0&&!(e.mode&1)&&(fl=Pt()+500,Uf&&no()))}function $r(t,e){var r=t.callbackNode;FP(t,e);var n=Hd(t,t===Kt?ar:0);if(n===0)r!==null&&px(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&px(r),e===1)t.tag===0?OI(ow.bind(null,t)):Fb(ow.bind(null,t)),MI(function(){!(je&6)&&no()}),r=null;else{switch(cb(n)){case 1:r=d0;break;case 4:r=lb;break;case 16:r=Gd;break;case 536870912:r=ub;break;default:r=Gd}r=DT(r,CT.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function CT(t,e){if(Ed=-1,Sd=0,je&6)throw Error(J(327));var r=t.callbackNode;if(Za()&&t.callbackNode!==r)return null;var n=Hd(t,t===Kt?ar:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=af(t,n);else{e=n;var i=je;je|=2;var s=IT();(Kt!==t||ar!==e)&&(Vi=null,fl=Pt()+500,Fo(t,e));do try{rR();break}catch(l){PT(t,l)}while(!0);T0(),nf.current=s,je=i,Mt!==null?e=0:(Kt=null,ar=0,e=Lt)}if(e!==0){if(e===2&&(i=Sy(t),i!==0&&(n=i,e=qy(t,i))),e===1)throw r=Yu,Fo(t,0),Ds(t,n),$r(t,Pt()),r;if(e===6)Ds(t,n);else{if(i=t.current.alternate,!(n&30)&&!eR(i)&&(e=af(t,n),e===2&&(s=Sy(t),s!==0&&(n=s,e=qy(t,s))),e===1))throw r=Yu,Fo(t,0),Ds(t,n),$r(t,Pt()),r;switch(t.finishedWork=i,t.finishedLanes=n,e){case 0:case 1:throw Error(J(345));case 2:bo(t,Lr,Vi);break;case 3:if(Ds(t,n),(n&130023424)===n&&(e=z0+500-Pt(),10<e)){if(Hd(t,0)!==0)break;if(i=t.suspendedLanes,(i&n)!==n){Cr(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=My(bo.bind(null,t,Lr,Vi),e);break}bo(t,Lr,Vi);break;case 4:if(Ds(t,n),(n&4194240)===n)break;for(e=t.eventTimes,i=-1;0<n;){var o=31-Xn(n);s=1<<o,o=e[o],o>i&&(i=o),n&=~s}if(n=i,n=Pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*JI(n/1960))-n,10<n){t.timeoutHandle=My(bo.bind(null,t,Lr,Vi),n);break}bo(t,Lr,Vi);break;case 5:bo(t,Lr,Vi);break;default:throw Error(J(329))}}}return $r(t,Pt()),t.callbackNode===r?CT.bind(null,t):null}function qy(t,e){var r=bu;return t.current.memoizedState.isDehydrated&&(Fo(t,e).flags|=256),t=af(t,e),t!==2&&(e=Lr,Lr=r,e!==null&&Zy(e)),t}function Zy(t){Lr===null?Lr=t:Lr.push.apply(Lr,t)}function eR(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!qn(s(),i))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Ds(t,e){for(e&=~U0,e&=~jf,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Xn(e),n=1<<r;t[r]=-1,e&=~n}}function ow(t){if(je&6)throw Error(J(327));Za();var e=Hd(t,0);if(!(e&1))return $r(t,Pt()),null;var r=af(t,e);if(t.tag!==0&&r===2){var n=Sy(t);n!==0&&(e=n,r=qy(t,n))}if(r===1)throw r=Yu,Fo(t,0),Ds(t,e),$r(t,Pt()),r;if(r===6)throw Error(J(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,bo(t,Lr,Vi),$r(t,Pt()),null}function G0(t,e){var r=je;je|=1;try{return t(e)}finally{je=r,je===0&&(fl=Pt()+500,Uf&&no())}}function Wo(t){Bs!==null&&Bs.tag===0&&!(je&6)&&Za();var e=je;je|=1;var r=An.transition,n=qe;try{if(An.transition=null,qe=1,t)return t()}finally{qe=n,An.transition=r,je=e,!(je&6)&&no()}}function H0(){Zr=Ha.current,st(Ha)}function Fo(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,RI(r)),Mt!==null)for(r=Mt.return;r!==null;){var n=r;switch(E0(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Xd();break;case 3:cl(),st(Hr),st(_r),M0();break;case 5:R0(n);break;case 4:cl();break;case 13:st(gt);break;case 19:st(gt);break;case 10:A0(n.type._context);break;case 22:case 23:H0()}r=r.return}if(Kt=t,Mt=t=Ys(t.current,null),ar=Zr=e,Lt=0,Yu=null,U0=jf=$o=0,Lr=bu=null,Do!==null){for(e=0;e<Do.length;e++)if(r=Do[e],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}Do=null}return t}function PT(t,e){do{var r=Mt;try{if(T0(),_d.current=rf,tf){for(var n=vt.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}tf=!1}if(jo=0,Xt=Bt=vt=null,Eu=!1,Wu=0,L0.current=null,r===null||r.return===null){Lt=1,Yu=e,Mt=null;break}e:{var s=t,o=r.return,l=r,h=e;if(e=ar,l.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){var c=h,f=l,m=f.tag;if(!(f.mode&1)&&(m===0||m===11||m===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var v=Xx(o);if(v!==null){v.flags&=-257,Yx(v,o,l,s,e),v.mode&1&&Vx(s,c,e),e=v,h=c;var _=e.updateQueue;if(_===null){var E=new Set;E.add(h),e.updateQueue=E}else _.add(h);break e}else{if(!(e&1)){Vx(s,c,e),j0();break e}h=Error(J(426))}}else if(dt&&l.mode&1){var A=Xx(o);if(A!==null){!(A.flags&65536)&&(A.flags|=256),Yx(A,o,l,s,e),S0(dl(h,l));break e}}s=h=dl(h,l),Lt!==4&&(Lt=2),bu===null?bu=[s]:bu.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var S=cT(s,h,e);zx(s,S);break e;case 1:l=h;var b=s.type,w=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Vs===null||!Vs.has(w)))){s.flags|=65536,e&=-e,s.lanes|=e;var T=dT(s,l,e);zx(s,T);break e}}s=s.return}while(s!==null)}MT(r)}catch(R){e=R,Mt===r&&r!==null&&(Mt=r=r.return);continue}break}while(!0)}function IT(){var t=nf.current;return nf.current=rf,t===null?rf:t}function j0(){(Lt===0||Lt===3||Lt===2)&&(Lt=4),Kt===null||!($o&268435455)&&!(jf&268435455)||Ds(Kt,ar)}function af(t,e){var r=je;je|=2;var n=IT();(Kt!==t||ar!==e)&&(Vi=null,Fo(t,e));do try{tR();break}catch(i){PT(t,i)}while(!0);if(T0(),je=r,nf.current=n,Mt!==null)throw Error(J(261));return Kt=null,ar=0,Lt}function tR(){for(;Mt!==null;)RT(Mt)}function rR(){for(;Mt!==null&&!CP();)RT(Mt)}function RT(t){var e=NT(t.alternate,t,Zr);t.memoizedProps=t.pendingProps,e===null?MT(t):Mt=e,L0.current=null}function MT(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=QI(r,e),r!==null){r.flags&=32767,Mt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Lt=6,Mt=null;return}}else if(r=YI(r,e,Zr),r!==null){Mt=r;return}if(e=e.sibling,e!==null){Mt=e;return}Mt=e=t}while(e!==null);Lt===0&&(Lt=5)}function bo(t,e,r){var n=qe,i=An.transition;try{An.transition=null,qe=1,nR(t,e,r,n)}finally{An.transition=i,qe=n}return null}function nR(t,e,r,n){do Za();while(Bs!==null);if(je&6)throw Error(J(327));r=t.finishedWork;var i=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(J(177));t.callbackNode=null,t.callbackPriority=0;var s=r.lanes|r.childLanes;if(BP(t,s),t===Kt&&(Mt=Kt=null,ar=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Mc||(Mc=!0,DT(Gd,function(){return Za(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=An.transition,An.transition=null;var o=qe;qe=1;var l=je;je|=4,L0.current=null,qI(t,r),TT(r,t),SI(Iy),jd=!!Py,Iy=Py=null,t.current=r,ZI(r),PP(),je=l,qe=o,An.transition=s}else t.current=r;if(Mc&&(Mc=!1,Bs=t,of=i),s=t.pendingLanes,s===0&&(Vs=null),MP(r.stateNode),$r(t,Pt()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)i=e[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(sf)throw sf=!1,t=Qy,Qy=null,t;return of&1&&t.tag!==0&&Za(),s=t.pendingLanes,s&1?t===Ky?Tu++:(Tu=0,Ky=t):Tu=0,no(),null}function Za(){if(Bs!==null){var t=cb(of),e=An.transition,r=qe;try{if(An.transition=null,qe=16>t?16:t,Bs===null)var n=!1;else{if(t=Bs,Bs=null,of=0,je&6)throw Error(J(331));var i=je;for(je|=4,xe=t.current;xe!==null;){var s=xe,o=s.child;if(xe.flags&16){var l=s.deletions;if(l!==null){for(var h=0;h<l.length;h++){var c=l[h];for(xe=c;xe!==null;){var f=xe;switch(f.tag){case 0:case 11:case 15:Su(8,f,s)}var m=f.child;if(m!==null)m.return=f,xe=m;else for(;xe!==null;){f=xe;var p=f.sibling,v=f.return;if(ET(f),f===c){xe=null;break}if(p!==null){p.return=v,xe=p;break}xe=v}}}var _=s.alternate;if(_!==null){var E=_.child;if(E!==null){_.child=null;do{var A=E.sibling;E.sibling=null,E=A}while(E!==null)}}xe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,xe=o;else e:for(;xe!==null;){if(s=xe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Su(9,s,s.return)}var S=s.sibling;if(S!==null){S.return=s.return,xe=S;break e}xe=s.return}}var b=t.current;for(xe=b;xe!==null;){o=xe;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,xe=w;else e:for(o=b;xe!==null;){if(l=xe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Hf(9,l)}}catch(R){St(l,l.return,R)}if(l===o){xe=null;break e}var T=l.sibling;if(T!==null){T.return=l.return,xe=T;break e}xe=l.return}}if(je=i,no(),Ai&&typeof Ai.onPostCommitFiberRoot=="function")try{Ai.onPostCommitFiberRoot(Df,t)}catch{}n=!0}return n}finally{qe=r,An.transition=e}}return!1}function aw(t,e,r){e=dl(r,e),e=cT(t,e,1),t=Ws(t,e,1),e=Cr(),t!==null&&(sh(t,1,e),$r(t,e))}function St(t,e,r){if(t.tag===3)aw(t,t,r);else for(;e!==null;){if(e.tag===3){aw(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Vs===null||!Vs.has(n))){t=dl(r,t),t=dT(e,t,1),e=Ws(e,t,1),t=Cr(),e!==null&&(sh(e,1,t),$r(e,t));break}}e=e.return}}function iR(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Cr(),t.pingedLanes|=t.suspendedLanes&r,Kt===t&&(ar&r)===r&&(Lt===4||Lt===3&&(ar&130023424)===ar&&500>Pt()-z0?Fo(t,0):U0|=r),$r(t,e)}function kT(t,e){e===0&&(t.mode&1?(e=wc,wc<<=1,!(wc&130023424)&&(wc=4194304)):e=1);var r=Cr();t=is(t,e),t!==null&&(sh(t,e,r),$r(t,r))}function sR(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),kT(t,r)}function oR(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(J(314))}n!==null&&n.delete(e),kT(t,r)}var NT;NT=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Hr.current)zr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return zr=!1,XI(t,e,r);zr=!!(t.flags&131072)}else zr=!1,dt&&e.flags&1048576&&Bb(e,Kd,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;wd(t,e),t=e.pendingProps;var i=ll(e,_r.current);qa(e,r),i=N0(null,e,n,t,i,r);var s=D0();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,jr(n)?(s=!0,Yd(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,P0(e),i.updater=Gf,e.stateNode=i,i._reactInternals=e,Ly(e,n,t,r),e=Gy(null,e,n,!0,s,r)):(e.tag=0,dt&&s&&w0(e),Tr(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(wd(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=lR(n),t=zn(n,t),i){case 0:e=zy(null,e,n,t,r);break e;case 1:e=qx(null,e,n,t,r);break e;case 11:e=Qx(null,e,n,t,r);break e;case 14:e=Kx(null,e,n,zn(n.type,t),r);break e}throw Error(J(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:zn(n,i),zy(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:zn(n,i),qx(t,e,n,i,r);case 3:e:{if(gT(e),t===null)throw Error(J(387));n=e.pendingProps,s=e.memoizedState,i=s.element,jb(t,e),Jd(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=dl(Error(J(423)),e),e=Zx(t,e,n,r,i);break e}else if(n!==i){i=dl(Error(J(424)),e),e=Zx(t,e,n,r,i);break e}else for(Jr=$s(e.stateNode.containerInfo.firstChild),en=e,dt=!0,Hn=null,r=Gb(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ul(),n===i){e=ss(t,e,r);break e}Tr(t,e,n,r)}e=e.child}return e;case 5:return $b(e),t===null&&Oy(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Ry(n,i)?o=null:s!==null&&Ry(n,s)&&(e.flags|=32),mT(t,e),Tr(t,e,o,r),e.child;case 6:return t===null&&Oy(e),null;case 13:return yT(t,e,r);case 4:return I0(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=hl(e,null,n,r):Tr(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:zn(n,i),Qx(t,e,n,i,r);case 7:return Tr(t,e,e.pendingProps,r),e.child;case 8:return Tr(t,e,e.pendingProps.children,r),e.child;case 12:return Tr(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,tt(qd,n._currentValue),n._currentValue=o,s!==null)if(qn(s.value,o)){if(s.children===i.children&&!Hr.current){e=ss(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var h=l.firstContext;h!==null;){if(h.context===n){if(s.tag===1){h=Ji(-1,r&-r),h.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?h.next=h:(h.next=f.next,f.next=h),c.pending=h}}s.lanes|=r,h=s.alternate,h!==null&&(h.lanes|=r),Fy(s.return,r,e),l.lanes|=r;break}h=h.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(J(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Fy(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Tr(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,qa(e,r),i=Cn(i),n=n(i),e.flags|=1,Tr(t,e,n,r),e.child;case 14:return n=e.type,i=zn(n,e.pendingProps),i=zn(n.type,i),Kx(t,e,n,i,r);case 15:return fT(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:zn(n,i),wd(t,e),e.tag=1,jr(n)?(t=!0,Yd(e)):t=!1,qa(e,r),hT(e,n,i),Ly(e,n,i,r),Gy(null,e,n,!0,t,r);case 19:return vT(t,e,r);case 22:return pT(t,e,r)}throw Error(J(156,e.tag))};function DT(t,e){return ab(t,e)}function aR(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(t,e,r,n){return new aR(t,e,r,n)}function $0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function lR(t){if(typeof t=="function")return $0(t)?1:0;if(t!=null){if(t=t.$$typeof,t===u0)return 11;if(t===h0)return 14}return 2}function Ys(t,e){var r=t.alternate;return r===null?(r=En(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function bd(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")$0(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ka:return Bo(r.children,i,s,e);case l0:o=8,i|=8;break;case ly:return t=En(12,r,e,i|2),t.elementType=ly,t.lanes=s,t;case uy:return t=En(13,r,e,i),t.elementType=uy,t.lanes=s,t;case hy:return t=En(19,r,e,i),t.elementType=hy,t.lanes=s,t;case $S:return $f(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case HS:o=10;break e;case jS:o=9;break e;case u0:o=11;break e;case h0:o=14;break e;case Ms:o=16,n=null;break e}throw Error(J(130,t==null?t:typeof t,""))}return e=En(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Bo(t,e,r,n){return t=En(7,t,n,e),t.lanes=r,t}function $f(t,e,r,n){return t=En(22,t,n,e),t.elementType=$S,t.lanes=r,t.stateNode={isHidden:!1},t}function eg(t,e,r){return t=En(6,t,null,e),t.lanes=r,t}function tg(t,e,r){return e=En(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function uR(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Om(0),this.expirationTimes=Om(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Om(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function W0(t,e,r,n,i,s,o,l,h){return t=new uR(t,e,r,l,h),e===1?(e=1,s===!0&&(e|=8)):e=0,s=En(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},P0(s),t}function hR(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ma,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function OT(t){if(!t)return qs;t=t._reactInternals;e:{if(Qo(t)!==t||t.tag!==1)throw Error(J(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(jr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(J(171))}if(t.tag===1){var r=t.type;if(jr(r))return Ob(t,r,e)}return e}function FT(t,e,r,n,i,s,o,l,h){return t=W0(r,n,!0,t,i,s,o,l,h),t.context=OT(null),r=t.current,n=Cr(),i=Xs(r),s=Ji(n,i),s.callback=e??null,Ws(r,s,i),t.current.lanes=i,sh(t,i,n),$r(t,n),t}function Wf(t,e,r,n){var i=e.current,s=Cr(),o=Xs(i);return r=OT(r),e.context===null?e.context=r:e.pendingContext=r,e=Ji(s,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Ws(i,e,o),t!==null&&(Yn(t,i,o,s),vd(t,i,o)),o}function lf(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function lw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function V0(t,e){lw(t,e),(t=t.alternate)&&lw(t,e)}function cR(){return null}var BT=typeof reportError=="function"?reportError:function(t){console.error(t)};function X0(t){this._internalRoot=t}Vf.prototype.render=X0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(J(409));Wf(t,e,null,null)};Vf.prototype.unmount=X0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Wo(function(){Wf(null,t,null,null)}),e[ns]=null}};function Vf(t){this._internalRoot=t}Vf.prototype.unstable_scheduleHydration=function(t){if(t){var e=pb();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ns.length&&e!==0&&e<Ns[r].priority;r++);Ns.splice(r,0,t),r===0&&gb(t)}};function Y0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Xf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function uw(){}function dR(t,e,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var c=lf(o);s.call(c)}}var o=FT(e,n,t,0,null,!1,!1,"",uw);return t._reactRootContainer=o,t[ns]=o.current,zu(t.nodeType===8?t.parentNode:t),Wo(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var c=lf(h);l.call(c)}}var h=W0(t,0,!1,null,null,!1,!1,"",uw);return t._reactRootContainer=h,t[ns]=h.current,zu(t.nodeType===8?t.parentNode:t),Wo(function(){Wf(e,h,r,n)}),h}function Yf(t,e,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var h=lf(o);l.call(h)}}Wf(e,o,t,i)}else o=dR(r,e,t,i,n);return lf(o)}db=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=ou(e.pendingLanes);r!==0&&(f0(e,r|1),$r(e,Pt()),!(je&6)&&(fl=Pt()+500,no()))}break;case 13:Wo(function(){var n=is(t,1);if(n!==null){var i=Cr();Yn(n,t,1,i)}}),V0(t,1)}};p0=function(t){if(t.tag===13){var e=is(t,134217728);if(e!==null){var r=Cr();Yn(e,t,134217728,r)}V0(t,134217728)}};fb=function(t){if(t.tag===13){var e=Xs(t),r=is(t,e);if(r!==null){var n=Cr();Yn(r,t,e,n)}V0(t,e)}};pb=function(){return qe};mb=function(t,e){var r=qe;try{return qe=t,e()}finally{qe=r}};xy=function(t,e,r){switch(e){case"input":if(fy(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var i=Lf(n);if(!i)throw Error(J(90));VS(n),fy(n,i)}}}break;case"textarea":YS(t,r);break;case"select":e=r.value,e!=null&&Xa(t,!!r.multiple,e,!1)}};tb=G0;rb=Wo;var fR={usingClientEntryPoint:!1,Events:[ah,Fa,Lf,JS,eb,G0]},ql={findFiberByHostInstance:No,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},pR={bundleType:ql.bundleType,version:ql.version,rendererPackageName:ql.rendererPackageName,rendererConfig:ql.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:us.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=sb(t),t===null?null:t.stateNode},findFiberByHostInstance:ql.findFiberByHostInstance||cR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Df=kc.inject(pR),Ai=kc}catch{}}nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fR;nn.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Y0(e))throw Error(J(200));return hR(t,e,null,r)};nn.createRoot=function(t,e){if(!Y0(t))throw Error(J(299));var r=!1,n="",i=BT;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=W0(t,1,!1,null,null,r,!1,n,i),t[ns]=e.current,zu(t.nodeType===8?t.parentNode:t),new X0(e)};nn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(J(188)):(t=Object.keys(t).join(","),Error(J(268,t)));return t=sb(e),t=t===null?null:t.stateNode,t};nn.flushSync=function(t){return Wo(t)};nn.hydrate=function(t,e,r){if(!Xf(e))throw Error(J(200));return Yf(null,t,e,!0,r)};nn.hydrateRoot=function(t,e,r){if(!Y0(t))throw Error(J(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=BT;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=FT(e,null,t,1,r??null,i,!1,s,o),t[ns]=e.current,zu(t),n)for(t=0;t<n.length;t++)r=n[t],i=r._getVersion,i=i(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,i]:e.mutableSourceEagerHydrationData.push(r,i);return new Vf(e)};nn.render=function(t,e,r){if(!Xf(e))throw Error(J(200));return Yf(null,t,e,!1,r)};nn.unmountComponentAtNode=function(t){if(!Xf(t))throw Error(J(40));return t._reactRootContainer?(Wo(function(){Yf(null,null,t,!1,function(){t._reactRootContainer=null,t[ns]=null})}),!0):!1};nn.unstable_batchedUpdates=G0;nn.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Xf(r))throw Error(J(200));if(t==null||t._reactInternals===void 0)throw Error(J(38));return Yf(t,e,r,!1,n)};nn.version="18.3.1-next-f1338f8080-20240426";function LT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(LT)}catch(t){console.error(t)}}LT(),LS.exports=nn;var mR=LS.exports,hw=mR;oy.createRoot=hw.createRoot,oy.hydrateRoot=hw.hydrateRoot;var Qf={},UT={exports:{}},gR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",yR=gR,vR=yR;function zT(){}function GT(){}GT.resetWarningCache=zT;var _R=function(){function t(n,i,s,o,l,h){if(h!==vR){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:GT,resetWarningCache:zT};return r.PropTypes=r,r};UT.exports=_R();var Q0=UT.exports;const it=kf(Q0);var HT={L:1,M:0,Q:3,H:2},jT={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},xR=jT;function $T(t){this.mode=xR.MODE_8BIT_BYTE,this.data=t}$T.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}};var wR=$T,Nc=HT;function Ei(t,e){this.totalCount=t,this.dataCount=e}Ei.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Ei.getRSBlocks=function(t,e){var r=Ei.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=new Array,s=0;s<n;s++)for(var o=r[s*3+0],l=r[s*3+1],h=r[s*3+2],c=0;c<o;c++)i.push(new Ei(l,h));return i};Ei.getRsBlockTable=function(t,e){switch(e){case Nc.L:return Ei.RS_BLOCK_TABLE[(t-1)*4+0];case Nc.M:return Ei.RS_BLOCK_TABLE[(t-1)*4+1];case Nc.Q:return Ei.RS_BLOCK_TABLE[(t-1)*4+2];case Nc.H:return Ei.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};var ER=Ei;function WT(){this.buffer=new Array,this.length=0}WT.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var SR=WT,jn={glog:function(t){if(t<1)throw new Error("glog("+t+")");return jn.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return jn.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var sr=0;sr<8;sr++)jn.EXP_TABLE[sr]=1<<sr;for(var sr=8;sr<256;sr++)jn.EXP_TABLE[sr]=jn.EXP_TABLE[sr-4]^jn.EXP_TABLE[sr-5]^jn.EXP_TABLE[sr-6]^jn.EXP_TABLE[sr-8];for(var sr=0;sr<255;sr++)jn.LOG_TABLE[jn.EXP_TABLE[sr]]=sr;var VT=jn,_o=VT;function Td(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}Td.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=_o.gexp(_o.glog(this.get(r))+_o.glog(t.get(n)));return new Td(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=_o.glog(this.get(0))-_o.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=_o.gexp(_o.glog(t.get(n))+e);return new Td(r,0).mod(t)}};var XT=Td,gn=jT,cw=XT,bR=VT,As={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tr={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;tr.getBCHDigit(e)-tr.getBCHDigit(tr.G15)>=0;)e^=tr.G15<<tr.getBCHDigit(e)-tr.getBCHDigit(tr.G15);return(t<<10|e)^tr.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;tr.getBCHDigit(e)-tr.getBCHDigit(tr.G18)>=0;)e^=tr.G18<<tr.getBCHDigit(e)-tr.getBCHDigit(tr.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return tr.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case As.PATTERN000:return(e+r)%2==0;case As.PATTERN001:return e%2==0;case As.PATTERN010:return r%3==0;case As.PATTERN011:return(e+r)%3==0;case As.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case As.PATTERN101:return e*r%2+e*r%3==0;case As.PATTERN110:return(e*r%2+e*r%3)%2==0;case As.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new cw([1],0),r=0;r<t;r++)e=e.multiply(new cw([1,bR.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case gn.MODE_NUMBER:return 10;case gn.MODE_ALPHA_NUM:return 9;case gn.MODE_8BIT_BYTE:return 8;case gn.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case gn.MODE_NUMBER:return 12;case gn.MODE_ALPHA_NUM:return 11;case gn.MODE_8BIT_BYTE:return 16;case gn.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case gn.MODE_NUMBER:return 14;case gn.MODE_ALPHA_NUM:return 13;case gn.MODE_8BIT_BYTE:return 16;case gn.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),l=-1;l<=1;l++)if(!(n+l<0||e<=n+l))for(var h=-1;h<=1;h++)i+h<0||e<=i+h||l==0&&h==0||o==t.isDark(n+l,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var c=0;t.isDark(n,i)&&c++,t.isDark(n+1,i)&&c++,t.isDark(n,i+1)&&c++,t.isDark(n+1,i+1)&&c++,(c==0||c==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var f=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&f++;var m=Math.abs(100*f/e/e-50)/5;return r+=m*10,r}},TR=tr,AR=wR,YT=ER,QT=SR,io=TR,CR=XT;function Si(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var on=Si.prototype;on.addData=function(t){var e=new AR(t);this.dataList.push(e),this.dataCache=null};on.isDark=function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]};on.getModuleCount=function(){return this.moduleCount};on.make=function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=YT.getRSBlocks(t,this.errorCorrectLevel),r=new QT,n=0,i=0;i<e.length;i++)n+=e[i].dataCount;for(var i=0;i<this.dataList.length;i++){var s=this.dataList[i];r.put(s.mode,4),r.put(s.getLength(),io.getLengthInBits(s.mode,t)),s.write(r)}if(r.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())};on.makeImpl=function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Si.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};on.setupPositionProbePattern=function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)};on.getBestMaskPattern=function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=io.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e};on.createMovieClip=function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,l=0;l<this.modules[s].length;l++){var h=l*i,c=this.modules[s][l];c&&(n.beginFill(0,100),n.moveTo(h,o),n.lineTo(h+i,o),n.lineTo(h+i,o+i),n.lineTo(h,o+i),n.endFill())}return n};on.setupTimingPattern=function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};on.setupPositionAdjustPattern=function(){for(var t=io.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}};on.setupTypeNumber=function(t){for(var e=io.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}};on.setupTypeInfo=function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=io.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t};on.mapData=function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var l=0;l<2;l++)if(this.modules[n][o-l]==null){var h=!1;s<t.length&&(h=(t[s]>>>i&1)==1);var c=io.getMask(e,n,o-l);c&&(h=!h),this.modules[n][o-l]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}};Si.PAD0=236;Si.PAD1=17;Si.createData=function(t,e,r){for(var n=YT.getRSBlocks(t,e),i=new QT,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),io.getLengthInBits(o.mode,t)),o.write(i)}for(var l=0,s=0;s<n.length;s++)l+=n[s].dataCount;if(i.getLengthInBits()>l*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+l*8+")");for(i.getLengthInBits()+4<=l*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=l*8||(i.put(Si.PAD0,8),i.getLengthInBits()>=l*8));)i.put(Si.PAD1,8);return Si.createBytes(i,n)};Si.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),l=0;l<e.length;l++){var h=e[l].dataCount,c=e[l].totalCount-h;n=Math.max(n,h),i=Math.max(i,c),s[l]=new Array(h);for(var f=0;f<s[l].length;f++)s[l][f]=255&t.buffer[f+r];r+=h;var m=io.getErrorCorrectPolynomial(c),p=new CR(s[l],m.getLength()-1),v=p.mod(m);o[l]=new Array(m.getLength()-1);for(var f=0;f<o[l].length;f++){var _=f+v.getLength()-o[l].length;o[l][f]=_>=0?v.get(_):0}}for(var E=0,f=0;f<e.length;f++)E+=e[f].totalCount;for(var A=new Array(E),S=0,f=0;f<n;f++)for(var l=0;l<e.length;l++)f<s[l].length&&(A[S++]=s[l][f]);for(var f=0;f<i;f++)for(var l=0;l<e.length;l++)f<o[l].length&&(A[S++]=o[l][f]);return A};var PR=Si,K0={};Object.defineProperty(K0,"__esModule",{value:!0});var IR=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},RR=Q0,yn=qT(RR),KT=Ce,Dc=qT(KT);function qT(t){return t&&t.__esModule?t:{default:t}}function MR(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}var kR={bgColor:yn.default.oneOfType([yn.default.object,yn.default.string]).isRequired,bgD:yn.default.string.isRequired,fgColor:yn.default.oneOfType([yn.default.object,yn.default.string]).isRequired,fgD:yn.default.string.isRequired,size:yn.default.number.isRequired,title:yn.default.string,viewBoxSize:yn.default.number.isRequired,xmlns:yn.default.string},q0=(0,KT.forwardRef)(function(t,e){var r=t.bgColor,n=t.bgD,i=t.fgD,s=t.fgColor,o=t.size,l=t.title,h=t.viewBoxSize,c=t.xmlns,f=c===void 0?"http://www.w3.org/2000/svg":c,m=MR(t,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return Dc.default.createElement("svg",IR({},m,{height:o,ref:e,viewBox:"0 0 "+h+" "+h,width:o,xmlns:f}),l?Dc.default.createElement("title",null,l):null,Dc.default.createElement("path",{d:n,fill:r}),Dc.default.createElement("path",{d:i,fill:s}))});q0.displayName="QRCodeSvg";q0.propTypes=kR;K0.default=q0;Object.defineProperty(Qf,"__esModule",{value:!0});Qf.QRCode=void 0;var NR=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},DR=Q0,Gi=uh(DR),OR=HT,FR=uh(OR),BR=PR,LR=uh(BR),ZT=Ce,UR=uh(ZT),zR=K0,GR=uh(zR);function uh(t){return t&&t.__esModule?t:{default:t}}function HR(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}var jR={bgColor:Gi.default.oneOfType([Gi.default.object,Gi.default.string]),fgColor:Gi.default.oneOfType([Gi.default.object,Gi.default.string]),level:Gi.default.string,size:Gi.default.number,value:Gi.default.string.isRequired},Kf=(0,ZT.forwardRef)(function(t,e){var r=t.bgColor,n=r===void 0?"#FFFFFF":r,i=t.fgColor,s=i===void 0?"#000000":i,o=t.level,l=o===void 0?"L":o,h=t.size,c=h===void 0?256:h,f=t.value,m=HR(t,["bgColor","fgColor","level","size","value"]),p=new LR.default(-1,FR.default[l]);p.addData(f),p.make();var v=p.modules;return UR.default.createElement(GR.default,NR({},m,{bgColor:n,bgD:v.map(function(_,E){return _.map(function(A,S){return A?"":"M "+S+" "+E+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:s,fgD:v.map(function(_,E){return _.map(function(A,S){return A?"M "+S+" "+E+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:c,viewBoxSize:v.length}))});Qf.QRCode=Kf;Kf.displayName="QRCode";Kf.propTypes=jR;var $R=Qf.default=Kf;const WR=({selectedAgent:t})=>U.jsxs("div",{className:"data-panel",children:[U.jsx("div",{className:"gamish-panel-title",children:U.jsx("span",{children:"AGENT PROFILE"})}),t?U.jsxs("div",{className:"flex flex-col gap-4",children:[U.jsxs("div",{className:"flex gap-3 items-center",children:[U.jsx("div",{className:"w-10 h-10 bg-slate-900 border-2 border-slate-600 rounded flex items-center justify-center",children:U.jsx("span",{className:"text-xl",children:"👾"})}),U.jsxs("div",{className:"flex flex-col",children:[U.jsx("span",{className:"text-primary font-bold text-xs uppercase tracking-wider",children:t.alias||t.name||"Unknown Agent"}),U.jsx("span",{className:"text-[9px] text-slate-400 uppercase",children:t.role||"Operative"})]})]}),U.jsxs("div",{className:"agent-stats",children:[U.jsxs("div",{className:"stat-box",children:[U.jsx("span",{className:"stat-label",children:"Model"}),U.jsx("span",{className:"stat-value truncate block",children:t.model||"N/A"})]}),U.jsxs("div",{className:"stat-box",children:[U.jsx("span",{className:"stat-label",children:"Status"}),U.jsx("span",{className:`stat-value uppercase ${t.status==="working"?"text-amber-400":"text-slate-400"}`,children:t.status||"IDLE"})]}),U.jsxs("div",{className:"stat-box col-span-2",children:[U.jsx("span",{className:"stat-label",children:"Provider"}),U.jsx("span",{className:"stat-value",children:t.provider||"Unknown"})]})]}),t.sessionId&&U.jsxs("div",{className:"border-t border-slate-700 pt-2",children:[U.jsx("span",{className:"stat-label mb-1",children:"Assigned Session"}),U.jsx("div",{className:"text-[9px] font-mono text-emerald-400/80 bg-emerald-950/30 p-1.5 rounded border border-emerald-900/50 truncate",children:t.sessionId})]}),t.lastMessageSnippet&&U.jsxs("div",{className:"bg-slate-900/50 p-2 rounded border border-slate-700/50",children:[U.jsx("span",{className:"stat-label mb-1 text-slate-500",children:"Last Transmission"}),U.jsxs("p",{className:"text-[9px] text-slate-300 italic",children:['"',t.lastMessageSnippet.slice(0,100),t.lastMessageSnippet.length>100?"...":"",'"']})]})]}):U.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-slate-600 gap-2",children:[U.jsx("span",{className:"text-2xl opacity-20",children:"?"}),U.jsx("span",{className:"text-[9px] uppercase",children:"Select an agent"})]})]});var JT={exports:{}},Ko=(t=>(t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2",t))(Ko||{}),eA=(t=>(t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS",t))(eA||{}),Jy=(t=>(t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL",t))(Jy||{}),Me=(t=>(t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR",t))(Me||{}),Wn=(t=>(t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t))(Wn||{}),te=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(te||{}),Ja=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(Ja||{}),Ae=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(Ae||{}),ge=(t=>(t[t.FLOAT=0]="FLOAT",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t))(ge||{}),Sn=(t=>(t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR",t))(Sn||{}),es=(t=>(t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t))(es||{}),Ri=(t=>(t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON",t[t.ON_MANUAL=3]="ON_MANUAL",t))(Ri||{}),Gr=(t=>(t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",t))(Gr||{}),_i=(t=>(t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT",t))(_i||{}),Z0=(t=>(t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL",t))(Z0||{}),bn=(t=>(t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp",t))(bn||{}),Ft=(t=>(t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE",t[t.COLOR=4]="COLOR",t))(Ft||{}),Rt=(t=>(t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH",t))(Rt||{}),Pi=(t=>(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(Pi||{});const VR={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")},pe={ADAPTER:VR,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var rg=/iPhone/i,dw=/iPod/i,fw=/iPad/i,pw=/\biOS-universal(?:.+)Mac\b/i,ng=/\bAndroid(?:.+)Mobile\b/i,mw=/Android/i,va=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Oc=/Silk/i,Hi=/Windows Phone/i,gw=/\bWindows(?:.+)ARM\b/i,yw=/BlackBerry/i,vw=/BB10/i,_w=/Opera Mini/i,xw=/\b(CriOS|Chrome)(?:.+)Mobile/i,ww=/Mobile(?:.+)Firefox\b/i,Ew=function(t){return typeof t<"u"&&t.platform==="MacIntel"&&typeof t.maxTouchPoints=="number"&&t.maxTouchPoints>1&&typeof MSStream>"u"};function XR(t){return function(e){return e.test(t)}}function Sw(t){var e={userAgent:"",platform:"",maxTouchPoints:0};!t&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof t=="string"?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0});var r=e.userAgent,n=r.split("[FBAN");typeof n[1]<"u"&&(r=n[0]),n=r.split("Twitter"),typeof n[1]<"u"&&(r=n[0]);var i=XR(r),s={apple:{phone:i(rg)&&!i(Hi),ipod:i(dw),tablet:!i(rg)&&(i(fw)||Ew(e))&&!i(Hi),universal:i(pw),device:(i(rg)||i(dw)||i(fw)||i(pw)||Ew(e))&&!i(Hi)},amazon:{phone:i(va),tablet:!i(va)&&i(Oc),device:i(va)||i(Oc)},android:{phone:!i(Hi)&&i(va)||!i(Hi)&&i(ng),tablet:!i(Hi)&&!i(va)&&!i(ng)&&(i(Oc)||i(mw)),device:!i(Hi)&&(i(va)||i(Oc)||i(ng)||i(mw))||i(/\bokhttp\b/i)},windows:{phone:i(Hi),tablet:i(gw),device:i(Hi)||i(gw)},other:{blackberry:i(yw),blackberry10:i(vw),opera:i(_w),firefox:i(ww),chrome:i(xw),device:i(yw)||i(vw)||i(_w)||i(ww)||i(xw)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const YR=Sw.default??Sw,qi=YR(globalThis.navigator);pe.RETINA_PREFIX=/@([0-9\.]+)x/;pe.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var tA={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(h,c,f){this.fn=h,this.context=c,this.once=f||!1}function s(h,c,f,m,p){if(typeof f!="function")throw new TypeError("The listener must be a function");var v=new i(f,m||h,p),_=r?r+c:c;return h._events[_]?h._events[_].fn?h._events[_]=[h._events[_],v]:h._events[_].push(v):(h._events[_]=v,h._eventsCount++),h}function o(h,c){--h._eventsCount===0?h._events=new n:delete h._events[c]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var c=[],f,m;if(this._eventsCount===0)return c;for(m in f=this._events)e.call(f,m)&&c.push(r?m.slice(1):m);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(f)):c},l.prototype.listeners=function(c){var f=r?r+c:c,m=this._events[f];if(!m)return[];if(m.fn)return[m.fn];for(var p=0,v=m.length,_=new Array(v);p<v;p++)_[p]=m[p].fn;return _},l.prototype.listenerCount=function(c){var f=r?r+c:c,m=this._events[f];return m?m.fn?1:m.length:0},l.prototype.emit=function(c,f,m,p,v,_){var E=r?r+c:c;if(!this._events[E])return!1;var A=this._events[E],S=arguments.length,b,w;if(A.fn){switch(A.once&&this.removeListener(c,A.fn,void 0,!0),S){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,f),!0;case 3:return A.fn.call(A.context,f,m),!0;case 4:return A.fn.call(A.context,f,m,p),!0;case 5:return A.fn.call(A.context,f,m,p,v),!0;case 6:return A.fn.call(A.context,f,m,p,v,_),!0}for(w=1,b=new Array(S-1);w<S;w++)b[w-1]=arguments[w];A.fn.apply(A.context,b)}else{var T=A.length,R;for(w=0;w<T;w++)switch(A[w].once&&this.removeListener(c,A[w].fn,void 0,!0),S){case 1:A[w].fn.call(A[w].context);break;case 2:A[w].fn.call(A[w].context,f);break;case 3:A[w].fn.call(A[w].context,f,m);break;case 4:A[w].fn.call(A[w].context,f,m,p);break;default:if(!b)for(R=1,b=new Array(S-1);R<S;R++)b[R-1]=arguments[R];A[w].fn.apply(A[w].context,b)}}return!0},l.prototype.on=function(c,f,m){return s(this,c,f,m,!1)},l.prototype.once=function(c,f,m){return s(this,c,f,m,!0)},l.prototype.removeListener=function(c,f,m,p){var v=r?r+c:c;if(!this._events[v])return this;if(!f)return o(this,v),this;var _=this._events[v];if(_.fn)_.fn===f&&(!p||_.once)&&(!m||_.context===m)&&o(this,v);else{for(var E=0,A=[],S=_.length;E<S;E++)(_[E].fn!==f||p&&!_[E].once||m&&_[E].context!==m)&&A.push(_[E]);A.length?this._events[v]=A.length===1?A[0]:A:o(this,v)}return this},l.prototype.removeAllListeners=function(c){var f;return c?(f=r?r+c:c,this._events[f]&&o(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l})(tA);var QR=tA.exports;const hh=kf(QR);var J0={exports:{}};J0.exports=qf;J0.exports.default=qf;function qf(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,s=rA(t,0,i,r,!0),o=[];if(!s||s.next===s.prev)return o;var l,h,c,f,m,p,v;if(n&&(s=eM(t,e,s,r)),t.length>80*r){l=c=t[0],h=f=t[1];for(var _=r;_<i;_+=r)m=t[_],p=t[_+1],m<l&&(l=m),p<h&&(h=p),m>c&&(c=m),p>f&&(f=p);v=Math.max(c-l,f-h),v=v!==0?32767/v:0}return Qu(s,o,r,l,h,v,0),o}function rA(t,e,r,n,i){var s,o;if(i===rv(t,e,r,n)>0)for(s=e;s<r;s+=n)o=bw(s,t[s],t[s+1],o);else for(s=r-n;s>=e;s-=n)o=bw(s,t[s],t[s+1],o);return o&&Zf(o,o.next)&&(qu(o),o=o.next),o}function Vo(t,e){if(!t)return t;e||(e=t);var r=t,n;do if(n=!1,!r.steiner&&(Zf(r,r.next)||yt(r.prev,r,r.next)===0)){if(qu(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}function Qu(t,e,r,n,i,s,o){if(t){!o&&s&&sM(t,n,i,s);for(var l=t,h,c;t.prev!==t.next;){if(h=t.prev,c=t.next,s?qR(t,n,i,s):KR(t)){e.push(h.i/r|0),e.push(t.i/r|0),e.push(c.i/r|0),qu(t),t=c.next,l=c.next;continue}if(t=c,t===l){o?o===1?(t=ZR(Vo(t),e,r),Qu(t,e,r,n,i,s,2)):o===2&&JR(t,e,r,n,i,s):Qu(Vo(t),e,r,n,i,s,1);break}}}}function KR(t){var e=t.prev,r=t,n=t.next;if(yt(e,r,n)>=0)return!1;for(var i=e.x,s=r.x,o=n.x,l=e.y,h=r.y,c=n.y,f=i<s?i<o?i:o:s<o?s:o,m=l<h?l<c?l:c:h<c?h:c,p=i>s?i>o?i:o:s>o?s:o,v=l>h?l>c?l:c:h>c?h:c,_=n.next;_!==e;){if(_.x>=f&&_.x<=p&&_.y>=m&&_.y<=v&&ja(i,l,s,h,o,c,_.x,_.y)&&yt(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function qR(t,e,r,n){var i=t.prev,s=t,o=t.next;if(yt(i,s,o)>=0)return!1;for(var l=i.x,h=s.x,c=o.x,f=i.y,m=s.y,p=o.y,v=l<h?l<c?l:c:h<c?h:c,_=f<m?f<p?f:p:m<p?m:p,E=l>h?l>c?l:c:h>c?h:c,A=f>m?f>p?f:p:m>p?m:p,S=ev(v,_,e,r,n),b=ev(E,A,e,r,n),w=t.prevZ,T=t.nextZ;w&&w.z>=S&&T&&T.z<=b;){if(w.x>=v&&w.x<=E&&w.y>=_&&w.y<=A&&w!==i&&w!==o&&ja(l,f,h,m,c,p,w.x,w.y)&&yt(w.prev,w,w.next)>=0||(w=w.prevZ,T.x>=v&&T.x<=E&&T.y>=_&&T.y<=A&&T!==i&&T!==o&&ja(l,f,h,m,c,p,T.x,T.y)&&yt(T.prev,T,T.next)>=0))return!1;T=T.nextZ}for(;w&&w.z>=S;){if(w.x>=v&&w.x<=E&&w.y>=_&&w.y<=A&&w!==i&&w!==o&&ja(l,f,h,m,c,p,w.x,w.y)&&yt(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;T&&T.z<=b;){if(T.x>=v&&T.x<=E&&T.y>=_&&T.y<=A&&T!==i&&T!==o&&ja(l,f,h,m,c,p,T.x,T.y)&&yt(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function ZR(t,e,r){var n=t;do{var i=n.prev,s=n.next.next;!Zf(i,s)&&nA(i,n,n.next,s)&&Ku(i,s)&&Ku(s,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(s.i/r|0),qu(n),qu(n.next),n=t=s),n=n.next}while(n!==t);return Vo(n)}function JR(t,e,r,n,i,s){var o=t;do{for(var l=o.next.next;l!==o.prev;){if(o.i!==l.i&&lM(o,l)){var h=iA(o,l);o=Vo(o,o.next),h=Vo(h,h.next),Qu(o,e,r,n,i,s,0),Qu(h,e,r,n,i,s,0);return}l=l.next}o=o.next}while(o!==t)}function eM(t,e,r,n){var i=[],s,o,l,h,c;for(s=0,o=e.length;s<o;s++)l=e[s]*n,h=s<o-1?e[s+1]*n:t.length,c=rA(t,l,h,n,!1),c===c.next&&(c.steiner=!0),i.push(aM(c));for(i.sort(tM),s=0;s<i.length;s++)r=rM(i[s],r);return r}function tM(t,e){return t.x-e.x}function rM(t,e){var r=nM(t,e);if(!r)return e;var n=iA(r,t);return Vo(n,n.next),Vo(r,r.next)}function nM(t,e){var r=e,n=t.x,i=t.y,s=-1/0,o;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var l=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(l<=n&&l>s&&(s=l,o=r.x<r.next.x?r:r.next,l===n))return o}r=r.next}while(r!==e);if(!o)return null;var h=o,c=o.x,f=o.y,m=1/0,p;r=o;do n>=r.x&&r.x>=c&&n!==r.x&&ja(i<f?n:s,i,c,f,i<f?s:n,i,r.x,r.y)&&(p=Math.abs(i-r.y)/(n-r.x),Ku(r,t)&&(p<m||p===m&&(r.x>o.x||r.x===o.x&&iM(o,r)))&&(o=r,m=p)),r=r.next;while(r!==h);return o}function iM(t,e){return yt(t.prev,t,e.prev)<0&&yt(e.next,t,t.next)<0}function sM(t,e,r,n){var i=t;do i.z===0&&(i.z=ev(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,oM(i)}function oM(t){var e,r,n,i,s,o,l,h,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,n=r,l=0,e=0;e<c&&(l++,n=n.nextZ,!!n);e++);for(h=c;l>0||h>0&&n;)l!==0&&(h===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,l--):(i=n,n=n.nextZ,h--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;r=n}s.nextZ=null,c*=2}while(o>1);return t}function ev(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function aM(t){var e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}function ja(t,e,r,n,i,s,o,l){return(i-o)*(e-l)>=(t-o)*(s-l)&&(t-o)*(n-l)>=(r-o)*(e-l)&&(r-o)*(s-l)>=(i-o)*(n-l)}function lM(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!uM(t,e)&&(Ku(t,e)&&Ku(e,t)&&hM(t,e)&&(yt(t.prev,t,e.prev)||yt(t,e.prev,e))||Zf(t,e)&&yt(t.prev,t,t.next)>0&&yt(e.prev,e,e.next)>0)}function yt(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Zf(t,e){return t.x===e.x&&t.y===e.y}function nA(t,e,r,n){var i=Bc(yt(t,e,r)),s=Bc(yt(t,e,n)),o=Bc(yt(r,n,t)),l=Bc(yt(r,n,e));return!!(i!==s&&o!==l||i===0&&Fc(t,r,e)||s===0&&Fc(t,n,e)||o===0&&Fc(r,t,n)||l===0&&Fc(r,e,n))}function Fc(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Bc(t){return t>0?1:t<0?-1:0}function uM(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&nA(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function Ku(t,e){return yt(t.prev,t,t.next)<0?yt(t,e,t.next)>=0&&yt(t,t.prev,e)>=0:yt(t,e,t.prev)<0||yt(t,t.next,e)<0}function hM(t,e){var r=t,n=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function iA(t,e){var r=new tv(t.i,t.x,t.y),n=new tv(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function bw(t,e,r,n){var i=new tv(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function qu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function tv(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}qf.deviation=function(t,e,r,n){var i=e&&e.length,s=i?e[0]*r:t.length,o=Math.abs(rv(t,0,s,r));if(i)for(var l=0,h=e.length;l<h;l++){var c=e[l]*r,f=l<h-1?e[l+1]*r:t.length;o-=Math.abs(rv(t,c,f,r))}var m=0;for(l=0;l<n.length;l+=3){var p=n[l]*r,v=n[l+1]*r,_=n[l+2]*r;m+=Math.abs((t[p]-t[_])*(t[v+1]-t[p+1])-(t[p]-t[v])*(t[_+1]-t[p+1]))}return o===0&&m===0?0:Math.abs((m-o)/o)};function rv(t,e,r,n){for(var i=0,s=e,o=r-n;s<r;s+=n)i+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return i}qf.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++)for(var o=0;o<e;o++)r.vertices.push(t[i][s][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r};var cM=J0.exports;const dM=kf(cM);var uf={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */uf.exports;(function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,s=typeof gu=="object"&&gu;(s.global===s||s.window===s||s.self===s)&&(r=s);var o,l=2147483647,h=36,c=1,f=26,m=38,p=700,v=72,_=128,E="-",A=/^xn--/,S=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=h-c,R=Math.floor,L=String.fromCharCode,D;function M(O){throw new RangeError(w[O])}function Y(O,G){for(var ie=O.length,q=[];ie--;)q[ie]=G(O[ie]);return q}function j(O,G){var ie=O.split("@"),q="";ie.length>1&&(q=ie[0]+"@",O=ie[1]),O=O.replace(b,".");var $=O.split("."),se=Y($,G).join(".");return q+se}function de(O){for(var G=[],ie=0,q=O.length,$,se;ie<q;)$=O.charCodeAt(ie++),$>=55296&&$<=56319&&ie<q?(se=O.charCodeAt(ie++),(se&64512)==56320?G.push((($&1023)<<10)+(se&1023)+65536):(G.push($),ie--)):G.push($);return G}function re(O){return Y(O,function(G){var ie="";return G>65535&&(G-=65536,ie+=L(G>>>10&1023|55296),G=56320|G&1023),ie+=L(G),ie}).join("")}function F(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:h}function V(O,G){return O+22+75*(O<26)-((G!=0)<<5)}function ne(O,G,ie){var q=0;for(O=ie?R(O/p):O>>1,O+=R(O/G);O>T*f>>1;q+=h)O=R(O/T);return R(q+(T+1)*O/(O+m))}function fe(O){var G=[],ie=O.length,q,$=0,se=_,ce=v,ve,ke,Re,he,P,we,ye,Ve,Qe;for(ve=O.lastIndexOf(E),ve<0&&(ve=0),ke=0;ke<ve;++ke)O.charCodeAt(ke)>=128&&M("not-basic"),G.push(O.charCodeAt(ke));for(Re=ve>0?ve+1:0;Re<ie;){for(he=$,P=1,we=h;Re>=ie&&M("invalid-input"),ye=F(O.charCodeAt(Re++)),(ye>=h||ye>R((l-$)/P))&&M("overflow"),$+=ye*P,Ve=we<=ce?c:we>=ce+f?f:we-ce,!(ye<Ve);we+=h)Qe=h-Ve,P>R(l/Qe)&&M("overflow"),P*=Qe;q=G.length+1,ce=ne($-he,q,he==0),R($/q)>l-se&&M("overflow"),se+=R($/q),$%=q,G.splice($++,0,se)}return re(G)}function ae(O){var G,ie,q,$,se,ce,ve,ke,Re,he,P,we=[],ye,Ve,Qe,Ke;for(O=de(O),ye=O.length,G=_,ie=0,se=v,ce=0;ce<ye;++ce)P=O[ce],P<128&&we.push(L(P));for(q=$=we.length,$&&we.push(E);q<ye;){for(ve=l,ce=0;ce<ye;++ce)P=O[ce],P>=G&&P<ve&&(ve=P);for(Ve=q+1,ve-G>R((l-ie)/Ve)&&M("overflow"),ie+=(ve-G)*Ve,G=ve,ce=0;ce<ye;++ce)if(P=O[ce],P<G&&++ie>l&&M("overflow"),P==G){for(ke=ie,Re=h;he=Re<=se?c:Re>=se+f?f:Re-se,!(ke<he);Re+=h)Ke=ke-he,Qe=h-he,we.push(L(V(he+Ke%Qe,0))),ke=R(Ke/Qe);we.push(L(V(ke,0))),se=ne(ie,Ve,q==$),ie=0,++q}++ie,++G}return we.join("")}function k(O){return j(O,function(G){return A.test(G)?fe(G.slice(4).toLowerCase()):G})}function X(O){return j(O,function(G){return S.test(G)?"xn--"+ae(G):G})}if(o={version:"1.4.1",ucs2:{decode:de,encode:re},decode:fe,encode:ae,toASCII:X,toUnicode:k},n&&i)if(t.exports==n)i.exports=o;else for(D in o)o.hasOwnProperty(D)&&(n[D]=o[D]);else r.punycode=o})(gu)})(uf,uf.exports);var fM=uf.exports,xl=TypeError;const pM={},mM=Object.freeze(Object.defineProperty({__proto__:null,default:pM},Symbol.toStringTag,{value:"Module"})),gM=AS(mM);var e_=typeof Map=="function"&&Map.prototype,ig=Object.getOwnPropertyDescriptor&&e_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hf=e_&&ig&&typeof ig.get=="function"?ig.get:null,Tw=e_&&Map.prototype.forEach,t_=typeof Set=="function"&&Set.prototype,sg=Object.getOwnPropertyDescriptor&&t_?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,cf=t_&&sg&&typeof sg.get=="function"?sg.get:null,Aw=t_&&Set.prototype.forEach,yM=typeof WeakMap=="function"&&WeakMap.prototype,Au=yM?WeakMap.prototype.has:null,vM=typeof WeakSet=="function"&&WeakSet.prototype,Cu=vM?WeakSet.prototype.has:null,_M=typeof WeakRef=="function"&&WeakRef.prototype,Cw=_M?WeakRef.prototype.deref:null,xM=Boolean.prototype.valueOf,wM=Object.prototype.toString,EM=Function.prototype.toString,SM=String.prototype.match,r_=String.prototype.slice,Ls=String.prototype.replace,bM=String.prototype.toUpperCase,Pw=String.prototype.toLowerCase,sA=RegExp.prototype.test,Iw=Array.prototype.concat,xi=Array.prototype.join,TM=Array.prototype.slice,Rw=Math.floor,nv=typeof BigInt=="function"?BigInt.prototype.valueOf:null,og=Object.getOwnPropertySymbols,iv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Pu=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pl||!0)?Symbol.toStringTag:null,oA=Object.prototype.propertyIsEnumerable,Mw=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function kw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||sA.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Rw(-t):Rw(t);if(n!==t){var i=String(n),s=r_.call(e,i.length+1);return Ls.call(i,r,"$&_")+"."+Ls.call(Ls.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ls.call(e,r,"$&_")}var sv=gM,Nw=sv.custom,Dw=uA(Nw)?Nw:null,aA={__proto__:null,double:'"',single:"'"},AM={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Jf=function t(e,r,n,i){var s=r||{};if(Xi(s,"quoteStyle")&&!Xi(aA,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Xi(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Xi(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Xi(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Xi(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return cA(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return l?kw(e,h):h}if(typeof e=="bigint"){var c=String(e)+"n";return l?kw(e,c):c}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return ov(e)?"[Array]":"[Object]";var m=$M(s,n);if(typeof i>"u")i=[];else if(hA(i,e)>=0)return"[Circular]";function p(F,V,ne){if(V&&(i=TM.call(i),i.push(V)),ne){var fe={depth:s.depth};return Xi(s,"quoteStyle")&&(fe.quoteStyle=s.quoteStyle),t(F,fe,n+1,i)}return t(F,s,n+1,i)}if(typeof e=="function"&&!Ow(e)){var v=OM(e),_=Lc(e,p);return"[Function"+(v?": "+v:" (anonymous)")+"]"+(_.length>0?" { "+xi.call(_,", ")+" }":"")}if(uA(e)){var E=pl?Ls.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):iv.call(e);return typeof e=="object"&&!pl?Zl(E):E}if(GM(e)){for(var A="<"+Pw.call(String(e.nodeName)),S=e.attributes||[],b=0;b<S.length;b++)A+=" "+S[b].name+"="+lA(CM(S[b].value),"double",s);return A+=">",e.childNodes&&e.childNodes.length&&(A+="..."),A+="</"+Pw.call(String(e.nodeName))+">",A}if(ov(e)){if(e.length===0)return"[]";var w=Lc(e,p);return m&&!jM(w)?"["+av(w,m)+"]":"[ "+xi.call(w,", ")+" ]"}if(IM(e)){var T=Lc(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!oA.call(e,"cause")?"{ ["+String(e)+"] "+xi.call(Iw.call("[cause]: "+p(e.cause),T),", ")+" }":T.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+xi.call(T,", ")+" }"}if(typeof e=="object"&&o){if(Dw&&typeof e[Dw]=="function"&&sv)return sv(e,{depth:f-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(FM(e)){var R=[];return Tw&&Tw.call(e,function(F,V){R.push(p(V,e,!0)+" => "+p(F,e))}),Fw("Map",hf.call(e),R,m)}if(UM(e)){var L=[];return Aw&&Aw.call(e,function(F){L.push(p(F,e))}),Fw("Set",cf.call(e),L,m)}if(BM(e))return ag("WeakMap");if(zM(e))return ag("WeakSet");if(LM(e))return ag("WeakRef");if(MM(e))return Zl(p(Number(e)));if(NM(e))return Zl(p(nv.call(e)));if(kM(e))return Zl(xM.call(e));if(RM(e))return Zl(p(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof gu<"u"&&e===gu)return"{ [object globalThis] }";if(!PM(e)&&!Ow(e)){var D=Lc(e,p),M=Mw?Mw(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",j=!M&&Pu&&Object(e)===e&&Pu in e?r_.call(so(e),8,-1):Y?"Object":"",de=M||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",re=de+(j||Y?"["+xi.call(Iw.call([],j||[],Y||[]),": ")+"] ":"");return D.length===0?re+"{}":m?re+"{"+av(D,m)+"}":re+"{ "+xi.call(D,", ")+" }"}return String(e)};function lA(t,e,r){var n=r.quoteStyle||e,i=aA[n];return i+t+i}function CM(t){return Ls.call(String(t),/"/g,"&quot;")}function qo(t){return!Pu||!(typeof t=="object"&&(Pu in t||typeof t[Pu]<"u"))}function ov(t){return so(t)==="[object Array]"&&qo(t)}function PM(t){return so(t)==="[object Date]"&&qo(t)}function Ow(t){return so(t)==="[object RegExp]"&&qo(t)}function IM(t){return so(t)==="[object Error]"&&qo(t)}function RM(t){return so(t)==="[object String]"&&qo(t)}function MM(t){return so(t)==="[object Number]"&&qo(t)}function kM(t){return so(t)==="[object Boolean]"&&qo(t)}function uA(t){if(pl)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!iv)return!1;try{return iv.call(t),!0}catch{}return!1}function NM(t){if(!t||typeof t!="object"||!nv)return!1;try{return nv.call(t),!0}catch{}return!1}var DM=Object.prototype.hasOwnProperty||function(t){return t in this};function Xi(t,e){return DM.call(t,e)}function so(t){return wM.call(t)}function OM(t){if(t.name)return t.name;var e=SM.call(EM.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function hA(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function FM(t){if(!hf||!t||typeof t!="object")return!1;try{hf.call(t);try{cf.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function BM(t){if(!Au||!t||typeof t!="object")return!1;try{Au.call(t,Au);try{Cu.call(t,Cu)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function LM(t){if(!Cw||!t||typeof t!="object")return!1;try{return Cw.call(t),!0}catch{}return!1}function UM(t){if(!cf||!t||typeof t!="object")return!1;try{cf.call(t);try{hf.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function zM(t){if(!Cu||!t||typeof t!="object")return!1;try{Cu.call(t,Cu);try{Au.call(t,Au)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function GM(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function cA(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return cA(r_.call(t,0,e.maxStringLength),e)+n}var i=AM[e.quoteStyle||"single"];i.lastIndex=0;var s=Ls.call(Ls.call(t,i,"\\$1"),/[\x00-\x1f]/g,HM);return lA(s,"single",e)}function HM(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+bM.call(e.toString(16))}function Zl(t){return"Object("+t+")"}function ag(t){return t+" { ? }"}function Fw(t,e,r,n){var i=n?av(r,n):xi.call(r,", ");return t+" ("+e+") {"+i+"}"}function jM(t){for(var e=0;e<t.length;e++)if(hA(t[e],`
41
+ `)>=0)return!1;return!0}function $M(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=xi.call(Array(t.indent+1)," ");else return null;return{base:r,prev:xi.call(Array(e+1),r)}}function av(t,e){if(t.length===0)return"";var r=`
42
+ `+e.prev+e.base;return r+xi.call(t,","+r)+`
43
+ `+e.prev}function Lc(t,e){var r=ov(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Xi(t,i)?e(t[i],t):""}var s=typeof og=="function"?og(t):[],o;if(pl){o={};for(var l=0;l<s.length;l++)o["$"+s[l]]=s[l]}for(var h in t)Xi(t,h)&&(r&&String(Number(h))===h&&h<t.length||pl&&o["$"+h]instanceof Symbol||(sA.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof og=="function")for(var c=0;c<s.length;c++)oA.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}var WM=Jf,VM=xl,ep=function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},XM=function(t,e){if(t){var r=ep(t,e);return r&&r.value}},YM=function(t,e,r){var n=ep(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},QM=function(t,e){return t?!!ep(t,e):!1},KM=function(t,e){if(t)return ep(t,e,!0)},qM=function(){var e,r={assert:function(n){if(!r.has(n))throw new VM("Side channel does not contain "+WM(n))},delete:function(n){var i=e&&e.next,s=KM(e,n);return s&&i&&i===s&&(e=void 0),!!s},get:function(n){return XM(e,n)},has:function(n){return QM(e,n)},set:function(n,i){e||(e={next:void 0}),YM(e,n,i)}};return r},dA=Object,ZM=Error,JM=EvalError,ek=RangeError,tk=ReferenceError,rk=SyntaxError,nk=URIError,ik=Math.abs,sk=Math.floor,ok=Math.max,ak=Math.min,lk=Math.pow,uk=Math.round,hk=Number.isNaN||function(e){return e!==e},ck=hk,dk=function(e){return ck(e)||e===0?e:e<0?-1:1},fk=Object.getOwnPropertyDescriptor,Ad=fk;if(Ad)try{Ad([],"length")}catch{Ad=null}var fA=Ad,Cd=Object.defineProperty||!1;if(Cd)try{Cd({},"a",{value:1})}catch{Cd=!1}var pk=Cd,lg,Bw;function mk(){return Bw||(Bw=1,lg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0}),lg}var ug,Lw;function gk(){if(Lw)return ug;Lw=1;var t=typeof Symbol<"u"&&Symbol,e=mk();return ug=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ug}var hg,Uw;function pA(){return Uw||(Uw=1,hg=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),hg}var cg,zw;function mA(){if(zw)return cg;zw=1;var t=dA;return cg=t.getPrototypeOf||null,cg}var dg,Gw;function yk(){if(Gw)return dg;Gw=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(h,c){for(var f=[],m=0;m<h.length;m+=1)f[m]=h[m];for(var p=0;p<c.length;p+=1)f[p+h.length]=c[p];return f},s=function(h,c){for(var f=[],m=c,p=0;m<h.length;m+=1,p+=1)f[p]=h[m];return f},o=function(l,h){for(var c="",f=0;f<l.length;f+=1)c+=l[f],f+1<l.length&&(c+=h);return c};return dg=function(h){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(t+c);for(var f=s(arguments,1),m,p=function(){if(this instanceof m){var S=c.apply(this,i(f,arguments));return Object(S)===S?S:this}return c.apply(h,i(f,arguments))},v=r(0,c.length-f.length),_=[],E=0;E<v;E++)_[E]="$"+E;if(m=Function("binder","return function ("+o(_,",")+"){ return binder.apply(this,arguments); }")(p),c.prototype){var A=function(){};A.prototype=c.prototype,m.prototype=new A,A.prototype=null}return m},dg}var fg,Hw;function tp(){if(Hw)return fg;Hw=1;var t=yk();return fg=Function.prototype.bind||t,fg}var pg,jw;function n_(){return jw||(jw=1,pg=Function.prototype.call),pg}var mg,$w;function gA(){return $w||($w=1,mg=Function.prototype.apply),mg}var vk=typeof Reflect<"u"&&Reflect&&Reflect.apply,_k=tp(),xk=gA(),wk=n_(),Ek=vk,Sk=Ek||_k.call(wk,xk),bk=tp(),Tk=xl,Ak=n_(),Ck=Sk,yA=function(e){if(e.length<1||typeof e[0]!="function")throw new Tk("a function is required");return Ck(bk,Ak,e)},gg,Ww;function Pk(){if(Ww)return gg;Ww=1;var t=yA,e=fA,r;try{r=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!r&&e&&e(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return gg=n&&typeof n.get=="function"?t([n.get]):typeof s=="function"?function(l){return s(l==null?l:i(l))}:!1,gg}var yg,Vw;function Ik(){if(Vw)return yg;Vw=1;var t=pA(),e=mA(),r=Pk();return yg=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:r?function(i){return r(i)}:null,yg}var vg,Xw;function Rk(){if(Xw)return vg;Xw=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=tp();return vg=r.call(t,e),vg}var Le,Mk=dA,kk=ZM,Nk=JM,Dk=ek,Ok=tk,ml=rk,el=xl,Fk=nk,Bk=ik,Lk=sk,Uk=ok,zk=ak,Gk=lk,Hk=uk,jk=dk,vA=Function,_g=function(t){try{return vA('"use strict"; return ('+t+").constructor;")()}catch{}},Zu=fA,$k=pk,xg=function(){throw new el},Wk=Zu?function(){try{return arguments.callee,xg}catch{try{return Zu(arguments,"callee").get}catch{return xg}}}():xg,_a=gk()(),Vt=Ik(),Vk=mA(),Xk=pA(),_A=gA(),ch=n_(),ba={},Yk=typeof Uint8Array>"u"||!Vt?Le:Vt(Uint8Array),Lo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":_a&&Vt?Vt([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":ba,"%AsyncGenerator%":ba,"%AsyncGeneratorFunction%":ba,"%AsyncIteratorPrototype%":ba,"%Atomics%":typeof Atomics>"u"?Le:Atomics,"%BigInt%":typeof BigInt>"u"?Le:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Le:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Le:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Le:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kk,"%eval%":eval,"%EvalError%":Nk,"%Float16Array%":typeof Float16Array>"u"?Le:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Le:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Le:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Le:FinalizationRegistry,"%Function%":vA,"%GeneratorFunction%":ba,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_a&&Vt?Vt(Vt([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_a||!Vt?Le:Vt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Mk,"%Object.getOwnPropertyDescriptor%":Zu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":Dk,"%ReferenceError%":Ok,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_a||!Vt?Le:Vt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_a&&Vt?Vt(""[Symbol.iterator]()):Le,"%Symbol%":_a?Symbol:Le,"%SyntaxError%":ml,"%ThrowTypeError%":Wk,"%TypedArray%":Yk,"%TypeError%":el,"%Uint8Array%":typeof Uint8Array>"u"?Le:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Le:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Le:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Le:Uint32Array,"%URIError%":Fk,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet,"%Function.prototype.call%":ch,"%Function.prototype.apply%":_A,"%Object.defineProperty%":$k,"%Object.getPrototypeOf%":Vk,"%Math.abs%":Bk,"%Math.floor%":Lk,"%Math.max%":Uk,"%Math.min%":zk,"%Math.pow%":Gk,"%Math.round%":Hk,"%Math.sign%":jk,"%Reflect.getPrototypeOf%":Xk};if(Vt)try{null.error}catch(t){var Qk=Vt(Vt(t));Lo["%Error.prototype%"]=Qk}var Kk=function t(e){var r;if(e==="%AsyncFunction%")r=_g("async function () {}");else if(e==="%GeneratorFunction%")r=_g("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=_g("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Vt&&(r=Vt(i.prototype))}return Lo[e]=r,r},Yw={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},dh=tp(),df=Rk(),qk=dh.call(ch,Array.prototype.concat),Zk=dh.call(_A,Array.prototype.splice),Qw=dh.call(ch,String.prototype.replace),ff=dh.call(ch,String.prototype.slice),Jk=dh.call(ch,RegExp.prototype.exec),e3=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,t3=/\\(\\)?/g,r3=function(e){var r=ff(e,0,1),n=ff(e,-1);if(r==="%"&&n!=="%")throw new ml("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ml("invalid intrinsic syntax, expected opening `%`");var i=[];return Qw(e,e3,function(s,o,l,h){i[i.length]=l?Qw(h,t3,"$1"):o||s}),i},n3=function(e,r){var n=e,i;if(df(Yw,n)&&(i=Yw[n],n="%"+i[0]+"%"),df(Lo,n)){var s=Lo[n];if(s===ba&&(s=Kk(n)),typeof s>"u"&&!r)throw new el("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ml("intrinsic "+e+" does not exist!")},i_=function(e,r){if(typeof e!="string"||e.length===0)throw new el("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new el('"allowMissing" argument must be a boolean');if(Jk(/^%?[^%]*%?$/,e)===null)throw new ml("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=r3(e),i=n.length>0?n[0]:"",s=n3("%"+i+"%",r),o=s.name,l=s.value,h=!1,c=s.alias;c&&(i=c[0],Zk(n,qk([0,1],c)));for(var f=1,m=!0;f<n.length;f+=1){var p=n[f],v=ff(p,0,1),_=ff(p,-1);if((v==='"'||v==="'"||v==="`"||_==='"'||_==="'"||_==="`")&&v!==_)throw new ml("property names with quotes must have matching quotes");if((p==="constructor"||!m)&&(h=!0),i+="."+p,o="%"+i+"%",df(Lo,o))l=Lo[o];else if(l!=null){if(!(p in l)){if(!r)throw new el("base intrinsic for "+e+" exists, but the property is not available.");return}if(Zu&&f+1>=n.length){var E=Zu(l,p);m=!!E,m&&"get"in E&&!("originalValue"in E.get)?l=E.get:l=l[p]}else m=df(l,p),l=l[p];m&&!h&&(Lo[o]=l)}}return l},xA=i_,wA=yA,i3=wA([xA("%String.prototype.indexOf%")]),EA=function(e,r){var n=xA(e,!!r);return typeof n=="function"&&i3(e,".prototype.")>-1?wA([n]):n},s3=i_,fh=EA,o3=Jf,a3=xl,Kw=s3("%Map%",!0),l3=fh("Map.prototype.get",!0),u3=fh("Map.prototype.set",!0),h3=fh("Map.prototype.has",!0),c3=fh("Map.prototype.delete",!0),d3=fh("Map.prototype.size",!0),SA=!!Kw&&function(){var e,r={assert:function(n){if(!r.has(n))throw new a3("Side channel does not contain "+o3(n))},delete:function(n){if(e){var i=c3(e,n);return d3(e)===0&&(e=void 0),i}return!1},get:function(n){if(e)return l3(e,n)},has:function(n){return e?h3(e,n):!1},set:function(n,i){e||(e=new Kw),u3(e,n,i)}};return r},f3=i_,rp=EA,p3=Jf,Uc=SA,m3=xl,xa=f3("%WeakMap%",!0),g3=rp("WeakMap.prototype.get",!0),y3=rp("WeakMap.prototype.set",!0),v3=rp("WeakMap.prototype.has",!0),_3=rp("WeakMap.prototype.delete",!0),x3=xa?function(){var e,r,n={assert:function(i){if(!n.has(i))throw new m3("Side channel does not contain "+p3(i))},delete:function(i){if(xa&&i&&(typeof i=="object"||typeof i=="function")){if(e)return _3(e,i)}else if(Uc&&r)return r.delete(i);return!1},get:function(i){return xa&&i&&(typeof i=="object"||typeof i=="function")&&e?g3(e,i):r&&r.get(i)},has:function(i){return xa&&i&&(typeof i=="object"||typeof i=="function")&&e?v3(e,i):!!r&&r.has(i)},set:function(i,s){xa&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new xa),y3(e,i,s)):Uc&&(r||(r=Uc()),r.set(i,s))}};return n}:Uc,w3=xl,E3=Jf,S3=qM,b3=SA,T3=x3,A3=T3||b3||S3,bA=function(){var e,r={assert:function(n){if(!r.has(n))throw new w3("Side channel does not contain "+E3(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,i){e||(e=A3()),e.set(n,i)}};return r},C3=String.prototype.replace,P3=/%20/g,wg={RFC1738:"RFC1738",RFC3986:"RFC3986"},s_={default:wg.RFC3986,formatters:{RFC1738:function(t){return C3.call(t,P3,"+")},RFC3986:function(t){return String(t)}},RFC1738:wg.RFC1738,RFC3986:wg.RFC3986},I3=s_,R3=bA,Eg=Object.prototype.hasOwnProperty,Mo=Array.isArray,np=R3(),TA=function(e,r){return np.set(e,r),e},pf=function(e){return np.has(e)},lv=function(e){return np.get(e)},AA=function(e,r){np.set(e,r)},ci=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),M3=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Mo(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},o_=function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},k3=function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(Mo(e))e.push(r);else if(e&&typeof e=="object")if(pf(e)){var i=lv(e)+1;e[i]=r,AA(e,i)}else(n&&(n.plainObjects||n.allowPrototypes)||!Eg.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object"){if(pf(r)){for(var s=Object.keys(r),o=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<s.length;l++){var h=parseInt(s[l],10);o[h+1]=r[s[l]]}return TA(o,lv(r)+1)}return[e].concat(r)}var c=e;return Mo(e)&&!Mo(r)&&(c=o_(e,n)),Mo(e)&&Mo(r)?(r.forEach(function(f,m){if(Eg.call(e,m)){var p=e[m];p&&typeof p=="object"&&f&&typeof f=="object"?e[m]=t(p,f,n):e.push(f)}else e[m]=f}),e):Object.keys(r).reduce(function(f,m){var p=r[m];return Eg.call(f,m)?f[m]=t(f[m],p,n):f[m]=p,f},c)},N3=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},D3=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Sg=1024,O3=function(e,r,n,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var l="",h=0;h<o.length;h+=Sg){for(var c=o.length>=Sg?o.slice(h,h+Sg):o,f=[],m=0;m<c.length;++m){var p=c.charCodeAt(m);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===I3.RFC1738&&(p===40||p===41)){f[f.length]=c.charAt(m);continue}if(p<128){f[f.length]=ci[p];continue}if(p<2048){f[f.length]=ci[192|p>>6]+ci[128|p&63];continue}if(p<55296||p>=57344){f[f.length]=ci[224|p>>12]+ci[128|p>>6&63]+ci[128|p&63];continue}m+=1,p=65536+((p&1023)<<10|c.charCodeAt(m)&1023),f[f.length]=ci[240|p>>18]+ci[128|p>>12&63]+ci[128|p>>6&63]+ci[128|p&63]}l+=f.join("")}return l},F3=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],l=Object.keys(o),h=0;h<l.length;++h){var c=l[h],f=o[c];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(r.push({obj:o,prop:c}),n.push(f))}return M3(r),e},B3=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},L3=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},U3=function(e,r,n,i){if(pf(e)){var s=lv(e)+1;return e[s]=r,AA(e,s),e}var o=[].concat(e,r);return o.length>n?TA(o_(o,{plainObjects:i}),o.length-1):o},z3=function(e,r){if(Mo(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},CA={arrayToObject:o_,assign:N3,combine:U3,compact:F3,decode:D3,encode:O3,isBuffer:L3,isOverflow:pf,isRegExp:B3,maybeMap:z3,merge:k3},PA=bA,Pd=CA,Iu=s_,G3=Object.prototype.hasOwnProperty,IA={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vi=Array.isArray,H3=Array.prototype.push,RA=function(t,e){H3.apply(t,vi(e)?e:[e])},j3=Date.prototype.toISOString,qw=Iu.default,Ot={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Pd.encode,encodeValuesOnly:!1,filter:void 0,format:qw,formatter:Iu.formatters[qw],indices:!1,serializeDate:function(e){return j3.call(e)},skipNulls:!1,strictNullHandling:!1},$3=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},bg={},W3=function t(e,r,n,i,s,o,l,h,c,f,m,p,v,_,E,A,S,b){for(var w=e,T=b,R=0,L=!1;(T=T.get(bg))!==void 0&&!L;){var D=T.get(e);if(R+=1,typeof D<"u"){if(D===R)throw new RangeError("Cyclic object value");L=!0}typeof T.get(bg)>"u"&&(R=0)}if(typeof f=="function"?w=f(r,w):w instanceof Date?w=v(w):n==="comma"&&vi(w)&&(w=Pd.maybeMap(w,function(O){return O instanceof Date?v(O):O})),w===null){if(o)return c&&!A?c(r,Ot.encoder,S,"key",_):r;w=""}if($3(w)||Pd.isBuffer(w)){if(c){var M=A?r:c(r,Ot.encoder,S,"key",_);return[E(M)+"="+E(c(w,Ot.encoder,S,"value",_))]}return[E(r)+"="+E(String(w))]}var Y=[];if(typeof w>"u")return Y;var j;if(n==="comma"&&vi(w))A&&c&&(w=Pd.maybeMap(w,c)),j=[{value:w.length>0?w.join(",")||null:void 0}];else if(vi(f))j=f;else{var de=Object.keys(w);j=m?de.sort(m):de}var re=h?String(r).replace(/\./g,"%2E"):String(r),F=i&&vi(w)&&w.length===1?re+"[]":re;if(s&&vi(w)&&w.length===0)return F+"[]";for(var V=0;V<j.length;++V){var ne=j[V],fe=typeof ne=="object"&&ne&&typeof ne.value<"u"?ne.value:w[ne];if(!(l&&fe===null)){var ae=p&&h?String(ne).replace(/\./g,"%2E"):String(ne),k=vi(w)?typeof n=="function"?n(F,ae):F:F+(p?"."+ae:"["+ae+"]");b.set(e,R);var X=PA();X.set(bg,b),RA(Y,t(fe,k,n,i,s,o,l,h,n==="comma"&&A&&vi(w)?null:c,f,m,p,v,_,E,A,S,X))}}return Y},V3=function(e){if(!e)return Ot;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Ot.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Iu.default;if(typeof e.format<"u"){if(!G3.call(Iu.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Iu.formatters[n],s=Ot.filter;(typeof e.filter=="function"||vi(e.filter))&&(s=e.filter);var o;if(e.arrayFormat in IA?o=e.arrayFormat:"indices"in e?o=e.indices?"indices":"repeat":o=Ot.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:Ot.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Ot.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Ot.allowEmptyArrays,arrayFormat:o,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ot.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Ot.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ot.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Ot.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Ot.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ot.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ot.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ot.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ot.strictNullHandling}},X3=function(t,e){var r=t,n=V3(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vi(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var l=IA[n.arrayFormat],h=l==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=PA(),f=0;f<i.length;++f){var m=i[f],p=r[m];n.skipNulls&&p===null||RA(o,W3(p,m,l,h,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var v=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),v.length>0?_+v:""},Zs=CA,Id=Object.prototype.hasOwnProperty,Zw=Array.isArray,Et={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Zs.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Y3=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},MA=function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},Q3="utf8=%26%2310003%3B",K3="utf8=%E2%9C%93",q3=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,r.throwOnLimitExceeded?s+1:s);if(r.throwOnLimitExceeded&&o.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var l=-1,h,c=r.charset;if(r.charsetSentinel)for(h=0;h<o.length;++h)o[h].indexOf("utf8=")===0&&(o[h]===K3?c="utf-8":o[h]===Q3&&(c="iso-8859-1"),l=h,h=o.length);for(h=0;h<o.length;++h)if(h!==l){var f=o[h],m=f.indexOf("]="),p=m===-1?f.indexOf("="):m+1,v,_;if(p===-1?(v=r.decoder(f,Et.decoder,c,"key"),_=r.strictNullHandling?null:""):(v=r.decoder(f.slice(0,p),Et.decoder,c,"key"),v!==null&&(_=Zs.maybeMap(MA(f.slice(p+1),r,Zw(n[v])?n[v].length:0),function(A){return r.decoder(A,Et.decoder,c,"value")}))),_&&r.interpretNumericEntities&&c==="iso-8859-1"&&(_=Y3(String(_))),f.indexOf("[]=")>-1&&(_=Zw(_)?[_]:_),v!==null){var E=Id.call(n,v);E&&r.duplicates==="combine"?n[v]=Zs.combine(n[v],_,r.arrayLimit,r.plainObjects):(!E||r.duplicates==="last")&&(n[v]=_)}}return n},Z3=function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var o=n?e:MA(e,r,i),l=t.length-1;l>=0;--l){var h,c=t[l];if(c==="[]"&&r.parseArrays)Zs.isOverflow(o)?h=o:h=r.allowEmptyArrays&&(o===""||r.strictNullHandling&&o===null)?[]:Zs.combine([],o,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var f=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,m=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,p=parseInt(m,10);!r.parseArrays&&m===""?h={0:o}:!isNaN(p)&&c!==m&&String(p)===m&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(h=[],h[p]=o):m!=="__proto__"&&(h[m]=o)}o=h}return o},J3=function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Id.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,o=i.exec(n),l=o?n.slice(0,o.index):n,h=[];if(l){if(!r.plainObjects&&Id.call(Object.prototype,l)&&!r.allowPrototypes)return;h.push(l)}for(var c=0;(o=s.exec(n))!==null&&c<r.depth;){c+=1;var f=o[1].slice(1,-1);if(!r.plainObjects&&Id.call(Object.prototype,f)&&!r.allowPrototypes)return;h.push(o[1])}if(o){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h.push("["+n.slice(o.index)+"]")}return h},e4=function(e,r,n,i){if(e){var s=J3(e,n);if(s)return Z3(s,r,n,i)}},t4=function(e){if(!e)return Et;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?Et.charset:e.charset,n=typeof e.duplicates>"u"?Et.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Et.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Et.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Et.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Et.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Et.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Et.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Et.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Et.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Et.decoder,delimiter:typeof e.delimiter=="string"||Zs.isRegExp(e.delimiter)?e.delimiter:Et.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Et.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Et.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Et.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Et.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Et.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},r4=function(t,e){var r=t4(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?q3(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),o=0;o<s.length;++o){var l=s[o],h=e4(l,n[l],r,typeof t=="string");i=Zs.merge(i,h,r)}return r.allowSparse===!0?i:Zs.compact(i)},n4=X3,i4=r4,s4=s_,o4={formats:s4,parse:i4,stringify:n4},a4=fM;function ts(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var l4=/^([a-z0-9.+-]+:)/i,u4=/:[0-9]*$/,h4=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c4=["<",">",'"',"`"," ","\r",`
44
+ `," "],d4=["{","}","|","\\","^","`"].concat(c4),uv=["'"].concat(d4),Jw=["%","/","?",";","#"].concat(uv),eE=["/","?","#"],f4=255,tE=/^[+a-z0-9A-Z_-]{0,63}$/,p4=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m4={javascript:!0,"javascript:":!0},hv={javascript:!0,"javascript:":!0},tl={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},cv=o4;function g4(t,e,r){if(t&&typeof t=="object"&&t instanceof ts)return t;var n=new ts;return n.parse(t,e,r),n}ts.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n<t.indexOf("#")?"?":"#",s=t.split(i),o=/\\/g;s[0]=s[0].replace(o,"/"),t=s.join(i);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var h=h4.exec(l);if(h)return this.path=l,this.href=l,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=cv.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=l4.exec(l);if(c){c=c[0];var f=c.toLowerCase();this.protocol=f,l=l.substr(c.length)}if(r||c||l.match(/^\/\/[^@/]+@[^@/]+/)){var m=l.substr(0,2)==="//";m&&!(c&&hv[c])&&(l=l.substr(2),this.slashes=!0)}if(!hv[c]&&(m||c&&!tl[c])){for(var p=-1,v=0;v<eE.length;v++){var _=l.indexOf(eE[v]);_!==-1&&(p===-1||_<p)&&(p=_)}var E,A;p===-1?A=l.lastIndexOf("@"):A=l.lastIndexOf("@",p),A!==-1&&(E=l.slice(0,A),l=l.slice(A+1),this.auth=decodeURIComponent(E)),p=-1;for(var v=0;v<Jw.length;v++){var _=l.indexOf(Jw[v]);_!==-1&&(p===-1||_<p)&&(p=_)}p===-1&&(p=l.length),this.host=l.slice(0,p),l=l.slice(p),this.parseHost(),this.hostname=this.hostname||"";var S=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!S)for(var b=this.hostname.split(/\./),v=0,w=b.length;v<w;v++){var T=b[v];if(T&&!T.match(tE)){for(var R="",L=0,D=T.length;L<D;L++)T.charCodeAt(L)>127?R+="x":R+=T[L];if(!R.match(tE)){var M=b.slice(0,v),Y=b.slice(v+1),j=T.match(p4);j&&(M.push(j[1]),Y.unshift(j[2])),Y.length&&(l="/"+Y.join(".")+l),this.hostname=M.join(".");break}}}this.hostname.length>f4?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=a4.toASCII(this.hostname));var de=this.port?":"+this.port:"",re=this.hostname||"";this.host=re+de,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!m4[f])for(var v=0,w=uv.length;v<w;v++){var F=uv[v];if(l.indexOf(F)!==-1){var V=encodeURIComponent(F);V===F&&(V=escape(F)),l=l.split(F).join(V)}}var ne=l.indexOf("#");ne!==-1&&(this.hash=l.substr(ne),l=l.slice(0,ne));var fe=l.indexOf("?");if(fe!==-1?(this.search=l.substr(fe),this.query=l.substr(fe+1),e&&(this.query=cv.parse(this.query)),l=l.slice(0,fe)):e&&(this.search="",this.query={}),l&&(this.pathname=l),tl[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var de=this.pathname||"",ae=this.search||"";this.path=de+ae}return this.href=this.format(),this};ts.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,s="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(s=cv.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var o=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||tl[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),o&&o.charAt(0)!=="?"&&(o="?"+o),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),o=o.replace("#","%23"),e+i+r+o+n};ts.prototype.resolve=function(t){return this.resolveObject(g4(t,!1,!0)).format()};ts.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new ts;e.parse(t,!1,!0),t=e}for(var r=new ts,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var o=Object.keys(t),l=0;l<o.length;l++){var h=o[l];h!=="protocol"&&(r[h]=t[h])}return tl[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!tl[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var m=c[f];r[m]=t[m]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!hv[t.protocol]){for(var w=(t.pathname||"").split("/");w.length&&!(t.host=w.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),w[0]!==""&&w.unshift(""),w.length<2&&w.unshift(""),r.pathname=w.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var p=r.pathname||"",v=r.search||"";r.path=p+v}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var _=r.pathname&&r.pathname.charAt(0)==="/",E=t.host||t.pathname&&t.pathname.charAt(0)==="/",A=E||_||r.host&&t.pathname,S=A,b=r.pathname&&r.pathname.split("/")||[],w=t.pathname&&t.pathname.split("/")||[],T=r.protocol&&!tl[r.protocol];if(T&&(r.hostname="",r.port=null,r.host&&(b[0]===""?b[0]=r.host:b.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(w[0]===""?w[0]=t.host:w.unshift(t.host)),t.host=null),A=A&&(w[0]===""||b[0]==="")),E)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,b=w;else if(w.length)b||(b=[]),b.pop(),b=b.concat(w),r.search=t.search,r.query=t.query;else if(t.search!=null){if(T){r.host=b.shift(),r.hostname=r.host;var R=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;R&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var L=b.slice(-1)[0],D=(r.host||t.host||b.length>1)&&(L==="."||L==="..")||L==="",M=0,Y=b.length;Y>=0;Y--)L=b[Y],L==="."?b.splice(Y,1):L===".."?(b.splice(Y,1),M++):M&&(b.splice(Y,1),M--);if(!A&&!S)for(;M--;M)b.unshift("..");A&&b[0]!==""&&(!b[0]||b[0].charAt(0)!=="/")&&b.unshift(""),D&&b.join("/").substr(-1)!=="/"&&b.push("");var j=b[0]===""||b[0]&&b[0].charAt(0)==="/";if(T){r.hostname=j?"":b.length?b.shift():"",r.host=r.hostname;var R=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;R&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)}return A=A||r.host&&b.length,A&&!j&&b.unshift(""),b.length>0?r.pathname=b.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};ts.prototype.parseHost=function(){var t=this.host,e=u4.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const rE={};function Ue(t,e,r=3){if(rE[e])return;let n=new Error().stack;typeof n>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
45
+ Deprecated since v${t}`):(n=n.split(`
46
+ `).splice(r).join(`
47
+ `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
48
+ Deprecated since v${t}`),console.warn(n),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
49
+ Deprecated since v${t}`),console.warn(n))),rE[e]=!0}function Fn(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function Jl(t){return t.split("?")[0].split("#")[0]}function y4(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v4(t,e,r){return t.replace(new RegExp(y4(e),"g"),r)}function _4(t,e){let r="",n=0,i=-1,s=0,o=-1;for(let l=0;l<=t.length;++l){if(l<t.length)o=t.charCodeAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||s===1))if(i!==l-1&&s===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){const h=r.lastIndexOf("/");if(h!==r.length-1){h===-1?(r="",n=0):(r=r.slice(0,h),n=r.length-1-r.lastIndexOf("/")),i=l,s=0;continue}}else if(r.length===2||r.length===1){r="",n=0,i=l,s=0;continue}}}else r.length>0?r+=`/${t.slice(i+1,l)}`:r=t.slice(i+1,l),n=l-i-1;i=l,s=0}else o===46&&s!==-1?++s:s=-1}return r}const qt={toPosix(t){return v4(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){Fn(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(Fn(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const n=Jl(this.toPosix(e??pe.ADAPTER.getBaseUrl())),i=Jl(this.toPosix(r??this.rootname(n)));return t=this.toPosix(t),t.startsWith("/")?qt.join(i,t.slice(1)):this.isAbsolute(t)?t:this.join(n,t)},normalize(t){if(Fn(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const r=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const n=t.endsWith("/");return t=_4(t),t.length>0&&n&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return Fn(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){const n=t[r];if(Fn(n),n.length>0)if(e===void 0)e=n;else{const i=t[r-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?e+=`/../${n}`:e+=`/${n}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(Fn(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const r=e===47;let n=-1,i=!0;const s=this.getProtocol(t),o=t;t=t.slice(s.length);for(let l=t.length-1;l>=1;--l)if(e=t.charCodeAt(l),e===47){if(!i){n=l;break}}else i=!1;return n===-1?r?"/":this.isUrl(o)?s+t:s:r&&n===1?"//":s+t.slice(0,n)},rootname(t){Fn(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);r!==-1?e=t.slice(0,r):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){Fn(t),e&&Fn(e),t=Jl(this.toPosix(t));let r=0,n=-1,i=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){const h=t.charCodeAt(s);if(h===47){if(!i){r=s+1;break}}else l===-1&&(i=!1,l=s+1),o>=0&&(h===e.charCodeAt(o)?--o===-1&&(n=s):(o=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!i){r=s+1;break}}else n===-1&&(i=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Fn(t),t=Jl(this.toPosix(t));let e=-1,r=0,n=-1,i=!0,s=0;for(let o=t.length-1;o>=0;--o){const l=t.charCodeAt(o);if(l===47){if(!i){r=o+1;break}continue}n===-1&&(i=!1,n=o+1),l===46?e===-1?e=o:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},parse(t){Fn(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=Jl(this.toPosix(t));let r=t.charCodeAt(0);const n=this.isAbsolute(t);let i;e.root=this.rootname(t),n||this.hasProtocol(t)?i=1:i=0;let s=-1,o=0,l=-1,h=!0,c=t.length-1,f=0;for(;c>=i;--c){if(r=t.charCodeAt(c),r===47){if(!h){o=c+1;break}continue}l===-1&&(h=!1,l=c+1),r===46?s===-1?s=c:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||l===-1||f===0||f===1&&s===l-1&&s===o+1?l!==-1&&(o===0&&n?e.base=e.name=t.slice(1,l):e.base=e.name=t.slice(o,l)):(o===0&&n?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(o,s),e.base=t.slice(o,l)),e.ext=t.slice(s,l)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};let Tg;async function x4(){return Tg??(Tg=(async()=>{var s;const t=document.createElement("canvas").getContext("webgl");if(!t)return Gr.UNPACK;const e=await new Promise(o=>{const l=document.createElement("video");l.onloadeddata=()=>o(l),l.onerror=()=>o(null),l.autoplay=!1,l.crossOrigin="anonymous",l.preload="auto",l.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",l.load()});if(!e)return Gr.UNPACK;const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const i=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,i),t.deleteFramebuffer(n),t.deleteTexture(r),(s=t.getExtension("WEBGL_lose_context"))==null||s.loseContext(),i[0]<=i[3]?Gr.PMA:Gr.UNPACK})()),Tg}let Ag;function w4(){return typeof Ag>"u"&&(Ag=function(){var e;const t={stencil:!0,failIfMajorPerformanceCaveat:pe.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!pe.ADAPTER.getWebGLRenderingContext())return!1;const r=pe.ADAPTER.createCanvas();let n=r.getContext("webgl",t)||r.getContext("experimental-webgl",t);const i=!!((e=n==null?void 0:n.getContextAttributes())!=null&&e.stencil);if(n){const s=n.getExtension("WEBGL_lose_context");s&&s.loseContext()}return n=null,i}catch{return!1}}()),Ag}var E4={grad:.9,turn:360,rad:360/(2*Math.PI)},ji=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Yt=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},Tn=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},kA=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},nE=function(t){return{r:Tn(t.r,0,255),g:Tn(t.g,0,255),b:Tn(t.b,0,255),a:Tn(t.a)}},Cg=function(t){return{r:Yt(t.r),g:Yt(t.g),b:Yt(t.b),a:Yt(t.a,3)}},S4=/^#([0-9a-f]{3,8})$/i,zc=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},NA=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=Math.max(e,r,n),o=s-Math.min(e,r,n),l=o?s===e?(r-n)/o:s===r?2+(n-e)/o:4+(e-r)/o:0;return{h:60*(l<0?l+6:l),s:s?o/s*100:0,v:s/255*100,a:i}},DA=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var s=Math.floor(e),o=n*(1-r),l=n*(1-(e-s)*r),h=n*(1-(1-e+s)*r),c=s%6;return{r:255*[n,l,o,o,h,n][c],g:255*[h,n,n,l,o,o][c],b:255*[o,o,h,n,n,l][c],a:i}},iE=function(t){return{h:kA(t.h),s:Tn(t.s,0,100),l:Tn(t.l,0,100),a:Tn(t.a)}},sE=function(t){return{h:Yt(t.h),s:Yt(t.s),l:Yt(t.l),a:Yt(t.a,3)}},oE=function(t){return DA((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},Ru=function(t){return{h:(e=NA(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},b4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,C4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dv={string:[[function(t){var e=S4.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Yt(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Yt(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=A4.exec(t)||C4.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:nE({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(t){var e=b4.exec(t)||T4.exec(t);if(!e)return null;var r,n,i=iE({h:(r=e[1],n=e[2],n===void 0&&(n="deg"),Number(r)*(E4[n]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return oE(i)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=i===void 0?1:i;return ji(e)&&ji(r)&&ji(n)?nE({r:Number(e),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,i=t.a,s=i===void 0?1:i;if(!ji(e)||!ji(r)||!ji(n))return null;var o=iE({h:Number(e),s:Number(r),l:Number(n),a:Number(s)});return oE(o)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,i=t.a,s=i===void 0?1:i;if(!ji(e)||!ji(r)||!ji(n))return null;var o=function(l){return{h:kA(l.h),s:Tn(l.s,0,100),v:Tn(l.v,0,100),a:Tn(l.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(s)});return DA(o)},"hsv"]]},aE=function(t,e){for(var r=0;r<e.length;r++){var n=e[r][0](t);if(n)return[n,e[r][1]]}return[null,void 0]},P4=function(t){return typeof t=="string"?aE(t.trim(),dv.string):typeof t=="object"&&t!==null?aE(t,dv.object):[null,void 0]},Pg=function(t,e){var r=Ru(t);return{h:r.h,s:Tn(r.s+100*e,0,100),l:r.l,a:r.a}},Ig=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},lE=function(t,e){var r=Ru(t);return{h:r.h,s:r.s,l:Tn(r.l+100*e,0,100),a:r.a}},fv=function(){function t(e){this.parsed=P4(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return Yt(Ig(this.rgba),2)},t.prototype.isDark=function(){return Ig(this.rgba)<.5},t.prototype.isLight=function(){return Ig(this.rgba)>=.5},t.prototype.toHex=function(){return e=Cg(this.rgba),r=e.r,n=e.g,i=e.b,o=(s=e.a)<1?zc(Yt(255*s)):"","#"+zc(r)+zc(n)+zc(i)+o;var e,r,n,i,s,o},t.prototype.toRgb=function(){return Cg(this.rgba)},t.prototype.toRgbString=function(){return e=Cg(this.rgba),r=e.r,n=e.g,i=e.b,(s=e.a)<1?"rgba("+r+", "+n+", "+i+", "+s+")":"rgb("+r+", "+n+", "+i+")";var e,r,n,i,s},t.prototype.toHsl=function(){return sE(Ru(this.rgba))},t.prototype.toHslString=function(){return e=sE(Ru(this.rgba)),r=e.h,n=e.s,i=e.l,(s=e.a)<1?"hsla("+r+", "+n+"%, "+i+"%, "+s+")":"hsl("+r+", "+n+"%, "+i+"%)";var e,r,n,i,s},t.prototype.toHsv=function(){return e=NA(this.rgba),{h:Yt(e.h),s:Yt(e.s),v:Yt(e.v),a:Yt(e.a,3)};var e},t.prototype.invert=function(){return di({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),di(Pg(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),di(Pg(this.rgba,-e))},t.prototype.grayscale=function(){return di(Pg(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),di(lE(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),di(lE(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?di({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Yt(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=Ru(this.rgba);return typeof e=="number"?di({h:e,s:r.s,l:r.l,a:r.a}):Yt(r.h)},t.prototype.isEqual=function(e){return this.toHex()===di(e).toHex()},t}(),di=function(t){return t instanceof fv?t:new fv(t)},uE=[],I4=function(t){t.forEach(function(e){uE.indexOf(e)<0&&(e(fv,dv),uE.push(e))})};function R4(t,e){var r={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"},n={};for(var i in r)n[r[i]]=i;var s={};t.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,h,c=n[this.toHex()];if(c)return c;if(o!=null&&o.closest){var f=this.toRgb(),m=1/0,p="black";if(!s.length)for(var v in r)s[v]=new t(r[v]).toRgb();for(var _ in r){var E=(l=f,h=s[_],Math.pow(l.r-h.r,2)+Math.pow(l.g-h.g,2)+Math.pow(l.b-h.b,2));E<m&&(m=E,p=_)}return p}},e.string.push([function(o){var l=o.toLowerCase(),h=l==="transparent"?"#0000":r[l];return h?new t(h).toRgb():null},"name"])}I4([R4]);const Ta=class Rd{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 Rd)this._value=this.cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set PIXI.Color#value to null");(this._value===null||!this.isSourceEqual(this._value,e))&&(this.normalize(e),this._value=this.cloneSource(e))}}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,r){const n=typeof e;if(n!==typeof r)return!1;if(n==="number"||n==="string"||e instanceof Number)return e===r;if(Array.isArray(e)&&Array.isArray(r)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(r))return e.length!==r.length?!1:e.every((i,s)=>i===r[s]);if(e!==null&&r!==null){const i=Object.keys(e),s=Object.keys(r);return i.length!==s.length?!1:i.every(o=>e[o]===r[o])}return e===r}toRgba(){const[e,r,n,i]=this._components;return{r:e,g:r,b:n,a:i}}toRgb(){const[e,r,n]=this._components;return{r:e,g:r,b:n}}toRgbaString(){const[e,r,n]=this.toUint8RgbArray();return`rgba(${e},${r},${n},${this.alpha})`}toUint8RgbArray(e){const[r,n,i]=this._components;return e=e??[],e[0]=Math.round(r*255),e[1]=Math.round(n*255),e[2]=Math.round(i*255),e}toRgbArray(e){e=e??[];const[r,n,i]=this._components;return e[0]=r,e[1]=n,e[2]=i,e}toNumber(){return this._int}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[r,n,i,s]=Rd.temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=n,this._components[2]*=i,this._components[3]*=s,this.refreshInt(),this._value=null,this}premultiply(e,r=!0){return r&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this.refreshInt(),this._value=null,this}toPremultiplied(e,r=!0){if(e===1)return(255<<24)+this._int;if(e===0)return r?0:this._int;let n=this._int>>16&255,i=this._int>>8&255,s=this._int&255;return r&&(n=n*e+.5|0,i=i*e+.5|0,s=s*e+.5|0),(e*255<<24)+(n<<16)+(i<<8)+s}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(e){return this._components[3]=this._clamp(e),this}round(e){const[r,n,i]=this._components;return this._components[0]=Math.round(r*e)/e,this._components[1]=Math.round(n*e)/e,this._components[2]=Math.round(i*e)/e,this.refreshInt(),this._value=null,this}toArray(e){e=e??[];const[r,n,i,s]=this._components;return e[0]=r,e[1]=n,e[2]=i,e[3]=s,e}normalize(e){let r,n,i,s;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;r=(o>>16&255)/255,n=(o>>8&255)/255,i=(o&255)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,n,i,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,n,i,s=255]=e,r/=255,n/=255,i/=255,s/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const l=Rd.HEX_PATTERN.exec(e);l&&(e=`#${l[2]}`)}const o=di(e);o.isValid()&&({r,g:n,b:i,a:s}=o.rgba,r/=255,n/=255,i/=255)}if(r!==void 0)this._components[0]=r,this._components[1]=n,this._components[2]=i,this._components[3]=s,this.refreshInt();else throw new Error(`Unable to convert color ${e}`)}refreshInt(){this._clamp(this._components);const[e,r,n]=this._components;this._int=(e*255<<16)+(r*255<<8)+(n*255|0)}_clamp(e,r=0,n=1){return typeof e=="number"?Math.min(Math.max(e,r),n):(e.forEach((i,s)=>{e[s]=Math.min(Math.max(i,r),n)}),e)}};Ta.shared=new Ta,Ta.temp=new Ta,Ta.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let rt=Ta;function M4(t){return Ue("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),rt.shared.setValue(t).toHex()}function k4(t){return Ue("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),rt.shared.setValue(t).toNumber()}function N4(){const t=[],e=[];for(let n=0;n<32;n++)t[n]=n,e[n]=n;t[Me.NORMAL_NPM]=Me.NORMAL,t[Me.ADD_NPM]=Me.ADD,t[Me.SCREEN_NPM]=Me.SCREEN,e[Me.NORMAL]=Me.NORMAL_NPM,e[Me.ADD]=Me.ADD_NPM,e[Me.SCREEN]=Me.SCREEN_NPM;const r=[];return r.push(e),r.push(t),r}const OA=N4();function FA(t,e){return OA[e?1:0][t]}function D4(t,e=null){const r=t*6;if(e=e||new Uint16Array(r),e.length!==r)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${r}`);for(let n=0,i=0;n<r;n+=6,i+=4)e[n+0]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3;return e}function BA(t){if(t.BYTES_PER_ELEMENT===4)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(t.BYTES_PER_ELEMENT===2){if(t instanceof Uint16Array)return"Uint16Array"}else if(t.BYTES_PER_ELEMENT===1&&t instanceof Uint8Array)return"Uint8Array";return null}function mf(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function hE(t){return!(t&t-1)&&!!t}function cE(t){let e=(t>65535?1:0)<<4;t>>>=e;let r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function rl(t,e,r){const n=t.length;let i;if(e>=n||r===0)return;r=e+r>n?n-e:r;const s=n-r;for(i=e;i<s;++i)t[i]=t[i+r];t.length=s}function Us(t){return t===0?0:t<0?-1:1}let O4=0;function Xo(){return++O4}const pv=class{constructor(t,e,r,n){this.left=t,this.top=e,this.right=r,this.bottom=n}get width(){return this.right-this.left}get height(){return this.bottom-this.top}isEmpty(){return this.left===this.right||this.top===this.bottom}};pv.EMPTY=new pv(0,0,0,0);let dE=pv;const fE={},fi=Object.create(null),Cs=Object.create(null);class F4{constructor(e,r,n){this._canvas=pe.ADAPTER.createCanvas(),this._context=this._canvas.getContext("2d"),this.resolution=n||pe.RESOLUTION,this.resize(e,r)}clear(){this._checkDestroyed(),this._context.setTransform(1,0,0,1,0,0),this._context.clearRect(0,0,this._canvas.width,this._canvas.height)}resize(e,r){this._checkDestroyed(),this._canvas.width=Math.round(e*this.resolution),this._canvas.height=Math.round(r*this.resolution)}destroy(){this._context=null,this._canvas=null}get width(){return this._checkDestroyed(),this._canvas.width}set width(e){this._checkDestroyed(),this._canvas.width=Math.round(e)}get height(){return this._checkDestroyed(),this._canvas.height}set height(e){this._checkDestroyed(),this._canvas.height=Math.round(e)}get canvas(){return this._checkDestroyed(),this._canvas}get context(){return this._checkDestroyed(),this._context}_checkDestroyed(){if(this._canvas===null)throw new TypeError("The CanvasRenderTarget has already been destroyed")}}function pE(t,e,r){for(let n=0,i=4*r*e;n<e;++n,i+=4)if(t[i+3]!==0)return!1;return!0}function mE(t,e,r,n,i){const s=4*e;for(let o=n,l=n*s+4*r;o<=i;++o,l+=s)if(t[l+3]!==0)return!1;return!0}function B4(t){const{width:e,height:r}=t,n=t.getContext("2d",{willReadFrequently:!0});if(n===null)throw new TypeError("Failed to get canvas 2D context");const i=n.getImageData(0,0,e,r).data;let s=0,o=0,l=e-1,h=r-1;for(;o<r&&pE(i,e,o);)++o;if(o===r)return dE.EMPTY;for(;pE(i,e,h);)--h;for(;mE(i,e,s,o,h);)++s;for(;mE(i,e,l,o,h);)--l;return++l,++h,new dE(s,o,l,h)}function L4(t){const e=B4(t),{width:r,height:n}=e;let i=null;if(!e.isEmpty()){const s=t.getContext("2d");if(s===null)throw new TypeError("Failed to get canvas 2D context");i=s.getImageData(e.left,e.top,r,n)}return{width:r,height:n,data:i}}function U4(t,e=globalThis.location){if(t.startsWith("data:"))return"";e=e||globalThis.location;const r=new URL(t,document.baseURI);return r.hostname!==e.hostname||r.port!==e.port||r.protocol!==e.protocol?"anonymous":""}function os(t,e=1){var n;const r=(n=pe.RETINA_PREFIX)==null?void 0:n.exec(t);return r?parseFloat(r[1]):e}var ue=(t=>(t.Renderer="renderer",t.Application="application",t.RendererSystem="renderer-webgl-system",t.RendererPlugin="renderer-webgl-plugin",t.CanvasRendererSystem="renderer-canvas-system",t.CanvasRendererPlugin="renderer-canvas-plugin",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t))(ue||{});const mv=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},gE=(t,e)=>mv(t).priority??e,Se={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(mv).forEach(e=>{e.type.forEach(r=>{var n,i;return(i=(n=this._removeHandlers)[r])==null?void 0:i.call(n,e)})}),this},add(...t){return t.map(mv).forEach(e=>{e.type.forEach(r=>{var s,o;const n=this._addHandlers,i=this._queue;n[r]?(s=n[r])==null||s.call(n,e):(i[r]=i[r]||[],(o=i[r])==null||o.push(e))})}),this},handle(t,e,r){var o;const n=this._addHandlers,i=this._removeHandlers;if(n[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);n[t]=e,i[t]=r;const s=this._queue;return s[t]&&((o=s[t])==null||o.forEach(l=>e(l)),delete s[t]),this},handleByMap(t,e){return this.handle(t,r=>{r.name&&(e[r.name]=r.ref)},r=>{r.name&&delete e[r.name]})},handleByList(t,e,r=-1){return this.handle(t,n=>{e.includes(n.ref)||(e.push(n.ref),e.sort((i,s)=>gE(s,r)-gE(i,r)))},n=>{const i=e.indexOf(n.ref);i!==-1&&e.splice(i,1)})}};class gv{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)}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 uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}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`)}}}const z4=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
50
+ `);function G4(t){let e="";for(let r=0;r<t;++r)r>0&&(e+=`
51
+ else `),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function H4(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);for(;;){const n=z4.replace(/%forloop%/gi,G4(t));if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))t=t/2|0;else break}return t}const Rg=0,Mg=1,kg=2,Ng=3,Dg=4,Og=5;class Ni{constructor(){this.data=0,this.blendMode=Me.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Rg)}set blend(e){!!(this.data&1<<Rg)!==e&&(this.data^=1<<Rg)}get offsets(){return!!(this.data&1<<Mg)}set offsets(e){!!(this.data&1<<Mg)!==e&&(this.data^=1<<Mg)}get culling(){return!!(this.data&1<<kg)}set culling(e){!!(this.data&1<<kg)!==e&&(this.data^=1<<kg)}get depthTest(){return!!(this.data&1<<Ng)}set depthTest(e){!!(this.data&1<<Ng)!==e&&(this.data^=1<<Ng)}get depthMask(){return!!(this.data&1<<Og)}set depthMask(e){!!(this.data&1<<Og)!==e&&(this.data^=1<<Og)}get clockwiseFrontFace(){return!!(this.data&1<<Dg)}set clockwiseFrontFace(e){!!(this.data&1<<Dg)!==e&&(this.data^=1<<Dg)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==Me.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}static for2d(){const e=new Ni;return e.depthTest=!1,e.blend=!0,e}}Ni.prototype.toString=function(){return`[@pixi/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`};const yv=[];function LA(t,e){if(!t)return null;let r="";if(typeof t=="string"){const n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(r=n[1].toLowerCase())}for(let n=yv.length-1;n>=0;--n){const i=yv[n];if(i.test&&i.test(t,r))return new i(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}class Qn{constructor(e){this.items=[],this._name=e,this._aliasCount=0}emit(e,r,n,i,s,o,l,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:c,items:f}=this;this._aliasCount++;for(let m=0,p=f.length;m<p;m++)f[m][c](e,r,n,i,s,o,l,h);return f===this.items&&this._aliasCount--,this}ensureNonAliasedItems(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this}remove(e){const r=this.items.indexOf(e);return r!==-1&&(this.ensureNonAliasedItems(),this.items.splice(r,1)),this}contains(e){return this.items.includes(e)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items.length=0,this._name=""}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(Qn.prototype,{dispatch:{value:Qn.prototype.emit},run:{value:Qn.prototype.emit}});class Ju{constructor(e=0,r=0){this._width=e,this._height=r,this.destroyed=!1,this.internal=!1,this.onResize=new Qn("setRealSize"),this.onUpdate=new Qn("update"),this.onError=new Qn("onError")}bind(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)}resize(e,r){(e!==this._width||r!==this._height)&&(this._width=e,this._height=r,this.onResize.emit(e,r))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(e,r,n){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(e,r){return!1}}class ip extends Ju{constructor(e,r){const{width:n,height:i}=r||{};if(!n||!i)throw new Error("BufferResource width or height invalid");super(n,i),this.data=e,this.unpackAlignment=r.unpackAlignment??4}upload(e,r,n){const i=e.gl;i.pixelStorei(i.UNPACK_ALIGNMENT,this.unpackAlignment),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Gr.UNPACK);const s=r.realWidth,o=r.realHeight;return n.width===s&&n.height===o?i.texSubImage2D(r.target,0,0,0,s,o,r.format,n.type,this.data):(n.width=s,n.height=o,i.texImage2D(r.target,0,n.internalFormat,s,o,0,r.format,n.type,this.data)),!0}dispose(){this.data=null}static test(e){return e===null||e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}const j4={scaleMode:Sn.NEAREST,alphaMode:Gr.NPM},vv=class Aa extends hh{constructor(e=null,r=null){super(),r=Object.assign({},Aa.defaultOptions,r);const{alphaMode:n,mipmap:i,anisotropicLevel:s,scaleMode:o,width:l,height:h,wrapMode:c,format:f,type:m,target:p,resolution:v,resourceOptions:_}=r;e&&!(e instanceof Ju)&&(e=LA(e,_),e.internal=!0),this.resolution=v||pe.RESOLUTION,this.width=Math.round((l||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=i,this.anisotropicLevel=s,this._wrapMode=c,this._scaleMode=o,this.format=f,this.type=m,this.target=p,this.alphaMode=n,this.uid=Xo(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=l>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(e)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(e){this._mipmap!==e&&(this._mipmap=e,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(e){this._scaleMode!==e&&(this._scaleMode=e,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(e){this._wrapMode!==e&&(this._wrapMode=e,this.dirtyStyleId++)}setStyle(e,r){let n;return e!==void 0&&e!==this.scaleMode&&(this.scaleMode=e,n=!0),r!==void 0&&r!==this.mipmap&&(this.mipmap=r,n=!0),n&&this.dirtyStyleId++,this}setSize(e,r,n){return n=n||this.resolution,this.setRealSize(e*n,r*n,n)}setRealSize(e,r,n){return this.resolution=n||this.resolution,this.width=Math.round(e)/this.resolution,this.height=Math.round(r)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=hE(this.realWidth)&&hE(this.realHeight)}setResolution(e){const r=this.resolution;return r===e?this:(this.resolution=e,this.valid&&(this.width=Math.round(this.width*r)/e,this.height=Math.round(this.height*r)/e,this.emit("update",this)),this._refreshPOT(),this)}setResource(e){if(this.resource===e)return this;if(this.resource)throw new Error("Resource can be set only once");return e.bind(this),this.resource=e,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(e){this.emit("error",this,e)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Cs[this.cacheId],delete fi[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Aa.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(e,r,n=pe.STRICT_TEXTURE_CACHE){const i=typeof e=="string";let s=null;if(i)s=e;else{if(!e._pixiId){const l=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${l}_${Xo()}`}s=e._pixiId}let o=Cs[s];if(i&&n&&!o)throw new Error(`The cacheId "${s}" does not exist in BaseTextureCache.`);return o||(o=new Aa(e,r),o.cacheId=s,Aa.addToCache(o,s)),o}static fromBuffer(e,r,n,i){e=e||new Float32Array(r*n*4);const s=new ip(e,{width:r,height:n,...i==null?void 0:i.resourceOptions});let o,l;return e instanceof Float32Array?(o=te.RGBA,l=Ae.FLOAT):e instanceof Int32Array?(o=te.RGBA_INTEGER,l=Ae.INT):e instanceof Uint32Array?(o=te.RGBA_INTEGER,l=Ae.UNSIGNED_INT):e instanceof Int16Array?(o=te.RGBA_INTEGER,l=Ae.SHORT):e instanceof Uint16Array?(o=te.RGBA_INTEGER,l=Ae.UNSIGNED_SHORT):e instanceof Int8Array?(o=te.RGBA,l=Ae.BYTE):(o=te.RGBA,l=Ae.UNSIGNED_BYTE),s.internal=!0,new Aa(s,Object.assign({},j4,{type:l,format:o},i))}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),Cs[r]&&Cs[r]!==e&&console.warn(`BaseTexture added to the cache with an id [${r}] that already had an entry`),Cs[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=Cs[e];if(r){const n=r.textureCacheIds.indexOf(e);return n>-1&&r.textureCacheIds.splice(n,1),delete Cs[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)delete Cs[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}};vv.defaultOptions={mipmap:Ri.POW2,anisotropicLevel:0,scaleMode:Sn.LINEAR,wrapMode:es.CLAMP,alphaMode:Gr.UNPACK,target:Ja.TEXTURE_2D,format:te.RGBA,type:Ae.UNSIGNED_BYTE},vv._globalBatch=0;let Ne=vv;class _v{constructor(){this.texArray=null,this.blend=0,this.type=Wn.TRIANGLES,this.start=0,this.size=0,this.data=null}}let $4=0;class Ct{constructor(e,r=!0,n=!1){this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=n,this.static=r,this.id=$4++,this.disposeRunner=new Qn("disposeBuffer")}update(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.data=null}set index(e){this.type=e?Pi.ELEMENT_ARRAY_BUFFER:Pi.ARRAY_BUFFER}get index(){return this.type===Pi.ELEMENT_ARRAY_BUFFER}static from(e){return e instanceof Array&&(e=new Float32Array(e)),new Ct(e)}}class gf{constructor(e,r=0,n=!1,i=Ae.FLOAT,s,o,l,h=1){this.buffer=e,this.size=r,this.normalized=n,this.type=i,this.stride=s,this.start=o,this.instance=l,this.divisor=h}destroy(){this.buffer=null}static from(e,r,n,i,s){return new gf(e,r,n,i,s)}}const W4={Float32Array,Uint32Array,Int32Array,Uint8Array};function V4(t,e){let r=0,n=0;const i={};for(let h=0;h<t.length;h++)n+=e[h],r+=t[h].length;const s=new ArrayBuffer(r*4);let o=null,l=0;for(let h=0;h<t.length;h++){const c=e[h],f=t[h],m=BA(f);i[m]||(i[m]=new W4[m](s)),o=i[m];for(let p=0;p<f.length;p++){const v=(p/c|0)*n+l,_=p%c;o[v+_]=f[p]}l+=c}return new Float32Array(s)}const yE={5126:4,5123:2,5121:1};let X4=0;const Y4={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array};class Js{constructor(e=[],r={}){this.buffers=e,this.indexBuffer=null,this.attributes=r,this.glVertexArrayObjects={},this.id=X4++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Qn("disposeGeometry"),this.refCount=0}addAttribute(e,r,n=0,i=!1,s,o,l,h=!1){if(!r)throw new Error("You must pass a buffer when creating an attribute");r instanceof Ct||(r instanceof Array&&(r=new Float32Array(r)),r=new Ct(r));const c=e.split("|");if(c.length>1){for(let m=0;m<c.length;m++)this.addAttribute(c[m],r,n,i,s);return this}let f=this.buffers.indexOf(r);return f===-1&&(this.buffers.push(r),f=this.buffers.length-1),this.attributes[e]=new gf(f,n,i,s,o,l,h),this.instanced=this.instanced||h,this}getAttribute(e){return this.attributes[e]}getBuffer(e){return this.buffers[this.getAttribute(e).buffer]}addIndex(e){return e instanceof Ct||(e instanceof Array&&(e=new Uint16Array(e)),e=new Ct(e)),e.type=Pi.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.includes(e)||this.buffers.push(e),this}getIndex(){return this.indexBuffer}interleave(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;const e=[],r=[],n=new Ct;let i;for(i in this.attributes){const s=this.attributes[i],o=this.buffers[s.buffer];e.push(o.data),r.push(s.size*yE[s.type]/4),s.buffer=0}for(n.data=V4(e,r),i=0;i<this.buffers.length;i++)this.buffers[i]!==this.indexBuffer&&this.buffers[i].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this}getSize(){for(const e in this.attributes){const r=this.attributes[e];return this.buffers[r.buffer].data.length/(r.stride/4||r.size)}return 0}dispose(){this.disposeRunner.emit(this,!1)}destroy(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null}clone(){const e=new Js;for(let r=0;r<this.buffers.length;r++)e.buffers[r]=new Ct(this.buffers[r].data.slice(0));for(const r in this.attributes){const n=this.attributes[r];e.attributes[r]=new gf(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Pi.ELEMENT_ARRAY_BUFFER),e}static merge(e){const r=new Js,n=[],i=[],s=[];let o;for(let l=0;l<e.length;l++){o=e[l];for(let h=0;h<o.buffers.length;h++)i[h]=i[h]||0,i[h]+=o.buffers[h].data.length,s[h]=0}for(let l=0;l<o.buffers.length;l++)n[l]=new Y4[BA(o.buffers[l].data)](i[l]),r.buffers[l]=new Ct(n[l]);for(let l=0;l<e.length;l++){o=e[l];for(let h=0;h<o.buffers.length;h++)n[h].set(o.buffers[h].data,s[h]),s[h]+=o.buffers[h].data.length}if(r.attributes=o.attributes,o.indexBuffer){r.indexBuffer=r.buffers[o.buffers.indexOf(o.indexBuffer)],r.indexBuffer.type=Pi.ELEMENT_ARRAY_BUFFER;let l=0,h=0,c=0,f=0;for(let m=0;m<o.buffers.length;m++)if(o.buffers[m]!==o.indexBuffer){f=m;break}for(const m in o.attributes){const p=o.attributes[m];(p.buffer|0)===f&&(h+=p.size*yE[p.type]/4)}for(let m=0;m<e.length;m++){const p=e[m].indexBuffer.data;for(let v=0;v<p.length;v++)r.indexBuffer.data[v+c]+=l;l+=e[m].buffers[f].data.length/h,c+=p.length}}return r}}class UA extends Js{constructor(e=!1){super(),this._buffer=new Ct(null,e,!1),this._indexBuffer=new Ct(null,e,!0),this.addAttribute("aVertexPosition",this._buffer,2,!1,Ae.FLOAT).addAttribute("aTextureCoord",this._buffer,2,!1,Ae.FLOAT).addAttribute("aColor",this._buffer,4,!0,Ae.UNSIGNED_BYTE).addAttribute("aTextureId",this._buffer,1,!0,Ae.FLOAT).addIndex(this._indexBuffer)}}const yf=Math.PI*2,Q4=180/Math.PI,K4=Math.PI/180;var or=(t=>(t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC",t))(or||{});class Ge{constructor(e=0,r=0){this.x=0,this.y=0,this.x=e,this.y=r}clone(){return new Ge(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,r=e){return this.x=e,this.y=r,this}}Ge.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const Gc=[new Ge,new Ge,new Ge,new Ge];class De{constructor(e=0,r=0,n=0,i=0){this.x=Number(e),this.y=Number(r),this.width=Number(n),this.height=Number(i),this.type=or.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new De(0,0,0,0)}clone(){return new De(this.x,this.y,this.width,this.height)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}contains(e,r){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height}intersects(e,r){if(!r){const M=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=M)return!1;const Y=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>Y}const n=this.left,i=this.right,s=this.top,o=this.bottom;if(i<=n||o<=s)return!1;const l=Gc[0].set(e.left,e.top),h=Gc[1].set(e.left,e.bottom),c=Gc[2].set(e.right,e.top),f=Gc[3].set(e.right,e.bottom);if(c.x<=l.x||h.y<=l.y)return!1;const m=Math.sign(r.a*r.d-r.b*r.c);if(m===0||(r.apply(l,l),r.apply(h,h),r.apply(c,c),r.apply(f,f),Math.max(l.x,h.x,c.x,f.x)<=n||Math.min(l.x,h.x,c.x,f.x)>=i||Math.max(l.y,h.y,c.y,f.y)<=s||Math.min(l.y,h.y,c.y,f.y)>=o))return!1;const p=m*(h.y-l.y),v=m*(l.x-h.x),_=p*n+v*s,E=p*i+v*s,A=p*n+v*o,S=p*i+v*o;if(Math.max(_,E,A,S)<=p*l.x+v*l.y||Math.min(_,E,A,S)>=p*f.x+v*f.y)return!1;const b=m*(l.y-c.y),w=m*(c.x-l.x),T=b*n+w*s,R=b*i+w*s,L=b*n+w*o,D=b*i+w*o;return!(Math.max(T,R,L,D)<=b*l.x+w*l.y||Math.min(T,R,L,D)>=b*f.x+w*f.y)}pad(e=0,r=e){return this.x-=e,this.y-=r,this.width+=e*2,this.height+=r*2,this}fit(e){const r=Math.max(this.x,e.x),n=Math.min(this.x+this.width,e.x+e.width),i=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=r,this.width=Math.max(n-r,0),this.y=i,this.height=Math.max(s-i,0),this}ceil(e=1,r=.001){const n=Math.ceil((this.x+this.width-r)*e)/e,i=Math.ceil((this.y+this.height-r)*e)/e;return this.x=Math.floor((this.x+r)*e)/e,this.y=Math.floor((this.y+r)*e)/e,this.width=n-this.x,this.height=i-this.y,this}enlarge(e){const r=Math.min(this.x,e.x),n=Math.max(this.x+this.width,e.x+e.width),i=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=r,this.width=n-r,this.y=i,this.height=s-i,this}}De.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class sp{constructor(e=0,r=0,n=0){this.x=e,this.y=r,this.radius=n,this.type=or.CIRC}clone(){return new sp(this.x,this.y,this.radius)}contains(e,r){if(this.radius<=0)return!1;const n=this.radius*this.radius;let i=this.x-e,s=this.y-r;return i*=i,s*=s,i+s<=n}getBounds(){return new De(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}sp.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class op{constructor(e=0,r=0,n=0,i=0){this.x=e,this.y=r,this.width=n,this.height=i,this.type=or.ELIP}clone(){return new op(this.x,this.y,this.width,this.height)}contains(e,r){if(this.width<=0||this.height<=0)return!1;let n=(e-this.x)/this.width,i=(r-this.y)/this.height;return n*=n,i*=i,n+i<=1}getBounds(){return new De(this.x-this.width,this.y-this.height,this.width,this.height)}}op.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Uo{constructor(...e){let r=Array.isArray(e[0])?e[0]:e;if(typeof r[0]!="number"){const n=[];for(let i=0,s=r.length;i<s;i++)n.push(r[i].x,r[i].y);r=n}this.points=r,this.type=or.POLY,this.closeStroke=!0}clone(){const e=this.points.slice(),r=new Uo(e);return r.closeStroke=this.closeStroke,r}contains(e,r){let n=!1;const i=this.points.length/2;for(let s=0,o=i-1;s<i;o=s++){const l=this.points[s*2],h=this.points[s*2+1],c=this.points[o*2],f=this.points[o*2+1];h>r!=f>r&&e<(c-l)*((r-h)/(f-h))+l&&(n=!n)}return n}}Uo.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`};class ap{constructor(e=0,r=0,n=0,i=0,s=20){this.x=e,this.y=r,this.width=n,this.height=i,this.radius=s,this.type=or.RREC}clone(){return new ap(this.x,this.y,this.width,this.height,this.radius)}contains(e,r){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&r>=this.y&&r<=this.y+this.height){const n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(r>=this.y+n&&r<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let i=e-(this.x+n),s=r-(this.y+n);const o=n*n;if(i*i+s*s<=o||(i=e-(this.x+this.width-n),i*i+s*s<=o)||(s=r-(this.y+this.height-n),i*i+s*s<=o)||(i=e-(this.x+n),i*i+s*s<=o))return!0}return!1}}ap.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class ot{constructor(e=1,r=0,n=0,i=1,s=0,o=0){this.array=null,this.a=e,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=o}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,r,n,i,s,o){return this.a=e,this.b=r,this.c=n,this.d=i,this.tx=s,this.ty=o,this}toArray(e,r){this.array||(this.array=new Float32Array(9));const n=r||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n}apply(e,r){r=r||new Ge;const n=e.x,i=e.y;return r.x=this.a*n+this.c*i+this.tx,r.y=this.b*n+this.d*i+this.ty,r}applyInverse(e,r){r=r||new Ge;const n=1/(this.a*this.d+this.c*-this.b),i=e.x,s=e.y;return r.x=this.d*n*i+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,r.y=this.a*n*s+-this.b*n*i+(-this.ty*this.a+this.tx*this.b)*n,r}translate(e,r){return this.tx+=e,this.ty+=r,this}scale(e,r){return this.a*=e,this.d*=r,this.c*=e,this.b*=r,this.tx*=e,this.ty*=r,this}rotate(e){const r=Math.cos(e),n=Math.sin(e),i=this.a,s=this.c,o=this.tx;return this.a=i*r-this.b*n,this.b=i*n+this.b*r,this.c=s*r-this.d*n,this.d=s*n+this.d*r,this.tx=o*r-this.ty*n,this.ty=o*n+this.ty*r,this}append(e){const r=this.a,n=this.b,i=this.c,s=this.d;return this.a=e.a*r+e.b*i,this.b=e.a*n+e.b*s,this.c=e.c*r+e.d*i,this.d=e.c*n+e.d*s,this.tx=e.tx*r+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*s+this.ty,this}setTransform(e,r,n,i,s,o,l,h,c){return this.a=Math.cos(l+c)*s,this.b=Math.sin(l+c)*s,this.c=-Math.sin(l-h)*o,this.d=Math.cos(l-h)*o,this.tx=e-(n*this.a+i*this.c),this.ty=r-(n*this.b+i*this.d),this}prepend(e){const r=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=r*e.a+this.ty*e.c+e.tx,this.ty=r*e.b+this.ty*e.d+e.ty,this}decompose(e){const r=this.a,n=this.b,i=this.c,s=this.d,o=e.pivot,l=-Math.atan2(-i,s),h=Math.atan2(n,r),c=Math.abs(l+h);return c<1e-5||Math.abs(yf-c)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=l,e.skew.y=h),e.scale.x=Math.sqrt(r*r+n*n),e.scale.y=Math.sqrt(i*i+s*s),e.position.x=this.tx+(o.x*r+o.y*i),e.position.y=this.ty+(o.x*n+o.y*s),e}invert(){const e=this.a,r=this.b,n=this.c,i=this.d,s=this.tx,o=e*i-r*n;return this.a=i/o,this.b=-r/o,this.c=-n/o,this.d=e/o,this.tx=(n*this.ty-i*s)/o,this.ty=-(e*this.ty-r*s)/o,this}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 ot;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}static get IDENTITY(){return new ot}static get TEMP_MATRIX(){return new ot}}ot.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const To=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ao=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Co=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Po=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],xv=[],zA=[],Hc=Math.sign;function q4(){for(let t=0;t<16;t++){const e=[];xv.push(e);for(let r=0;r<16;r++){const n=Hc(To[t]*To[r]+Co[t]*Ao[r]),i=Hc(Ao[t]*To[r]+Po[t]*Ao[r]),s=Hc(To[t]*Co[r]+Co[t]*Po[r]),o=Hc(Ao[t]*Co[r]+Po[t]*Po[r]);for(let l=0;l<16;l++)if(To[l]===n&&Ao[l]===i&&Co[l]===s&&Po[l]===o){e.push(l);break}}}for(let t=0;t<16;t++){const e=new ot;e.set(To[t],Ao[t],Co[t],Po[t],0,0),zA.push(e)}}q4();const mt={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:t=>To[t],uY:t=>Ao[t],vX:t=>Co[t],vY:t=>Po[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>xv[t][e],sub:(t,e)=>xv[t][mt.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?mt.S:mt.N:Math.abs(e)*2<=Math.abs(t)?t>0?mt.E:mt.W:e>0?t>0?mt.SE:mt.SW:t>0?mt.NE:mt.NW,matrixAppendRotationInv:(t,e,r=0,n=0)=>{const i=zA[mt.inv(e)];i.tx=r,i.ty=n,t.append(i)}};class bi{constructor(e,r,n=0,i=0){this._x=n,this._y=i,this.cb=e,this.scope=r}clone(e=this.cb,r=this.scope){return new bi(e,r,this._x,this._y)}set(e=0,r=e){return(this._x!==e||this._y!==r)&&(this._x=e,this._y=r,this.cb.call(this.scope)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))}}bi.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const wv=class{constructor(){this.worldTransform=new ot,this.localTransform=new ot,this.position=new bi(this.onChange,this,0,0),this.scale=new bi(this.onChange,this,1,1),this.pivot=new bi(this.onChange,this,0,0),this.skew=new bi(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(t){const e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){const r=t.worldTransform,n=this.worldTransform;n.a=e.a*r.a+e.b*r.c,n.b=e.a*r.b+e.b*r.d,n.c=e.c*r.a+e.d*r.c,n.d=e.c*r.b+e.d*r.d,n.tx=e.tx*r.a+e.ty*r.c+r.tx,n.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}}setFromMatrix(t){t.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}};wv.IDENTITY=new wv;let lp=wv;lp.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var Z4=`varying vec2 vTextureCoord;
52
+
53
+ uniform sampler2D uSampler;
54
+
55
+ void main(void){
56
+ gl_FragColor *= texture2D(uSampler, vTextureCoord);
57
+ }`,J4=`attribute vec2 aVertexPosition;
58
+ attribute vec2 aTextureCoord;
59
+
60
+ uniform mat3 projectionMatrix;
61
+
62
+ varying vec2 vTextureCoord;
63
+
64
+ void main(void){
65
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
66
+ vTextureCoord = aTextureCoord;
67
+ }
68
+ `;function vE(t,e,r){const n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),n}function Fg(t){const e=new Array(t);for(let r=0;r<e.length;r++)e[r]=!1;return e}function GA(t,e){switch(t){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 Fg(2*e);case"bvec3":return Fg(3*e);case"bvec4":return Fg(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}const nl=[{test:t=>t.type==="float"&&t.size===1&&!t.isArray,code:t=>`
69
+ if(uv["${t}"] !== ud["${t}"].value)
70
+ {
71
+ ud["${t}"].value = uv["${t}"]
72
+ gl.uniform1f(ud["${t}"].location, uv["${t}"])
73
+ }
74
+ `},{test:(t,e)=>(t.type==="sampler2D"||t.type==="samplerCube"||t.type==="sampler2DArray")&&t.size===1&&!t.isArray&&(e==null||e.castToBaseTexture!==void 0),code:t=>`t = syncData.textureCount++;
75
+
76
+ renderer.texture.bind(uv["${t}"], t);
77
+
78
+ if(ud["${t}"].value !== t)
79
+ {
80
+ ud["${t}"].value = t;
81
+ gl.uniform1i(ud["${t}"].location, t);
82
+ ; // eslint-disable-line max-len
83
+ }`},{test:(t,e)=>t.type==="mat3"&&t.size===1&&!t.isArray&&e.a!==void 0,code:t=>`
84
+ gl.uniformMatrix3fv(ud["${t}"].location, false, uv["${t}"].toArray(true));
85
+ `,codeUbo:t=>`
86
+ var ${t}_matrix = uv.${t}.toArray(true);
87
+
88
+ data[offset] = ${t}_matrix[0];
89
+ data[offset+1] = ${t}_matrix[1];
90
+ data[offset+2] = ${t}_matrix[2];
91
+
92
+ data[offset + 4] = ${t}_matrix[3];
93
+ data[offset + 5] = ${t}_matrix[4];
94
+ data[offset + 6] = ${t}_matrix[5];
95
+
96
+ data[offset + 8] = ${t}_matrix[6];
97
+ data[offset + 9] = ${t}_matrix[7];
98
+ data[offset + 10] = ${t}_matrix[8];
99
+ `},{test:(t,e)=>t.type==="vec2"&&t.size===1&&!t.isArray&&e.x!==void 0,code:t=>`
100
+ cv = ud["${t}"].value;
101
+ v = uv["${t}"];
102
+
103
+ if(cv[0] !== v.x || cv[1] !== v.y)
104
+ {
105
+ cv[0] = v.x;
106
+ cv[1] = v.y;
107
+ gl.uniform2f(ud["${t}"].location, v.x, v.y);
108
+ }`,codeUbo:t=>`
109
+ v = uv.${t};
110
+
111
+ data[offset] = v.x;
112
+ data[offset+1] = v.y;
113
+ `},{test:t=>t.type==="vec2"&&t.size===1&&!t.isArray,code:t=>`
114
+ cv = ud["${t}"].value;
115
+ v = uv["${t}"];
116
+
117
+ if(cv[0] !== v[0] || cv[1] !== v[1])
118
+ {
119
+ cv[0] = v[0];
120
+ cv[1] = v[1];
121
+ gl.uniform2f(ud["${t}"].location, v[0], v[1]);
122
+ }
123
+ `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.width!==void 0,code:t=>`
124
+ cv = ud["${t}"].value;
125
+ v = uv["${t}"];
126
+
127
+ if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)
128
+ {
129
+ cv[0] = v.x;
130
+ cv[1] = v.y;
131
+ cv[2] = v.width;
132
+ cv[3] = v.height;
133
+ gl.uniform4f(ud["${t}"].location, v.x, v.y, v.width, v.height)
134
+ }`,codeUbo:t=>`
135
+ v = uv.${t};
136
+
137
+ data[offset] = v.x;
138
+ data[offset+1] = v.y;
139
+ data[offset+2] = v.width;
140
+ data[offset+3] = v.height;
141
+ `},{test:(t,e)=>t.type==="vec4"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
142
+ cv = ud["${t}"].value;
143
+ v = uv["${t}"];
144
+
145
+ if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha)
146
+ {
147
+ cv[0] = v.red;
148
+ cv[1] = v.green;
149
+ cv[2] = v.blue;
150
+ cv[3] = v.alpha;
151
+ gl.uniform4f(ud["${t}"].location, v.red, v.green, v.blue, v.alpha)
152
+ }`,codeUbo:t=>`
153
+ v = uv.${t};
154
+
155
+ data[offset] = v.red;
156
+ data[offset+1] = v.green;
157
+ data[offset+2] = v.blue;
158
+ data[offset+3] = v.alpha;
159
+ `},{test:(t,e)=>t.type==="vec3"&&t.size===1&&!t.isArray&&e.red!==void 0,code:t=>`
160
+ cv = ud["${t}"].value;
161
+ v = uv["${t}"];
162
+
163
+ if(cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.a)
164
+ {
165
+ cv[0] = v.red;
166
+ cv[1] = v.green;
167
+ cv[2] = v.blue;
168
+
169
+ gl.uniform3f(ud["${t}"].location, v.red, v.green, v.blue)
170
+ }`,codeUbo:t=>`
171
+ v = uv.${t};
172
+
173
+ data[offset] = v.red;
174
+ data[offset+1] = v.green;
175
+ data[offset+2] = v.blue;
176
+ `},{test:t=>t.type==="vec4"&&t.size===1&&!t.isArray,code:t=>`
177
+ cv = ud["${t}"].value;
178
+ v = uv["${t}"];
179
+
180
+ if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
181
+ {
182
+ cv[0] = v[0];
183
+ cv[1] = v[1];
184
+ cv[2] = v[2];
185
+ cv[3] = v[3];
186
+
187
+ gl.uniform4f(ud["${t}"].location, v[0], v[1], v[2], v[3])
188
+ }`}],eN={float:`
189
+ if (cv !== v)
190
+ {
191
+ cu.value = v;
192
+ gl.uniform1f(location, v);
193
+ }`,vec2:`
194
+ if (cv[0] !== v[0] || cv[1] !== v[1])
195
+ {
196
+ cv[0] = v[0];
197
+ cv[1] = v[1];
198
+
199
+ gl.uniform2f(location, v[0], v[1])
200
+ }`,vec3:`
201
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
202
+ {
203
+ cv[0] = v[0];
204
+ cv[1] = v[1];
205
+ cv[2] = v[2];
206
+
207
+ gl.uniform3f(location, v[0], v[1], v[2])
208
+ }`,vec4:`
209
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
210
+ {
211
+ cv[0] = v[0];
212
+ cv[1] = v[1];
213
+ cv[2] = v[2];
214
+ cv[3] = v[3];
215
+
216
+ gl.uniform4f(location, v[0], v[1], v[2], v[3]);
217
+ }`,int:`
218
+ if (cv !== v)
219
+ {
220
+ cu.value = v;
221
+
222
+ gl.uniform1i(location, v);
223
+ }`,ivec2:`
224
+ if (cv[0] !== v[0] || cv[1] !== v[1])
225
+ {
226
+ cv[0] = v[0];
227
+ cv[1] = v[1];
228
+
229
+ gl.uniform2i(location, v[0], v[1]);
230
+ }`,ivec3:`
231
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
232
+ {
233
+ cv[0] = v[0];
234
+ cv[1] = v[1];
235
+ cv[2] = v[2];
236
+
237
+ gl.uniform3i(location, v[0], v[1], v[2]);
238
+ }`,ivec4:`
239
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
240
+ {
241
+ cv[0] = v[0];
242
+ cv[1] = v[1];
243
+ cv[2] = v[2];
244
+ cv[3] = v[3];
245
+
246
+ gl.uniform4i(location, v[0], v[1], v[2], v[3]);
247
+ }`,uint:`
248
+ if (cv !== v)
249
+ {
250
+ cu.value = v;
251
+
252
+ gl.uniform1ui(location, v);
253
+ }`,uvec2:`
254
+ if (cv[0] !== v[0] || cv[1] !== v[1])
255
+ {
256
+ cv[0] = v[0];
257
+ cv[1] = v[1];
258
+
259
+ gl.uniform2ui(location, v[0], v[1]);
260
+ }`,uvec3:`
261
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
262
+ {
263
+ cv[0] = v[0];
264
+ cv[1] = v[1];
265
+ cv[2] = v[2];
266
+
267
+ gl.uniform3ui(location, v[0], v[1], v[2]);
268
+ }`,uvec4:`
269
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
270
+ {
271
+ cv[0] = v[0];
272
+ cv[1] = v[1];
273
+ cv[2] = v[2];
274
+ cv[3] = v[3];
275
+
276
+ gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
277
+ }`,bool:`
278
+ if (cv !== v)
279
+ {
280
+ cu.value = v;
281
+ gl.uniform1i(location, v);
282
+ }`,bvec2:`
283
+ if (cv[0] != v[0] || cv[1] != v[1])
284
+ {
285
+ cv[0] = v[0];
286
+ cv[1] = v[1];
287
+
288
+ gl.uniform2i(location, v[0], v[1]);
289
+ }`,bvec3:`
290
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])
291
+ {
292
+ cv[0] = v[0];
293
+ cv[1] = v[1];
294
+ cv[2] = v[2];
295
+
296
+ gl.uniform3i(location, v[0], v[1], v[2]);
297
+ }`,bvec4:`
298
+ if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])
299
+ {
300
+ cv[0] = v[0];
301
+ cv[1] = v[1];
302
+ cv[2] = v[2];
303
+ cv[3] = v[3];
304
+
305
+ gl.uniform4i(location, v[0], v[1], v[2], v[3]);
306
+ }`,mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:`
307
+ if (cv !== v)
308
+ {
309
+ cu.value = v;
310
+
311
+ gl.uniform1i(location, v);
312
+ }`,samplerCube:`
313
+ if (cv !== v)
314
+ {
315
+ cu.value = v;
316
+
317
+ gl.uniform1i(location, v);
318
+ }`,sampler2DArray:`
319
+ if (cv !== v)
320
+ {
321
+ cu.value = v;
322
+
323
+ gl.uniform1i(location, v);
324
+ }`},tN={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function rN(t,e){var n;const r=[`
325
+ var v = null;
326
+ var cv = null;
327
+ var cu = null;
328
+ var t = 0;
329
+ var gl = renderer.gl;
330
+ `];for(const i in t.uniforms){const s=e[i];if(!s){((n=t.uniforms[i])==null?void 0:n.group)===!0&&(t.uniforms[i].ubo?r.push(`
331
+ renderer.shader.syncUniformBufferGroup(uv.${i}, '${i}');
332
+ `):r.push(`
333
+ renderer.shader.syncUniformGroup(uv.${i}, syncData);
334
+ `));continue}const o=t.uniforms[i];let l=!1;for(let h=0;h<nl.length;h++)if(nl[h].test(s,o)){r.push(nl[h].code(i,o)),l=!0;break}if(!l){const h=(s.size===1&&!s.isArray?eN:tN)[s.type].replace("location",`ud["${i}"].location`);r.push(`
335
+ cu = ud["${i}"];
336
+ cv = cu.value;
337
+ v = uv["${i}"];
338
+ ${h};`)}}return new Function("ud","uv","renderer","syncData",r.join(`
339
+ `))}const HA={};let wa=HA;function nN(){if(wa===HA||wa!=null&&wa.isContextLost()){const t=pe.ADAPTER.createCanvas();let e;pe.PREFER_ENV>=Ko.WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),wa=e}return wa}let jc;function iN(){if(!jc){jc=bn.MEDIUM;const t=nN();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);e&&(jc=e.precision?bn.HIGH:bn.MEDIUM)}}return jc}function _E(t,e){const r=t.getShaderSource(e).split(`
340
+ `).map((c,f)=>`${f}: ${c}`),n=t.getShaderInfoLog(e),i=n.split(`
341
+ `),s={},o=i.map(c=>parseFloat(c.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(c=>c&&!s[c]?(s[c]=!0,!0):!1),l=[""];o.forEach(c=>{r[c-1]=`%c${r[c-1]}%c`,l.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=r.join(`
342
+ `);l[0]=h,console.error(n),console.groupCollapsed("click to view full shader code"),console.warn(...l),console.groupEnd()}function sN(t,e,r,n){t.getProgramParameter(e,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS)||_E(t,r),t.getShaderParameter(n,t.COMPILE_STATUS)||_E(t,n),console.error("PixiJS Error: Could not initialize shader."),t.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(e)))}const oN={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function jA(t){return oN[t]}let $c=null;const xE={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"};function $A(t,e){if(!$c){const r=Object.keys(xE);$c={};for(let n=0;n<r.length;++n){const i=r[n];$c[t[i]]=xE[i]}}return $c[e]}function wE(t,e,r){if(t.substring(0,9)!=="precision"){let n=e;return e===bn.HIGH&&r!==bn.HIGH&&(n=bn.MEDIUM),`precision ${n} float;
343
+ ${t}`}else if(r!==bn.HIGH&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}let eu;function aN(){if(typeof eu=="boolean")return eu;try{eu=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{eu=!1}return eu}let lN=0;const Wc={},Ev=class Ca{constructor(e,r,n="pixi-shader",i={}){this.extra={},this.id=lN++,this.vertexSrc=e||Ca.defaultVertexSrc,this.fragmentSrc=r||Ca.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.extra=i,this.vertexSrc.substring(0,8)!=="#version"&&(n=n.replace(/\s+/g,"-"),Wc[n]?(Wc[n]++,n+=`-${Wc[n]}`):Wc[n]=1,this.vertexSrc=`#define SHADER_NAME ${n}
344
+ ${this.vertexSrc}`,this.fragmentSrc=`#define SHADER_NAME ${n}
345
+ ${this.fragmentSrc}`,this.vertexSrc=wE(this.vertexSrc,Ca.defaultVertexPrecision,bn.HIGH),this.fragmentSrc=wE(this.fragmentSrc,Ca.defaultFragmentPrecision,iN())),this.glPrograms={},this.syncUniforms=null}static get defaultVertexSrc(){return J4}static get defaultFragmentSrc(){return Z4}static from(e,r,n){const i=e+r;let s=fE[i];return s||(fE[i]=s=new Ca(e,r,n)),s}};Ev.defaultVertexPrecision=bn.HIGH,Ev.defaultFragmentPrecision=qi.apple.device?bn.HIGH:bn.MEDIUM;let Zi=Ev,uN=0;class Kn{constructor(e,r,n){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=uN++,this.static=!!r,this.ubo=!!n,e instanceof Ct?(this.buffer=e,this.buffer.type=Pi.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Ct(new Float32Array(1)),this.buffer.type=Pi.UNIFORM_BUFFER,this.autoManage=!0))}update(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()}add(e,r,n){if(!this.ubo)this.uniforms[e]=new Kn(r,n);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")}static from(e,r,n){return new Kn(e,r,n)}static uboFrom(e,r){return new Kn(e,r??!0,!0)}}class Ii{constructor(e,r){this.uniformBindCount=0,this.program=e,r?r instanceof Kn?this.uniformGroup=r:this.uniformGroup=new Kn(r):this.uniformGroup=new Kn({}),this.disposeRunner=new Qn("disposeShader")}checkUniformExists(e,r){if(r.uniforms[e])return!0;for(const n in r.uniforms){const i=r.uniforms[n];if(i.group===!0&&this.checkUniformExists(e,i))return!0}return!1}destroy(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()}get uniforms(){return this.uniformGroup.uniforms}static from(e,r,n){const i=Zi.from(e,r);return new Ii(i,n)}}class hN{constructor(e,r){if(this.vertexSrc=e,this.fragTemplate=r,this.programCache={},this.defaultGroupCache={},!r.includes("%count%"))throw new Error('Fragment template must contain "%count%".');if(!r.includes("%forloop%"))throw new Error('Fragment template must contain "%forloop%".')}generateShader(e){if(!this.programCache[e]){const n=new Int32Array(e);for(let s=0;s<e;s++)n[s]=s;this.defaultGroupCache[e]=Kn.from({uSamplers:n},!0);let i=this.fragTemplate;i=i.replace(/%count%/gi,`${e}`),i=i.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Zi(this.vertexSrc,i)}const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new ot,default:this.defaultGroupCache[e]};return new Ii(this.programCache[e],r)}generateSampleSrc(e){let r="";r+=`
346
+ `,r+=`
347
+ `;for(let n=0;n<e;n++)n>0&&(r+=`
348
+ else `),n<e-1&&(r+=`if(vTextureId < ${n}.5)`),r+=`
349
+ {`,r+=`
350
+ color = texture2D(uSamplers[${n}], vTextureCoord);`,r+=`
351
+ }`;return r+=`
352
+ `,r+=`
353
+ `,r}}class Sv{constructor(){this.elements=[],this.ids=[],this.count=0}clear(){for(let e=0;e<this.count;e++)this.elements[e]=null;this.count=0}}function cN(){return!qi.apple.device}function dN(t){let e=!0;const r=pe.ADAPTER.getNavigator();if(qi.tablet||qi.phone){if(qi.apple.device){const n=r.userAgent.match(/OS (\d+)_(\d+)?/);n&&parseInt(n[1],10)<11&&(e=!1)}if(qi.android.device){const n=r.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)<7&&(e=!1)}}return e?t:4}class up{constructor(e){this.renderer=e}flush(){}destroy(){this.renderer=null}start(){}stop(){this.flush()}render(e){}}var fN=`varying vec2 vTextureCoord;
354
+ varying vec4 vColor;
355
+ varying float vTextureId;
356
+ uniform sampler2D uSamplers[%count%];
357
+
358
+ void main(void){
359
+ vec4 color;
360
+ %forloop%
361
+ gl_FragColor = color * vColor;
362
+ }
363
+ `,pN=`precision highp float;
364
+ attribute vec2 aVertexPosition;
365
+ attribute vec2 aTextureCoord;
366
+ attribute vec4 aColor;
367
+ attribute float aTextureId;
368
+
369
+ uniform mat3 projectionMatrix;
370
+ uniform mat3 translationMatrix;
371
+ uniform vec4 tint;
372
+
373
+ varying vec2 vTextureCoord;
374
+ varying vec4 vColor;
375
+ varying float vTextureId;
376
+
377
+ void main(void){
378
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
379
+
380
+ vTextureCoord = aTextureCoord;
381
+ vTextureId = aTextureId;
382
+ vColor = aColor * tint;
383
+ }
384
+ `;const lu=class Ln extends up{constructor(e){super(e),this.setShaderGenerator(),this.geometryClass=UA,this.vertexSize=6,this.state=Ni.for2d(),this.size=Ln.defaultBatchSize*4,this._vertexCount=0,this._indexCount=0,this._bufferedElements=[],this._bufferedTextures=[],this._bufferSize=0,this._shader=null,this._packedGeometries=[],this._packedGeometryPoolSize=2,this._flushId=0,this._aBuffers={},this._iBuffers={},this.maxTextures=1,this.renderer.on("prerender",this.onPrerender,this),e.runners.contextChange.add(this),this._dcIndex=0,this._aIndex=0,this._iIndex=0,this._attributeBuffer=null,this._indexBuffer=null,this._tempBoundTextures=[]}static get defaultMaxTextures(){return this._defaultMaxTextures=this._defaultMaxTextures??dN(32),this._defaultMaxTextures}static set defaultMaxTextures(e){this._defaultMaxTextures=e}static get canUploadSameBuffer(){return this._canUploadSameBuffer=this._canUploadSameBuffer??cN(),this._canUploadSameBuffer}static set canUploadSameBuffer(e){this._canUploadSameBuffer=e}get MAX_TEXTURES(){return Ue("7.1.0","BatchRenderer#MAX_TEXTURES renamed to BatchRenderer#maxTextures"),this.maxTextures}static get defaultVertexSrc(){return pN}static get defaultFragmentTemplate(){return fN}setShaderGenerator({vertex:e=Ln.defaultVertexSrc,fragment:r=Ln.defaultFragmentTemplate}={}){this.shaderGenerator=new hN(e,r)}contextChange(){const e=this.renderer.gl;pe.PREFER_ENV===Ko.WEBGL_LEGACY?this.maxTextures=1:(this.maxTextures=Math.min(e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),Ln.defaultMaxTextures),this.maxTextures=H4(this.maxTextures,e)),this._shader=this.shaderGenerator.generateShader(this.maxTextures);for(let r=0;r<this._packedGeometryPoolSize;r++)this._packedGeometries[r]=new this.geometryClass;this.initFlushBuffers()}initFlushBuffers(){const{_drawCallPool:e,_textureArrayPool:r}=Ln,n=this.size/4,i=Math.floor(n/this.maxTextures)+1;for(;e.length<n;)e.push(new _v);for(;r.length<i;)r.push(new Sv);for(let s=0;s<this.maxTextures;s++)this._tempBoundTextures[s]=null}onPrerender(){this._flushId=0}render(e){e._texture.valid&&(this._vertexCount+e.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=e.vertexData.length/2,this._indexCount+=e.indices.length,this._bufferedTextures[this._bufferSize]=e._texture.baseTexture,this._bufferedElements[this._bufferSize++]=e)}buildTexturesAndDrawCalls(){const{_bufferedTextures:e,maxTextures:r}=this,n=Ln._textureArrayPool,i=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count;let l=++Ne._globalBatch,h=0,c=n[0],f=0;i.copyBoundTextures(s,r);for(let m=0;m<this._bufferSize;++m){const p=e[m];e[m]=null,p._batchEnabled!==l&&(c.count>=r&&(i.boundArray(c,s,l,r),this.buildDrawCalls(c,f,m),f=m,c=n[++h],++l),p._batchEnabled=l,p.touched=o,c.elements[c.count++]=p)}c.count>0&&(i.boundArray(c,s,l,r),this.buildDrawCalls(c,f,this._bufferSize),++h,++l);for(let m=0;m<s.length;m++)s[m]=null;Ne._globalBatch=l}buildDrawCalls(e,r,n){const{_bufferedElements:i,_attributeBuffer:s,_indexBuffer:o,vertexSize:l}=this,h=Ln._drawCallPool;let c=this._dcIndex,f=this._aIndex,m=this._iIndex,p=h[c];p.start=this._iIndex,p.texArray=e;for(let v=r;v<n;++v){const _=i[v],E=_._texture.baseTexture,A=OA[E.alphaMode?1:0][_.blendMode];i[v]=null,r<v&&p.blend!==A&&(p.size=m-p.start,r=v,p=h[++c],p.texArray=e,p.start=m),this.packInterleavedGeometry(_,s,o,f,m),f+=_.vertexData.length/2*l,m+=_.indices.length,p.blend=A}r<n&&(p.size=m-p.start,++c),this._dcIndex=c,this._aIndex=f,this._iIndex=m}bindAndClearTexArray(e){const r=this.renderer.texture;for(let n=0;n<e.count;n++)r.bind(e.elements[n],e.ids[n]),e.elements[n]=null;e.count=0}updateGeometry(){const{_packedGeometries:e,_attributeBuffer:r,_indexBuffer:n}=this;Ln.canUploadSameBuffer?(e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(n),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,e[this._flushId]=new this.geometryClass),e[this._flushId]._buffer.update(r.rawBinaryData),e[this._flushId]._indexBuffer.update(n),this.renderer.geometry.bind(e[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)}drawBatches(){const e=this._dcIndex,{gl:r,state:n}=this.renderer,i=Ln._drawCallPool;let s=null;for(let o=0;o<e;o++){const{texArray:l,type:h,size:c,start:f,blend:m}=i[o];s!==l&&(s=l,this.bindAndClearTexArray(l)),this.state.blendMode=m,n.set(this.state),r.drawElements(h,c,r.UNSIGNED_SHORT,f*2)}}flush(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)}start(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.maxTextures),this.renderer.shader.bind(this._shader),Ln.canUploadSameBuffer&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])}stop(){this.flush()}destroy(){for(let e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),super.destroy()}getAttributeBuffer(e){const r=mf(Math.ceil(e/8)),n=cE(r),i=r*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);let s=this._aBuffers[i];return s||(this._aBuffers[i]=s=new gv(i*this.vertexSize*4)),s}getIndexBuffer(e){const r=mf(Math.ceil(e/12)),n=cE(r),i=r*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);let s=this._iBuffers[n];return s||(this._iBuffers[n]=s=new Uint16Array(i)),s}packInterleavedGeometry(e,r,n,i,s){const{uint32View:o,float32View:l}=r,h=i/this.vertexSize,c=e.uvs,f=e.indices,m=e.vertexData,p=e._texture.baseTexture._batchLocation,v=Math.min(e.worldAlpha,1),_=rt.shared.setValue(e._tintRGB).toPremultiplied(v,e._texture.baseTexture.alphaMode>0);for(let E=0;E<m.length;E+=2)l[i++]=m[E],l[i++]=m[E+1],l[i++]=c[E],l[i++]=c[E+1],o[i++]=_,l[i++]=p;for(let E=0;E<f.length;E++)n[s++]=h+f[E]}};lu.defaultBatchSize=4096,lu.extension={name:"batch",type:ue.RendererPlugin},lu._drawCallPool=[],lu._textureArrayPool=[];let Io=lu;Se.add(Io);var mN=`varying vec2 vTextureCoord;
385
+
386
+ uniform sampler2D uSampler;
387
+
388
+ void main(void){
389
+ gl_FragColor = texture2D(uSampler, vTextureCoord);
390
+ }
391
+ `,gN=`attribute vec2 aVertexPosition;
392
+
393
+ uniform mat3 projectionMatrix;
394
+
395
+ varying vec2 vTextureCoord;
396
+
397
+ uniform vec4 inputSize;
398
+ uniform vec4 outputFrame;
399
+
400
+ vec4 filterVertexPosition( void )
401
+ {
402
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
403
+
404
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
405
+ }
406
+
407
+ vec2 filterTextureCoord( void )
408
+ {
409
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
410
+ }
411
+
412
+ void main(void)
413
+ {
414
+ gl_Position = filterVertexPosition();
415
+ vTextureCoord = filterTextureCoord();
416
+ }
417
+ `;const bv=class uu extends Ii{constructor(e,r,n){const i=Zi.from(e||uu.defaultVertexSrc,r||uu.defaultFragmentSrc);super(i,n),this.padding=0,this.resolution=uu.defaultResolution,this.multisample=uu.defaultMultisample,this.enabled=!0,this.autoFit=!0,this.state=new Ni}apply(e,r,n,i,s){e.applyFilter(this,r,n,i)}get blendMode(){return this.state.blendMode}set blendMode(e){this.state.blendMode=e}get resolution(){return this._resolution}set resolution(e){this._resolution=e}static get defaultVertexSrc(){return gN}static get defaultFragmentSrc(){return mN}};bv.defaultResolution=1,bv.defaultMultisample=Rt.NONE;let Ar=bv;class vf{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new rt(0),this.alpha=1}init(e){this.clearBeforeRender=e.clearBeforeRender;const{backgroundColor:r,background:n,backgroundAlpha:i}=e,s=n??r;s!==void 0&&(this.color=s),this.alpha=i}get color(){return this._backgroundColor.value}set color(e){this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get backgroundColor(){return this._backgroundColor}destroy(){}}vf.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0},vf.extension={type:[ue.RendererSystem,ue.CanvasRendererSystem],name:"background"};Se.add(vf);class WA{constructor(e){this.renderer=e,this.emptyRenderer=new up(e),this.currentRenderer=this.emptyRenderer}setObjectRenderer(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())}flush(){this.setObjectRenderer(this.emptyRenderer)}reset(){this.setObjectRenderer(this.emptyRenderer)}copyBoundTextures(e,r){const{boundTextures:n}=this.renderer.texture;for(let i=r-1;i>=0;--i)e[i]=n[i]||null,e[i]&&(e[i]._batchLocation=i)}boundArray(e,r,n,i){const{elements:s,ids:o,count:l}=e;let h=0;for(let c=0;c<l;c++){const f=s[c],m=f._batchLocation;if(m>=0&&m<i&&r[m]===f){o[c]=m;continue}for(;h<i;){const p=r[h];if(p&&p._batchEnabled===n&&p._batchLocation===h){h++;continue}o[c]=h,f._batchLocation=h,r[h]=f;break}}}destroy(){this.renderer=null}}WA.extension={type:ue.RendererSystem,name:"batch"};Se.add(WA);let EE=0;class _f{constructor(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},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,this.renderer.CONTEXT_UID=EE++}init(e){if(e.context)this.initFromContext(e.context);else{const r=this.renderer.background.alpha<1,n=e.premultipliedAlpha;this.preserveDrawingBuffer=e.preserveDrawingBuffer,this.useContextAlpha=e.useContextAlpha,this.powerPreference=e.powerPreference,this.initFromOptions({alpha:r,premultipliedAlpha:n,antialias:e.antialias,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference})}}initFromContext(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=EE++,this.renderer.runners.contextChange.emit(e);const r=this.renderer.view;r.addEventListener!==void 0&&(r.addEventListener("webglcontextlost",this.handleContextLost,!1),r.addEventListener("webglcontextrestored",this.handleContextRestored,!1))}initFromOptions(e){const r=this.createContext(this.renderer.view,e);this.initFromContext(r)}createContext(e,r){let n;if(pe.PREFER_ENV>=Ko.WEBGL2&&(n=e.getContext("webgl2",r)),n)this.webGLVersion=2;else if(this.webGLVersion=1,n=e.getContext("webgl",r)||e.getContext("experimental-webgl",r),!n)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),this.gl}getExtensions(){const{gl:e}=this,r={loseContext:e.getExtension("WEBGL_lose_context"),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")};this.webGLVersion===1?Object.assign(this.extensions,r,{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")}):this.webGLVersion===2&&Object.assign(this.extensions,r,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})}handleContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const e=this.renderer.view;this.renderer=null,e.removeEventListener!==void 0&&(e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(e){const r=e.getContextAttributes(),n="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;n&&(this.webGLVersion=2),r&&!r.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const i=n||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}_f.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},_f.extension={type:ue.RendererSystem,name:"context"};Se.add(_f);class Tv{constructor(e,r){if(this.width=Math.round(e),this.height=Math.round(r),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Qn("disposeFramebuffer"),this.multisample=Rt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(e=0,r){return this.colorTextures[e]=r||new Ne(null,{scaleMode:Sn.NEAREST,resolution:1,mipmap:Ri.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(e){return this.depthTexture=e||new Ne(null,{scaleMode:Sn.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:Ri.OFF,format:te.DEPTH_COMPONENT,type:Ae.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(e,r){if(e=Math.round(e),r=Math.round(r),!e||!r)throw new Error("Framebuffer width and height must not be zero");if(!(e===this.width&&r===this.height)){this.width=e,this.height=r,this.dirtyId++,this.dirtySize++;for(let n=0;n<this.colorTextures.length;n++){const i=this.colorTextures[n],s=i.resolution;i.setSize(e/s,r/s)}if(this.depthTexture){const n=this.depthTexture.resolution;this.depthTexture.setSize(e/n,r/n)}}}dispose(){this.disposeRunner.emit(this,!1)}destroyDepthTexture(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)}}class VA extends Ne{constructor(e={}){if(typeof e=="number"){const r=arguments[0],n=arguments[1],i=arguments[2],s=arguments[3];e={width:r,height:n,scaleMode:i,resolution:s}}e.width=e.width??100,e.height=e.height??100,e.multisample??(e.multisample=Rt.NONE),super(null,e),this.mipmap=Ri.OFF,this.valid=!0,this._clear=new rt([0,0,0,0]),this.framebuffer=new Tv(this.realWidth,this.realHeight).addColorTexture(0,this),this.framebuffer.multisample=e.multisample,this.maskStack=[],this.filterStack=[{}]}set clearColor(e){this._clear.setValue(e)}get clearColor(){return this._clear.value}get clear(){return this._clear}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r){this.framebuffer.resize(e*this.resolution,r*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)}dispose(){this.framebuffer.dispose(),super.dispose()}destroy(){super.destroy(),this.framebuffer.destroyDepthTexture(),this.framebuffer=null}}class as extends Ju{constructor(e){const r=e,n=r.naturalWidth||r.videoWidth||r.displayWidth||r.width,i=r.naturalHeight||r.videoHeight||r.displayHeight||r.height;super(n,i),this.source=e,this.noSubImage=!1}static crossOrigin(e,r,n){n===void 0&&!r.startsWith("data:")?e.crossOrigin=U4(r):n!==!1&&(e.crossOrigin=typeof n=="string"?n:"anonymous")}upload(e,r,n,i){const s=e.gl,o=r.realWidth,l=r.realHeight;if(i=i||this.source,typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement){if(!i.complete||i.naturalWidth===0)return!1}else if(typeof HTMLVideoElement<"u"&&i instanceof HTMLVideoElement&&i.readyState<=1)return!1;return s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.alphaMode===Gr.UNPACK),!this.noSubImage&&r.target===s.TEXTURE_2D&&n.width===o&&n.height===l?s.texSubImage2D(s.TEXTURE_2D,0,0,0,r.format,n.type,i):(n.width=o,n.height=l,s.texImage2D(r.target,0,n.internalFormat,r.format,n.type,i)),!0}update(){if(this.destroyed)return;const e=this.source,r=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(r,n),super.update()}dispose(){this.source=null}}class XA extends as{constructor(e,r){if(r=r||{},typeof e=="string"){const n=new Image;as.crossOrigin(n,e,r.crossorigin),n.src=e,e=n}super(e),!e.complete&&this._width&&this._height&&(this._width=0,this._height=0),this.url=e.src,this._process=null,this.preserveBitmap=!1,this.createBitmap=(r.createBitmap??pe.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.bitmap=null,this._load=null,r.autoLoad!==!1&&this.load()}load(e){return this._load?this._load:(e!==void 0&&(this.createBitmap=e),this._load=new Promise((r,n)=>{const i=this.source;this.url=i.src;const s=()=>{this.destroyed||(i.onload=null,i.onerror=null,this.update(),this._load=null,this.createBitmap?r(this.process()):r(this))};i.complete&&i.src?s():(i.onload=s,i.onerror=o=>{n(o),this.onError.emit(o)})}),this._load)}process(){const e=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const r=globalThis.createImageBitmap,n=!e.crossOrigin||e.crossOrigin==="anonymous";return this._process=fetch(e.src,{mode:n?"cors":"no-cors"}).then(i=>i.blob()).then(i=>r(i,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Gr.UNPACK?"premultiply":"none"})).then(i=>this.destroyed?Promise.reject():(this.bitmap=i,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(e,r,n){if(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(e,r,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(e,r,n,this.bitmap),!this.preserveBitmap){let i=!0;const s=r._glTextures;for(const o in s){const l=s[o];if(l!==n&&l.dirtyId!==r.dirtyId){i=!1;break}}i&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(e){return typeof HTMLImageElement<"u"&&(typeof e=="string"||e instanceof HTMLImageElement)}}class a_{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(e,r,n){const i=r.width,s=r.height;if(n){const o=e.width/2/i,l=e.height/2/s,h=e.x/i+o,c=e.y/s+l;n=mt.add(n,mt.NW),this.x0=h+o*mt.uX(n),this.y0=c+l*mt.uY(n),n=mt.add(n,2),this.x1=h+o*mt.uX(n),this.y1=c+l*mt.uY(n),n=mt.add(n,2),this.x2=h+o*mt.uX(n),this.y2=c+l*mt.uY(n),n=mt.add(n,2),this.x3=h+o*mt.uX(n),this.y3=c+l*mt.uY(n)}else this.x0=e.x/i,this.y0=e.y/s,this.x1=(e.x+e.width)/i,this.y1=e.y/s,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/s,this.x3=e.x/i,this.y3=(e.y+e.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}a_.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const SE=new a_;function Vc(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}class oe extends hh{constructor(e,r,n,i,s,o,l){if(super(),this.noFrame=!1,r||(this.noFrame=!0,r=new De(0,0,1,1)),e instanceof oe&&(e=e.baseTexture),this.baseTexture=e,this._frame=r,this.trim=i,this.valid=!1,this.destroyed=!1,this._uvs=SE,this.uvMatrix=null,this.orig=n||r,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Ge(o.x,o.y):new Ge(0,0),this.defaultBorders=l,this._updateID=0,this.textureCacheIds=[],e.valid?this.noFrame?e.valid&&this.onBaseTextureUpdated(e):this.frame=r:e.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&e.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(e){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=e.width,this._frame.height=e.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(e){if(this.baseTexture){if(e){const{resource:r}=this.baseTexture;r!=null&&r.url&&fi[r.url]&&oe.removeFromCache(r.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,oe.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var i;const e=this._frame.clone(),r=this._frame===this.orig?e:this.orig.clone(),n=new oe(this.baseTexture,!this.noFrame&&e,r,(i=this.trim)==null?void 0:i.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(n._frame=e),n}updateUvs(){this._uvs===SE&&(this._uvs=new a_),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(e,r={},n=pe.STRICT_TEXTURE_CACHE){const i=typeof e=="string";let s=null;if(i)s=e;else if(e instanceof Ne){if(!e.cacheId){const l=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e.cacheId=`${l}-${Xo()}`,Ne.addToCache(e,e.cacheId)}s=e.cacheId}else{if(!e._pixiId){const l=(r==null?void 0:r.pixiIdPrefix)||"pixiid";e._pixiId=`${l}_${Xo()}`}s=e._pixiId}let o=fi[s];if(i&&n&&!o)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!o&&!(e instanceof Ne)?(r.resolution||(r.resolution=os(e)),o=new oe(new Ne(e,r)),o.baseTexture.cacheId=s,Ne.addToCache(o.baseTexture,s),oe.addToCache(o,s)):!o&&e instanceof Ne&&(o=new oe(e),oe.addToCache(o,s)),o}static fromURL(e,r){const n=Object.assign({autoLoad:!1},r==null?void 0:r.resourceOptions),i=oe.from(e,Object.assign({resourceOptions:n},r),!1),s=i.baseTexture.resource;return i.baseTexture.valid?Promise.resolve(i):s.load().then(()=>Promise.resolve(i))}static fromBuffer(e,r,n,i){return new oe(Ne.fromBuffer(e,r,n,i))}static fromLoader(e,r,n,i){const s=new Ne(e,Object.assign({scaleMode:Ne.defaultOptions.scaleMode,resolution:os(r)},i)),{resource:o}=s;o instanceof XA&&(o.url=r);const l=new oe(s);return n||(n=r),Ne.addToCache(l.baseTexture,n),oe.addToCache(l,n),n!==r&&(Ne.addToCache(l.baseTexture,r),oe.addToCache(l,r)),l.baseTexture.valid?Promise.resolve(l):new Promise(h=>{l.baseTexture.once("loaded",()=>h(l))})}static addToCache(e,r){r&&(e.textureCacheIds.includes(r)||e.textureCacheIds.push(r),fi[r]&&fi[r]!==e&&console.warn(`Texture added to the cache with an id [${r}] that already had an entry`),fi[r]=e)}static removeFromCache(e){if(typeof e=="string"){const r=fi[e];if(r){const n=r.textureCacheIds.indexOf(e);return n>-1&&r.textureCacheIds.splice(n,1),delete fi[e],r}}else if(e!=null&&e.textureCacheIds){for(let r=0;r<e.textureCacheIds.length;++r)fi[e.textureCacheIds[r]]===e&&delete fi[e.textureCacheIds[r]];return e.textureCacheIds.length=0,e}return null}get resolution(){return this.baseTexture.resolution}get frame(){return this._frame}set frame(e){this._frame=e,this.noFrame=!1;const{x:r,y:n,width:i,height:s}=e,o=r+i>this.baseTexture.width,l=n+s>this.baseTexture.height;if(o||l){const h=o&&l?"and":"or",c=`X: ${r} + ${i} = ${r+i} > ${this.baseTexture.width}`,f=`Y: ${n} + ${s} = ${n+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${c} ${h} ${f}`)}this.valid=i&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=e),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(e){this._rotate=e,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return oe._EMPTY||(oe._EMPTY=new oe(new Ne),Vc(oe._EMPTY),Vc(oe._EMPTY.baseTexture)),oe._EMPTY}static get WHITE(){if(!oe._WHITE){const e=pe.ADAPTER.createCanvas(16,16),r=e.getContext("2d");e.width=16,e.height=16,r.fillStyle="white",r.fillRect(0,0,16,16),oe._WHITE=new oe(Ne.from(e)),Vc(oe._WHITE),Vc(oe._WHITE.baseTexture)}return oe._WHITE}}class Zo extends oe{constructor(e,r){super(e,r),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(e){this.framebuffer.multisample=e}resize(e,r,n=!0){const i=this.baseTexture.resolution,s=Math.round(e*i)/i,o=Math.round(r*i)/i;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(s,o),this.updateUvs()}setResolution(e){const{baseTexture:r}=this;r.resolution!==e&&(r.setResolution(e),this.resize(r.width,r.height,!1))}static create(e){return new Zo(new VA(e))}}class YA{constructor(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(e,r,n=Rt.NONE){const i=new VA(Object.assign({width:e,height:r,resolution:1,multisample:n},this.textureOptions));return new Zo(i)}getOptimalTexture(e,r,n=1,i=Rt.NONE){let s;e=Math.max(Math.ceil(e*n-1e-6),1),r=Math.max(Math.ceil(r*n-1e-6),1),!this.enableFullScreen||e!==this._pixelsWidth||r!==this._pixelsHeight?(e=mf(e),r=mf(r),s=((e&65535)<<16|r&65535)>>>0,i>1&&(s+=i*4294967296)):s=i>1?-i:-1,this.texturePool[s]||(this.texturePool[s]=[]);let o=this.texturePool[s].pop();return o||(o=this.createTexture(e,r,i)),o.filterPoolKey=s,o.setResolution(n),o}getFilterTexture(e,r,n){const i=this.getOptimalTexture(e.width,e.height,r||e.resolution,n||Rt.NONE);return i.filterFrame=e.filterFrame,i}returnTexture(e){const r=e.filterPoolKey;e.filterFrame=null,this.texturePool[r].push(e)}returnFilterTexture(e){this.returnTexture(e)}clear(e){if(e=e!==!1,e)for(const r in this.texturePool){const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0)}this.texturePool={}}setScreenSize(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(const r in this.texturePool){if(!(Number(r)<0))continue;const n=this.texturePool[r];if(n)for(let i=0;i<n.length;i++)n[i].destroy(!0);this.texturePool[r]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}}}YA.SCREEN_KEY=-1;class yN extends Js{constructor(){super(),this.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2])}}class QA extends Js{constructor(){super(),this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.vertexBuffer=new Ct(this.vertices),this.uvBuffer=new Ct(this.uvs),this.addAttribute("aVertexPosition",this.vertexBuffer).addAttribute("aTextureCoord",this.uvBuffer).addIndex([0,1,2,0,2,3])}map(e,r){let n=0,i=0;return this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+r.width/e.width,this.uvs[3]=i,this.uvs[4]=n+r.width/e.width,this.uvs[5]=i+r.height/e.height,this.uvs[6]=n,this.uvs[7]=i+r.height/e.height,n=r.x,i=r.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+r.width,this.vertices[3]=i,this.vertices[4]=n+r.width,this.vertices[5]=i+r.height,this.vertices[6]=n,this.vertices[7]=i+r.height,this.invalidate(),this}invalidate(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this}}class vN{constructor(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=Rt.NONE,this.sourceFrame=new De,this.destinationFrame=new De,this.bindingSourceFrame=new De,this.bindingDestinationFrame=new De,this.filters=[],this.transform=null}clear(){this.target=null,this.filters=null,this.renderTexture=null}}const Xc=[new Ge,new Ge,new Ge,new Ge],Bg=new ot;class KA{constructor(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new YA,this.statePool=[],this.quad=new yN,this.quadUv=new QA,this.tempRect=new De,this.activeState={},this.globalUniforms=new Kn({outputFrame:new De,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}init(){this.texturePool.setScreenSize(this.renderer.view)}push(e,r){const n=this.renderer,i=this.defaultFilterStack,s=this.statePool.pop()||new vN,o=n.renderTexture;let l,h;if(o.current){const A=o.current;l=A.resolution,h=A.multisample}else l=n.resolution,h=n.multisample;let c=r[0].resolution||l,f=r[0].multisample??h,m=r[0].padding,p=r[0].autoFit,v=r[0].legacy??!0;for(let A=1;A<r.length;A++){const S=r[A];c=Math.min(c,S.resolution||l),f=Math.min(f,S.multisample??h),m=this.useMaxPadding?Math.max(m,S.padding):m+S.padding,p=p&&S.autoFit,v=v||(S.legacy??!0)}i.length===1&&(this.defaultFilterStack[0].renderTexture=o.current),i.push(s),s.resolution=c,s.multisample=f,s.legacy=v,s.target=e,s.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),s.sourceFrame.pad(m);const _=this.tempRect.copyFrom(o.sourceFrame);n.projection.transform&&this.transformAABB(Bg.copyFrom(n.projection.transform).invert(),_),p?(s.sourceFrame.fit(_),(s.sourceFrame.width<=0||s.sourceFrame.height<=0)&&(s.sourceFrame.width=0,s.sourceFrame.height=0)):s.sourceFrame.intersects(_)||(s.sourceFrame.width=0,s.sourceFrame.height=0),this.roundFrame(s.sourceFrame,o.current?o.current.resolution:n.resolution,o.sourceFrame,o.destinationFrame,n.projection.transform),s.renderTexture=this.getOptimalFilterTexture(s.sourceFrame.width,s.sourceFrame.height,c,f),s.filters=r,s.destinationFrame.width=s.renderTexture.width,s.destinationFrame.height=s.renderTexture.height;const E=this.tempRect;E.x=0,E.y=0,E.width=s.sourceFrame.width,E.height=s.sourceFrame.height,s.renderTexture.filterFrame=s.sourceFrame,s.bindingSourceFrame.copyFrom(o.sourceFrame),s.bindingDestinationFrame.copyFrom(o.destinationFrame),s.transform=n.projection.transform,n.projection.transform=null,o.bind(s.renderTexture,s.sourceFrame,E),n.framebuffer.clear(0,0,0,0)}pop(){const e=this.defaultFilterStack,r=e.pop(),n=r.filters;this.activeState=r;const i=this.globalUniforms.uniforms;i.outputFrame=r.sourceFrame,i.resolution=r.resolution;const s=i.inputSize,o=i.inputPixel,l=i.inputClamp;if(s[0]=r.destinationFrame.width,s[1]=r.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],o[0]=Math.round(s[0]*r.resolution),o[1]=Math.round(s[1]*r.resolution),o[2]=1/o[0],o[3]=1/o[1],l[0]=.5*o[2],l[1]=.5*o[3],l[2]=r.sourceFrame.width*s[2]-.5*o[2],l[3]=r.sourceFrame.height*s[3]-.5*o[3],r.legacy){const c=i.filterArea;c[0]=r.destinationFrame.width,c[1]=r.destinationFrame.height,c[2]=r.sourceFrame.x,c[3]=r.sourceFrame.y,i.filterClamp=i.inputClamp}this.globalUniforms.update();const h=e[e.length-1];if(this.renderer.framebuffer.blit(),n.length===1)n[0].apply(this,r.renderTexture,h.renderTexture,_i.BLEND,r),this.returnFilterTexture(r.renderTexture);else{let c=r.renderTexture,f=this.getOptimalFilterTexture(c.width,c.height,r.resolution);f.filterFrame=c.filterFrame;let m=0;for(m=0;m<n.length-1;++m){m===1&&r.multisample>1&&(f=this.getOptimalFilterTexture(c.width,c.height,r.resolution),f.filterFrame=c.filterFrame),n[m].apply(this,c,f,_i.CLEAR,r);const p=c;c=f,f=p}n[m].apply(this,c,h.renderTexture,_i.BLEND,r),m>1&&r.multisample>1&&this.returnFilterTexture(r.renderTexture),this.returnFilterTexture(c),this.returnFilterTexture(f)}r.clear(),this.statePool.push(r)}bindAndClear(e,r=_i.CLEAR){const{renderTexture:n,state:i}=this.renderer;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e==null?void 0:e.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,n.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=i.stateId&1||this.forceClear;(r===_i.CLEAR||r===_i.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(e,r,n,i){const s=this.renderer;s.state.set(e.state),this.bindAndClear(n,i),e.uniforms.uSampler=r,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(r._frame,r.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(Wn.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(Wn.TRIANGLE_STRIP))}calculateSpriteMatrix(e,r){const{sourceFrame:n,destinationFrame:i}=this.activeState,{orig:s}=r._texture,o=e.set(i.width,0,0,i.height,n.x,n.y),l=r.worldTransform.copyTo(ot.TEMP_MATRIX);return l.invert(),o.prepend(l),o.scale(1/s.width,1/s.height),o.translate(r.anchor.x,r.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(e,r,n=1,i=Rt.NONE){return this.texturePool.getOptimalTexture(e,r,n,i)}getFilterTexture(e,r,n){if(typeof e=="number"){const s=e;e=r,r=s}e=e||this.activeState.renderTexture;const i=this.texturePool.getOptimalTexture(e.width,e.height,r||e.resolution,n||Rt.NONE);return i.filterFrame=e.filterFrame,i}returnFilterTexture(e){this.texturePool.returnTexture(e)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(e,r){const n=Xc[0],i=Xc[1],s=Xc[2],o=Xc[3];n.set(r.left,r.top),i.set(r.left,r.bottom),s.set(r.right,r.top),o.set(r.right,r.bottom),e.apply(n,n),e.apply(i,i),e.apply(s,s),e.apply(o,o);const l=Math.min(n.x,i.x,s.x,o.x),h=Math.min(n.y,i.y,s.y,o.y),c=Math.max(n.x,i.x,s.x,o.x),f=Math.max(n.y,i.y,s.y,o.y);r.x=l,r.y=h,r.width=c-l,r.height=f-h}roundFrame(e,r,n,i,s){if(!(e.width<=0||e.height<=0||n.width<=0||n.height<=0)){if(s){const{a:o,b:l,c:h,d:c}=s;if((Math.abs(l)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(c)>1e-4))return}s=s?Bg.copyFrom(s):Bg.identity(),s.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.transformAABB(s,e),e.ceil(r),this.transformAABB(s.invert(),e)}}}KA.extension={type:ue.RendererSystem,name:"filter"};Se.add(KA);class _N{constructor(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=Rt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const xN=new De;class qA{constructor(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Tv(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new De,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let r=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;pe.PREFER_ENV===Ko.WEBGL_LEGACY&&(r=null,n=null),r?e.drawBuffers=i=>r.drawBuffersWEBGL(i):(this.hasMRT=!1,e.drawBuffers=()=>{}),n||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}bind(e,r,n=0){const{gl:i}=this;if(e){const s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,i.bindFramebuffer(i.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==n&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=n),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,n)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(let o=0;o<e.colorTextures.length;o++){const l=e.colorTextures[o];this.renderer.texture.unbind(l.parentTextureArray||l)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),r){const o=r.width>>n,l=r.height>>n,h=o/r.width;this.setViewport(r.x*h,r.y*h,o,l)}else{const o=e.width>>n,l=e.height>>n;this.setViewport(0,0,o,l)}}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),r?this.setViewport(r.x,r.y,r.width,r.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(e,r,n,i){const s=this.viewport;e=Math.round(e),r=Math.round(r),n=Math.round(n),i=Math.round(i),(s.width!==n||s.height!==i||s.x!==e||s.y!==r)&&(s.x=e,s.y=r,s.width=n,s.height=i,this.gl.viewport(e,r,n,i))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(e,r,n,i,s=Jy.COLOR|Jy.DEPTH){const{gl:o}=this;o.clearColor(e,r,n,i),o.clear(s)}initFramebuffer(e){const{gl:r}=this,n=new _N(r.createFramebuffer());return n.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=n,this.managedFramebuffers.push(e),e.disposeRunner.add(this),n}resizeFramebuffer(e){const{gl:r}=this,n=e.glFramebuffers[this.CONTEXT_UID];if(n.stencil){r.bindRenderbuffer(r.RENDERBUFFER,n.stencil);let o;this.renderer.context.webGLVersion===1?o=r.DEPTH_STENCIL:e.depth&&e.stencil?o=r.DEPTH24_STENCIL8:e.depth?o=r.DEPTH_COMPONENT24:o=r.STENCIL_INDEX8,n.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,o,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,o,e.width,e.height)}const i=e.colorTextures;let s=i.length;r.drawBuffers||(s=Math.min(s,1));for(let o=0;o<s;o++){const l=i[o],h=l.parentTextureArray||l;this.renderer.texture.bind(h,0),o===0&&n.msaaBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,n.msaaBuffer),r.renderbufferStorageMultisample(r.RENDERBUFFER,n.multisample,h._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height))}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)}updateFramebuffer(e,r){const{gl:n}=this,i=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures;let o=s.length;n.drawBuffers||(o=Math.min(o,1)),i.multisample>1&&this.canMultisampleFramebuffer(e)?i.msaaBuffer=i.msaaBuffer||n.createRenderbuffer():i.msaaBuffer&&(n.deleteRenderbuffer(i.msaaBuffer),i.msaaBuffer=null,i.blitFramebuffer&&(i.blitFramebuffer.dispose(),i.blitFramebuffer=null));const l=[];for(let h=0;h<o;h++){const c=s[h],f=c.parentTextureArray||c;this.renderer.texture.bind(f,0),h===0&&i.msaaBuffer?(n.bindRenderbuffer(n.RENDERBUFFER,i.msaaBuffer),n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,f._glTextures[this.CONTEXT_UID].internalFormat,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,i.msaaBuffer)):(n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+h,c.target,f._glTextures[this.CONTEXT_UID].texture,r),l.push(n.COLOR_ATTACHMENT0+h))}if(l.length>1&&n.drawBuffers(l),e.depthTexture&&this.writeDepthTexture){const h=e.depthTexture;this.renderer.texture.bind(h,0),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,r)}if((e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)){i.stencil=i.stencil||n.createRenderbuffer();let h,c;this.renderer.context.webGLVersion===1?(h=n.DEPTH_STENCIL_ATTACHMENT,c=n.DEPTH_STENCIL):e.depth&&e.stencil?(h=n.DEPTH_STENCIL_ATTACHMENT,c=n.DEPTH24_STENCIL8):e.depth?(h=n.DEPTH_ATTACHMENT,c=n.DEPTH_COMPONENT24):(h=n.STENCIL_ATTACHMENT,c=n.STENCIL_INDEX8),n.bindRenderbuffer(n.RENDERBUFFER,i.stencil),i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,c,e.width,e.height):n.renderbufferStorage(n.RENDERBUFFER,c,e.width,e.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,h,n.RENDERBUFFER,i.stencil)}else i.stencil&&(n.deleteRenderbuffer(i.stencil),i.stencil=null)}canMultisampleFramebuffer(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture}detectSamples(e){const{msaaSamples:r}=this;let n=Rt.NONE;if(e<=1||r===null)return n;for(let i=0;i<r.length;i++)if(r[i]<=e){n=r[i];break}return n===1&&(n=Rt.NONE),n}blit(e,r,n){const{current:i,renderer:s,gl:o,CONTEXT_UID:l}=this;if(s.context.webGLVersion!==2||!i)return;const h=i.glFramebuffers[l];if(!h)return;if(!e){if(!h.msaaBuffer)return;const f=i.colorTextures[0];if(!f)return;h.blitFramebuffer||(h.blitFramebuffer=new Tv(i.width,i.height),h.blitFramebuffer.addColorTexture(0,f)),e=h.blitFramebuffer,e.colorTextures[0]!==f&&(e.colorTextures[0]=f,e.dirtyId++,e.dirtyFormat++),(e.width!==i.width||e.height!==i.height)&&(e.width=i.width,e.height=i.height,e.dirtyId++,e.dirtySize++)}r||(r=xN,r.width=i.width,r.height=i.height),n||(n=r);const c=r.width===n.width&&r.height===n.height;this.bind(e),o.bindFramebuffer(o.READ_FRAMEBUFFER,h.framebuffer),o.blitFramebuffer(r.left,r.top,r.right,r.bottom,n.left,n.top,n.right,n.bottom,o.COLOR_BUFFER_BIT,c?o.NEAREST:o.LINEAR),o.bindFramebuffer(o.READ_FRAMEBUFFER,e.glFramebuffers[this.CONTEXT_UID].framebuffer)}disposeFramebuffer(e,r){const n=e.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(!n)return;delete e.glFramebuffers[this.CONTEXT_UID];const s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),r||(i.deleteFramebuffer(n.framebuffer),n.msaaBuffer&&i.deleteRenderbuffer(n.msaaBuffer),n.stencil&&i.deleteRenderbuffer(n.stencil)),n.blitFramebuffer&&this.disposeFramebuffer(n.blitFramebuffer,r)}disposeAll(e){const r=this.managedFramebuffers;this.managedFramebuffers=[];for(let n=0;n<r.length;n++)this.disposeFramebuffer(r[n],e)}forceStencil(){const e=this.current;if(!e)return;const r=e.glFramebuffers[this.CONTEXT_UID];if(!r||r.stencil&&e.stencil)return;e.stencil=!0;const n=e.width,i=e.height,s=this.gl,o=r.stencil=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,o);let l,h;this.renderer.context.webGLVersion===1?(l=s.DEPTH_STENCIL_ATTACHMENT,h=s.DEPTH_STENCIL):e.depth?(l=s.DEPTH_STENCIL_ATTACHMENT,h=s.DEPTH24_STENCIL8):(l=s.STENCIL_ATTACHMENT,h=s.STENCIL_INDEX8),r.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,r.multisample,h,n,i):s.renderbufferStorage(s.RENDERBUFFER,h,n,i),s.framebufferRenderbuffer(s.FRAMEBUFFER,l,s.RENDERBUFFER,o)}reset(){this.current=this.unknownFramebuffer,this.viewport=new De}destroy(){this.renderer=null}}qA.extension={type:ue.RendererSystem,name:"framebuffer"};Se.add(qA);const Lg={5126:4,5123:2,5121:1};class ZA{constructor(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}contextChange(){this.disposeAll(!0);const e=this.gl=this.renderer.gl,r=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,r.webGLVersion!==2){let n=this.renderer.context.extensions.vertexArrayObject;pe.PREFER_ENV===Ko.WEBGL_LEGACY&&(n=null),n?(e.createVertexArray=()=>n.createVertexArrayOES(),e.bindVertexArray=i=>n.bindVertexArrayOES(i),e.deleteVertexArray=i=>n.deleteVertexArrayOES(i)):(this.hasVao=!1,e.createVertexArray=()=>null,e.bindVertexArray=()=>null,e.deleteVertexArray=()=>null)}if(r.webGLVersion!==2){const n=e.getExtension("ANGLE_instanced_arrays");n?(e.vertexAttribDivisor=(i,s)=>n.vertexAttribDivisorANGLE(i,s),e.drawElementsInstanced=(i,s,o,l,h)=>n.drawElementsInstancedANGLE(i,s,o,l,h),e.drawArraysInstanced=(i,s,o,l)=>n.drawArraysInstancedANGLE(i,s,o,l)):this.hasInstance=!1}this.canUseUInt32ElementIndex=r.webGLVersion===2||!!r.extensions.uint32ElementIndex}bind(e,r){r=r||this.renderer.shader.shader;const{gl:n}=this;let i=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;i||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=i={},s=!0);const o=i[r.program.id]||this.initGeometryVao(e,r,s);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?n.bindVertexArray(o):this.activateVao(e,r.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this.renderer.buffer;for(let n=0;n<e.buffers.length;n++){const i=e.buffers[n];r.update(i)}}checkCompatibility(e,r){const n=e.attributes,i=r.attributeData;for(const s in i)if(!n[s])throw new Error(`shader and geometry incompatible, geometry missing the "${s}" attribute`)}getSignature(e,r){const n=e.attributes,i=r.attributeData,s=["g",e.id];for(const o in n)i[o]&&s.push(o,i[o].location);return s.join("-")}initGeometryVao(e,r,n=!0){const i=this.gl,s=this.CONTEXT_UID,o=this.renderer.buffer,l=r.program;l.glPrograms[s]||this.renderer.shader.generateProgram(r),this.checkCompatibility(e,l);const h=this.getSignature(e,l),c=e.glVertexArrayObjects[this.CONTEXT_UID];let f=c[h];if(f)return c[l.id]=f,f;const m=e.buffers,p=e.attributes,v={},_={};for(const E in m)v[E]=0,_[E]=0;for(const E in p)!p[E].size&&l.attributeData[E]?p[E].size=l.attributeData[E].size:p[E].size||console.warn(`PIXI Geometry attribute '${E}' size cannot be determined (likely the bound shader does not have the attribute)`),v[p[E].buffer]+=p[E].size*Lg[p[E].type];for(const E in p){const A=p[E],S=A.size;A.stride===void 0&&(v[A.buffer]===S*Lg[A.type]?A.stride=0:A.stride=v[A.buffer]),A.start===void 0&&(A.start=_[A.buffer],_[A.buffer]+=S*Lg[A.type])}f=i.createVertexArray(),i.bindVertexArray(f);for(let E=0;E<m.length;E++){const A=m[E];o.bind(A),n&&A._glBuffers[s].refCount++}return this.activateVao(e,l),c[l.id]=f,c[h]=f,i.bindVertexArray(null),o.unbind(Pi.ARRAY_BUFFER),f}disposeGeometry(e,r){var l;if(!this.managedGeometries[e.id])return;delete this.managedGeometries[e.id];const n=e.glVertexArrayObjects[this.CONTEXT_UID],i=this.gl,s=e.buffers,o=(l=this.renderer)==null?void 0:l.buffer;if(e.disposeRunner.remove(this),!!n){if(o)for(let h=0;h<s.length;h++){const c=s[h]._glBuffers[this.CONTEXT_UID];c&&(c.refCount--,c.refCount===0&&!r&&o.dispose(s[h],r))}if(!r){for(const h in n)if(h[0]==="g"){const c=n[h];this._activeVao===c&&this.unbind(),i.deleteVertexArray(c)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}disposeAll(e){const r=Object.keys(this.managedGeometries);for(let n=0;n<r.length;n++)this.disposeGeometry(this.managedGeometries[r[n]],e)}activateVao(e,r){const n=this.gl,i=this.CONTEXT_UID,s=this.renderer.buffer,o=e.buffers,l=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let h=null;for(const c in l){const f=l[c],m=o[f.buffer],p=m._glBuffers[i];if(r.attributeData[c]){h!==p&&(s.bind(m),h=p);const v=r.attributeData[c].location;if(n.enableVertexAttribArray(v),n.vertexAttribPointer(v,f.size,f.type||n.FLOAT,f.normalized,f.stride,f.start),f.instance)if(this.hasInstance)n.vertexAttribDivisor(v,f.divisor);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,r,n,i){const{gl:s}=this,o=this._activeGeometry;if(o.indexBuffer){const l=o.indexBuffer.data.BYTES_PER_ELEMENT,h=l===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;l===2||l===4&&this.canUseUInt32ElementIndex?o.instanced?s.drawElementsInstanced(e,r||o.indexBuffer.data.length,h,(n||0)*l,i||1):s.drawElements(e,r||o.indexBuffer.data.length,h,(n||0)*l):console.warn("unsupported index buffer type: uint32")}else o.instanced?s.drawArraysInstanced(e,n,r||o.getSize(),i||1):s.drawArrays(e,n,r||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this.renderer=null}}ZA.extension={type:ue.RendererSystem,name:"geometry"};Se.add(ZA);const bE=new ot;class l_{constructor(e,r){this._texture=e,this.mapCoord=new ot,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof r>"u"?.5:r,this.isSimple=!1}get texture(){return this._texture}set texture(e){this._texture=e,this._textureID=-1}multiplyUvs(e,r){r===void 0&&(r=e);const n=this.mapCoord;for(let i=0;i<e.length;i+=2){const s=e[i],o=e[i+1];r[i]=s*n.a+o*n.c+n.tx,r[i+1]=s*n.b+o*n.d+n.ty}return r}update(e){const r=this._texture;if(!r||!r.valid||!e&&this._textureID===r._updateID)return!1;this._textureID=r._updateID,this._updateID++;const n=r._uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=r.orig,s=r.trim;s&&(bE.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(bE));const o=r.baseTexture,l=this.uClampFrame,h=this.clampMargin/o.resolution,c=this.clampOffset;return l[0]=(r._frame.x+h+c)/o.width,l[1]=(r._frame.y+h+c)/o.height,l[2]=(r._frame.x+r._frame.width-h+c)/o.width,l[3]=(r._frame.y+r._frame.height-h+c)/o.height,this.uClampOffset[0]=c/o.realWidth,this.uClampOffset[1]=c/o.realHeight,this.isSimple=r._frame.width===o.width&&r._frame.height===o.height&&r.rotate===0,!0}}var wN=`varying vec2 vMaskCoord;
418
+ varying vec2 vTextureCoord;
419
+
420
+ uniform sampler2D uSampler;
421
+ uniform sampler2D mask;
422
+ uniform float alpha;
423
+ uniform float npmAlpha;
424
+ uniform vec4 maskClamp;
425
+
426
+ void main(void)
427
+ {
428
+ float clip = step(3.5,
429
+ step(maskClamp.x, vMaskCoord.x) +
430
+ step(maskClamp.y, vMaskCoord.y) +
431
+ step(vMaskCoord.x, maskClamp.z) +
432
+ step(vMaskCoord.y, maskClamp.w));
433
+
434
+ vec4 original = texture2D(uSampler, vTextureCoord);
435
+ vec4 masky = texture2D(mask, vMaskCoord);
436
+ float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
437
+
438
+ original *= (alphaMul * masky.r * alpha * clip);
439
+
440
+ gl_FragColor = original;
441
+ }
442
+ `,EN=`attribute vec2 aVertexPosition;
443
+ attribute vec2 aTextureCoord;
444
+
445
+ uniform mat3 projectionMatrix;
446
+ uniform mat3 otherMatrix;
447
+
448
+ varying vec2 vMaskCoord;
449
+ varying vec2 vTextureCoord;
450
+
451
+ void main(void)
452
+ {
453
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
454
+
455
+ vTextureCoord = aTextureCoord;
456
+ vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
457
+ }
458
+ `;class SN extends Ar{constructor(e,r,n){let i=null;typeof e!="string"&&r===void 0&&n===void 0&&(i=e,e=void 0,r=void 0,n=void 0),super(e||EN,r||wN,n),this.maskSprite=i,this.maskMatrix=new ot}get maskSprite(){return this._maskSprite}set maskSprite(e){this._maskSprite=e,this._maskSprite&&(this._maskSprite.renderable=!1)}apply(e,r,n,i){const s=this._maskSprite,o=s._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new l_(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=e.calculateSpriteMatrix(this.maskMatrix,s).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=s.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,e.applyFilter(this,r,n,i))}}class bN{constructor(e=null){this.type=Ft.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=Ar.defaultMultisample,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}get filter(){return this._filters?this._filters[0]:null}set filter(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null}reset(){this.pooled&&(this.maskObject=null,this.type=Ft.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null}copyCountersOrReset(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)}}class JA{constructor(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}setMaskStack(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)}push(e,r){let n=r;if(!n.isMaskData){const s=this.maskDataPool.pop()||new bN;s.pooled=!0,s.maskObject=r,n=s}const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(n.copyCountersOrReset(i),n._colorMask=i?i._colorMask:15,n.autoDetect&&this.detect(n),n._target=e,n.type!==Ft.SPRITE&&this.maskStack.push(n),n.enabled)switch(n.type){case Ft.SCISSOR:this.renderer.scissor.push(n);break;case Ft.STENCIL:this.renderer.stencil.push(n);break;case Ft.SPRITE:n.copyCountersOrReset(null),this.pushSpriteMask(n);break;case Ft.COLOR:this.pushColorMask(n);break}n.type===Ft.SPRITE&&this.maskStack.push(n)}pop(e){const r=this.maskStack.pop();if(!(!r||r._target!==e)){if(r.enabled)switch(r.type){case Ft.SCISSOR:this.renderer.scissor.pop(r);break;case Ft.STENCIL:this.renderer.stencil.pop(r.maskObject);break;case Ft.SPRITE:this.popSpriteMask(r);break;case Ft.COLOR:this.popColorMask(r);break}if(r.reset(),r.pooled&&this.maskDataPool.push(r),this.maskStack.length!==0){const n=this.maskStack[this.maskStack.length-1];n.type===Ft.SPRITE&&n._filters&&(n._filters[0].maskSprite=n.maskObject)}}}detect(e){const r=e.maskObject;r?r.isSprite?e.type=Ft.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Ft.SCISSOR:e.type=Ft.STENCIL:e.type=Ft.COLOR}pushSpriteMask(e){const{maskObject:r}=e,n=e._target;let i=e._filters;i||(i=this.alphaMaskPool[this.alphaMaskIndex],i||(i=this.alphaMaskPool[this.alphaMaskIndex]=[new SN])),i[0].resolution=e.resolution,i[0].multisample=e.multisample,i[0].maskSprite=r;const s=n.filterArea;n.filterArea=r.getBounds(!0),this.renderer.filter.push(n,i),n.filterArea=s,e._filters||this.alphaMaskIndex++}popSpriteMask(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)}pushColorMask(e){const r=e._colorMask,n=e._colorMask=r&e.colorMask;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}popColorMask(e){const r=e._colorMask,n=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;n!==r&&this.renderer.gl.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)}destroy(){this.renderer=null}}JA.extension={type:ue.RendererSystem,name:"mask"};Se.add(JA);class eC{constructor(e){this.renderer=e,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(e){const{gl:r}=this.renderer,n=this.getStackLength();this.maskStack=e;const i=this.getStackLength();i!==n&&(i===0?r.disable(this.glConst):(r.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const TE=new ot,AE=[],tC=class Md extends eC{constructor(e){super(e),this.glConst=pe.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._scissorCounter:0}calcScissorRect(e){if(e._scissorRectLocal)return;const r=e._scissorRect,{maskObject:n}=e,{renderer:i}=this,s=i.renderTexture,o=n.getBounds(!0,AE.pop()??new De);this.roundFrameToPixels(o,s.current?s.current.resolution:i.resolution,s.sourceFrame,s.destinationFrame,i.projection.transform),r&&o.fit(r),e._scissorRectLocal=o}static isMatrixRotated(e){if(!e)return!1;const{a:r,b:n,c:i,d:s}=e;return(Math.abs(n)>1e-4||Math.abs(i)>1e-4)&&(Math.abs(r)>1e-4||Math.abs(s)>1e-4)}testScissor(e){const{maskObject:r}=e;if(!r.isFastRect||!r.isFastRect()||Md.isMatrixRotated(r.worldTransform)||Md.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(e);const n=e._scissorRectLocal;return n.width>0&&n.height>0}roundFrameToPixels(e,r,n,i,s){Md.isMatrixRotated(s)||(s=s?TE.copyFrom(s):TE.identity(),s.translate(-n.x,-n.y).scale(i.width/n.width,i.height/n.height).translate(i.x,i.y),this.renderer.filter.transformAABB(s,e),e.fit(i),e.x=Math.round(e.x*r),e.y=Math.round(e.y*r),e.width=Math.round(e.width*r),e.height=Math.round(e.height*r))}push(e){e._scissorRectLocal||this.calcScissorRect(e);const{gl:r}=this.renderer;e._scissorRect||r.enable(r.SCISSOR_TEST),e._scissorCounter++,e._scissorRect=e._scissorRectLocal,this._useCurrent()}pop(e){const{gl:r}=this.renderer;e&&AE.push(e._scissorRectLocal),this.getStackLength()>0?this._useCurrent():r.disable(r.SCISSOR_TEST)}_useCurrent(){const e=this.maskStack[this.maskStack.length-1]._scissorRect;let r;this.renderer.renderTexture.current?r=e.y:r=this.renderer.height-e.height-e.y,this.renderer.gl.scissor(e.x,r,e.width,e.height)}};tC.extension={type:ue.RendererSystem,name:"scissor"};let TN=tC;Se.add(TN);class rC extends eC{constructor(e){super(e),this.glConst=pe.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const e=this.maskStack[this.maskStack.length-1];return e?e._stencilCounter:0}push(e){const r=e.maskObject,{gl:n}=this.renderer,i=e._stencilCounter;i===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),e._stencilCounter++;const s=e._colorMask;s!==0&&(e._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,i,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),r.renderable=!0,r.render(this.renderer),this.renderer.batch.flush(),r.renderable=!1,s!==0&&(e._colorMask=s,n.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(e){const r=this.renderer.gl;if(this.getStackLength()===0)r.disable(r.STENCIL_TEST);else{const n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,i=n?n._colorMask:15;i!==0&&(n._colorMask=0,r.colorMask(!1,!1,!1,!1)),r.stencilOp(r.KEEP,r.KEEP,r.DECR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,i!==0&&(n._colorMask=i,r.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)),this._useCurrent()}}_useCurrent(){const e=this.renderer.gl;e.stencilFunc(e.EQUAL,this.getStackLength(),4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}rC.extension={type:ue.RendererSystem,name:"stencil"};Se.add(rC);class nC{constructor(e){this.renderer=e,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return Ue("7.0.0","renderer.plugins.extract has moved to renderer.extract"),e.extract}},prepare:{enumerable:!1,get(){return Ue("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),e.prepare}},interaction:{enumerable:!1,get(){return Ue("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),e.events}}})}init(){const e=this.rendererPlugins;for(const r in e)this.plugins[r]=new e[r](this.renderer)}destroy(){for(const e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null}}nC.extension={type:[ue.RendererSystem,ue.CanvasRendererSystem],name:"_plugin"};Se.add(nC);class iC{constructor(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ot,this.transform=null}update(e,r,n,i){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=r||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,n,i),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(e,r,n,i){const s=this.projectionMatrix,o=i?-1:1;s.identity(),s.a=1/r.width*2,s.d=o*(1/r.height*2),s.tx=-1-r.x*s.a,s.ty=-o-r.y*s.d}setTransform(e){}destroy(){this.renderer=null}}iC.extension={type:ue.RendererSystem,name:"projection"};Se.add(iC);const AN=new lp,CE=new De;class sC{constructor(e){this.renderer=e,this._tempMatrix=new ot}generateTexture(e,r){const{region:n,...i}=r||{},s=(n==null?void 0:n.copyTo(CE))||e.getLocalBounds(CE,!0),o=i.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/o),s.height=Math.max(s.height,1/o),i.width=s.width,i.height=s.height,i.resolution=o,i.multisample??(i.multisample=this.renderer.multisample);const l=Zo.create(i);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const h=e.transform;return e.transform=AN,this.renderer.render(e,{renderTexture:l,transform:this._tempMatrix,skipUpdateTransform:!!e.parent,blit:!0}),e.transform=h,l}destroy(){}}sC.extension={type:[ue.RendererSystem,ue.CanvasRendererSystem],name:"textureGenerator"};Se.add(sC);const xo=new De,tu=new De;class oC{constructor(e){this.renderer=e,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new De,this.destinationFrame=new De,this.viewportFrame=new De}contextChange(){var r;const e=(r=this.renderer)==null?void 0:r.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}bind(e=null,r,n){const i=this.renderer;this.current=e;let s,o,l;e?(s=e.baseTexture,l=s.resolution,r||(xo.width=e.frame.width,xo.height=e.frame.height,r=xo),n||(tu.x=e.frame.x,tu.y=e.frame.y,tu.width=r.width,tu.height=r.height,n=tu),o=s.framebuffer):(l=i.resolution,r||(xo.width=i._view.screen.width,xo.height=i._view.screen.height,r=xo),n||(n=xo,n.width=r.width,n.height=r.height));const h=this.viewportFrame;h.x=n.x*l,h.y=n.y*l,h.width=n.width*l,h.height=n.height*l,e||(h.y=i.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(n,r,l,!o),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(r),this.destinationFrame.copyFrom(n)}clear(e,r){const n=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,i=rt.shared.setValue(e||n);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&i.premultiply(i.alpha);const s=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,l=s.width!==o.width||s.height!==o.height;if(l){let{x:h,y:c,width:f,height:m}=this.viewportFrame;h=Math.round(h),c=Math.round(c),f=Math.round(f),m=Math.round(m),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,c,f,m)}this.renderer.framebuffer.clear(i.red,i.green,i.blue,i.alpha,r),l&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}oC.extension={type:ue.RendererSystem,name:"renderTexture"};Se.add(oC);class CN{constructor(e,r){this.program=e,this.uniformData=r,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function PN(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=e.getActiveAttrib(t,i);if(s.name.startsWith("gl_"))continue;const o=$A(e,s.type),l={type:o,name:s.name,size:jA(o),location:e.getAttribLocation(t,s.name)};r[s.name]=l}return r}function IN(t,e){const r={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;i++){const s=e.getActiveUniform(t,i),o=s.name.replace(/\[.*?\]$/,""),l=!!s.name.match(/\[.*?\]$/),h=$A(e,s.type);r[o]={name:o,index:i,type:h,size:s.size,isArray:l,value:GA(h,s.size)}}return r}function RN(t,e){var l;const r=vE(t,t.VERTEX_SHADER,e.vertexSrc),n=vE(t,t.FRAGMENT_SHADER,e.fragmentSrc),i=t.createProgram();t.attachShader(i,r),t.attachShader(i,n);const s=(l=e.extra)==null?void 0:l.transformFeedbackVaryings;if(s&&(typeof t.transformFeedbackVaryings!="function"?console.warn("TransformFeedback is not supported but TransformFeedbackVaryings are given."):t.transformFeedbackVaryings(i,s.names,s.bufferMode==="separate"?t.SEPARATE_ATTRIBS:t.INTERLEAVED_ATTRIBS)),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||sN(t,i,r,n),e.attributeData=PN(i,t),e.uniformData=IN(i,t),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){const h=Object.keys(e.attributeData);h.sort((c,f)=>c>f?1:-1);for(let c=0;c<h.length;c++)e.attributeData[h[c]].location=c,t.bindAttribLocation(i,c,h[c]);t.linkProgram(i)}t.deleteShader(r),t.deleteShader(n);const o={};for(const h in e.uniformData){const c=e.uniformData[h];o[h]={location:t.getUniformLocation(i,h),value:GA(c.type,c.size)}}return new CN(i,o)}function MN(t,e,r,n,i){r.buffer.update(i)}const kN={float:`
459
+ data[offset] = v;
460
+ `,vec2:`
461
+ data[offset] = v[0];
462
+ data[offset+1] = v[1];
463
+ `,vec3:`
464
+ data[offset] = v[0];
465
+ data[offset+1] = v[1];
466
+ data[offset+2] = v[2];
467
+
468
+ `,vec4:`
469
+ data[offset] = v[0];
470
+ data[offset+1] = v[1];
471
+ data[offset+2] = v[2];
472
+ data[offset+3] = v[3];
473
+ `,mat2:`
474
+ data[offset] = v[0];
475
+ data[offset+1] = v[1];
476
+
477
+ data[offset+4] = v[2];
478
+ data[offset+5] = v[3];
479
+ `,mat3:`
480
+ data[offset] = v[0];
481
+ data[offset+1] = v[1];
482
+ data[offset+2] = v[2];
483
+
484
+ data[offset + 4] = v[3];
485
+ data[offset + 5] = v[4];
486
+ data[offset + 6] = v[5];
487
+
488
+ data[offset + 8] = v[6];
489
+ data[offset + 9] = v[7];
490
+ data[offset + 10] = v[8];
491
+ `,mat4:`
492
+ for(var i = 0; i < 16; i++)
493
+ {
494
+ data[offset + i] = v[i];
495
+ }
496
+ `},aC={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function NN(t){const e=t.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let r=0,n=0,i=0;for(let s=0;s<e.length;s++){const o=e[s];if(r=aC[o.data.type],o.data.size>1&&(r=Math.max(r,16)*o.data.size),o.dataLen=r,n%r!==0&&n<16){const l=n%r%16;n+=l,i+=l}n+r>16?(i=Math.ceil(i/16)*16,o.offset=i,i+=r,n=r):(o.offset=i,n+=r,i+=r)}return i=Math.ceil(i/16)*16,{uboElements:e,size:i}}function DN(t,e){const r=[];for(const n in t)e[n]&&r.push(e[n]);return r.sort((n,i)=>n.index-i.index),r}function ON(t,e){if(!t.autoManage)return{size:0,syncFunc:MN};const r=DN(t.uniforms,e),{uboElements:n,size:i}=NN(r),s=[`
497
+ var v = null;
498
+ var v2 = null;
499
+ var cv = null;
500
+ var t = 0;
501
+ var gl = renderer.gl
502
+ var index = 0;
503
+ var data = buffer.data;
504
+ `];for(let o=0;o<n.length;o++){const l=n[o],h=t.uniforms[l.data.name],c=l.data.name;let f=!1;for(let m=0;m<nl.length;m++){const p=nl[m];if(p.codeUbo&&p.test(l.data,h)){s.push(`offset = ${l.offset/4};`,nl[m].codeUbo(l.data.name,h)),f=!0;break}}if(!f)if(l.data.size>1){const m=jA(l.data.type),p=Math.max(aC[l.data.type]/16,1),v=m/p,_=(4-v%4)%4;s.push(`
505
+ cv = ud.${c}.value;
506
+ v = uv.${c};
507
+ offset = ${l.offset/4};
508
+
509
+ t = 0;
510
+
511
+ for(var i=0; i < ${l.data.size*p}; i++)
512
+ {
513
+ for(var j = 0; j < ${v}; j++)
514
+ {
515
+ data[offset++] = v[t++];
516
+ }
517
+ offset += ${_};
518
+ }
519
+
520
+ `)}else{const m=kN[l.data.type];s.push(`
521
+ cv = ud.${c}.value;
522
+ v = uv.${c};
523
+ offset = ${l.offset/4};
524
+ ${m};
525
+ `)}}return s.push(`
526
+ renderer.buffer.update(buffer);
527
+ `),{size:i,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(`
528
+ `))}}let FN=0;const Yc={textureCount:0,uboCount:0};class lC{constructor(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=FN++}systemCheck(){if(!aN())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(e){this.gl=e,this.reset()}bind(e,r){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;const n=e.program,i=n.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==n&&(this.program=n,this.gl.useProgram(i.program)),r||(Yc.textureCount=0,Yc.uboCount=0,this.syncUniformGroup(e.uniformGroup,Yc)),i}setUniforms(e){const r=this.shader.program,n=r.glPrograms[this.renderer.CONTEXT_UID];r.syncUniforms(n.uniformData,e,this.renderer)}syncUniformGroup(e,r){const n=this.getGlProgram();(!e.static||e.dirtyId!==n.uniformDirtyGroups[e.id])&&(n.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,n,r))}syncUniforms(e,r,n){(e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e))(r.uniformData,e.uniforms,this.renderer,n)}createSyncGroups(e){const r=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[r]||(this.cache[r]=rN(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[r],e.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(e,r){const n=this.getGlProgram();if(!e.static||e.dirtyId!==0||!n.uniformGroups[e.id]){e.dirtyId=0;const i=n.uniformGroups[e.id]||this.createSyncBufferGroup(e,n,r);e.buffer.update(),i(n.uniformData,e.uniforms,this.renderer,Yc,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,n.uniformBufferBindings[r])}createSyncBufferGroup(e,r,n){const{gl:i}=this.renderer;this.renderer.buffer.bind(e.buffer);const s=this.gl.getUniformBlockIndex(r.program,n);r.uniformBufferBindings[n]=this.shader.uniformBindCount,i.uniformBlockBinding(r.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(e,this.shader.program.uniformData,"ubo");let l=this._uboCache[o];if(l||(l=this._uboCache[o]=ON(e,this.shader.program.uniformData)),e.autoManage){const h=new Float32Array(l.size/4);e.buffer.update(h)}return r.uniformGroups[e.id]=l.syncFunc,r.uniformGroups[e.id]}getSignature(e,r,n){const i=e.uniforms,s=[`${n}-`];for(const o in i)s.push(o),r[o]&&s.push(r[o].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(e){const r=this.gl,n=e.program,i=RN(r,n);return n.glPrograms[this.renderer.CONTEXT_UID]=i,i}reset(){this.program=null,this.shader=null}disposeShader(e){this.shader===e&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}lC.extension={type:ue.RendererSystem,name:"shader"};Se.add(lC);class xf{constructor(e){this.renderer=e}run(e){const{renderer:r}=this;r.runners.init.emit(r.options),e.hello&&console.log(`PixiJS 7.4.3 - ${r.rendererLogId} - https://pixijs.com`),r.resize(r.screen.width,r.screen.height)}destroy(){}}xf.defaultOptions={hello:!1},xf.extension={type:[ue.RendererSystem,ue.CanvasRendererSystem],name:"startup"};Se.add(xf);function BN(t,e=[]){return e[Me.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.ADD]=[t.ONE,t.ONE],e[Me.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.NONE]=[0,0],e[Me.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[Me.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[Me.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[Me.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[Me.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[Me.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[Me.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[Me.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[Me.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[Me.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[Me.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}const LN=0,UN=1,zN=2,GN=3,HN=4,jN=5,uC=class Av{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=Me.NONE,this._blendEq=!1,this.map=[],this.map[LN]=this.setBlend,this.map[UN]=this.setOffset,this.map[zN]=this.setCullFace,this.map[GN]=this.setDepthTest,this.map[HN]=this.setFrontFace,this.map[jN]=this.setDepthMask,this.checks=[],this.defaultState=new Ni,this.defaultState.blend=!0}contextChange(e){this.gl=e,this.blendModes=BN(e),this.set(this.defaultState),this.reset()}set(e){if(e=e||this.defaultState,this.stateId!==e.data){let r=this.stateId^e.data,n=0;for(;r;)r&1&&this.map[n].call(this,!!(e.data&1<<n)),r=r>>1,n++;this.stateId=e.data}for(let r=0;r<this.checks.length;r++)this.checks[r](this,e)}forceState(e){e=e||this.defaultState;for(let r=0;r<this.map.length;r++)this.map[r].call(this,!!(e.data&1<<r));for(let r=0;r<this.checks.length;r++)this.checks[r](this,e);this.stateId=e.data}setBlend(e){this.updateCheck(Av.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this.updateCheck(Av.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.gl[e?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])}setBlendMode(e){if(e===this.blendMode)return;this.blendMode=e;const r=this.blendModes[e],n=this.gl;r.length===2?n.blendFunc(r[0],r[1]):n.blendFuncSeparate(r[0],r[1],r[2],r[3]),r.length===6?(this._blendEq=!0,n.blendEquationSeparate(r[4],r[5])):this._blendEq&&(this._blendEq=!1,n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD))}setPolygonOffset(e,r){this.gl.polygonOffset(e,r)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(e,r){const n=this.checks.indexOf(e);r&&n===-1?this.checks.push(e):!r&&n!==-1&&this.checks.splice(n,1)}static checkBlendMode(e,r){e.setBlendMode(r.blendMode)}static checkPolygonOffset(e,r){e.setPolygonOffset(1,r.polygonOffset)}destroy(){this.gl=null}};uC.extension={type:ue.RendererSystem,name:"state"};let $N=uC;Se.add($N);class WN extends hh{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(e){this.addRunners(...e.runners);const r=(e.priority??[]).filter(i=>e.systems[i]),n=[...r,...Object.keys(e.systems).filter(i=>!r.includes(i))];for(const i of n)this.addSystem(e.systems[i],i)}addRunners(...e){e.forEach(r=>{this.runners[r]=new Qn(r)})}addSystem(e,r){const n=new e(this);if(this[r])throw new Error(`Whoops! The name "${r}" is already in use`);this[r]=n,this._systemsHash[r]=n;for(const i in this.runners)this.runners[i].add(n);return this}emitWithCustomOptions(e,r){const n=Object.keys(this._systemsHash);e.items.forEach(i=>{const s=n.find(o=>this._systemsHash[o]===i);i[e.name](r[s])})}destroy(){Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash={}}}const hu=class kd{constructor(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=kd.defaultMaxIdle,this.checkCountMax=kd.defaultCheckCountMax,this.mode=kd.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==Z0.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this.renderer.texture,r=e.managedTextures;let n=!1;for(let i=0;i<r.length;i++){const s=r[i];s.resource&&this.count-s.touched>this.maxIdle&&(e.destroyTexture(s,!0),r[i]=null,n=!0)}if(n){let i=0;for(let s=0;s<r.length;s++)r[s]!==null&&(r[i++]=r[s]);r.length=i}}unload(e){const r=this.renderer.texture,n=e._texture;n&&!n.framebuffer&&r.destroyTexture(n);for(let i=e.children.length-1;i>=0;i--)this.unload(e.children[i])}destroy(){this.renderer=null}};hu.defaultMode=Z0.AUTO,hu.defaultMaxIdle=60*60,hu.defaultCheckCountMax=60*10,hu.extension={type:ue.RendererSystem,name:"textureGC"};let Ro=hu;Se.add(Ro);class Ug{constructor(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=Ae.UNSIGNED_BYTE,this.internalFormat=te.RGBA,this.samplerType=0}}function VN(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[t.RGB]:ge.FLOAT,[t.RGBA]:ge.FLOAT,[t.ALPHA]:ge.FLOAT,[t.LUMINANCE]:ge.FLOAT,[t.LUMINANCE_ALPHA]:ge.FLOAT,[t.R8]:ge.FLOAT,[t.R8_SNORM]:ge.FLOAT,[t.RG8]:ge.FLOAT,[t.RG8_SNORM]:ge.FLOAT,[t.RGB8]:ge.FLOAT,[t.RGB8_SNORM]:ge.FLOAT,[t.RGB565]:ge.FLOAT,[t.RGBA4]:ge.FLOAT,[t.RGB5_A1]:ge.FLOAT,[t.RGBA8]:ge.FLOAT,[t.RGBA8_SNORM]:ge.FLOAT,[t.RGB10_A2]:ge.FLOAT,[t.RGB10_A2UI]:ge.FLOAT,[t.SRGB8]:ge.FLOAT,[t.SRGB8_ALPHA8]:ge.FLOAT,[t.R16F]:ge.FLOAT,[t.RG16F]:ge.FLOAT,[t.RGB16F]:ge.FLOAT,[t.RGBA16F]:ge.FLOAT,[t.R32F]:ge.FLOAT,[t.RG32F]:ge.FLOAT,[t.RGB32F]:ge.FLOAT,[t.RGBA32F]:ge.FLOAT,[t.R11F_G11F_B10F]:ge.FLOAT,[t.RGB9_E5]:ge.FLOAT,[t.R8I]:ge.INT,[t.R8UI]:ge.UINT,[t.R16I]:ge.INT,[t.R16UI]:ge.UINT,[t.R32I]:ge.INT,[t.R32UI]:ge.UINT,[t.RG8I]:ge.INT,[t.RG8UI]:ge.UINT,[t.RG16I]:ge.INT,[t.RG16UI]:ge.UINT,[t.RG32I]:ge.INT,[t.RG32UI]:ge.UINT,[t.RGB8I]:ge.INT,[t.RGB8UI]:ge.UINT,[t.RGB16I]:ge.INT,[t.RGB16UI]:ge.UINT,[t.RGB32I]:ge.INT,[t.RGB32UI]:ge.UINT,[t.RGBA8I]:ge.INT,[t.RGBA8UI]:ge.UINT,[t.RGBA16I]:ge.INT,[t.RGBA16UI]:ge.UINT,[t.RGBA32I]:ge.INT,[t.RGBA32UI]:ge.UINT,[t.DEPTH_COMPONENT16]:ge.FLOAT,[t.DEPTH_COMPONENT24]:ge.FLOAT,[t.DEPTH_COMPONENT32F]:ge.FLOAT,[t.DEPTH_STENCIL]:ge.FLOAT,[t.DEPTH24_STENCIL8]:ge.FLOAT,[t.DEPTH32F_STENCIL8]:ge.FLOAT}:e={[t.RGB]:ge.FLOAT,[t.RGBA]:ge.FLOAT,[t.ALPHA]:ge.FLOAT,[t.LUMINANCE]:ge.FLOAT,[t.LUMINANCE_ALPHA]:ge.FLOAT,[t.DEPTH_STENCIL]:ge.FLOAT},e}function XN(t){let e;return"WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext?e={[Ae.UNSIGNED_BYTE]:{[te.RGBA]:t.RGBA8,[te.RGB]:t.RGB8,[te.RG]:t.RG8,[te.RED]:t.R8,[te.RGBA_INTEGER]:t.RGBA8UI,[te.RGB_INTEGER]:t.RGB8UI,[te.RG_INTEGER]:t.RG8UI,[te.RED_INTEGER]:t.R8UI,[te.ALPHA]:t.ALPHA,[te.LUMINANCE]:t.LUMINANCE,[te.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[Ae.BYTE]:{[te.RGBA]:t.RGBA8_SNORM,[te.RGB]:t.RGB8_SNORM,[te.RG]:t.RG8_SNORM,[te.RED]:t.R8_SNORM,[te.RGBA_INTEGER]:t.RGBA8I,[te.RGB_INTEGER]:t.RGB8I,[te.RG_INTEGER]:t.RG8I,[te.RED_INTEGER]:t.R8I},[Ae.UNSIGNED_SHORT]:{[te.RGBA_INTEGER]:t.RGBA16UI,[te.RGB_INTEGER]:t.RGB16UI,[te.RG_INTEGER]:t.RG16UI,[te.RED_INTEGER]:t.R16UI,[te.DEPTH_COMPONENT]:t.DEPTH_COMPONENT16},[Ae.SHORT]:{[te.RGBA_INTEGER]:t.RGBA16I,[te.RGB_INTEGER]:t.RGB16I,[te.RG_INTEGER]:t.RG16I,[te.RED_INTEGER]:t.R16I},[Ae.UNSIGNED_INT]:{[te.RGBA_INTEGER]:t.RGBA32UI,[te.RGB_INTEGER]:t.RGB32UI,[te.RG_INTEGER]:t.RG32UI,[te.RED_INTEGER]:t.R32UI,[te.DEPTH_COMPONENT]:t.DEPTH_COMPONENT24},[Ae.INT]:{[te.RGBA_INTEGER]:t.RGBA32I,[te.RGB_INTEGER]:t.RGB32I,[te.RG_INTEGER]:t.RG32I,[te.RED_INTEGER]:t.R32I},[Ae.FLOAT]:{[te.RGBA]:t.RGBA32F,[te.RGB]:t.RGB32F,[te.RG]:t.RG32F,[te.RED]:t.R32F,[te.DEPTH_COMPONENT]:t.DEPTH_COMPONENT32F},[Ae.HALF_FLOAT]:{[te.RGBA]:t.RGBA16F,[te.RGB]:t.RGB16F,[te.RG]:t.RG16F,[te.RED]:t.R16F},[Ae.UNSIGNED_SHORT_5_6_5]:{[te.RGB]:t.RGB565},[Ae.UNSIGNED_SHORT_4_4_4_4]:{[te.RGBA]:t.RGBA4},[Ae.UNSIGNED_SHORT_5_5_5_1]:{[te.RGBA]:t.RGB5_A1},[Ae.UNSIGNED_INT_2_10_10_10_REV]:{[te.RGBA]:t.RGB10_A2,[te.RGBA_INTEGER]:t.RGB10_A2UI},[Ae.UNSIGNED_INT_10F_11F_11F_REV]:{[te.RGB]:t.R11F_G11F_B10F},[Ae.UNSIGNED_INT_5_9_9_9_REV]:{[te.RGB]:t.RGB9_E5},[Ae.UNSIGNED_INT_24_8]:{[te.DEPTH_STENCIL]:t.DEPTH24_STENCIL8},[Ae.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[te.DEPTH_STENCIL]:t.DEPTH32F_STENCIL8}}:e={[Ae.UNSIGNED_BYTE]:{[te.RGBA]:t.RGBA,[te.RGB]:t.RGB,[te.ALPHA]:t.ALPHA,[te.LUMINANCE]:t.LUMINANCE,[te.LUMINANCE_ALPHA]:t.LUMINANCE_ALPHA},[Ae.UNSIGNED_SHORT_5_6_5]:{[te.RGB]:t.RGB},[Ae.UNSIGNED_SHORT_4_4_4_4]:{[te.RGBA]:t.RGBA},[Ae.UNSIGNED_SHORT_5_5_5_1]:{[te.RGBA]:t.RGBA}},e}class hC{constructor(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Ne,this.hasIntegerTextures=!1}contextChange(){const e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=XN(e),this.samplerTypes=VN(e);const r=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=r;for(let i=0;i<r;i++)this.boundTextures[i]=null;this.emptyTextures={};const n=new Ug(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new Ug(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(let i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(let i=0;i<this.boundTextures.length;i++)this.bind(null,i)}bind(e,r=0){const{gl:n}=this;if(e=e==null?void 0:e.castToBaseTexture(),(e==null?void 0:e.valid)&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;const i=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[r]!==e&&(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(e.target,i.texture)),i.dirtyId!==e.dirtyId?(this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),this.updateTexture(e)):i.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[r]=e}else this.currentLocation!==r&&(this.currentLocation=r,n.activeTexture(n.TEXTURE0+r)),n.bindTexture(n.TEXTURE_2D,this.emptyTextures[n.TEXTURE_2D].texture),this.boundTextures[r]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture}unbind(e){const{gl:r,boundTextures:n}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let i=0;i<n.length;i++)n[i]===this.unknownTexture&&this.bind(null,i)}for(let i=0;i<n.length;i++)n[i]===e&&(this.currentLocation!==i&&(r.activeTexture(r.TEXTURE0+i),this.currentLocation=i),r.bindTexture(e.target,this.emptyTextures[e.target].texture),n[i]=null)}ensureSamplerType(e){const{boundTextures:r,hasIntegerTextures:n,CONTEXT_UID:i}=this;if(n)for(let s=e-1;s>=0;--s){const o=r[s];o&&o._glTextures[i].samplerType!==ge.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(e){const r=new Ug(this.gl.createTexture());return r.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=r,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),r}initTextureType(e,r){var n;r.internalFormat=((n=this.internalFormats[e.type])==null?void 0:n[e.format])??e.format,r.samplerType=this.samplerTypes[r.internalFormat]??ge.FLOAT,this.webGLVersion===2&&e.type===Ae.HALF_FLOAT?r.type=this.gl.HALF_FLOAT:r.type=e.type}updateTexture(e){var i;const r=e._glTextures[this.CONTEXT_UID];if(!r)return;const n=this.renderer;if(this.initTextureType(e,r),(i=e.resource)==null?void 0:i.upload(n,e,r))r.samplerType!==ge.FLOAT&&(this.hasIntegerTextures=!0);else{const s=e.realWidth,o=e.realHeight,l=n.gl;(r.width!==s||r.height!==o||r.dirtyId<0)&&(r.width=s,r.height=o,l.texImage2D(e.target,0,r.internalFormat,s,o,0,e.format,r.type,null))}e.dirtyStyleId!==r.dirtyStyleId&&this.updateTextureStyle(e),r.dirtyId=e.dirtyId}destroyTexture(e,r){const{gl:n}=this;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),n.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!r)){const i=this.managedTextures.indexOf(e);i!==-1&&rl(this.managedTextures,i,1)}}updateTextureStyle(e){var n;const r=e._glTextures[this.CONTEXT_UID];r&&((e.mipmap===Ri.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?r.mipmap=!1:r.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?r.wrapMode=es.CLAMP:r.wrapMode=e.wrapMode,(n=e.resource)!=null&&n.style(this.renderer,e,r)||this.setStyle(e,r),r.dirtyStyleId=e.dirtyStyleId)}setStyle(e,r){const n=this.gl;if(r.mipmap&&e.mipmap!==Ri.ON_MANUAL&&n.generateMipmap(e.target),n.texParameteri(e.target,n.TEXTURE_WRAP_S,r.wrapMode),n.texParameteri(e.target,n.TEXTURE_WRAP_T,r.wrapMode),r.mipmap){n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sn.LINEAR?n.LINEAR_MIPMAP_LINEAR:n.NEAREST_MIPMAP_NEAREST);const i=this.renderer.context.extensions.anisotropicFiltering;if(i&&e.anisotropicLevel>0&&e.scaleMode===Sn.LINEAR){const s=Math.min(e.anisotropicLevel,n.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));n.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else n.texParameteri(e.target,n.TEXTURE_MIN_FILTER,e.scaleMode===Sn.LINEAR?n.LINEAR:n.NEAREST);n.texParameteri(e.target,n.TEXTURE_MAG_FILTER,e.scaleMode===Sn.LINEAR?n.LINEAR:n.NEAREST)}destroy(){this.renderer=null}}hC.extension={type:ue.RendererSystem,name:"texture"};Se.add(hC);class cC{constructor(e){this.renderer=e}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glTransformFeedbacks[n]||this.createGLTransformFeedback(e);r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,i)}unbind(){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(e,r){const{gl:n,renderer:i}=this;r&&i.shader.bind(r),n.beginTransformFeedback(e)}endTransformFeedback(){const{gl:e}=this;e.endTransformFeedback()}createGLTransformFeedback(e){const{gl:r,renderer:n,CONTEXT_UID:i}=this,s=r.createTransformFeedback();e._glTransformFeedbacks[i]=s,r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,s);for(let o=0;o<e.buffers.length;o++){const l=e.buffers[o];l&&(n.buffer.update(l),l._glBuffers[i].refCount++,r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,o,l._glBuffers[i].buffer||null))}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),e.disposeRunner.add(this),s}disposeTransformFeedback(e,r){const n=e._glTransformFeedbacks[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this);const s=this.renderer.buffer;if(s)for(let o=0;o<e.buffers.length;o++){const l=e.buffers[o];if(!l)continue;const h=l._glBuffers[this.CONTEXT_UID];h&&(h.refCount--,h.refCount===0&&!r&&s.dispose(l,r))}n&&(r||i.deleteTransformFeedback(n),delete e._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}cC.extension={type:ue.RendererSystem,name:"transformFeedback"};Se.add(cC);class wf{constructor(e){this.renderer=e}init(e){this.screen=new De(0,0,e.width,e.height),this.element=e.view||pe.ADAPTER.createCanvas(),this.resolution=e.resolution||pe.RESOLUTION,this.autoDensity=!!e.autoDensity}resizeView(e,r){this.element.width=Math.round(e*this.resolution),this.element.height=Math.round(r*this.resolution);const n=this.element.width/this.resolution,i=this.element.height/this.resolution;this.screen.width=n,this.screen.height=i,this.autoDensity&&(this.element.style.width=`${n}px`,this.element.style.height=`${i}px`),this.renderer.emit("resize",n,i),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(e){var r;e&&((r=this.element.parentNode)==null||r.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}wf.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},wf.extension={type:[ue.RendererSystem,ue.CanvasRendererSystem],name:"_view"};Se.add(wf);pe.PREFER_ENV=Ko.WEBGL2;pe.STRICT_TEXTURE_CACHE=!1;pe.RENDER_OPTIONS={..._f.defaultOptions,...vf.defaultOptions,...wf.defaultOptions,...xf.defaultOptions};Object.defineProperties(pe,{WRAP_MODE:{get(){return Ne.defaultOptions.wrapMode},set(t){Ue("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),Ne.defaultOptions.wrapMode=t}},SCALE_MODE:{get(){return Ne.defaultOptions.scaleMode},set(t){Ue("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),Ne.defaultOptions.scaleMode=t}},MIPMAP_TEXTURES:{get(){return Ne.defaultOptions.mipmap},set(t){Ue("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),Ne.defaultOptions.mipmap=t}},ANISOTROPIC_LEVEL:{get(){return Ne.defaultOptions.anisotropicLevel},set(t){Ue("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),Ne.defaultOptions.anisotropicLevel=t}},FILTER_RESOLUTION:{get(){return Ue("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Ar.defaultResolution},set(t){Ar.defaultResolution=t}},FILTER_MULTISAMPLE:{get(){return Ue("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Ar.defaultMultisample},set(t){Ar.defaultMultisample=t}},SPRITE_MAX_TEXTURES:{get(){return Io.defaultMaxTextures},set(t){Ue("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),Io.defaultMaxTextures=t}},SPRITE_BATCH_SIZE:{get(){return Io.defaultBatchSize},set(t){Ue("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),Io.defaultBatchSize=t}},CAN_UPLOAD_SAME_BUFFER:{get(){return Io.canUploadSameBuffer},set(t){Ue("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),Io.canUploadSameBuffer=t}},GC_MODE:{get(){return Ro.defaultMode},set(t){Ue("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),Ro.defaultMode=t}},GC_MAX_IDLE:{get(){return Ro.defaultMaxIdle},set(t){Ue("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),Ro.defaultMaxIdle=t}},GC_MAX_CHECK_COUNT:{get(){return Ro.defaultCheckCountMax},set(t){Ue("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),Ro.defaultCheckCountMax=t}},PRECISION_VERTEX:{get(){return Zi.defaultVertexPrecision},set(t){Ue("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Zi.defaultVertexPrecision=t}},PRECISION_FRAGMENT:{get(){return Zi.defaultFragmentPrecision},set(t){Ue("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Zi.defaultFragmentPrecision=t}}});var eo=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(eo||{});class zg{constructor(e,r=null,n=0,i=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=r,this.priority=n,this.once=i}match(e,r=null){return this.fn===e&&this.context===r}emit(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));const r=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),r}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 r=this.next;return this.next=e?null:r,this.previous=null,r}}const dC=class qr{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 zg(null,null,1/0),this.deltaMS=1/qr.targetFPMS,this.elapsedMS=1/qr.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,r,n=eo.NORMAL){return this._addListener(new zg(e,r,n))}addOnce(e,r,n=eo.NORMAL){return this._addListener(new zg(e,r,n,!0))}_addListener(e){let r=this._head.next,n=this._head;if(!r)e.connect(n);else{for(;r;){if(e.priority>r.priority){e.connect(n);break}n=r,r=r.next}e.previous||e.connect(n)}return this._startIfPossible(),this}remove(e,r){let n=this._head.next;for(;n;)n.match(e,r)?n=n.destroy():n=n.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,r=this._head;for(;r=r.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 r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const s=e-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=e-s%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*qr.targetFPMS;const n=this._head;let i=n.next;for(;i;)i=i.emit(this.deltaTime);n.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 r=Math.min(this.maxFPS,e),n=Math.min(Math.max(0,r)/1e3,qr.targetFPMS);this._maxElapsedMS=1/n}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const r=Math.max(this.minFPS,e);this._minElapsedMS=1/(r/1e3)}}static get shared(){if(!qr._shared){const e=qr._shared=new qr;e.autoStart=!0,e._protected=!0}return qr._shared}static get system(){if(!qr._system){const e=qr._system=new qr;e.autoStart=!0,e._protected=!0}return qr._system}};dC.targetFPMS=.06;let Qt=dC;Object.defineProperties(pe,{TARGET_FPMS:{get(){return Qt.targetFPMS},set(t){Ue("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Qt.targetFPMS=t}}});class fC{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(r){this._ticker&&this._ticker.remove(this.render,this),this._ticker=r,r&&r.add(this.render,this,eo.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Qt.shared:new Qt,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}fC.extension=ue.Application;Se.add(fC);const pC=[];Se.handleByList(ue.Renderer,pC);function YN(t){for(const e of pC)if(e.test(t))return new e(t);throw new Error("Unable to auto-detect a suitable renderer.")}var QN=`attribute vec2 aVertexPosition;
529
+ attribute vec2 aTextureCoord;
530
+
531
+ uniform mat3 projectionMatrix;
532
+
533
+ varying vec2 vTextureCoord;
534
+
535
+ void main(void)
536
+ {
537
+ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
538
+ vTextureCoord = aTextureCoord;
539
+ }`,KN=`attribute vec2 aVertexPosition;
540
+
541
+ uniform mat3 projectionMatrix;
542
+
543
+ varying vec2 vTextureCoord;
544
+
545
+ uniform vec4 inputSize;
546
+ uniform vec4 outputFrame;
547
+
548
+ vec4 filterVertexPosition( void )
549
+ {
550
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
551
+
552
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
553
+ }
554
+
555
+ vec2 filterTextureCoord( void )
556
+ {
557
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
558
+ }
559
+
560
+ void main(void)
561
+ {
562
+ gl_Position = filterVertexPosition();
563
+ vTextureCoord = filterTextureCoord();
564
+ }
565
+ `;const qN=QN,mC=KN;class gC{constructor(e){this.renderer=e}contextChange(e){let r;if(this.renderer.context.webGLVersion===1){const n=e.getParameter(e.FRAMEBUFFER_BINDING);e.bindFramebuffer(e.FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.FRAMEBUFFER,n)}else{const n=e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),r=e.getParameter(e.SAMPLES),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n)}r>=Rt.HIGH?this.multisample=Rt.HIGH:r>=Rt.MEDIUM?this.multisample=Rt.MEDIUM:r>=Rt.LOW?this.multisample=Rt.LOW:this.multisample=Rt.NONE}destroy(){}}gC.extension={type:ue.RendererSystem,name:"_multisample"};Se.add(gC);class ZN{constructor(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class yC{constructor(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);r.bindBuffer(e.type,i.buffer)}unbind(e){const{gl:r}=this;r.bindBuffer(e,null)}bindBufferBase(e,r){const{gl:n,CONTEXT_UID:i}=this;if(this.boundBufferBases[r]!==e){const s=e._glBuffers[i]||this.createGLBuffer(e);this.boundBufferBases[r]=e,n.bindBufferBase(n.UNIFORM_BUFFER,r,s.buffer)}}bindBufferRange(e,r,n){const{gl:i,CONTEXT_UID:s}=this;n=n||0;const o=e._glBuffers[s]||this.createGLBuffer(e);i.bindBufferRange(i.UNIFORM_BUFFER,r||0,o.buffer,n*256,256)}update(e){const{gl:r,CONTEXT_UID:n}=this,i=e._glBuffers[n]||this.createGLBuffer(e);if(e._updateID!==i.updateID)if(i.updateID=e._updateID,r.bindBuffer(e.type,i.buffer),i.byteLength>=e.data.byteLength)r.bufferSubData(e.type,0,e.data);else{const s=e.static?r.STATIC_DRAW:r.DYNAMIC_DRAW;i.byteLength=e.data.byteLength,r.bufferData(e.type,e.data,s)}}dispose(e,r){if(!this.managedBuffers[e.id])return;delete this.managedBuffers[e.id];const n=e._glBuffers[this.CONTEXT_UID],i=this.gl;e.disposeRunner.remove(this),n&&(r||i.deleteBuffer(n.buffer),delete e._glBuffers[this.CONTEXT_UID])}disposeAll(e){const r=Object.keys(this.managedBuffers);for(let n=0;n<r.length;n++)this.dispose(this.managedBuffers[r[n]],e)}createGLBuffer(e){const{CONTEXT_UID:r,gl:n}=this;return e._glBuffers[r]=new ZN(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[r]}}yC.extension={type:ue.RendererSystem,name:"buffer"};Se.add(yC);class vC{constructor(e){this.renderer=e}render(e,r){const n=this.renderer;let i,s,o,l;if(r&&(i=r.renderTexture,s=r.clear,o=r.transform,l=r.skipUpdateTransform),this.renderingToScreen=!i,n.runners.prerender.emit(),n.emit("prerender"),n.projection.transform=o,!n.context.isLost){if(i||(this.lastObjectRendered=e),!l){const h=e.enableTempParent();e.updateTransform(),e.disableTempParent(h)}n.renderTexture.bind(i),n.batch.currentRenderer.start(),(s??n.background.clearBeforeRender)&&n.renderTexture.clear(),e.render(n),n.batch.currentRenderer.flush(),i&&(r.blit&&n.framebuffer.blit(),i.baseTexture.update()),n.runners.postrender.emit(),n.projection.transform=null,n.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}vC.extension={type:ue.RendererSystem,name:"objectRenderer"};Se.add(vC);const Nd=class Cv extends WN{constructor(e){super(),this.type=eA.WEBGL,e=Object.assign({},pe.RENDER_OPTIONS,e),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new Kn({projectionMatrix:new ot},!0);const r={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:Cv.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(r),"useContextAlpha"in e&&(Ue("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),e.premultipliedAlpha=e.useContextAlpha&&e.useContextAlpha!=="notMultiplied",e.backgroundAlpha=e.useContextAlpha===!1?1:e.backgroundAlpha),this._plugin.rendererPlugins=Cv.__plugins,this.options=e,this.startup.run(this.options)}static test(e){return e!=null&&e.forceCanvas?!1:w4()}render(e,r){this.objectRenderer.render(e,r)}resize(e,r){this._view.resizeView(e,r)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(e=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:e}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(e){this._view.resolution=e,this.runners.resolutionChange.emit(e)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return Ue("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return Ue("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return Ue("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return Ue("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(e){Ue("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=e}get backgroundAlpha(){return Ue("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(e){Ue("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=e}get powerPreference(){return Ue("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(e,r){return this.textureGenerator.generateTexture(e,r)}};Nd.extension={type:ue.Renderer,priority:1},Nd.__plugins={},Nd.__systems={};let u_=Nd;Se.handleByMap(ue.RendererPlugin,u_.__plugins);Se.handleByMap(ue.RendererSystem,u_.__systems);Se.add(u_);class _C extends Ju{constructor(e,r){const{width:n,height:i}=r||{};super(n,i),this.items=[],this.itemDirtyIds=[];for(let s=0;s<e;s++){const o=new Ne;this.items.push(o),this.itemDirtyIds.push(-2)}this.length=e,this._load=null,this.baseTexture=null}initFromArray(e,r){for(let n=0;n<this.length;n++)e[n]&&(e[n].castToBaseTexture?this.addBaseTextureAt(e[n].castToBaseTexture(),n):e[n]instanceof Ju?this.addResourceAt(e[n],n):this.addResourceAt(LA(e[n],r),n))}dispose(){for(let e=0,r=this.length;e<r;e++)this.items[e].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(e,r){if(!this.items[r])throw new Error(`Index ${r} is out of bounds`);return e.valid&&!this.valid&&this.resize(e.width,e.height),this.items[r].setResource(e),this}bind(e){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=e,this.items[r].on("update",e.update,e)}unbind(e){super.unbind(e);for(let r=0;r<this.length;r++)this.items[r].parentTextureArray=null,this.items[r].off("update",e.update,e)}load(){if(this._load)return this._load;const e=this.items.map(r=>r.resource).filter(r=>r).map(r=>r.load());return this._load=Promise.all(e).then(()=>{const{realWidth:r,realHeight:n}=this.items[0];return this.resize(r,n),this.update(),Promise.resolve(this)}),this._load}}class JN extends _C{constructor(e,r){const{width:n,height:i}=r||{};let s,o;Array.isArray(e)?(s=e,o=e.length):o=e,super(o,{width:n,height:i}),s&&this.initFromArray(s,r)}addBaseTextureAt(e,r){if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(e){super.bind(e),e.target=Ja.TEXTURE_2D_ARRAY}upload(e,r,n){const{length:i,itemDirtyIds:s,items:o}=this,{gl:l}=e;n.dirtyId<0&&l.texImage3D(l.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,i,0,r.format,n.type,null);for(let h=0;h<i;h++){const c=o[h];s[h]<c.dirtyId&&(s[h]=c.dirtyId,c.valid&&l.texSubImage3D(l.TEXTURE_2D_ARRAY,0,0,0,h,c.resource.width,c.resource.height,1,r.format,n.type,c.resource.source))}return!0}}class eD extends as{constructor(e){super(e)}static test(e){const{OffscreenCanvas:r}=globalThis;return r&&e instanceof r?!0:globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement}}const xC=class cu extends _C{constructor(e,r){const{width:n,height:i,autoLoad:s,linkBaseTexture:o}=r||{};if(e&&e.length!==cu.SIDES)throw new Error(`Invalid length. Got ${e.length}, expected 6`);super(6,{width:n,height:i});for(let l=0;l<cu.SIDES;l++)this.items[l].target=Ja.TEXTURE_CUBE_MAP_POSITIVE_X+l;this.linkBaseTexture=o!==!1,e&&this.initFromArray(e,r),s!==!1&&this.load()}bind(e){super.bind(e),e.target=Ja.TEXTURE_CUBE_MAP}addBaseTextureAt(e,r,n){if(n===void 0&&(n=this.linkBaseTexture),!this.items[r])throw new Error(`Index ${r} is out of bounds`);if(!this.linkBaseTexture||e.parentTextureArray||Object.keys(e._glTextures).length>0)if(e.resource)this.addResourceAt(e.resource,r);else throw new Error("CubeResource does not support copying of renderTexture.");else e.target=Ja.TEXTURE_CUBE_MAP_POSITIVE_X+r,e.parentTextureArray=this.baseTexture,this.items[r]=e;return e.valid&&!this.valid&&this.resize(e.realWidth,e.realHeight),this.items[r]=e,this}upload(e,r,n){const i=this.itemDirtyIds;for(let s=0;s<cu.SIDES;s++){const o=this.items[s];(i[s]<o.dirtyId||n.dirtyId<r.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(e,o,n),i[s]=o.dirtyId):i[s]<-1&&(e.gl.texImage2D(o.target,0,n.internalFormat,r.realWidth,r.realHeight,0,r.format,n.type,null),i[s]=-1))}return!0}static test(e){return Array.isArray(e)&&e.length===cu.SIDES}};xC.SIDES=6;let tD=xC;class $a extends as{constructor(e,r){r=r||{};let n,i,s;typeof e=="string"?(n=$a.EMPTY,i=e,s=!0):(n=e,i=null,s=!1),super(n),this.url=i,this.crossOrigin=r.crossOrigin??!0,this.alphaMode=typeof r.alphaMode=="number"?r.alphaMode:null,this.ownsImageBitmap=r.ownsImageBitmap??s,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(e,r)=>{if(this.url===null){e(this);return}try{const n=await pe.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const i=await n.blob();if(this.destroyed)return;const s=await createImageBitmap(i,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Gr.UNPACK?"premultiply":"none"});if(this.destroyed){s.close();return}this.source=s,this.update(),e(this)}catch(n){if(this.destroyed)return;r(n),this.onError.emit(n)}}),this._load)}upload(e,r,n){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(r.alphaMode=this.alphaMode),super.upload(e,r,n)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(e){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof e=="string"||e instanceof ImageBitmap)}static get EMPTY(){return $a._EMPTY=$a._EMPTY??pe.ADAPTER.createCanvas(0,0),$a._EMPTY}}const Pv=class Dd extends as{constructor(e,r){r=r||{},super(pe.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=e,this.scale=r.scale||1,this._overrideWidth=r.width,this._overrideHeight=r.height,this._resolve=null,this._crossorigin=r.crossorigin,this._load=null,r.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(e=>{if(this._resolve=()=>{this.update(),e(this)},Dd.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const e=new Image;as.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=r=>{this._resolve&&(e.onerror=null,this.onError.emit(r))},e.onload=()=>{if(!this._resolve)return;const r=e.width,n=e.height;if(!r||!n)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let i=r*this.scale,s=n*this.scale;(this._overrideWidth||this._overrideHeight)&&(i=this._overrideWidth||this._overrideHeight/n*r,s=this._overrideHeight||this._overrideWidth/r*n),i=Math.round(i),s=Math.round(s);const o=this.source;o.width=i,o.height=s,o._pixiId=`canvas_${Xo()}`,o.getContext("2d").drawImage(e,0,0,r,n,0,0,i,s),this._resolve(),this._resolve=null}}static getSize(e){const r=Dd.SVG_SIZE.exec(e),n={};return r&&(n[r[1]]=Math.round(parseFloat(r[3])),n[r[5]]=Math.round(parseFloat(r[7]))),n}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(e,r){return r==="svg"||typeof e=="string"&&e.startsWith("data:image/svg+xml")||typeof e=="string"&&Dd.SVG_XML.test(e)}};Pv.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,Pv.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Iv=Pv;class rD extends as{constructor(e){super(e)}static test(e){return!!globalThis.VideoFrame&&e instanceof globalThis.VideoFrame}}const Rv=class Mv extends as{constructor(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){const n=document.createElement("video");r.autoLoad!==!1&&n.setAttribute("preload","auto"),r.playsinline!==!1&&(n.setAttribute("webkit-playsinline",""),n.setAttribute("playsinline","")),r.muted===!0&&(n.setAttribute("muted",""),n.muted=!0),r.loop===!0&&n.setAttribute("loop",""),r.autoPlay!==!1&&n.setAttribute("autoplay",""),typeof e=="string"&&(e=[e]);const i=e[0].src||e[0];as.crossOrigin(n,i,r.crossorigin);for(let s=0;s<e.length;++s){const o=document.createElement("source");let{src:l,mime:h}=e[s];if(l=l||e[s],l.startsWith("data:"))h=l.slice(5,l.indexOf(";"));else if(!l.startsWith("blob:")){const c=l.split("?").shift().toLowerCase(),f=c.slice(c.lastIndexOf(".")+1);h=h||Mv.MIME_TYPES[f]||`video/${f}`}o.src=l,h&&(o.type=h),n.appendChild(o)}e=n}super(e),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=r.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=r.autoPlay!==!1,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._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),r.autoLoad!==!1&&this.load()}update(e=0){if(!this.destroyed){if(this._updateFPS){const r=Qt.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-r)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const e=this.source;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._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((r,n)=>{this.valid?r(this):(this._resolve=r,this._reject=n,e.load())}),this._load}_onError(e){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.source;return!e.paused&&!e.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const r=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!r&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&e.play()}dispose(){this._configureAutoUpdate();const e=this.source;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._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.dispose()}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.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Qt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Qt.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Qt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e,r){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement||Mv.TYPES.includes(r)}};Rv.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Rv.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let wC=Rv;yv.push($a,XA,eD,wC,rD,Iv,ip,tD,JN);class Ef{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(e){return this.minX>this.maxX||this.minY>this.maxY?De.EMPTY:(e=e||new De(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)}addPoint(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)}addPointMatrix(e,r){const{a:n,b:i,c:s,d:o,tx:l,ty:h}=e,c=n*r.x+s*r.y+l,f=i*r.x+o*r.y+h;this.minX=Math.min(this.minX,c),this.maxX=Math.max(this.maxX,c),this.minY=Math.min(this.minY,f),this.maxY=Math.max(this.maxY,f)}addQuad(e){let r=this.minX,n=this.minY,i=this.maxX,s=this.maxY,o=e[0],l=e[1];r=o<r?o:r,n=l<n?l:n,i=o>i?o:i,s=l>s?l:s,o=e[2],l=e[3],r=o<r?o:r,n=l<n?l:n,i=o>i?o:i,s=l>s?l:s,o=e[4],l=e[5],r=o<r?o:r,n=l<n?l:n,i=o>i?o:i,s=l>s?l:s,o=e[6],l=e[7],r=o<r?o:r,n=l<n?l:n,i=o>i?o:i,s=l>s?l:s,this.minX=r,this.minY=n,this.maxX=i,this.maxY=s}addFrame(e,r,n,i,s){this.addFrameMatrix(e.worldTransform,r,n,i,s)}addFrameMatrix(e,r,n,i,s){const o=e.a,l=e.b,h=e.c,c=e.d,f=e.tx,m=e.ty;let p=this.minX,v=this.minY,_=this.maxX,E=this.maxY,A=o*r+h*n+f,S=l*r+c*n+m;p=A<p?A:p,v=S<v?S:v,_=A>_?A:_,E=S>E?S:E,A=o*i+h*n+f,S=l*i+c*n+m,p=A<p?A:p,v=S<v?S:v,_=A>_?A:_,E=S>E?S:E,A=o*r+h*s+f,S=l*r+c*s+m,p=A<p?A:p,v=S<v?S:v,_=A>_?A:_,E=S>E?S:E,A=o*i+h*s+f,S=l*i+c*s+m,p=A<p?A:p,v=S<v?S:v,_=A>_?A:_,E=S>E?S:E,this.minX=p,this.minY=v,this.maxX=_,this.maxY=E}addVertexData(e,r,n){let i=this.minX,s=this.minY,o=this.maxX,l=this.maxY;for(let h=r;h<n;h+=2){const c=e[h],f=e[h+1];i=c<i?c:i,s=f<s?f:s,o=c>o?c:o,l=f>l?f:l}this.minX=i,this.minY=s,this.maxX=o,this.maxY=l}addVertices(e,r,n,i){this.addVerticesMatrix(e.worldTransform,r,n,i)}addVerticesMatrix(e,r,n,i,s=0,o=s){const l=e.a,h=e.b,c=e.c,f=e.d,m=e.tx,p=e.ty;let v=this.minX,_=this.minY,E=this.maxX,A=this.maxY;for(let S=n;S<i;S+=2){const b=r[S],w=r[S+1],T=l*b+c*w+m,R=f*w+h*b+p;v=Math.min(v,T-s),E=Math.max(E,T+s),_=Math.min(_,R-o),A=Math.max(A,R+o)}this.minX=v,this.minY=_,this.maxX=E,this.maxY=A}addBounds(e){const r=this.minX,n=this.minY,i=this.maxX,s=this.maxY;this.minX=e.minX<r?e.minX:r,this.minY=e.minY<n?e.minY:n,this.maxX=e.maxX>i?e.maxX:i,this.maxY=e.maxY>s?e.maxY:s}addBoundsMask(e,r){const n=e.minX>r.minX?e.minX:r.minX,i=e.minY>r.minY?e.minY:r.minY,s=e.maxX<r.maxX?e.maxX:r.maxX,o=e.maxY<r.maxY?e.maxY:r.maxY;if(n<=s&&i<=o){const l=this.minX,h=this.minY,c=this.maxX,f=this.maxY;this.minX=n<l?n:l,this.minY=i<h?i:h,this.maxX=s>c?s:c,this.maxY=o>f?o:f}}addBoundsMatrix(e,r){this.addFrameMatrix(r,e.minX,e.minY,e.maxX,e.maxY)}addBoundsArea(e,r){const n=e.minX>r.x?e.minX:r.x,i=e.minY>r.y?e.minY:r.y,s=e.maxX<r.x+r.width?e.maxX:r.x+r.width,o=e.maxY<r.y+r.height?e.maxY:r.y+r.height;if(n<=s&&i<=o){const l=this.minX,h=this.minY,c=this.maxX,f=this.maxY;this.minX=n<l?n:l,this.minY=i<h?i:h,this.maxX=s>c?s:c,this.maxY=o>f?o:f}}pad(e=0,r=e){this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=r,this.maxY+=r)}addFramePad(e,r,n,i,s,o){e-=s,r-=o,n+=s,i+=o,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>n?this.maxX:n,this.minY=this.minY<r?this.minY:r,this.maxY=this.maxY>i?this.maxY:i}}class ft extends hh{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new lp,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Ef,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(e){const r=Object.keys(e);for(let n=0;n<r.length;++n){const i=r[n];Object.defineProperty(ft.prototype,i,Object.getOwnPropertyDescriptor(e,i))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(e,r){return e||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),r||(this._boundsRect||(this._boundsRect=new De),r=this._boundsRect),this._bounds.getRectangle(r)}getLocalBounds(e){e||(this._localBoundsRect||(this._localBoundsRect=new De),e=this._localBoundsRect),this._localBounds||(this._localBounds=new Ef);const r=this.transform,n=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(n==null?void 0:n.worldAlpha)??1,this.transform=this._tempDisplayObjectParent.transform;const i=this._bounds,s=this._boundsID;this._bounds=this._localBounds;const o=this.getBounds(!1,e);return this.parent=n,this.transform=r,this._bounds=i,this._bounds.updateID+=this._boundsID-s,o}toGlobal(e,r,n=!1){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(e,r)}toLocal(e,r,n,i){return r&&(e=r.toGlobal(e,n,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(e,n)}setParent(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e}removeFromParent(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e=0,r=0,n=1,i=1,s=0,o=0,l=0,h=0,c=0){return this.position.x=e,this.position.y=r,this.scale.x=n||1,this.scale.y=i||1,this.rotation=s,this.skew.x=o,this.skew.y=l,this.pivot.x=h,this.pivot.y=c,this}destroy(e){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new nD),this.tempDisplayObjectParent}enableTempParent(){const e=this.parent;return this.parent=this._tempDisplayObjectParent,e}disableTempParent(e){this.parent=e}get x(){return this.position.x}set x(e){this.transform.position.x=e}get y(){return this.position.y}set y(e){this.transform.position.y=e}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(e){this.transform.position.copyFrom(e)}get scale(){return this.transform.scale}set scale(e){this.transform.scale.copyFrom(e)}get pivot(){return this.transform.pivot}set pivot(e){this.transform.pivot.copyFrom(e)}get skew(){return this.transform.skew}set skew(e){this.transform.skew.copyFrom(e)}get rotation(){return this.transform.rotation}set rotation(e){this.transform.rotation=e}get angle(){return this.transform.rotation*Q4}set angle(e){this.transform.rotation=e*K4}get zIndex(){return this._zIndex}set zIndex(e){this._zIndex!==e&&(this._zIndex=e,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}get mask(){return this._mask}set mask(e){if(this._mask!==e){if(this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount--,r._maskRefCount===0&&(r.renderable=!0,r.isMask=!1))}if(this._mask=e,this._mask){const r=this._mask.isMaskData?this._mask.maskObject:this._mask;r&&(r._maskRefCount===0&&(r.renderable=!1,r.isMask=!0),r._maskRefCount++)}}}}class nD extends ft{constructor(){super(...arguments),this.sortDirty=null}}ft.prototype.displayObjectUpdateTransform=ft.prototype.updateTransform;const iD=new ot;function sD(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}const EC=class kv extends ft{constructor(){super(),this.children=[],this.sortableChildren=kv.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(e){}addChild(...e){if(e.length>1)for(let r=0;r<e.length;r++)this.addChild(e[r]);else{const r=e[0];r.parent&&r.parent.removeChild(r),r.parent=this,this.sortDirty=!0,r.transform._parentID=-1,this.children.push(r),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",r,this,this.children.length-1),r.emit("added",this)}return e[0]}addChildAt(e,r){if(r<0||r>this.children.length)throw new Error(`${e}addChildAt: The index ${r} supplied is out of bounds ${this.children.length}`);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(r,0,e),this._boundsID++,this.onChildrenChange(r),e.emit("added",this),this.emit("childAdded",e,this,r),e}swapChildren(e,r){if(e===r)return;const n=this.getChildIndex(e),i=this.getChildIndex(r);this.children[n]=r,this.children[i]=e,this.onChildrenChange(n<i?n:i)}getChildIndex(e){const r=this.children.indexOf(e);if(r===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return r}setChildIndex(e,r){if(r<0||r>=this.children.length)throw new Error(`The index ${r} supplied is out of bounds ${this.children.length}`);const n=this.getChildIndex(e);rl(this.children,n,1),this.children.splice(r,0,e),this.onChildrenChange(r)}getChildAt(e){if(e<0||e>=this.children.length)throw new Error(`getChildAt: Index (${e}) does not exist.`);return this.children[e]}removeChild(...e){if(e.length>1)for(let r=0;r<e.length;r++)this.removeChild(e[r]);else{const r=e[0],n=this.children.indexOf(r);if(n===-1)return null;r.parent=null,r.transform._parentID=-1,rl(this.children,n,1),this._boundsID++,this.onChildrenChange(n),r.emit("removed",this),this.emit("childRemoved",r,this,n)}return e[0]}removeChildAt(e){const r=this.getChildAt(e);return r.parent=null,r.transform._parentID=-1,rl(this.children,e,1),this._boundsID++,this.onChildrenChange(e),r.emit("removed",this),this.emit("childRemoved",r,this,e),r}removeChildren(e=0,r=this.children.length){const n=e,i=r,s=i-n;let o;if(s>0&&s<=i){o=this.children.splice(n,s);for(let l=0;l<o.length;++l)o[l].parent=null,o[l].transform&&(o[l].transform._parentID=-1);this._boundsID++,this.onChildrenChange(e);for(let l=0;l<o.length;++l)o[l].emit("removed",this),this.emit("childRemoved",o[l],this,l);return o}else if(s===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let e=!1;for(let r=0,n=this.children.length;r<n;++r){const i=this.children[r];i._lastSortedIndex=r,!e&&i.zIndex!==0&&(e=!0)}e&&this.children.length>1&&this.children.sort(sD),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let e=0,r=this.children.length;e<r;++e){const n=this.children[e];n.visible&&n.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let e=0;e<this.children.length;e++){const r=this.children[e];if(!(!r.visible||!r.renderable))if(r.calculateBounds(),r._mask){const n=r._mask.isMaskData?r._mask.maskObject:r._mask;n?(n.calculateBounds(),this._bounds.addBoundsMask(r._bounds,n._bounds)):this._bounds.addBounds(r._bounds)}else r.filterArea?this._bounds.addBoundsArea(r._bounds,r.filterArea):this._bounds.addBounds(r._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(e,r=!1){const n=super.getLocalBounds(e);if(!r)for(let i=0,s=this.children.length;i<s;++i){const o=this.children[i];o.visible&&o.updateTransform()}return n}_calculateBounds(){}_renderWithCulling(e){const r=e.renderTexture.sourceFrame;if(!(r.width>0&&r.height>0))return;let n,i;this.cullArea?(n=this.cullArea,i=this.worldTransform):this._render!==kv.prototype._render&&(n=this.getBounds(!0));const s=e.projection.transform;if(s&&(i?(i=iD.copyFrom(i),i.prepend(s)):i=s),n&&r.intersects(n,i))this._render(e);else if(this.cullArea)return;for(let o=0,l=this.children.length;o<l;++o){const h=this.children[o],c=h.cullable;h.cullable=c||!this.cullArea,h.render(e),h.cullable=c}}render(e){var r;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(r=this.filters)!=null&&r.length)this.renderAdvanced(e);else if(this.cullable)this._renderWithCulling(e);else{this._render(e);for(let n=0,i=this.children.length;n<i;++n)this.children[n].render(e)}}renderAdvanced(e){var s,o,l;const r=this.filters,n=this._mask;if(r){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let h=0;h<r.length;h++)r[h].enabled&&this._enabledFilters.push(r[h])}const i=r&&((s=this._enabledFilters)==null?void 0:s.length)||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==Ft.NONE));if(i&&e.batch.flush(),r&&((o=this._enabledFilters)!=null&&o.length)&&e.filter.push(this,this._enabledFilters),n&&e.mask.push(this,this._mask),this.cullable)this._renderWithCulling(e);else{this._render(e);for(let h=0,c=this.children.length;h<c;++h)this.children[h].render(e)}i&&e.batch.flush(),n&&e.mask.pop(this),r&&((l=this._enabledFilters)!=null&&l.length)&&e.filter.pop()}_render(e){}destroy(e){super.destroy(),this.sortDirty=!1;const r=typeof e=="boolean"?e:e==null?void 0:e.children,n=this.removeChildren(0,this.children.length);if(r)for(let i=0;i<n.length;++i)n[i].destroy(e)}get width(){return this.scale.x*this.getLocalBounds().width}set width(e){const r=this.getLocalBounds().width;r!==0?this.scale.x=e/r:this.scale.x=1,this._width=e}get height(){return this.scale.y*this.getLocalBounds().height}set height(e){const r=this.getLocalBounds().height;r!==0?this.scale.y=e/r:this.scale.y=1,this._height=e}};EC.defaultSortableChildren=!1;let Pr=EC;Pr.prototype.containerUpdateTransform=Pr.prototype.updateTransform;Object.defineProperties(pe,{SORTABLE_CHILDREN:{get(){return Pr.defaultSortableChildren},set(t){Ue("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Pr.defaultSortableChildren=t}}});var hp=(t=>(t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",t))(hp||{});const ru=new Ge,oD=new Uint16Array([0,1,2,0,2,3]);class Di extends Pr{constructor(e){super(),this._anchor=new bi(this._onAnchorUpdate,this,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new rt(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=Me.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=e||oe.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=oD,this.pluginName="batch",this.isSprite=!0,this._roundPixels=pe.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Us(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Us(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const e=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===e._updateID)return;this._textureID!==e._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=e._updateID;const r=this.transform.worldTransform,n=r.a,i=r.b,s=r.c,o=r.d,l=r.tx,h=r.ty,c=this.vertexData,f=e.trim,m=e.orig,p=this._anchor;let v=0,_=0,E=0,A=0;if(f?(_=f.x-p._x*m.width,v=_+f.width,A=f.y-p._y*m.height,E=A+f.height):(_=-p._x*m.width,v=_+m.width,A=-p._y*m.height,E=A+m.height),c[0]=n*_+s*A+l,c[1]=o*A+i*_+h,c[2]=n*v+s*A+l,c[3]=o*A+i*v+h,c[4]=n*v+s*E+l,c[5]=o*E+i*v+h,c[6]=n*_+s*E+l,c[7]=o*E+i*_+h,this._roundPixels){const S=pe.RESOLUTION;for(let b=0;b<c.length;++b)c[b]=Math.round(c[b]*S)/S}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const e=this._texture,r=this.vertexTrimmedData,n=e.orig,i=this._anchor,s=this.transform.worldTransform,o=s.a,l=s.b,h=s.c,c=s.d,f=s.tx,m=s.ty,p=-i._x*n.width,v=p+n.width,_=-i._y*n.height,E=_+n.height;if(r[0]=o*p+h*_+f,r[1]=c*_+l*p+m,r[2]=o*v+h*_+f,r[3]=c*_+l*v+m,r[4]=o*v+h*E+f,r[5]=c*E+l*v+m,r[6]=o*p+h*E+f,r[7]=c*E+l*p+m,this._roundPixels){const A=pe.RESOLUTION;for(let S=0;S<r.length;++S)r[S]=Math.round(r[S]*A)/A}}_render(e){this.calculateVertices(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this)}_calculateBounds(){const e=this._texture.trim,r=this._texture.orig;!e||e.width===r.width&&e.height===r.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(e){return this.children.length===0?(this._localBounds||(this._localBounds=new Ef),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new De),e=this._localBoundsRect),this._localBounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,ru);const r=this._texture.orig.width,n=this._texture.orig.height,i=-r*this.anchor.x;let s=0;return ru.x>=i&&ru.x<i+r&&(s=-n*this.anchor.y,ru.y>=s&&ru.y<s+n)}destroy(e){if(super.destroy(e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof e=="boolean"?e:e==null?void 0:e.texture){const r=typeof e=="boolean"?e:e==null?void 0:e.baseTexture;this._texture.destroy(!!r)}this._texture=null}static from(e,r){const n=e instanceof oe?e:oe.from(e,r);return new Di(n)}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){const r=Us(this.scale.x)||1;this.scale.x=r*e/this._texture.orig.width,this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){const r=Us(this.scale.y)||1;this.scale.y=r*e/this._texture.orig.height,this._height=e}get anchor(){return this._anchor}set anchor(e){this._anchor.copyFrom(e)}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||oe.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}const Qc={willReadFrequently:!0},pi=class Te{static get experimentalLetterSpacingSupported(){let e=Te._experimentalLetterSpacingSupported;if(e!==void 0){const r=pe.ADAPTER.getCanvasRenderingContext2D().prototype;e=Te._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(e,r,n,i,s,o,l,h,c){this.text=e,this.style=r,this.width=n,this.height=i,this.lines=s,this.lineWidths=o,this.lineHeight=l,this.maxLineWidth=h,this.fontProperties=c}static measureText(e,r,n,i=Te._canvas){n=n??r.wordWrap;const s=r.toFontString(),o=Te.measureFont(s);o.fontSize===0&&(o.fontSize=r.fontSize,o.ascent=r.fontSize);const l=i.getContext("2d",Qc);l.font=s;const h=(n?Te.wordWrap(e,r,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(h.length);let f=0;for(let _=0;_<h.length;_++){const E=Te._measureText(h[_],r.letterSpacing,l);c[_]=E,f=Math.max(f,E)}let m=f+r.strokeThickness;r.dropShadow&&(m+=r.dropShadowDistance);const p=r.lineHeight||o.fontSize+r.strokeThickness;let v=Math.max(p,o.fontSize+r.strokeThickness*2)+r.leading+(h.length-1)*(p+r.leading);return r.dropShadow&&(v+=r.dropShadowDistance),new Te(e,r,m,v,h,c,p+r.leading,f,o)}static _measureText(e,r,n){let i=!1;Te.experimentalLetterSpacingSupported&&(Te.experimentalLetterSpacing?(n.letterSpacing=`${r}px`,n.textLetterSpacing=`${r}px`,i=!0):(n.letterSpacing="0px",n.textLetterSpacing="0px"));let s=n.measureText(e).width;return s>0&&(i?s-=r:s+=(Te.graphemeSegmenter(e).length-1)*r),s}static wordWrap(e,r,n=Te._canvas){const i=n.getContext("2d",Qc);let s=0,o="",l="";const h=Object.create(null),{letterSpacing:c,whiteSpace:f}=r,m=Te.collapseSpaces(f),p=Te.collapseNewlines(f);let v=!m;const _=r.wordWrapWidth+c,E=Te.tokenize(e);for(let A=0;A<E.length;A++){let S=E[A];if(Te.isNewline(S)){if(!p){l+=Te.addLine(o),v=!m,o="",s=0;continue}S=" "}if(m){const w=Te.isBreakingSpace(S),T=Te.isBreakingSpace(o[o.length-1]);if(w&&T)continue}const b=Te.getFromCache(S,c,h,i);if(b>_)if(o!==""&&(l+=Te.addLine(o),o="",s=0),Te.canBreakWords(S,r.breakWords)){const w=Te.wordWrapSplit(S);for(let T=0;T<w.length;T++){let R=w[T],L=R,D=1;for(;w[T+D];){const Y=w[T+D];if(!Te.canBreakChars(L,Y,S,T,r.breakWords))R+=Y;else break;L=Y,D++}T+=D-1;const M=Te.getFromCache(R,c,h,i);M+s>_&&(l+=Te.addLine(o),v=!1,o="",s=0),o+=R,s+=M}}else{o.length>0&&(l+=Te.addLine(o),o="",s=0);const w=A===E.length-1;l+=Te.addLine(S,!w),v=!1,o="",s=0}else b+s>_&&(v=!1,l+=Te.addLine(o),o="",s=0),(o.length>0||!Te.isBreakingSpace(S)||v)&&(o+=S,s+=b)}return l+=Te.addLine(o,!1),l}static addLine(e,r=!0){return e=Te.trimRight(e),e=r?`${e}
566
+ `:e,e}static getFromCache(e,r,n,i){let s=n[e];return typeof s!="number"&&(s=Te._measureText(e,r,i)+r,n[e]=s),s}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 r=e.length-1;r>=0;r--){const n=e[r];if(!Te.isBreakingSpace(n))break;e=e.slice(0,-1)}return e}static isNewline(e){return typeof e!="string"?!1:Te._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,r){return typeof e!="string"?!1:Te._breakingSpaces.includes(e.charCodeAt(0))}static tokenize(e){const r=[];let n="";if(typeof e!="string")return r;for(let i=0;i<e.length;i++){const s=e[i],o=e[i+1];if(Te.isBreakingSpace(s,o)||Te.isNewline(s)){n!==""&&(r.push(n),n=""),r.push(s);continue}n+=s}return n!==""&&r.push(n),r}static canBreakWords(e,r){return r}static canBreakChars(e,r,n,i,s){return!0}static wordWrapSplit(e){return Te.graphemeSegmenter(e)}static measureFont(e){if(Te._fonts[e])return Te._fonts[e];const r={ascent:0,descent:0,fontSize:0},n=Te._canvas,i=Te._context;i.font=e;const s=Te.METRICS_STRING+Te.BASELINE_SYMBOL,o=Math.ceil(i.measureText(s).width);let l=Math.ceil(i.measureText(Te.BASELINE_SYMBOL).width);const h=Math.ceil(Te.HEIGHT_MULTIPLIER*l);if(l=l*Te.BASELINE_MULTIPLIER|0,o===0||h===0)return Te._fonts[e]=r,r;n.width=o,n.height=h,i.fillStyle="#f00",i.fillRect(0,0,o,h),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(s,0,l);const c=i.getImageData(0,0,o,h).data,f=c.length,m=o*4;let p=0,v=0,_=!1;for(p=0;p<l;++p){for(let E=0;E<m;E+=4)if(c[v+E]!==255){_=!0;break}if(!_)v+=m;else break}for(r.ascent=l-p,v=f-m,_=!1,p=h;p>l;--p){for(let E=0;E<m;E+=4)if(c[v+E]!==255){_=!0;break}if(!_)v-=m;else break}return r.descent=p-l,r.fontSize=r.ascent+r.descent,Te._fonts[e]=r,r}static clearMetrics(e=""){e?delete Te._fonts[e]:Te._fonts={}}static get _canvas(){var e;if(!Te.__canvas){let r;try{const n=new OffscreenCanvas(0,0);if((e=n.getContext("2d",Qc))!=null&&e.measureText)return Te.__canvas=n,n;r=pe.ADAPTER.createCanvas()}catch{r=pe.ADAPTER.createCanvas()}r.width=r.height=10,Te.__canvas=r}return Te.__canvas}static get _context(){return Te.__context||(Te.__context=Te._canvas.getContext("2d",Qc)),Te.__context}};pi.METRICS_STRING="|ÉqÅ",pi.BASELINE_SYMBOL="M",pi.BASELINE_MULTIPLIER=1.4,pi.HEIGHT_MULTIPLIER=2,pi.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const t=new Intl.Segmenter;return e=>[...t.segment(e)].map(r=>r.segment)}return t=>[...t]})(),pi.experimentalLetterSpacing=!1,pi._fonts={},pi._newlines=[10,13],pi._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let wn=pi;const aD=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],SC=class du{constructor(e){this.styleID=0,this.reset(),Hg(this,e,e)}clone(){const e={};return Hg(e,this,du.defaultStyle),new du(e)}reset(){Hg(this,du.defaultStyle,du.defaultStyle)}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(e){const r=Gg(e);this._dropShadowColor!==r&&(this._dropShadowColor=r,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)}get fill(){return this._fill}set fill(e){const r=Gg(e);this._fill!==r&&(this._fill=r,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(e){lD(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.styleID++)}get stroke(){return this._stroke}set stroke(e){const r=Gg(e);this._stroke!==r&&(this._stroke=r,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)}toFontString(){const e=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let r=this.fontFamily;Array.isArray(this.fontFamily)||(r=this.fontFamily.split(","));for(let n=r.length-1;n>=0;n--){let i=r[n].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!aD.includes(i)&&(i=`"${i}"`),r[n]=i}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${e} ${r.join(",")}`}};SC.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:hp.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Ur=SC;function Gg(t){const e=rt.shared,r=n=>{const i=e.setValue(n);return i.alpha===1?i.toHex():i.toRgbaString()};return Array.isArray(t)?t.map(r):r(t)}function lD(t,e){if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}function Hg(t,e,r){for(const n in r)Array.isArray(e[n])?t[n]=e[n].slice():t[n]=e[n]}const uD={texture:!0,children:!1,baseTexture:!0},bC=class Nv extends Di{constructor(e,r,n){let i=!1;n||(n=pe.ADAPTER.createCanvas(),i=!0),n.width=3,n.height=3;const s=oe.from(n);s.orig=new De,s.trim=new De,super(s),this._ownCanvas=i,this.canvas=n,this.context=n.getContext("2d",{willReadFrequently:!0}),this._resolution=Nv.defaultResolution??pe.RESOLUTION,this._autoResolution=Nv.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=e,this.style=r,this.localStyleID=-1}static get experimentalLetterSpacing(){return wn.experimentalLetterSpacing}static set experimentalLetterSpacing(e){Ue("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),wn.experimentalLetterSpacing=e}updateText(e){const r=this._style;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;this._font=this._style.toFontString();const n=this.context,i=wn.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),s=i.width,o=i.height,l=i.lines,h=i.lineHeight,c=i.lineWidths,f=i.maxLineWidth,m=i.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,s)+r.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+r.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=r.strokeThickness,n.textBaseline=r.textBaseline,n.lineJoin=r.lineJoin,n.miterLimit=r.miterLimit;let p,v;const _=r.dropShadow?2:1;for(let E=0;E<_;++E){const A=r.dropShadow&&E===0,S=A?Math.ceil(Math.max(1,o)+r.padding*2):0,b=S*this._resolution;if(A){n.fillStyle="black",n.strokeStyle="black";const T=r.dropShadowColor,R=r.dropShadowBlur*this._resolution,L=r.dropShadowDistance*this._resolution;n.shadowColor=rt.shared.setValue(T).setAlpha(r.dropShadowAlpha).toRgbaString(),n.shadowBlur=R,n.shadowOffsetX=Math.cos(r.dropShadowAngle)*L,n.shadowOffsetY=Math.sin(r.dropShadowAngle)*L+b}else n.fillStyle=this._generateFillStyle(r,l,i),n.strokeStyle=r.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;let w=(h-m.fontSize)/2;h-m.fontSize<0&&(w=0);for(let T=0;T<l.length;T++)p=r.strokeThickness/2,v=r.strokeThickness/2+T*h+m.ascent+w,r.align==="right"?p+=f-c[T]:r.align==="center"&&(p+=(f-c[T])/2),r.stroke&&r.strokeThickness&&this.drawLetterSpacing(l[T],p+r.padding,v+r.padding-S,!0),r.fill&&this.drawLetterSpacing(l[T],p+r.padding,v+r.padding-S)}this.updateTexture()}drawLetterSpacing(e,r,n,i=!1){const s=this._style.letterSpacing;let o=!1;if(wn.experimentalLetterSpacingSupported&&(wn.experimentalLetterSpacing?(this.context.letterSpacing=`${s}px`,this.context.textLetterSpacing=`${s}px`,o=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),s===0||o){i?this.context.strokeText(e,r,n):this.context.fillText(e,r,n);return}let l=r;const h=wn.graphemeSegmenter(e);let c=this.context.measureText(e).width,f=0;for(let m=0;m<h.length;++m){const p=h[m];i?this.context.strokeText(p,l,n):this.context.fillText(p,l,n);let v="";for(let _=m+1;_<h.length;++_)v+=h[_];f=this.context.measureText(v).width,l+=c-f+s,c=f}}updateTexture(){const e=this.canvas;if(this._style.trim){const o=L4(e);o.data&&(e.width=o.width,e.height=o.height,this.context.putImageData(o.data,0,0))}const r=this._texture,n=this._style,i=n.trim?0:n.padding,s=r.baseTexture;r.trim.width=r._frame.width=e.width/this._resolution,r.trim.height=r._frame.height=e.height/this._resolution,r.trim.x=-i,r.trim.y=-i,r.orig.width=r._frame.width-i*2,r.orig.height=r._frame.height-i*2,this._onTextureUpdate(),s.setRealSize(e.width,e.height,this._resolution),r.updateUvs(),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(e,r){return this.updateText(!0),this._textureID===-1&&(e=!1),super.getBounds(e,r)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds.call(this,e)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(e,r,n){const i=e.fill;if(Array.isArray(i)){if(i.length===1)return i[0]}else return i;let s;const o=e.dropShadow?e.dropShadowDistance:0,l=e.padding||0,h=this.canvas.width/this._resolution-o-l*2,c=this.canvas.height/this._resolution-o-l*2,f=i.slice(),m=e.fillGradientStops.slice();if(!m.length){const p=f.length+1;for(let v=1;v<p;++v)m.push(v/p)}if(f.unshift(i[0]),m.unshift(0),f.push(i[i.length-1]),m.push(1),e.fillGradientType===hp.LINEAR_VERTICAL){s=this.context.createLinearGradient(h/2,l,h/2,c+l);const p=n.fontProperties.fontSize+e.strokeThickness;for(let v=0;v<r.length;v++){const _=n.lineHeight*(v-1)+p,E=n.lineHeight*v;let A=E;v>0&&_>E&&(A=(E+_)/2);const S=E+p,b=n.lineHeight*(v+1);let w=S;v+1<r.length&&b<S&&(w=(S+b)/2);const T=(w-A)/c;for(let R=0;R<f.length;R++){let L=0;typeof m[R]=="number"?L=m[R]:L=R/f.length;let D=Math.min(1,Math.max(0,A/c+L*T));D=Number(D.toFixed(5)),s.addColorStop(D,f[R])}}}else{s=this.context.createLinearGradient(l,c/2,h+l,c/2);const p=f.length+1;let v=1;for(let _=0;_<f.length;_++){let E;typeof m[_]=="number"?E=m[_]:E=v/p,s.addColorStop(E,f[_]),v++}}return s}destroy(e){typeof e=="boolean"&&(e={children:e}),e=Object.assign({},uD,e),super.destroy(e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this.updateText(!0);const r=Us(this.scale.x)||1;this.scale.x=r*e/this._texture.orig.width,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this.updateText(!0);const r=Us(this.scale.y)||1;this.scale.y=r*e/this._texture.orig.height,this._height=e}get style(){return this._style}set style(e){e=e||{},e instanceof Ur?this._style=e:this._style=new Ur(e),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}};bC.defaultAutoResolution=!0;let h_=bC;class Sf{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Od{static test(e){return typeof e=="string"&&e.startsWith("info face=")}static parse(e){const r=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const s in r){const o=r[s].match(/^[a-z]+/gm)[0],l=r[s].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const c in l){const f=l[c].split("="),m=f[0],p=f[1].replace(/"/gm,""),v=parseFloat(p),_=isNaN(v)?p:v;h[m]=_}n[o].push(h)}const i=new Sf;return n.info.forEach(s=>i.info.push({face:s.face,size:parseInt(s.size,10)})),n.common.forEach(s=>i.common.push({lineHeight:parseInt(s.lineHeight,10)})),n.page.forEach(s=>i.page.push({id:parseInt(s.id,10),file:s.file})),n.char.forEach(s=>i.char.push({id:parseInt(s.id,10),page:parseInt(s.page,10),x:parseInt(s.x,10),y:parseInt(s.y,10),width:parseInt(s.width,10),height:parseInt(s.height,10),xoffset:parseInt(s.xoffset,10),yoffset:parseInt(s.yoffset,10),xadvance:parseInt(s.xadvance,10)})),n.kerning.forEach(s=>i.kerning.push({first:parseInt(s.first,10),second:parseInt(s.second,10),amount:parseInt(s.amount,10)})),n.distanceField.forEach(s=>i.distanceField.push({distanceRange:parseInt(s.distanceRange,10),fieldType:s.fieldType})),i}}class Dv{static test(e){const r=e;return typeof e!="string"&&"getElementsByTagName"in e&&r.getElementsByTagName("page").length&&r.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(e){const r=new Sf,n=e.getElementsByTagName("info"),i=e.getElementsByTagName("common"),s=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),l=e.getElementsByTagName("kerning"),h=e.getElementsByTagName("distanceField");for(let c=0;c<n.length;c++)r.info.push({face:n[c].getAttribute("face"),size:parseInt(n[c].getAttribute("size"),10)});for(let c=0;c<i.length;c++)r.common.push({lineHeight:parseInt(i[c].getAttribute("lineHeight"),10)});for(let c=0;c<s.length;c++)r.page.push({id:parseInt(s[c].getAttribute("id"),10)||0,file:s[c].getAttribute("file")});for(let c=0;c<o.length;c++){const f=o[c];r.char.push({id:parseInt(f.getAttribute("id"),10),page:parseInt(f.getAttribute("page"),10)||0,x:parseInt(f.getAttribute("x"),10),y:parseInt(f.getAttribute("y"),10),width:parseInt(f.getAttribute("width"),10),height:parseInt(f.getAttribute("height"),10),xoffset:parseInt(f.getAttribute("xoffset"),10),yoffset:parseInt(f.getAttribute("yoffset"),10),xadvance:parseInt(f.getAttribute("xadvance"),10)})}for(let c=0;c<l.length;c++)r.kerning.push({first:parseInt(l[c].getAttribute("first"),10),second:parseInt(l[c].getAttribute("second"),10),amount:parseInt(l[c].getAttribute("amount"),10)});for(let c=0;c<h.length;c++)r.distanceField.push({fieldType:h[c].getAttribute("fieldType"),distanceRange:parseInt(h[c].getAttribute("distanceRange"),10)});return r}}class Ov{static test(e){return typeof e=="string"&&e.includes("<font>")?Dv.test(pe.ADAPTER.parseXML(e)):!1}static parse(e){return Dv.parse(pe.ADAPTER.parseXML(e))}}const jg=[Od,Dv,Ov];function hD(t){for(let e=0;e<jg.length;e++)if(jg[e].test(t))return jg[e];return null}function cD(t,e,r,n,i,s){const o=r.fill;if(Array.isArray(o)){if(o.length===1)return o[0]}else return o;let l;const h=r.dropShadow?r.dropShadowDistance:0,c=r.padding||0,f=t.width/n-h-c*2,m=t.height/n-h-c*2,p=o.slice(),v=r.fillGradientStops.slice();if(!v.length){const _=p.length+1;for(let E=1;E<_;++E)v.push(E/_)}if(p.unshift(o[0]),v.unshift(0),p.push(o[o.length-1]),v.push(1),r.fillGradientType===hp.LINEAR_VERTICAL){l=e.createLinearGradient(f/2,c,f/2,m+c);let _=0;const E=(s.fontProperties.fontSize+r.strokeThickness)/m;for(let A=0;A<i.length;A++){const S=s.lineHeight*A;for(let b=0;b<p.length;b++){let w=0;typeof v[b]=="number"?w=v[b]:w=b/p.length;const T=S/m+w*E;let R=Math.max(_,T);R=Math.min(R,1),l.addColorStop(R,p[b]),_=R}}}else{l=e.createLinearGradient(c,m/2,f+c,m/2);const _=p.length+1;let E=1;for(let A=0;A<p.length;A++){let S;typeof v[A]=="number"?S=v[A]:S=E/_,l.addColorStop(S,p[A]),E++}}return l}function dD(t,e,r,n,i,s,o){const l=r.text,h=r.fontProperties;e.translate(n,i),e.scale(s,s);const c=o.strokeThickness/2,f=-(o.strokeThickness/2);if(e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=cD(t,e,o,s,[l],r),e.strokeStyle=o.stroke,o.dropShadow){const m=o.dropShadowColor,p=o.dropShadowBlur*s,v=o.dropShadowDistance*s;e.shadowColor=rt.shared.setValue(m).setAlpha(o.dropShadowAlpha).toRgbaString(),e.shadowBlur=p,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*v,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*v}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;o.stroke&&o.strokeThickness&&e.strokeText(l,c,f+r.lineHeight-h.descent),o.fill&&e.fillText(l,c,f+r.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Fd(t){return t.codePointAt?t.codePointAt(0):t.charCodeAt(0)}function TC(t){return Array.from?Array.from(t):t.split("")}function fD(t){typeof t=="string"&&(t=[t]);const e=[];for(let r=0,n=t.length;r<n;r++){const i=t[r];if(Array.isArray(i)){if(i.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${i.length}.`);const s=i[0].charCodeAt(0),o=i[1].charCodeAt(0);if(o<s)throw new Error("[BitmapFont]: Invalid character range.");for(let l=s,h=o;l<=h;l++)e.push(String.fromCharCode(l))}else e.push(...TC(i))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}const Is=class mi{constructor(e,r,n){var f;const[i]=e.info,[s]=e.common,[o]=e.page,[l]=e.distanceField,h=os(o.file),c={};this._ownsTextures=n,this.font=i.face,this.size=i.size,this.lineHeight=s.lineHeight/h,this.chars={},this.pageTextures=c;for(let m=0;m<e.page.length;m++){const{id:p,file:v}=e.page[m];c[p]=r instanceof Array?r[m]:r[v],l!=null&&l.fieldType&&l.fieldType!=="none"&&(c[p].baseTexture.alphaMode=Gr.NO_PREMULTIPLIED_ALPHA,c[p].baseTexture.mipmap=Ri.OFF)}for(let m=0;m<e.char.length;m++){const{id:p,page:v}=e.char[m];let{x:_,y:E,width:A,height:S,xoffset:b,yoffset:w,xadvance:T}=e.char[m];_/=h,E/=h,A/=h,S/=h,b/=h,w/=h,T/=h;const R=new De(_+c[v].frame.x/h,E+c[v].frame.y/h,A,S);this.chars[p]={xOffset:b,yOffset:w,xAdvance:T,kerning:{},texture:new oe(c[v].baseTexture,R),page:v}}for(let m=0;m<e.kerning.length;m++){let{first:p,second:v,amount:_}=e.kerning[m];p/=h,v/=h,_/=h,this.chars[v]&&(this.chars[v].kerning[p]=_)}this.distanceFieldRange=l==null?void 0:l.distanceRange,this.distanceFieldType=((f=l==null?void 0:l.fieldType)==null?void 0:f.toLowerCase())??"none"}destroy(){for(const e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(const e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null}static install(e,r,n){let i;if(e instanceof Sf)i=e;else{const o=hD(e);if(!o)throw new Error("Unrecognized data format for font.");i=o.parse(e)}r instanceof oe&&(r=[r]);const s=new mi(i,r,n);return mi.available[s.font]=s,s}static uninstall(e){const r=mi.available[e];if(!r)throw new Error(`No font found named '${e}'`);r.destroy(),delete mi.available[e]}static from(e,r,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");const{chars:i,padding:s,resolution:o,textureWidth:l,textureHeight:h,...c}=Object.assign({},mi.defaultOptions,n),f=fD(i),m=r instanceof Ur?r:new Ur(r),p=l,v=new Sf;v.info[0]={face:m.fontFamily,size:m.fontSize},v.common[0]={lineHeight:m.fontSize};let _=0,E=0,A,S,b,w=0;const T=[];for(let L=0;L<f.length;L++){A||(A=pe.ADAPTER.createCanvas(),A.width=l,A.height=h,S=A.getContext("2d"),b=new Ne(A,{resolution:o,...c}),T.push(new oe(b)),v.page.push({id:T.length-1,file:""}));const D=f[L],M=wn.measureText(D,m,!1,A),Y=M.width,j=Math.ceil(M.height),de=Math.ceil((m.fontStyle==="italic"?2:1)*Y);if(E>=h-j*o){if(E===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${m.fontFamily}', fontSize: ${m.fontSize}px, char: '${D}')`);--L,A=null,S=null,b=null,E=0,_=0,w=0;continue}if(w=Math.max(j+M.fontProperties.descent,w),de*o+_>=p){if(_===0)throw new Error(`[BitmapFont] textureWidth ${l}px is too small (fontFamily: '${m.fontFamily}', fontSize: ${m.fontSize}px, char: '${D}')`);--L,E+=w*o,E=Math.ceil(E),_=0,w=0;continue}dD(A,S,M,_,E,o,m);const re=Fd(M.text);v.char.push({id:re,page:T.length-1,x:_/o,y:E/o,width:de,height:j,xoffset:0,yoffset:0,xadvance:Y-(m.dropShadow?m.dropShadowDistance:0)-(m.stroke?m.strokeThickness:0)}),_+=(de+2*s)*o,_=Math.ceil(_)}if(!(n!=null&&n.skipKerning))for(let L=0,D=f.length;L<D;L++){const M=f[L];for(let Y=0;Y<D;Y++){const j=f[Y],de=S.measureText(M).width,re=S.measureText(j).width,F=S.measureText(M+j).width-(de+re);F&&v.kerning.push({first:Fd(M),second:Fd(j),amount:F})}}const R=new mi(v,T,!0);return mi.available[e]!==void 0&&mi.uninstall(e),mi.available[e]=R,R}};Is.ALPHA=[["a","z"],["A","Z"]," "],Is.NUMERIC=[["0","9"]],Is.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],Is.ASCII=[[" ","~"]],Is.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:Is.ALPHANUMERIC},Is.available={};let Rs=Is;class pD{constructor(e,r){this.uvBuffer=e,this.uvMatrix=r,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(e){if(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const r=this.uvBuffer.data;(!this.data||this.data.length!==r.length)&&(this.data=new Float32Array(r.length)),this.uvMatrix.multiplyUvs(r,this.data),this._updateID++}}const $g=new Ge,PE=new Uo,AC=class CC extends Pr{constructor(e,r,n,i=Wn.TRIANGLES){super(),this.geometry=e,this.shader=r,this.state=n||Ni.for2d(),this.drawMode=i,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=pe.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(e){this.shader=e}get material(){return this.shader}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}set roundPixels(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(e){this.shader.tint=e}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(e){this.shader.texture=e}_render(e){const r=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===Wn.TRIANGLES&&r.length<CC.BATCHABLE_SIZE*2?this._renderToBatch(e):this._renderDefault(e)}_renderDefault(e){const r=this.shader;r.alpha=this.worldAlpha,r.update&&r.update(),e.batch.flush(),r.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(r),e.state.set(this.state),e.geometry.bind(this.geometry,r),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(e){const r=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=r.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;const i=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[i]),e.plugins[i].render(this)}calculateVertices(){const e=this.geometry.buffers[0],r=e.data,n=e._updateID;if(n===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==r.length&&(this.vertexData=new Float32Array(r.length));const i=this.transform.worldTransform,s=i.a,o=i.b,l=i.c,h=i.d,c=i.tx,f=i.ty,m=this.vertexData;for(let p=0;p<m.length/2;p++){const v=r[p*2],_=r[p*2+1];m[p*2]=s*v+l*_+c,m[p*2+1]=o*v+h*_+f}if(this._roundPixels){const p=pe.RESOLUTION;for(let v=0;v<m.length;++v)m[v]=Math.round(m[v]*p)/p}this.vertexDirty=n}calculateUvs(){const e=this.geometry.buffers[1],r=this.shader;r.uvMatrix.isSimple?this.uvs=e.data:(this.batchUvs||(this.batchUvs=new pD(e,r.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,$g);const r=this.geometry.getBuffer("aVertexPosition").data,n=PE.points,i=this.geometry.getIndex().data,s=i.length,o=this.drawMode===4?3:1;for(let l=0;l+2<s;l+=o){const h=i[l]*2,c=i[l+1]*2,f=i[l+2]*2;if(n[0]=r[h],n[1]=r[h+1],n[2]=r[c],n[3]=r[c+1],n[4]=r[f],n[5]=r[f+1],PE.contains($g.x,$g.y))return!0}return!1}destroy(e){super.destroy(e),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};AC.BATCHABLE_SIZE=100;let eh=AC;class cp extends Js{constructor(e,r,n){super();const i=new Ct(e),s=new Ct(r,!0),o=new Ct(n,!0,!0);this.addAttribute("aVertexPosition",i,2,!1,Ae.FLOAT).addAttribute("aTextureCoord",s,2,!1,Ae.FLOAT).addIndex(o),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var mD=`varying vec2 vTextureCoord;
567
+ uniform vec4 uColor;
568
+
569
+ uniform sampler2D uSampler;
570
+
571
+ void main(void)
572
+ {
573
+ gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
574
+ }
575
+ `,gD=`attribute vec2 aVertexPosition;
576
+ attribute vec2 aTextureCoord;
577
+
578
+ uniform mat3 projectionMatrix;
579
+ uniform mat3 translationMatrix;
580
+ uniform mat3 uTextureMatrix;
581
+
582
+ varying vec2 vTextureCoord;
583
+
584
+ void main(void)
585
+ {
586
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
587
+
588
+ vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
589
+ }
590
+ `;class th extends Ii{constructor(e,r){const n={uSampler:e,alpha:1,uTextureMatrix:ot.IDENTITY,uColor:new Float32Array([1,1,1,1])};r=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},r),r.uniforms&&Object.assign(n,r.uniforms),super(r.program||Zi.from(gD,mD),n),this._colorDirty=!1,this.uvMatrix=new l_(e),this.batchable=r.program===void 0,this.pluginName=r.pluginName,this._tintColor=new rt(r.tint),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0,this.alpha=r.alpha}get texture(){return this.uniforms.uSampler}set texture(e){this.uniforms.uSampler!==e&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!e.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=e,this.uvMatrix.texture=e)}set alpha(e){e!==this._alpha&&(this._alpha=e,this._colorDirty=!0)}get alpha(){return this._alpha}set tint(e){e!==this.tint&&(this._tintColor.setValue(e),this._tintRGB=this._tintColor.toLittleEndianNumber(),this._colorDirty=!0)}get tint(){return this._tintColor.value}get tintValue(){return this._tintColor.toNumber()}update(){if(this._colorDirty){this._colorDirty=!1;const e=this.texture.baseTexture.alphaMode;rt.shared.setValue(this._tintColor).premultiply(this._alpha,e).toArray(this.uniforms.uColor)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)}}var yD=`// Pixi texture info\r
591
+ varying vec2 vTextureCoord;\r
592
+ uniform sampler2D uSampler;\r
593
+ \r
594
+ // Tint\r
595
+ uniform vec4 uColor;\r
596
+ \r
597
+ // on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r
598
+ uniform float uFWidth;\r
599
+ \r
600
+ void main(void) {\r
601
+ \r
602
+ // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r
603
+ vec4 texColor = texture2D(uSampler, vTextureCoord);\r
604
+ \r
605
+ // MSDF\r
606
+ float median = texColor.r + texColor.g + texColor.b -\r
607
+ min(texColor.r, min(texColor.g, texColor.b)) -\r
608
+ max(texColor.r, max(texColor.g, texColor.b));\r
609
+ // SDF\r
610
+ median = min(median, texColor.a);\r
611
+ \r
612
+ float screenPxDistance = uFWidth * (median - 0.5);\r
613
+ float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r
614
+ if (median < 0.01) {\r
615
+ alpha = 0.0;\r
616
+ } else if (median > 0.99) {\r
617
+ alpha = 1.0;\r
618
+ }\r
619
+ \r
620
+ // Gamma correction for coverage-like alpha\r
621
+ float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r
622
+ float gamma = mix(1.0, 1.0 / 2.2, luma);\r
623
+ float coverage = pow(uColor.a * alpha, gamma); \r
624
+ \r
625
+ // NPM Textures, NPM outputs\r
626
+ gl_FragColor = vec4(uColor.rgb, coverage);\r
627
+ }\r
628
+ `,vD=`// Mesh material default fragment\r
629
+ attribute vec2 aVertexPosition;\r
630
+ attribute vec2 aTextureCoord;\r
631
+ \r
632
+ uniform mat3 projectionMatrix;\r
633
+ uniform mat3 translationMatrix;\r
634
+ uniform mat3 uTextureMatrix;\r
635
+ \r
636
+ varying vec2 vTextureCoord;\r
637
+ \r
638
+ void main(void)\r
639
+ {\r
640
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r
641
+ \r
642
+ vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
643
+ }\r
644
+ `;const IE=[],RE=[],ME=[],PC=class IC extends Pr{constructor(e,r={}){super();const{align:n,tint:i,maxWidth:s,letterSpacing:o,fontName:l,fontSize:h}=Object.assign({},IC.styleDefaults,r);if(!Rs.available[l])throw new Error(`Missing BitmapFont "${l}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=n,this._tintColor=new rt(i),this._font=void 0,this._fontName=l,this._fontSize=h,this.text=e,this._maxWidth=s,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new bi(()=>{this.dirty=!0},this,0,0),this._roundPixels=pe.ROUND_PIXELS,this.dirty=!0,this._resolution=pe.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var de;const e=Rs.available[this._fontName],r=this.fontSize,n=r/e.size,i=new Ge,s=[],o=[],l=[],h=this._text.replace(/(?:\r\n|\r)/g,`
645
+ `)||" ",c=TC(h),f=this._maxWidth*e.size/r,m=e.distanceFieldType==="none"?IE:RE;let p=null,v=0,_=0,E=0,A=-1,S=0,b=0,w=0,T=0;for(let re=0;re<c.length;re++){const F=c[re],V=Fd(F);if(/(?:\s)/.test(F)&&(A=re,S=v,T++),F==="\r"||F===`
646
+ `){o.push(v),l.push(-1),_=Math.max(_,v),++E,++b,i.x=0,i.y+=e.lineHeight,p=null,T=0;continue}const ne=e.chars[V];if(!ne)continue;p&&ne.kerning[p]&&(i.x+=ne.kerning[p]);const fe=ME.pop()||{texture:oe.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Ge};fe.texture=ne.texture,fe.line=E,fe.charCode=V,fe.position.x=Math.round(i.x+ne.xOffset+this._letterSpacing/2),fe.position.y=Math.round(i.y+ne.yOffset),fe.prevSpaces=T,s.push(fe),v=fe.position.x+Math.max(ne.xAdvance-ne.xOffset,ne.texture.orig.width),i.x+=ne.xAdvance+this._letterSpacing,w=Math.max(w,ne.yOffset+ne.texture.height),p=V,A!==-1&&f>0&&i.x>f&&(++b,rl(s,1+A-b,1+re-A),re=A,A=-1,o.push(S),l.push(s.length>0?s[s.length-1].prevSpaces:0),_=Math.max(_,S),E++,i.x=0,i.y+=e.lineHeight,p=null,T=0)}const R=c[c.length-1];R!=="\r"&&R!==`
647
+ `&&(/(?:\s)/.test(R)&&(v=S),o.push(v),_=Math.max(_,v),l.push(-1));const L=[];for(let re=0;re<=E;re++){let F=0;this._align==="right"?F=_-o[re]:this._align==="center"?F=(_-o[re])/2:this._align==="justify"&&(F=l[re]<0?0:(_-o[re])/l[re]),L.push(F)}const D=s.length,M={},Y=[],j=this._activePagesMeshData;m.push(...j);for(let re=0;re<D;re++){const F=s[re].texture,V=F.baseTexture.uid;if(!M[V]){let ne=m.pop();if(!ne){const ae=new cp;let k,X;e.distanceFieldType==="none"?(k=new th(oe.EMPTY),X=Me.NORMAL):(k=new th(oe.EMPTY,{program:Zi.from(vD,yD),uniforms:{uFWidth:0}}),X=Me.NORMAL_NPM);const O=new eh(ae,k);O.blendMode=X,ne={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:O,vertices:null,uvs:null,indices:null}}ne.index=0,ne.indexCount=0,ne.vertexCount=0,ne.uvsCount=0,ne.total=0;const{_textureCache:fe}=this;fe[V]=fe[V]||new oe(F.baseTexture),ne.mesh.texture=fe[V],ne.mesh.tint=this._tintColor.value,Y.push(ne),M[V]=ne}M[V].total++}for(let re=0;re<j.length;re++)Y.includes(j[re])||this.removeChild(j[re].mesh);for(let re=0;re<Y.length;re++)Y[re].mesh.parent!==this&&this.addChild(Y[re].mesh);this._activePagesMeshData=Y;for(const re in M){const F=M[re],V=F.total;if(!(((de=F.indices)==null?void 0:de.length)>6*V)||F.vertices.length<eh.BATCHABLE_SIZE*2)F.vertices=new Float32Array(4*2*V),F.uvs=new Float32Array(4*2*V),F.indices=new Uint16Array(6*V);else{const ne=F.total,fe=F.vertices;for(let ae=ne*4*2;ae<fe.length;ae++)fe[ae]=0}F.mesh.size=6*V}for(let re=0;re<D;re++){const F=s[re];let V=F.position.x+L[F.line]*(this._align==="justify"?F.prevSpaces:1);this._roundPixels&&(V=Math.round(V));const ne=V*n,fe=F.position.y*n,ae=F.texture,k=M[ae.baseTexture.uid],X=ae.frame,O=ae._uvs,G=k.index++;k.indices[G*6+0]=0+G*4,k.indices[G*6+1]=1+G*4,k.indices[G*6+2]=2+G*4,k.indices[G*6+3]=0+G*4,k.indices[G*6+4]=2+G*4,k.indices[G*6+5]=3+G*4,k.vertices[G*8+0]=ne,k.vertices[G*8+1]=fe,k.vertices[G*8+2]=ne+X.width*n,k.vertices[G*8+3]=fe,k.vertices[G*8+4]=ne+X.width*n,k.vertices[G*8+5]=fe+X.height*n,k.vertices[G*8+6]=ne,k.vertices[G*8+7]=fe+X.height*n,k.uvs[G*8+0]=O.x0,k.uvs[G*8+1]=O.y0,k.uvs[G*8+2]=O.x1,k.uvs[G*8+3]=O.y1,k.uvs[G*8+4]=O.x2,k.uvs[G*8+5]=O.y2,k.uvs[G*8+6]=O.x3,k.uvs[G*8+7]=O.y3}this._textWidth=_*n,this._textHeight=(i.y+e.lineHeight)*n;for(const re in M){const F=M[re];if(this.anchor.x!==0||this.anchor.y!==0){let ae=0;const k=this._textWidth*this.anchor.x,X=this._textHeight*this.anchor.y;for(let O=0;O<F.total;O++)F.vertices[ae++]-=k,F.vertices[ae++]-=X,F.vertices[ae++]-=k,F.vertices[ae++]-=X,F.vertices[ae++]-=k,F.vertices[ae++]-=X,F.vertices[ae++]-=k,F.vertices[ae++]-=X}this._maxLineHeight=w*n;const V=F.mesh.geometry.getBuffer("aVertexPosition"),ne=F.mesh.geometry.getBuffer("aTextureCoord"),fe=F.mesh.geometry.getIndex();V.data=F.vertices,ne.data=F.uvs,fe.data=F.indices,V.update(),ne.update(),fe.update()}for(let re=0;re<s.length;re++)ME.push(s[re]);this._font=e,this.dirty=!1}updateTransform(){this.validate(),this.containerUpdateTransform()}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0);const{distanceFieldRange:r,distanceFieldType:n,size:i}=Rs.available[this._fontName];if(n!=="none"){const{a:s,b:o,c:l,d:h}=this.worldTransform,c=Math.sqrt(s*s+o*o),f=Math.sqrt(l*l+h*h),m=(Math.abs(c)+Math.abs(f))/2,p=this.fontSize/i,v=e._view.resolution;for(const _ of this._activePagesMeshData)_.mesh.shader.uniforms.uFWidth=m*r*p*v}super._render(e)}getLocalBounds(){return this.validate(),super.getLocalBounds()}validate(){const e=Rs.available[this._fontName];if(!e)throw new Error(`Missing BitmapFont "${this._fontName}"`);this._font!==e&&(this.dirty=!0),this.dirty&&this.updateText()}get tint(){return this._tintColor.value}set tint(e){if(this.tint!==e){this._tintColor.setValue(e);for(let r=0;r<this._activePagesMeshData.length;r++)this._activePagesMeshData[r].mesh.tint=e}}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.dirty=!0)}get fontName(){return this._fontName}set fontName(e){if(!Rs.available[e])throw new Error(`Missing BitmapFont "${e}"`);this._fontName!==e&&(this._fontName=e,this.dirty=!0)}get fontSize(){return this._fontSize??Rs.available[this._fontName].size}set fontSize(e){this._fontSize!==e&&(this._fontSize=e,this.dirty=!0)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get text(){return this._text}set text(e){e=String(e??""),this._text!==e&&(this._text=e,this.dirty=!0)}get maxWidth(){return this._maxWidth}set maxWidth(e){this._maxWidth!==e&&(this._maxWidth=e,this.dirty=!0)}get maxLineHeight(){return this.validate(),this._maxLineHeight}get textWidth(){return this.validate(),this._textWidth}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.dirty=!0)}get roundPixels(){return this._roundPixels}set roundPixels(e){e!==this._roundPixels&&(this._roundPixels=e,this.dirty=!0)}get textHeight(){return this.validate(),this._textHeight}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}destroy(e){const{_textureCache:r}=this,n=Rs.available[this._fontName].distanceFieldType==="none"?IE:RE;n.push(...this._activePagesMeshData);for(const i of this._activePagesMeshData)this.removeChild(i.mesh);this._activePagesMeshData=[],n.filter(i=>r[i.mesh.texture.baseTexture.uid]).forEach(i=>{i.mesh.texture=oe.EMPTY});for(const i in r)r[i].destroy(),delete r[i];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(e)}};PC.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};let _D=PC;const kE={loader:ue.LoadParser,resolver:ue.ResolveParser,cache:ue.CacheParser,detection:ue.DetectionParser};Se.handle(ue.Asset,t=>{const e=t.ref;Object.entries(kE).filter(([r])=>!!e[r]).forEach(([r,n])=>Se.add(Object.assign(e[r],{extension:e[r].extension??n})))},t=>{const e=t.ref;Object.keys(kE).filter(r=>!!e[r]).forEach(r=>Se.remove(e[r]))});class xD{constructor(e,r=!1){this._loader=e,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=r}add(e){e.forEach(r=>{this._assetList.push(r)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const e=[],r=Math.min(this._assetList.length,this._maxConcurrent);for(let n=0;n<r;n++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=!1,this._next()}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next())}}function wl(t,e){if(Array.isArray(e)){for(const r of e)if(t.startsWith(`data:${r}`))return!0;return!1}return t.startsWith(`data:${e}`)}function oo(t,e){const r=t.split("?")[0],n=qt.extname(r).toLowerCase();return Array.isArray(e)?e.includes(n):n===e}const $n=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(n=>typeof n=="string"||r?e(n):n):t),Fv=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};function RC(t,e,r,n,i){const s=e[r];for(let o=0;o<s.length;o++){const l=s[o];r<e.length-1?RC(t.replace(n[r],l),e,r+1,n,i):i.push(t.replace(n[r],l))}}function wD(t){const e=/\{(.*?)\}/g,r=t.match(e),n=[];if(r){const i=[];r.forEach(s=>{const o=s.substring(1,s.length-1).split(",");i.push(o)}),RC(t,i,0,r,n)}else n.push(t);return n}const bf=t=>!Array.isArray(t);class ED{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 r=this._cache.get(e);return r||console.warn(`[Assets] Asset id ${e} was not found in the Cache`),r}set(e,r){const n=$n(e);let i;for(let l=0;l<this.parsers.length;l++){const h=this.parsers[l];if(h.test(r)){i=h.getCacheableAssets(n,r);break}}i||(i={},n.forEach(l=>{i[l]=r}));const s=Object.keys(i),o={cacheKeys:s,keys:n};if(n.forEach(l=>{this._cacheMap.set(l,o)}),s.forEach(l=>{const h=i?i[l]:r;this._cache.has(l)&&this._cache.get(l)!==h&&console.warn("[Cache] already has key:",l),this._cache.set(l,i[l])}),r instanceof oe){const l=r;n.forEach(h=>{l.baseTexture!==oe.EMPTY.baseTexture&&Ne.addToCache(l.baseTexture,h),oe.addToCache(l,h)})}}remove(e){if(!this._cacheMap.has(e)){console.warn(`[Assets] Asset id ${e} was not found in the Cache`);return}const r=this._cacheMap.get(e);r.cacheKeys.forEach(n=>{this._cache.delete(n)}),r.keys.forEach(n=>{this._cacheMap.delete(n)})}get parsers(){return this._parsers}}const ko=new ED;class SD{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(e,r,n)=>(this._parsersValidated=!1,e[r]=n,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(e,r){const n={promise:null,parser:null};return n.promise=(async()=>{var o,l;let i=null,s=null;if(r.loadParser&&(s=this._parserHash[r.loadParser],s||console.warn(`[Assets] specified load parser "${r.loadParser}" not found while loading ${e}`)),!s){for(let h=0;h<this.parsers.length;h++){const c=this.parsers[h];if(c.load&&((o=c.test)!=null&&o.call(c,e,r,this))){s=c;break}}if(!s)return console.warn(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}i=await s.load(e,r,this),n.parser=s;for(let h=0;h<this.parsers.length;h++){const c=this.parsers[h];c.parse&&c.parse&&await((l=c.testParse)==null?void 0:l.call(c,i,r,this))&&(i=await c.parse(i,r,this)||i,n.parser=c)}return i})(),n}async load(e,r){this._parsersValidated||this._validateParsers();let n=0;const i={},s=bf(e),o=$n(e,c=>({alias:[c],src:c})),l=o.length,h=o.map(async c=>{const f=qt.toAbsolute(c.src);if(!i[c.src])try{this.promiseCache[f]||(this.promiseCache[f]=this._getLoadPromiseAndParser(f,c)),i[c.src]=await this.promiseCache[f].promise,r&&r(++n/l)}catch(m){throw delete this.promiseCache[f],delete i[c.src],new Error(`[Loader.load] Failed to load ${f}.
648
+ ${m}`)}});return await Promise.all(h),s?i[o[0].src]:i}async unload(e){const r=$n(e,n=>({alias:[n],src:n})).map(async n=>{var o,l;const i=qt.toAbsolute(n.src),s=this.promiseCache[i];if(s){const h=await s.promise;delete this.promiseCache[i],(l=(o=s.parser)==null?void 0:o.unload)==null||l.call(o,h,n,this)}});await Promise.all(r)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,r)=>(e[r.name]&&console.warn(`[Assets] loadParser name conflict "${r.name}"`),{...e,[r.name]:r}),{})}}var Zn=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(Zn||{});const bD=".json",TD="application/json",AD={extension:{type:ue.LoadParser,priority:Zn.Low},name:"loadJson",test(t){return wl(t,TD)||oo(t,bD)},async load(t){return await(await pe.ADAPTER.fetch(t)).json()}};Se.add(AD);const CD=".txt",PD="text/plain",ID={name:"loadTxt",extension:{type:ue.LoadParser,priority:Zn.Low},test(t){return wl(t,PD)||oo(t,CD)},async load(t){return await(await pe.ADAPTER.fetch(t)).text()}};Se.add(ID);const RD=["normal","bold","100","200","300","400","500","600","700","800","900"],MD=[".ttf",".otf",".woff",".woff2"],kD=["font/ttf","font/otf","font/woff","font/woff2"],ND=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function DD(t){const e=qt.extname(t),r=qt.basename(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1));let n=r.length>0;for(const s of r)if(!s.match(ND)){n=!1;break}let i=r.join(" ");return n||(i=`"${i.replace(/[\\"]/g,"\\$&")}"`),i}const OD=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function FD(t){return OD.test(t)?t:encodeURI(t)}const BD={extension:{type:ue.LoadParser,priority:Zn.Low},name:"loadWebFont",test(t){return wl(t,kD)||oo(t,MD)},async load(t,e){var n,i,s;const r=pe.ADAPTER.getFontFaceSet();if(r){const o=[],l=((n=e.data)==null?void 0:n.family)??DD(t),h=((s=(i=e.data)==null?void 0:i.weights)==null?void 0:s.filter(f=>RD.includes(f)))??["normal"],c=e.data??{};for(let f=0;f<h.length;f++){const m=h[f],p=new FontFace(l,`url(${FD(t)})`,{...c,weight:m});await p.load(),r.add(p),o.push(p)}return o.length===1?o[0]:o}return console.warn("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(t){(Array.isArray(t)?t:[t]).forEach(e=>pe.ADAPTER.getFontFaceSet().delete(e))}};Se.add(BD);const LD=`(function() {
649
+ "use strict";
650
+ const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
651
+ async function checkImageBitmap() {
652
+ try {
653
+ if (typeof createImageBitmap != "function")
654
+ return !1;
655
+ const imageBlob = await (await fetch(WHITE_PNG)).blob(), imageBitmap = await createImageBitmap(imageBlob);
656
+ return imageBitmap.width === 1 && imageBitmap.height === 1;
657
+ } catch {
658
+ return !1;
659
+ }
660
+ }
661
+ checkImageBitmap().then((result) => {
662
+ self.postMessage(result);
663
+ });
664
+ })();
665
+ `;let il=null,Bv=class{constructor(){il||(il=URL.createObjectURL(new Blob([LD],{type:"application/javascript"}))),this.worker=new Worker(il)}};Bv.revokeObjectURL=function(){il&&(URL.revokeObjectURL(il),il=null)};const UD=`(function() {
666
+ "use strict";
667
+ async function loadImageBitmap(url) {
668
+ const response = await fetch(url);
669
+ if (!response.ok)
670
+ throw new Error(\`[WorkerManager.loadImageBitmap] Failed to fetch \${url}: \${response.status} \${response.statusText}\`);
671
+ const imageBlob = await response.blob();
672
+ return await createImageBitmap(imageBlob);
673
+ }
674
+ self.onmessage = async (event) => {
675
+ try {
676
+ const imageBitmap = await loadImageBitmap(event.data.data[0]);
677
+ self.postMessage({
678
+ data: imageBitmap,
679
+ uuid: event.data.uuid,
680
+ id: event.data.id
681
+ }, [imageBitmap]);
682
+ } catch (e) {
683
+ self.postMessage({
684
+ error: e,
685
+ uuid: event.data.uuid,
686
+ id: event.data.id
687
+ });
688
+ }
689
+ };
690
+ })();
691
+ `;let sl=null;class MC{constructor(){sl||(sl=URL.createObjectURL(new Blob([UD],{type:"application/javascript"}))),this.worker=new Worker(sl)}}MC.revokeObjectURL=function(){sl&&(URL.revokeObjectURL(sl),sl=null)};let NE=0,Wg;class zD{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{const{worker:r}=new Bv;r.addEventListener("message",n=>{r.terminate(),Bv.revokeObjectURL(),e(n.data)})}),this._isImageBitmapSupported)}loadImageBitmap(e){return this._run("loadImageBitmap",[e])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Wg===void 0&&(Wg=navigator.hardwareConcurrency||4);let e=this.workerPool.pop();return!e&&this._createdWorkers<Wg&&(this._createdWorkers++,e=new MC().worker,e.addEventListener("message",r=>{this.complete(r.data),this.returnWorker(r.target),this.next()})),e}returnWorker(e){this.workerPool.push(e)}complete(e){e.error!==void 0?this.resolveHash[e.uuid].reject(e.error):this.resolveHash[e.uuid].resolve(e.data),this.resolveHash[e.uuid]=null}async _run(e,r){await this._initWorkers();const n=new Promise((i,s)=>{this.queue.push({id:e,arguments:r,resolve:i,reject:s})});return this.next(),n}next(){if(!this.queue.length)return;const e=this.getWorker();if(!e)return;const r=this.queue.pop(),n=r.id;this.resolveHash[NE]={resolve:r.resolve,reject:r.reject},e.postMessage({data:r.arguments,uuid:NE++,id:n})}}const DE=new zD;function ph(t,e,r){t.resource.internal=!0;const n=new oe(t),i=()=>{delete e.promiseCache[r],ko.has(r)&&ko.remove(r)};return n.baseTexture.once("destroyed",()=>{r in e.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),i())}),n.once("destroyed",()=>{t.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),i())}),n}const GD=[".jpeg",".jpg",".png",".webp",".avif"],HD=["image/jpeg","image/png","image/webp","image/avif"];async function jD(t){const e=await pe.ADAPTER.fetch(t);if(!e.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${t}: ${e.status} ${e.statusText}`);const r=await e.blob();return await createImageBitmap(r)}const dp={name:"loadTextures",extension:{type:ue.LoadParser,priority:Zn.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(t){return wl(t,HD)||oo(t,GD)},async load(t,e,r){var l;const n=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let i;n?this.config.preferWorkers&&await DE.isImageBitmapSupported()?i=await DE.loadImageBitmap(t):i=await jD(t):i=await new Promise((h,c)=>{const f=new Image;f.crossOrigin=this.config.crossOrigin,f.src=t,f.complete?h(f):(f.onload=()=>h(f),f.onerror=m=>c(m))});const s={...e.data};s.resolution??(s.resolution=os(t)),n&&((l=s.resourceOptions)==null?void 0:l.ownsImageBitmap)===void 0&&(s.resourceOptions={...s.resourceOptions},s.resourceOptions.ownsImageBitmap=!0);const o=new Ne(i,s);return o.resource.src=t,ph(o,r,t)},unload(t){t.destroy(!0)}};Se.add(dp);const $D=".svg",WD="image/svg+xml",VD={extension:{type:ue.LoadParser,priority:Zn.High},name:"loadSVG",test(t){return wl(t,WD)||oo(t,$D)},async testParse(t){return Iv.test(t)},async parse(t,e,r){var s;const n=new Iv(t,(s=e==null?void 0:e.data)==null?void 0:s.resourceOptions);await n.load();const i=new Ne(n,{resolution:os(t),...e==null?void 0:e.data});return i.resource.src=e.src,ph(i,r,e.src)},async load(t,e){return(await pe.ADAPTER.fetch(t)).text()},unload:dp.unload};Se.add(VD);const XD=[".mp4",".m4v",".webm",".ogv"],YD=["video/mp4","video/webm","video/ogg"],QD={name:"loadVideo",extension:{type:ue.LoadParser,priority:Zn.High},config:{defaultAutoPlay:!0,defaultUpdateFPS:0,defaultLoop:!1,defaultMuted:!1,defaultPlaysinline:!0},test(t){return wl(t,YD)||oo(t,XD)},async load(t,e,r){var o;let n;const i=await(await pe.ADAPTER.fetch(t)).blob(),s=URL.createObjectURL(i);try{const l={autoPlay:this.config.defaultAutoPlay,updateFPS:this.config.defaultUpdateFPS,loop:this.config.defaultLoop,muted:this.config.defaultMuted,playsinline:this.config.defaultPlaysinline,...(o=e==null?void 0:e.data)==null?void 0:o.resourceOptions,autoLoad:!0},h=new wC(s,l);await h.load();const c=new Ne(h,{alphaMode:await x4(),resolution:os(t),...e==null?void 0:e.data});c.resource.src=t,n=ph(c,r,t),n.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(s)})}catch(l){throw URL.revokeObjectURL(s),l}return n},unload(t){t.destroy(!0)}};Se.add(QD);class KD{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,r)=>`${e}${this._bundleIdConnector}${r}`,extractAssetIdFromBundle:(e,r)=>r.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(r=>{this._preferredOrder.push(r),r.priority||(r.priority=Object.keys(r.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 r=e;this._defaultSearchParams=Object.keys(r).map(n=>`${encodeURIComponent(n)}=${encodeURIComponent(r[n])}`).join("&")}}getAlias(e){const{alias:r,name:n,src:i,srcs:s}=e;return $n(r||n||i||s,o=>typeof o=="string"?o:Array.isArray(o)?o.map(l=>(l==null?void 0:l.src)??(l==null?void 0:l.srcs)??l):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(e){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(r=>{this.addBundle(r.name,r.assets)})}addBundle(e,r){const n=[];Array.isArray(r)?r.forEach(i=>{const s=i.src??i.srcs,o=i.alias??i.name;let l;if(typeof o=="string"){const h=this._createBundleAssetId(e,o);n.push(h),l=[o,h]}else{const h=o.map(c=>this._createBundleAssetId(e,c));n.push(...h),l=[...o,...h]}this.add({...i,alias:l,src:s})}):Object.keys(r).forEach(i=>{const s=[i,this._createBundleAssetId(e,i)];if(typeof r[i]=="string")this.add({alias:s,src:r[i]});else if(Array.isArray(r[i]))this.add({alias:s,src:r[i]});else{const o=r[i],l=o.src??o.srcs;this.add({...o,alias:s,src:Array.isArray(l)?l:[l]})}n.push(...s)}),this._bundles[e]=n}add(e,r,n,i,s){const o=[];typeof e=="string"||Array.isArray(e)&&typeof e[0]=="string"?(Ue("7.2.0",`Assets.add now uses an object instead of individual parameters.
692
+ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:e,src:r,data:n,format:i,loadParser:s})):Array.isArray(e)?o.push(...e):o.push(e);let l;l=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},$n(o).forEach(h=>{const{src:c,srcs:f}=h;let{data:m,format:p,loadParser:v}=h;const _=$n(c||f).map(S=>typeof S=="string"?wD(S):Array.isArray(S)?S:[S]),E=this.getAlias(h);Array.isArray(E)?E.forEach(l):l(E);const A=[];_.forEach(S=>{S.forEach(b=>{let w={};if(typeof b!="object"){w.src=b;for(let T=0;T<this._parsers.length;T++){const R=this._parsers[T];if(R.test(b)){w=R.parse(b);break}}}else m=b.data??m,p=b.format??p,v=b.loadParser??v,w={...w,...b};if(!E)throw new Error(`[Resolver] alias is undefined for this asset: ${w.src}`);w=this.buildResolvedAsset(w,{aliases:E,data:m,format:p,loadParser:v}),A.push(w)})}),E.forEach(S=>{this._assetMap[S]=A})})}resolveBundle(e){const r=bf(e);e=$n(e);const n={};return e.forEach(i=>{const s=this._bundles[i];if(s){const o=this.resolve(s),l={};for(const h in o){const c=o[h];l[this._extractAssetIdFromBundle(i,h)]=c}n[i]=l}}),r?n[e[0]]:n}resolveUrl(e){const r=this.resolve(e);if(typeof e!="string"){const n={};for(const i in r)n[i]=r[i].src;return n}return r.src}resolve(e){const r=bf(e);e=$n(e);const n={};return e.forEach(i=>{if(!this._resolverHash[i])if(this._assetMap[i]){let s=this._assetMap[i];const o=s[0],l=this._getPreferredOrder(s);l==null||l.priority.forEach(h=>{l.params[h].forEach(c=>{const f=s.filter(m=>m[h]?m[h]===c:!1);f.length&&(s=f)})}),this._resolverHash[i]=s[0]??o}else this._resolverHash[i]=this.buildResolvedAsset({alias:[i],src:i},{});n[i]=this._resolverHash[i]}),r?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let r=0;r<e.length;r++){const n=e[0],i=this._preferredOrder.find(s=>s.params.format.includes(n.format));if(i)return i}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const r=/\?/.test(e)?"&":"?";return`${e}${r}${this._defaultSearchParams}`}buildResolvedAsset(e,r){const{aliases:n,data:i,loadParser:s,format:o}=r;return(this._basePath||this._rootPath)&&(e.src=qt.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...i||{},...e.data},e.loadParser=s??e.loadParser,e.format=o??e.format??qt.extname(e.src).slice(1),e.srcs=e.src,e.name=e.alias,e}}class qD{constructor(){this._detections=[],this._initialized=!1,this.resolver=new KD,this.loader=new SD,this.cache=ko,this._backgroundLoader=new xD(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(e={}){var s,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=!0,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let l=e.manifest;typeof l=="string"&&(l=await this.load(l)),this.resolver.addManifest(l)}const r=((s=e.texturePreference)==null?void 0:s.resolution)??1,n=typeof r=="number"?[r]:r,i=await this._detectFormats({preferredFormats:(o=e.texturePreference)==null?void 0:o.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:i,resolution:n}}),e.preferences&&this.setPreferences(e.preferences)}add(e,r,n,i,s){this.resolver.add(e,r,n,i,s)}async load(e,r){this._initialized||await this.init();const n=bf(e),i=$n(e).map(l=>{if(typeof l!="string"){const h=this.resolver.getAlias(l);return h.some(c=>!this.resolver.hasKey(c))&&this.add(l),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(l)||this.add({alias:l,src:l}),l}),s=this.resolver.resolve(i),o=await this._mapLoadToResolve(s,r);return n?o[i[0]]:o}addBundle(e,r){this.resolver.addBundle(e,r)}async loadBundle(e,r){this._initialized||await this.init();let n=!1;typeof e=="string"&&(n=!0,e=[e]);const i=this.resolver.resolveBundle(e),s={},o=Object.keys(i);let l=0,h=0;const c=()=>{r==null||r(++l/h)},f=o.map(m=>{const p=i[m];return h+=Object.keys(p).length,this._mapLoadToResolve(p,c).then(v=>{s[m]=v})});return await Promise.all(f),n?s[e[0]]:s}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const r=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(r))}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);const r=this.resolver.resolveBundle(e);Object.values(r).forEach(n=>{this._backgroundLoader.add(Object.values(n))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(e){if(typeof e=="string")return ko.get(e);const r={};for(let n=0;n<e.length;n++)r[n]=ko.get(e[n]);return r}async _mapLoadToResolve(e,r){const n=Object.values(e),i=Object.keys(e);this._backgroundLoader.active=!1;const s=await this.loader.load(n,r);this._backgroundLoader.active=!0;const o={};return n.forEach((l,h)=>{const c=s[l.src],f=[l.src];l.alias&&f.push(...l.alias),o[i[h]]=c,ko.set(f,c)}),o}async unload(e){this._initialized||await this.init();const r=$n(e).map(i=>typeof i!="string"?i.src:i),n=this.resolver.resolve(r);await this._unloadFromResolved(n)}async unloadBundle(e){this._initialized||await this.init(),e=$n(e);const r=this.resolver.resolveBundle(e),n=Object.keys(r).map(i=>this._unloadFromResolved(r[i]));await Promise.all(n)}async _unloadFromResolved(e){const r=Object.values(e);r.forEach(n=>{ko.remove(n.src)}),await this.loader.unload(r)}async _detectFormats(e){let r=[];e.preferredFormats&&(r=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(const n of e.detections)e.skipDetections||await n.test()?r=await n.add(r):e.skipDetections||(r=await n.remove(r));return r=r.filter((n,i)=>r.indexOf(n)===i),r}get detections(){return this._detections}get preferWorkers(){return dp.config.preferWorkers}set preferWorkers(e){Ue("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:e})}setPreferences(e){this.loader.parsers.forEach(r=>{r.config&&Object.keys(r.config).filter(n=>n in e).forEach(n=>{r.config[n]=e[n]})})}}const Kc=new qD;Se.handleByList(ue.LoadParser,Kc.loader.parsers).handleByList(ue.ResolveParser,Kc.resolver.parsers).handleByList(ue.CacheParser,Kc.cache.parsers).handleByList(ue.DetectionParser,Kc.detections);const ZD={extension:ue.CacheParser,test:t=>Array.isArray(t)&&t.every(e=>e instanceof oe),getCacheableAssets:(t,e)=>{const r={};return t.forEach(n=>{e.forEach((i,s)=>{r[n+(s===0?"":s+1)]=i})}),r}};Se.add(ZD);async function kC(t){if("Image"in globalThis)return new Promise(e=>{const r=new Image;r.onload=()=>{e(!0)},r.onerror=()=>{e(!1)},r.src=t});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{const e=await(await fetch(t)).blob();await createImageBitmap(e)}catch{return!1}return!0}return!1}const JD={extension:{type:ue.DetectionParser,priority:1},test:async()=>kC("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async t=>[...t,"avif"],remove:async t=>t.filter(e=>e!=="avif")};Se.add(JD);const eO={extension:{type:ue.DetectionParser,priority:0},test:async()=>kC("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async t=>[...t,"webp"],remove:async t=>t.filter(e=>e!=="webp")};Se.add(eO);const OE=["png","jpg","jpeg"],tO={extension:{type:ue.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async t=>[...t,...OE],remove:async t=>t.filter(e=>!OE.includes(e))};Se.add(tO);const rO="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function c_(t){return rO?!1:document.createElement("video").canPlayType(t)!==""}const nO={extension:{type:ue.DetectionParser,priority:0},test:async()=>c_("video/webm"),add:async t=>[...t,"webm"],remove:async t=>t.filter(e=>e!=="webm")};Se.add(nO);const iO={extension:{type:ue.DetectionParser,priority:0},test:async()=>c_("video/mp4"),add:async t=>[...t,"mp4","m4v"],remove:async t=>t.filter(e=>e!=="mp4"&&e!=="m4v")};Se.add(iO);const sO={extension:{type:ue.DetectionParser,priority:0},test:async()=>c_("video/ogg"),add:async t=>[...t,"ogv"],remove:async t=>t.filter(e=>e!=="ogv")};Se.add(sO);const oO={extension:ue.ResolveParser,test:dp.test,parse:t=>{var e;return{resolution:parseFloat(((e=pe.RETINA_PREFIX.exec(t))==null?void 0:e[1])??"1"),format:qt.extname(t).slice(1),src:t}}};Se.add(oO);const aO=[".xml",".fnt"],lO={extension:{type:ue.LoadParser,priority:Zn.Normal},name:"loadBitmapFont",test(t){return aO.includes(qt.extname(t).toLowerCase())},async testParse(t){return Od.test(t)||Ov.test(t)},async parse(t,e,r){const n=Od.test(t)?Od.parse(t):Ov.parse(t),{src:i}=e,{page:s}=n,o=[];for(let c=0;c<s.length;++c){const f=s[c].file;let m=qt.join(qt.dirname(i),f);m=Fv(m,i),o.push(m)}const l=await r.load(o),h=o.map(c=>l[c]);return Rs.install(n,h,!0)},async load(t,e){return(await pe.ADAPTER.fetch(t)).text()},unload(t){t.destroy()}};Se.add(lO);const Tf={build(t){const e=t.points;let r,n,i,s,o,l;if(t.type===or.CIRC){const _=t.shape;r=_.x,n=_.y,o=l=_.radius,i=s=0}else if(t.type===or.ELIP){const _=t.shape;r=_.x,n=_.y,o=_.width,l=_.height,i=s=0}else{const _=t.shape,E=_.width/2,A=_.height/2;r=_.x+E,n=_.y+A,o=l=Math.max(0,Math.min(_.radius,Math.min(E,A))),i=E-o,s=A-l}if(!(o>=0&&l>=0&&i>=0&&s>=0)){e.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+l)),c=h*8+(i?4:0)+(s?4:0);if(e.length=c,c===0)return;if(h===0){e.length=8,e[0]=e[6]=r+i,e[1]=e[3]=n+s,e[2]=e[4]=r-i,e[5]=e[7]=n-s;return}let f=0,m=h*4+(i?2:0)+2,p=m,v=c;{const _=i+o,E=s,A=r+_,S=r-_,b=n+E;if(e[f++]=A,e[f++]=b,e[--m]=b,e[--m]=S,s){const w=n-E;e[p++]=S,e[p++]=w,e[--v]=w,e[--v]=A}}for(let _=1;_<h;_++){const E=Math.PI/2*(_/h),A=i+Math.cos(E)*o,S=s+Math.sin(E)*l,b=r+A,w=r-A,T=n+S,R=n-S;e[f++]=b,e[f++]=T,e[--m]=T,e[--m]=w,e[p++]=w,e[p++]=R,e[--v]=R,e[--v]=b}{const _=i,E=s+l,A=r+_,S=r-_,b=n+E,w=n-E;e[f++]=A,e[f++]=b,e[--v]=w,e[--v]=A,i&&(e[f++]=S,e[f++]=b,e[--v]=w,e[--v]=S)}},triangulate(t,e){const r=t.points,n=e.points,i=e.indices;if(r.length===0)return;let s=n.length/2;const o=s;let l,h;if(t.type!==or.RREC){const f=t.shape;l=f.x,h=f.y}else{const f=t.shape;l=f.x+f.width/2,h=f.y+f.height/2}const c=t.matrix;n.push(t.matrix?c.a*l+c.c*h+c.tx:l,t.matrix?c.b*l+c.d*h+c.ty:h),s++,n.push(r[0],r[1]);for(let f=2;f<r.length;f+=2)n.push(r[f],r[f+1]),i.push(s++,o,s);i.push(o+1,o,s)}};function FE(t,e=!1){const r=t.length;if(r<6)return;let n=0;for(let i=0,s=t[r-2],o=t[r-1];i<r;i+=2){const l=t[i],h=t[i+1];n+=(l-s)*(h+o),s=l,o=h}if(!e&&n>0||e&&n<=0){const i=r/2;for(let s=i+i%2;s<r;s+=2){const o=r-s-2,l=r-s-1,h=s,c=s+1;[t[o],t[h]]=[t[h],t[o]],[t[l],t[c]]=[t[c],t[l]]}}}const NC={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let r=t.points;const n=t.holes,i=e.points,s=e.indices;if(r.length>=6){FE(r,!1);const o=[];for(let c=0;c<n.length;c++){const f=n[c];FE(f.points,!0),o.push(r.length/2),r=r.concat(f.points)}const l=dM(r,o,2);if(!l)return;const h=i.length/2;for(let c=0;c<l.length;c+=3)s.push(l[c]+h),s.push(l[c+1]+h),s.push(l[c+2]+h);for(let c=0;c<r.length;c++)i.push(r[c])}}},uO={build(t){const e=t.shape,r=e.x,n=e.y,i=e.width,s=e.height,o=t.points;o.length=0,i>=0&&s>=0&&o.push(r,n,r+i,n,r+i,n+s,r,n+s)},triangulate(t,e){const r=t.points,n=e.points;if(r.length===0)return;const i=n.length/2;n.push(r[0],r[1],r[2],r[3],r[6],r[7],r[4],r[5]),e.indices.push(i,i+1,i+2,i+1,i+2,i+3)}},hO={build(t){Tf.build(t)},triangulate(t,e){Tf.triangulate(t,e)}};var vn=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(vn||{}),zs=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(zs||{});const gl={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let r=Math.ceil(t/this.maxLength);return r<this.minSegments?r=this.minSegments:r>this.maxSegments&&(r=this.maxSegments),r}};class BE{static curveTo(e,r,n,i,s,o){const l=o[o.length-2],h=o[o.length-1]-r,c=l-e,f=i-r,m=n-e,p=Math.abs(h*m-c*f);if(p<1e-8||s===0)return(o[o.length-2]!==e||o[o.length-1]!==r)&&o.push(e,r),null;const v=h*h+c*c,_=f*f+m*m,E=h*f+c*m,A=s*Math.sqrt(v)/p,S=s*Math.sqrt(_)/p,b=A*E/v,w=S*E/_,T=A*m+S*c,R=A*f+S*h,L=c*(S+b),D=h*(S+b),M=m*(A+w),Y=f*(A+w),j=Math.atan2(D-R,L-T),de=Math.atan2(Y-R,M-T);return{cx:T+e,cy:R+r,radius:s,startAngle:j,endAngle:de,anticlockwise:c*f>m*h}}static arc(e,r,n,i,s,o,l,h,c){const f=l-o,m=gl._segmentsCount(Math.abs(f)*s,Math.ceil(Math.abs(f)/yf)*40),p=f/(m*2),v=p*2,_=Math.cos(p),E=Math.sin(p),A=m-1,S=A%1/A;for(let b=0;b<=A;++b){const w=b+S*b,T=p+o+v*w,R=Math.cos(T),L=-Math.sin(T);c.push((_*R+E*L)*s+n,(_*-L+E*R)*s+i)}}}class cO{constructor(){this.reset()}begin(e,r,n){this.reset(),this.style=e,this.start=r,this.attribStart=n}end(e,r){this.attribSize=r-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class d_{static curveLength(e,r,n,i,s,o,l,h){let c=0,f=0,m=0,p=0,v=0,_=0,E=0,A=0,S=0,b=0,w=0,T=e,R=r;for(let L=1;L<=10;++L)f=L/10,m=f*f,p=m*f,v=1-f,_=v*v,E=_*v,A=E*e+3*_*f*n+3*v*m*s+p*l,S=E*r+3*_*f*i+3*v*m*o+p*h,b=T-A,w=R-S,T=A,R=S,c+=Math.sqrt(b*b+w*w);return c}static curveTo(e,r,n,i,s,o,l){const h=l[l.length-2],c=l[l.length-1];l.length-=2;const f=gl._segmentsCount(d_.curveLength(h,c,e,r,n,i,s,o));let m=0,p=0,v=0,_=0,E=0;l.push(h,c);for(let A=1,S=0;A<=f;++A)S=A/f,m=1-S,p=m*m,v=p*m,_=S*S,E=_*S,l.push(v*h+3*p*S*e+3*m*_*n+E*s,v*c+3*p*S*r+3*m*_*i+E*o)}}function LE(t,e,r,n,i,s,o,l){const h=t-r*i,c=e-n*i,f=t+r*s,m=e+n*s;let p,v;o?(p=n,v=-r):(p=-n,v=r);const _=h+p,E=c+v,A=f+p,S=m+v;return l.push(_,E,A,S),2}function wo(t,e,r,n,i,s,o,l){const h=r-t,c=n-e;let f=Math.atan2(h,c),m=Math.atan2(i-t,s-e);l&&f<m?f+=Math.PI*2:!l&&f>m&&(m+=Math.PI*2);let p=f;const v=m-f,_=Math.abs(v),E=Math.sqrt(h*h+c*c),A=(15*_*Math.sqrt(E)/Math.PI>>0)+1,S=v/A;if(p+=S,l){o.push(t,e,r,n);for(let b=1,w=p;b<A;b++,w+=S)o.push(t,e,t+Math.sin(w)*E,e+Math.cos(w)*E);o.push(t,e,i,s)}else{o.push(r,n,t,e);for(let b=1,w=p;b<A;b++,w+=S)o.push(t+Math.sin(w)*E,e+Math.cos(w)*E,t,e);o.push(i,s,t,e)}return A*2}function dO(t,e){const r=t.shape;let n=t.points||r.points.slice();const i=e.closePointEps;if(n.length===0)return;const s=t.lineStyle,o=new Ge(n[0],n[1]),l=new Ge(n[n.length-2],n[n.length-1]),h=r.type!==or.POLY||r.closeStroke,c=Math.abs(o.x-l.x)<i&&Math.abs(o.y-l.y)<i;if(h){n=n.slice(),c&&(n.pop(),n.pop(),l.set(n[n.length-2],n[n.length-1]));const ae=(o.x+l.x)*.5,k=(l.y+o.y)*.5;n.unshift(ae,k),n.push(ae,k)}const f=e.points,m=n.length/2;let p=n.length;const v=f.length/2,_=s.width/2,E=_*_,A=s.miterLimit*s.miterLimit;let S=n[0],b=n[1],w=n[2],T=n[3],R=0,L=0,D=-(b-T),M=S-w,Y=0,j=0,de=Math.sqrt(D*D+M*M);D/=de,M/=de,D*=_,M*=_;const re=s.alignment,F=(1-re)*2,V=re*2;h||(s.cap===zs.ROUND?p+=wo(S-D*(F-V)*.5,b-M*(F-V)*.5,S-D*F,b-M*F,S+D*V,b+M*V,f,!0)+2:s.cap===zs.SQUARE&&(p+=LE(S,b,D,M,F,V,!0,f))),f.push(S-D*F,b-M*F,S+D*V,b+M*V);for(let ae=1;ae<m-1;++ae){S=n[(ae-1)*2],b=n[(ae-1)*2+1],w=n[ae*2],T=n[ae*2+1],R=n[(ae+1)*2],L=n[(ae+1)*2+1],D=-(b-T),M=S-w,de=Math.sqrt(D*D+M*M),D/=de,M/=de,D*=_,M*=_,Y=-(T-L),j=w-R,de=Math.sqrt(Y*Y+j*j),Y/=de,j/=de,Y*=_,j*=_;const k=w-S,X=b-T,O=w-R,G=L-T,ie=k*O+X*G,q=X*O-G*k,$=q<0;if(Math.abs(q)<.001*Math.abs(ie)){f.push(w-D*F,T-M*F,w+D*V,T+M*V),ie>=0&&(s.join===vn.ROUND?p+=wo(w,T,w-D*F,T-M*F,w-Y*F,T-j*F,f,!1)+4:p+=2,f.push(w-Y*V,T-j*V,w+Y*F,T+j*F));continue}const se=(-D+S)*(-M+T)-(-D+w)*(-M+b),ce=(-Y+R)*(-j+T)-(-Y+w)*(-j+L),ve=(k*ce-O*se)/q,ke=(G*se-X*ce)/q,Re=(ve-w)*(ve-w)+(ke-T)*(ke-T),he=w+(ve-w)*F,P=T+(ke-T)*F,we=w-(ve-w)*V,ye=T-(ke-T)*V,Ve=Math.min(k*k+X*X,O*O+G*G),Qe=$?F:V,Ke=Ve+Qe*Qe*E,Ut=Re<=Ke;let at=s.join;if(at===vn.MITER&&Re/E>A&&(at=vn.BEVEL),Ut)switch(at){case vn.MITER:{f.push(he,P,we,ye);break}case vn.BEVEL:{$?f.push(he,P,w+D*V,T+M*V,he,P,w+Y*V,T+j*V):f.push(w-D*F,T-M*F,we,ye,w-Y*F,T-j*F,we,ye),p+=2;break}case vn.ROUND:{$?(f.push(he,P,w+D*V,T+M*V),p+=wo(w,T,w+D*V,T+M*V,w+Y*V,T+j*V,f,!0)+4,f.push(he,P,w+Y*V,T+j*V)):(f.push(w-D*F,T-M*F,we,ye),p+=wo(w,T,w-D*F,T-M*F,w-Y*F,T-j*F,f,!1)+4,f.push(w-Y*F,T-j*F,we,ye));break}}else{switch(f.push(w-D*F,T-M*F,w+D*V,T+M*V),at){case vn.MITER:{$?f.push(we,ye,we,ye):f.push(he,P,he,P),p+=2;break}case vn.ROUND:{$?p+=wo(w,T,w+D*V,T+M*V,w+Y*V,T+j*V,f,!0)+2:p+=wo(w,T,w-D*F,T-M*F,w-Y*F,T-j*F,f,!1)+2;break}}f.push(w-Y*F,T-j*F,w+Y*V,T+j*V),p+=2}}S=n[(m-2)*2],b=n[(m-2)*2+1],w=n[(m-1)*2],T=n[(m-1)*2+1],D=-(b-T),M=S-w,de=Math.sqrt(D*D+M*M),D/=de,M/=de,D*=_,M*=_,f.push(w-D*F,T-M*F,w+D*V,T+M*V),h||(s.cap===zs.ROUND?p+=wo(w-D*(F-V)*.5,T-M*(F-V)*.5,w-D*F,T-M*F,w+D*V,T+M*V,f,!1)+2:s.cap===zs.SQUARE&&(p+=LE(w,T,D,M,F,V,!1,f)));const ne=e.indices,fe=gl.epsilon*gl.epsilon;for(let ae=v;ae<p+v-2;++ae)S=f[ae*2],b=f[ae*2+1],w=f[(ae+1)*2],T=f[(ae+1)*2+1],R=f[(ae+2)*2],L=f[(ae+2)*2+1],!(Math.abs(S*(T-L)+w*(L-b)+R*(b-T))<fe)&&ne.push(ae,ae+1,ae+2)}function fO(t,e){let r=0;const n=t.shape,i=t.points||n.points,s=n.type!==or.POLY||n.closeStroke;if(i.length===0)return;const o=e.points,l=e.indices,h=i.length/2,c=o.length/2;let f=c;for(o.push(i[0],i[1]),r=1;r<h;r++)o.push(i[r*2],i[r*2+1]),l.push(f,f+1),f++;s&&l.push(f,c)}function UE(t,e){t.lineStyle.native?fO(t,e):dO(t,e)}class f_{static curveLength(e,r,n,i,s,o){const l=e-2*n+s,h=r-2*i+o,c=2*n-2*e,f=2*i-2*r,m=4*(l*l+h*h),p=4*(l*c+h*f),v=c*c+f*f,_=2*Math.sqrt(m+p+v),E=Math.sqrt(m),A=2*m*E,S=2*Math.sqrt(v),b=p/E;return(A*_+E*p*(_-S)+(4*v*m-p*p)*Math.log((2*E+b+_)/(b+S)))/(4*A)}static curveTo(e,r,n,i,s){const o=s[s.length-2],l=s[s.length-1],h=gl._segmentsCount(f_.curveLength(o,l,e,r,n,i));let c=0,f=0;for(let m=1;m<=h;++m){const p=m/h;c=o+(e-o)*p,f=l+(r-l)*p,s.push(c+(e+(n-e)*p-c)*p,f+(r+(i-r)*p-f)*p)}}}const Vg={[or.POLY]:NC,[or.CIRC]:Tf,[or.ELIP]:Tf,[or.RECT]:uO,[or.RREC]:hO},zE=[],qc=[];class Af{constructor(e,r=null,n=null,i=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=r,this.matrix=i,this.type=e.type}clone(){return new Af(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const Ea=new Ge,DC=class OC extends UA{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new Ef,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),qc.push(this.drawCalls[e]);this.drawCalls.length=0;for(let e=0;e<this.batches.length;e++){const r=this.batches[e];r.reset(),zE.push(r)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(e,r=null,n=null,i=null){const s=new Af(e,r,n,i);return this.graphicsData.push(s),this.dirty++,this}drawHole(e,r=null){if(!this.graphicsData.length)return null;const n=new Af(e,null,null,r),i=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=i.lineStyle,i.holes.push(n),this.dirty++,this}destroy(){super.destroy();for(let e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(e){const r=this.graphicsData;for(let n=0;n<r.length;++n){const i=r[n];if(i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(e,Ea):Ea.copyFrom(e),i.shape.contains(Ea.x,Ea.y))){let s=!1;if(i.holes){for(let o=0;o<i.holes.length;o++)if(i.holes[o].shape.contains(Ea.x,Ea.y)){s=!0;break}}if(!s)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const e=this.uvs,r=this.graphicsData;let n=null,i=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],i=n.style);for(let h=this.shapeIndex;h<r.length;h++){this.shapeIndex++;const c=r[h],f=c.fillStyle,m=c.lineStyle;Vg[c.type].build(c),c.matrix&&this.transformPoints(c.points,c.matrix),(f.visible||m.visible)&&this.processHoles(c.holes);for(let p=0;p<2;p++){const v=p===0?f:m;if(!v.visible)continue;const _=v.texture.baseTexture,E=this.indices.length,A=this.points.length/2;_.wrapMode=es.REPEAT,p===0?this.processFill(c):this.processLine(c);const S=this.points.length/2-A;S!==0&&(n&&!this._compareStyles(i,v)&&(n.end(E,A),n=null),n||(n=zE.pop()||new cO,n.begin(v,E,A),this.batches.push(n),i=v),this.addUvs(this.points,e,v.texture,A,S,v.matrix))}}const s=this.indices.length,o=this.points.length/2;if(n&&n.end(s,o),this.batches.length===0){this.batchable=!0;return}const l=o>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&l===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=l?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(e,r){return!(!e||!r||e.texture.baseTexture!==r.texture.baseTexture||e.color+e.alpha!==r.color+r.alpha||!!e.native!=!!r.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let e=0,r=this.graphicsData.length;e<r;e++){const n=this.graphicsData[e],i=n.fillStyle,s=n.lineStyle;if(i&&!i.texture.baseTexture.valid||s&&!s.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const e=this.batches;for(let r=0,n=e.length;r<n;r++){const i=e[r];for(let s=0;s<i.size;s++){const o=i.start+s;this.indicesUint16[o]=this.indicesUint16[o]-i.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const e=this.batches;for(let r=0;r<e.length;r++)if(e[r].style.native)return!1;return this.points.length<OC.BATCHABLE_SIZE*2}buildDrawCalls(){let e=++Ne._globalBatch;for(let m=0;m<this.drawCalls.length;m++)this.drawCalls[m].texArray.clear(),qc.push(this.drawCalls[m]);this.drawCalls.length=0;const r=this.colors,n=this.textureIds;let i=qc.pop();i||(i=new _v,i.texArray=new Sv),i.texArray.count=0,i.start=0,i.size=0,i.type=Wn.TRIANGLES;let s=0,o=null,l=0,h=!1,c=Wn.TRIANGLES,f=0;this.drawCalls.push(i);for(let m=0;m<this.batches.length;m++){const p=this.batches[m],v=8,_=p.style,E=_.texture.baseTexture;h!==!!_.native&&(h=!!_.native,c=h?Wn.LINES:Wn.TRIANGLES,o=null,s=v,e++),o!==E&&(o=E,E._batchEnabled!==e&&(s===v&&(e++,s=0,i.size>0&&(i=qc.pop(),i||(i=new _v,i.texArray=new Sv),this.drawCalls.push(i)),i.start=f,i.size=0,i.texArray.count=0,i.type=c),E.touched=1,E._batchEnabled=e,E._batchLocation=s,E.wrapMode=es.REPEAT,i.texArray.elements[i.texArray.count++]=E,s++)),i.size+=p.size,f+=p.size,l=E._batchLocation,this.addColors(r,_.color,_.alpha,p.attribSize,p.attribStart),this.addTextureIds(n,l,p.attribSize,p.attribStart)}Ne._globalBatch=e,this.packAttributes()}packAttributes(){const e=this.points,r=this.uvs,n=this.colors,i=this.textureIds,s=new ArrayBuffer(e.length*3*4),o=new Float32Array(s),l=new Uint32Array(s);let h=0;for(let c=0;c<e.length/2;c++)o[h++]=e[c*2],o[h++]=e[c*2+1],o[h++]=r[c*2],o[h++]=r[c*2+1],l[h++]=n[c],o[h++]=i[c];this._buffer.update(s),this._indexBuffer.update(this.indicesUint16)}processFill(e){e.holes.length?NC.triangulate(e,this):Vg[e.type].triangulate(e,this)}processLine(e){UE(e,this);for(let r=0;r<e.holes.length;r++)UE(e.holes[r],this)}processHoles(e){for(let r=0;r<e.length;r++){const n=e[r];Vg[n.type].build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}}calculateBounds(){const e=this._bounds;e.clear(),e.addVertexData(this.points,0,this.points.length),e.pad(this.boundsPadding,this.boundsPadding)}transformPoints(e,r){for(let n=0;n<e.length/2;n++){const i=e[n*2],s=e[n*2+1];e[n*2]=r.a*i+r.c*s+r.tx,e[n*2+1]=r.b*i+r.d*s+r.ty}}addColors(e,r,n,i,s=0){const o=rt.shared.setValue(r).toLittleEndianNumber(),l=rt.shared.setValue(o).toPremultiplied(n);e.length=Math.max(e.length,s+i);for(let h=0;h<i;h++)e[s+h]=l}addTextureIds(e,r,n,i=0){e.length=Math.max(e.length,i+n);for(let s=0;s<n;s++)e[i+s]=r}addUvs(e,r,n,i,s,o=null){let l=0;const h=r.length,c=n.frame;for(;l<s;){let m=e[(i+l)*2],p=e[(i+l)*2+1];if(o){const v=o.a*m+o.c*p+o.tx;p=o.b*m+o.d*p+o.ty,m=v}l++,r.push(m/c.width,p/c.height)}const f=n.baseTexture;(c.width<f.width||c.height<f.height)&&this.adjustUvs(r,n,h,s)}adjustUvs(e,r,n,i){const s=r.baseTexture,o=1e-6,l=n+i*2,h=r.frame,c=h.width/s.width,f=h.height/s.height;let m=h.x/h.width,p=h.y/h.height,v=Math.floor(e[n]+o),_=Math.floor(e[n+1]+o);for(let E=n+2;E<l;E+=2)v=Math.min(v,Math.floor(e[E]+o)),_=Math.min(_,Math.floor(e[E+1]+o));m-=v,p-=_;for(let E=n;E<l;E+=2)e[E]=(e[E]+m)*c,e[E+1]=(e[E+1]+p)*f}};DC.BATCHABLE_SIZE=100;let pO=DC;class fp{constructor(){this.color=16777215,this.alpha=1,this.texture=oe.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new fp;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=oe.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}class p_ extends fp{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=zs.BUTT,this.join=vn.MITER,this.miterLimit=10}clone(){const e=new p_;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1,this.cap=zs.BUTT,this.join=vn.MITER,this.miterLimit=10}}const Xg={},Lv=class Bd extends Pr{constructor(e=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new fp,this._lineStyle=new p_,this._matrix=null,this._holeMode=!1,this.state=Ni.for2d(),this._geometry=e||new pO,this._geometry.refCount++,this._transformID=-1,this._tintColor=new rt(16777215),this.blendMode=Me.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new Bd(this._geometry)}set blendMode(e){this.state.blendMode=e}get blendMode(){return this.state.blendMode}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e)}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(e=null,r=0,n,i=.5,s=!1){return typeof e=="number"&&(e={width:e,color:r,alpha:n,alignment:i,native:s}),this.lineTextureStyle(e)}lineTextureStyle(e){const r={width:0,texture:oe.WHITE,color:e!=null&&e.texture?16777215:0,matrix:null,alignment:.5,native:!1,cap:zs.BUTT,join:vn.MITER,miterLimit:10};e=Object.assign(r,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const n=e.width>0&&e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:n},e)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const e=this.currentPath.points,r=this.currentPath.points.length;r>2&&(this.drawShape(this.currentPath),this.currentPath=new Uo,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[r-2],e[r-1]))}else this.currentPath=new Uo,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(e,r){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=r,this}lineTo(e,r){this.currentPath||this.moveTo(0,0);const n=this.currentPath.points,i=n[n.length-2],s=n[n.length-1];return(i!==e||s!==r)&&n.push(e,r),this}_initCurve(e=0,r=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[e,r]):this.moveTo(e,r)}quadraticCurveTo(e,r,n,i){this._initCurve();const s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),f_.curveTo(e,r,n,i,s),this}bezierCurveTo(e,r,n,i,s,o){return this._initCurve(),d_.curveTo(e,r,n,i,s,o,this.currentPath.points),this}arcTo(e,r,n,i,s){this._initCurve(e,r);const o=this.currentPath.points,l=BE.curveTo(e,r,n,i,s,o);if(l){const{cx:h,cy:c,radius:f,startAngle:m,endAngle:p,anticlockwise:v}=l;this.arc(h,c,f,m,p,v)}return this}arc(e,r,n,i,s,o=!1){if(i===s)return this;if(!o&&s<=i?s+=yf:o&&i<=s&&(i+=yf),s-i===0)return this;const l=e+Math.cos(i)*n,h=r+Math.sin(i)*n,c=this._geometry.closePointEps;let f=this.currentPath?this.currentPath.points:null;if(f){const m=Math.abs(f[f.length-2]-l),p=Math.abs(f[f.length-1]-h);m<c&&p<c||f.push(l,h)}else this.moveTo(l,h),f=this.currentPath.points;return BE.arc(l,h,e,r,n,i,s,o,f),this}beginFill(e=0,r){return this.beginTextureFill({texture:oe.WHITE,color:e,alpha:r})}normalizeColor(e){const r=rt.shared.setValue(e.color??0);e.color=r.toNumber(),e.alpha??(e.alpha=r.alpha)}beginTextureFill(e){const r={texture:oe.WHITE,color:16777215,matrix:null};e=Object.assign(r,e),this.normalizeColor(e),this.currentPath&&this.startPoly();const n=e.alpha>0;return n?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:n},e)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(e,r,n,i){return this.drawShape(new De(e,r,n,i))}drawRoundedRect(e,r,n,i,s){return this.drawShape(new ap(e,r,n,i,s))}drawCircle(e,r,n){return this.drawShape(new sp(e,r,n))}drawEllipse(e,r,n,i){return this.drawShape(new op(e,r,n,i))}drawPolygon(...e){let r,n=!0;const i=e[0];i.points?(n=i.closeStroke,r=i.points):Array.isArray(e[0])?r=e[0]:r=e;const s=new Uo(r);return s.closeStroke=n,this.drawShape(s),this}drawShape(e){return this._holeMode?this._geometry.drawHole(e,this._matrix):this._geometry.drawShape(e,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const e=this._geometry.graphicsData;return e.length===1&&e[0].shape.type===or.RECT&&!e[0].matrix&&!e[0].holes.length&&!(e[0].lineStyle.visible&&e[0].lineStyle.width)}_render(e){this.finishPoly();const r=this._geometry;r.updateBatches(),r.batchable?(this.batchDirty!==r.batchDirty&&this._populateBatches(),this._renderBatched(e)):(e.batch.flush(),this._renderDirect(e))}_populateBatches(){const e=this._geometry,r=this.blendMode,n=e.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=e.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(e.points);for(let i=0;i<n;i++){const s=e.batches[i],o=s.style.color,l=new Float32Array(this.vertexData.buffer,s.attribStart*4*2,s.attribSize*2),h=new Float32Array(e.uvsFloat32.buffer,s.attribStart*4*2,s.attribSize*2),c=new Uint16Array(e.indicesUint16.buffer,s.start*2,s.size),f={vertexData:l,blendMode:r,indices:c,uvs:h,_batchRGB:rt.shared.setValue(o).toRgbArray(),_tintRGB:o,_texture:s.style.texture,alpha:s.style.alpha,worldAlpha:1};this.batches[i]=f}}_renderBatched(e){if(this.batches.length){e.batch.setObjectRenderer(e.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let r=0,n=this.batches.length;r<n;r++){const i=this.batches[r];i.worldAlpha=this.worldAlpha*i.alpha,e.plugins[this.pluginName].render(i)}}}_renderDirect(e){const r=this._resolveDirectShader(e),n=this._geometry,i=this.worldAlpha,s=r.uniforms,o=n.drawCalls;s.translationMatrix=this.transform.worldTransform,rt.shared.setValue(this._tintColor).premultiply(i).toArray(s.tint),e.shader.bind(r),e.geometry.bind(n,r),e.state.set(this.state);for(let l=0,h=o.length;l<h;l++)this._renderDrawCallDirect(e,n.drawCalls[l])}_renderDrawCallDirect(e,r){const{texArray:n,type:i,size:s,start:o}=r,l=n.count;for(let h=0;h<l;h++)e.texture.bind(n.elements[h],h);e.geometry.draw(i,s,o)}_resolveDirectShader(e){let r=this.shader;const n=this.pluginName;if(!r){if(!Xg[n]){const{maxTextures:i}=e.plugins[n],s=new Int32Array(i);for(let h=0;h<i;h++)s[h]=h;const o={tint:new Float32Array([1,1,1,1]),translationMatrix:new ot,default:Kn.from({uSamplers:s},!0)},l=e.plugins[n]._shader.program;Xg[n]=new Ii(l,o)}r=Xg[n]}return r}_calculateBounds(){this.finishPoly();const e=this._geometry;if(!e.graphicsData.length)return;const{minX:r,minY:n,maxX:i,maxY:s}=e.bounds;this._bounds.addFrame(this.transform,r,n,i,s)}containsPoint(e){return this.worldTransform.applyInverse(e,Bd._TEMP_POINT),this._geometry.containsPoint(Bd._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this._tintColor.toNumber();for(let e=0;e<this.batches.length;e++){const r=this.batches[e];r._tintRGB=rt.shared.setValue(this._tintColor).multiply(r._batchRGB).toLittleEndianNumber()}}}calculateVertices(){const e=this.transform._worldID;if(this._transformID===e)return;this._transformID=e;const r=this.transform.worldTransform,n=r.a,i=r.b,s=r.c,o=r.d,l=r.tx,h=r.ty,c=this._geometry.points,f=this.vertexData;let m=0;for(let p=0;p<c.length;p+=2){const v=c[p],_=c[p+1];f[m++]=n*v+s*_+l,f[m++]=o*_+i*v+h}}closePath(){const e=this.currentPath;return e&&(e.closeStroke=!0,this.finishPoly()),this}setMatrix(e){return this._matrix=e,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(e){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(e)}};Lv.curves=gl,Lv._TEMP_POINT=new Ge;let Mu=Lv;class mO extends cp{constructor(e=100,r=100,n=10,i=10){super(),this.segWidth=n,this.segHeight=i,this.width=e,this.height=r,this.build()}build(){const e=this.segWidth*this.segHeight,r=[],n=[],i=[],s=this.segWidth-1,o=this.segHeight-1,l=this.width/s,h=this.height/o;for(let f=0;f<e;f++){const m=f%this.segWidth,p=f/this.segWidth|0;r.push(m*l,p*h),n.push(m/s,p/o)}const c=s*o;for(let f=0;f<c;f++){const m=f%s,p=f/s|0,v=p*this.segWidth+m,_=p*this.segWidth+m+1,E=(p+1)*this.segWidth+m,A=(p+1)*this.segWidth+m+1;i.push(v,_,E,_,A,E)}this.buffers[0].data=new Float32Array(r),this.buffers[1].data=new Float32Array(n),this.indexBuffer.data=new Uint16Array(i),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}}class gO extends cp{constructor(e=200,r,n=0){super(new Float32Array(r.length*4),new Float32Array(r.length*4),new Uint16Array((r.length-1)*6)),this.points=r,this._width=e,this.textureScale=n,this.build()}get width(){return this._width}build(){const e=this.points;if(!e)return;const r=this.getBuffer("aVertexPosition"),n=this.getBuffer("aTextureCoord"),i=this.getIndex();if(e.length<1)return;r.data.length/4!==e.length&&(r.data=new Float32Array(e.length*4),n.data=new Float32Array(e.length*4),i.data=new Uint16Array((e.length-1)*6));const s=n.data,o=i.data;s[0]=0,s[1]=0,s[2]=0,s[3]=1;let l=0,h=e[0];const c=this._width*this.textureScale,f=e.length;for(let p=0;p<f;p++){const v=p*4;if(this.textureScale>0){const _=h.x-e[p].x,E=h.y-e[p].y,A=Math.sqrt(_*_+E*E);h=e[p],l+=A/c}else l=p/(f-1);s[v]=l,s[v+1]=0,s[v+2]=l,s[v+3]=1}let m=0;for(let p=0;p<f-1;p++){const v=p*2;o[m++]=v,o[m++]=v+1,o[m++]=v+2,o[m++]=v+2,o[m++]=v+1,o[m++]=v+3}n.update(),i.update(),this.updateVertices()}updateVertices(){const e=this.points;if(e.length<1)return;let r=e[0],n,i=0,s=0;const o=this.buffers[0].data,l=e.length,h=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let c=0;c<l;c++){const f=e[c],m=c*4;c<e.length-1?n=e[c+1]:n=f,s=-(n.x-r.x),i=n.y-r.y;const p=Math.sqrt(i*i+s*s);p<1e-6?(i=0,s=0):(i/=p,s/=p,i*=h,s*=h),o[m]=f.x+i,o[m+1]=f.y+s,o[m+2]=f.x-i,o[m+3]=f.y-s,r=f}this.buffers[0].update()}update(){this.textureScale>0?this.build():this.updateVertices()}}class yO extends eh{constructor(e,r,n){const i=new mO(e.width,e.height,r,n),s=new th(oe.WHITE);super(i,s),this.texture=e,this.autoResize=!0}textureUpdated(){this._textureID=this.shader.texture._updateID;const e=this.geometry,{width:r,height:n}=this.shader.texture;this.autoResize&&(e.width!==r||e.height!==n)&&(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())}set texture(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))}get texture(){return this.shader.texture}_render(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),super._render(e)}destroy(e){this.shader.texture.off("update",this.textureUpdated,this),super.destroy(e)}}const Zc=10;class vO extends yO{constructor(e,r,n,i,s){var o,l,h,c;super(oe.WHITE,4,4),this._origWidth=e.orig.width,this._origHeight=e.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=r??((o=e.defaultBorders)==null?void 0:o.left)??Zc,this._rightWidth=i??((l=e.defaultBorders)==null?void 0:l.right)??Zc,this._topHeight=n??((h=e.defaultBorders)==null?void 0:h.top)??Zc,this._bottomHeight=s??((c=e.defaultBorders)==null?void 0:c.bottom)??Zc,this.texture=e}textureUpdated(){this._textureID=this.shader.texture._updateID,this._refresh()}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(e){this.geometry.getBuffer("aVertexPosition").data=e}updateHorizontalVertices(){const e=this.vertices,r=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height}updateVerticalVertices(){const e=this.vertices,r=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width}_getMinScale(){const e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e,n=this._topHeight+this._bottomHeight,i=this._height>n?1:this._height/n;return Math.min(r,i)}get width(){return this._width}set width(e){this._width=e,this._refresh()}get height(){return this._height}set height(e){this._height=e,this._refresh()}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this._refresh()}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this._refresh()}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this._refresh()}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this._refresh()}_refresh(){const e=this.texture,r=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;const n=1/this._origWidth,i=1/this._origHeight;r[0]=r[8]=r[16]=r[24]=0,r[1]=r[3]=r[5]=r[7]=0,r[6]=r[14]=r[22]=r[30]=1,r[25]=r[27]=r[29]=r[31]=1,r[2]=r[10]=r[18]=r[26]=n*this._leftWidth,r[4]=r[12]=r[20]=r[28]=1-n*this._rightWidth,r[9]=r[11]=r[13]=r[15]=i*this._topHeight,r[17]=r[19]=r[21]=r[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}class _O extends eh{constructor(e=oe.EMPTY,r,n,i,s){const o=new cp(r,n,i);o.getBuffer("aVertexPosition").static=!1;const l=new th(e);super(o,l,null,s),this.autoUpdate=!0}get vertices(){return this.geometry.getBuffer("aVertexPosition").data}set vertices(e){this.geometry.getBuffer("aVertexPosition").data=e}_render(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),super._render(e)}}class xO extends eh{constructor(e,r,n=0){const i=new gO(e.height,r,n),s=new th(e);n>0&&(e.baseTexture.wrapMode=es.REPEAT),super(i,s),this.autoUpdate=!0}_render(e){const r=this.geometry;(this.autoUpdate||r._width!==this.shader.texture.height)&&(r._width=this.shader.texture.height,r.update()),super._render(e)}}class wO extends Pr{constructor(e=1500,r,n=16384,i=!1){super();const s=16384;n>s&&(n=s),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=n,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=Me.NORMAL,this.autoResize=i,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tintColor=new rt(0),this.tintRgb=new Float32Array(3),this.tint=16777215}setProperties(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])}updateTransform(){this.displayObjectUpdateTransform()}get tint(){return this._tintColor.value}set tint(e){this._tintColor.setValue(e),this._tintColor.toRgbArray(this.tintRgb)}render(e){!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",()=>this.onChildrenChange(0))),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))}onChildrenChange(e){const r=Math.floor(e/this._batchSize);for(;this._bufferUpdateIDs.length<r;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[r]=++this._updateID}dispose(){if(this._buffers){for(let e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._buffers=null}}destroy(e){super.destroy(e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null}}class GE{constructor(e,r,n){this.geometry=new Js,this.indexBuffer=null,this.size=n,this.dynamicProperties=[],this.staticProperties=[];for(let i=0;i<e.length;++i){let s=e[i];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||Ae.FLOAT,offset:s.offset},r[i]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}initBuffers(){const e=this.geometry;let r=0;this.indexBuffer=new Ct(D4(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(let o=0;o<this.dynamicProperties.length;++o){const l=this.dynamicProperties[o];l.offset=r,r+=l.size,this.dynamicStride+=l.size}const n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new Ct(this.dynamicData,!1,!1);let i=0;this.staticStride=0;for(let o=0;o<this.staticProperties.length;++o){const l=this.staticProperties[o];l.offset=i,i+=l.size,this.staticStride+=l.size}const s=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(s),this.staticDataUint32=new Uint32Array(s),this.staticBuffer=new Ct(this.staticData,!0,!1);for(let o=0;o<this.dynamicProperties.length;++o){const l=this.dynamicProperties[o];e.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===Ae.UNSIGNED_BYTE,l.type,this.dynamicStride*4,l.offset*4)}for(let o=0;o<this.staticProperties.length;++o){const l=this.staticProperties[o];e.addAttribute(l.attributeName,this.staticBuffer,0,l.type===Ae.UNSIGNED_BYTE,l.type,this.staticStride*4,l.offset*4)}}uploadDynamic(e,r,n){for(let i=0;i<this.dynamicProperties.length;i++){const s=this.dynamicProperties[i];s.uploadFunction(e,r,n,s.type===Ae.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,s.offset)}this.dynamicBuffer._updateID++}uploadStatic(e,r,n){for(let i=0;i<this.staticProperties.length;i++){const s=this.staticProperties[i];s.uploadFunction(e,r,n,s.type===Ae.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,s.offset)}this.staticBuffer._updateID++}destroy(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()}}var EO=`varying vec2 vTextureCoord;
693
+ varying vec4 vColor;
694
+
695
+ uniform sampler2D uSampler;
696
+
697
+ void main(void){
698
+ vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
699
+ gl_FragColor = color;
700
+ }`,SO=`attribute vec2 aVertexPosition;
701
+ attribute vec2 aTextureCoord;
702
+ attribute vec4 aColor;
703
+
704
+ attribute vec2 aPositionCoord;
705
+ attribute float aRotation;
706
+
707
+ uniform mat3 translationMatrix;
708
+ uniform vec4 uColor;
709
+
710
+ varying vec2 vTextureCoord;
711
+ varying vec4 vColor;
712
+
713
+ void main(void){
714
+ float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);
715
+ float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);
716
+
717
+ vec2 v = vec2(x, y);
718
+ v = v + aPositionCoord;
719
+
720
+ gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
721
+
722
+ vTextureCoord = aTextureCoord;
723
+ vColor = aColor * uColor;
724
+ }
725
+ `;class FC extends up{constructor(e){super(e),this.shader=null,this.properties=null,this.tempMatrix=new ot,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:Ae.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=Ii.from(SO,EO,{}),this.state=Ni.for2d()}render(e){const r=e.children,n=e._maxSize,i=e._batchSize,s=this.renderer;let o=r.length;if(o===0)return;o>n&&!e.autoResize&&(o=n);let l=e._buffers;l||(l=e._buffers=this.generateBuffers(e));const h=r[0]._texture.baseTexture,c=h.alphaMode>0;this.state.blendMode=FA(e.blendMode,c),s.state.set(this.state);const f=s.gl,m=e.worldTransform.copyTo(this.tempMatrix);m.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=m.toArray(!0),this.shader.uniforms.uColor=rt.shared.setValue(e.tintRgb).premultiply(e.worldAlpha,c).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let p=!1;for(let v=0,_=0;v<o;v+=i,_+=1){let E=o-v;E>i&&(E=i),_>=l.length&&l.push(this._generateOneMoreBuffer(e));const A=l[_];A.uploadDynamic(r,v,E);const S=e._bufferUpdateIDs[_]||0;p=p||A._updateID<S,p&&(A._updateID=e._updateID,A.uploadStatic(r,v,E)),s.geometry.bind(A.geometry),f.drawElements(f.TRIANGLES,E*6,f.UNSIGNED_SHORT,0)}}generateBuffers(e){const r=[],n=e._maxSize,i=e._batchSize,s=e._properties;for(let o=0;o<n;o+=i)r.push(new GE(this.properties,s,i));return r}_generateOneMoreBuffer(e){const r=e._batchSize,n=e._properties;return new GE(this.properties,n,r)}uploadVertices(e,r,n,i,s,o){let l=0,h=0,c=0,f=0;for(let m=0;m<n;++m){const p=e[r+m],v=p._texture,_=p.scale.x,E=p.scale.y,A=v.trim,S=v.orig;A?(h=A.x-p.anchor.x*S.width,l=h+A.width,f=A.y-p.anchor.y*S.height,c=f+A.height):(l=S.width*(1-p.anchor.x),h=S.width*-p.anchor.x,c=S.height*(1-p.anchor.y),f=S.height*-p.anchor.y),i[o]=h*_,i[o+1]=f*E,i[o+s]=l*_,i[o+s+1]=f*E,i[o+s*2]=l*_,i[o+s*2+1]=c*E,i[o+s*3]=h*_,i[o+s*3+1]=c*E,o+=s*4}}uploadPosition(e,r,n,i,s,o){for(let l=0;l<n;l++){const h=e[r+l].position;i[o]=h.x,i[o+1]=h.y,i[o+s]=h.x,i[o+s+1]=h.y,i[o+s*2]=h.x,i[o+s*2+1]=h.y,i[o+s*3]=h.x,i[o+s*3+1]=h.y,o+=s*4}}uploadRotation(e,r,n,i,s,o){for(let l=0;l<n;l++){const h=e[r+l].rotation;i[o]=h,i[o+s]=h,i[o+s*2]=h,i[o+s*3]=h,o+=s*4}}uploadUvs(e,r,n,i,s,o){for(let l=0;l<n;++l){const h=e[r+l]._texture._uvs;h?(i[o]=h.x0,i[o+1]=h.y0,i[o+s]=h.x1,i[o+s+1]=h.y1,i[o+s*2]=h.x2,i[o+s*2+1]=h.y2,i[o+s*3]=h.x3,i[o+s*3+1]=h.y3,o+=s*4):(i[o]=0,i[o+1]=0,i[o+s]=0,i[o+s+1]=0,i[o+s*2]=0,i[o+s*2+1]=0,i[o+s*3]=0,i[o+s*3+1]=0,o+=s*4)}}uploadTint(e,r,n,i,s,o){for(let l=0;l<n;++l){const h=e[r+l],c=rt.shared.setValue(h._tintRGB).toPremultiplied(h.alpha,h.texture.baseTexture.alphaMode>0);i[o]=c,i[o+s]=c,i[o+s*2]=c,i[o+s*3]=c,o+=s*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}FC.extension={name:"particle",type:ue.RendererPlugin};Se.add(FC);class rh extends Di{constructor(e,r=!0){super(e[0]instanceof oe?e[0]:e[0].texture),this._textures=null,this._durations=null,this._autoUpdate=r,this._isConnectedToTicker=!1,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this._playing=!1,this._previousFrame=null,this.textures=e}stop(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Qt.shared.remove(this.update,this),this._isConnectedToTicker=!1))}play(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Qt.shared.add(this.update,this,eo.HIGH),this._isConnectedToTicker=!0))}gotoAndStop(e){this.stop(),this.currentFrame=e}gotoAndPlay(e){this.currentFrame=e,this.play()}update(e){if(!this._playing)return;const r=this.animationSpeed*e,n=this.currentFrame;if(this._durations!==null){let i=this._currentTime%1*this._durations[this.currentFrame];for(i+=r/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];const s=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=r;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<n||this.animationSpeed<0&&this.currentFrame>n)&&this.onLoop(),this.updateTexture())}updateTexture(){const e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))}destroy(e){this.stop(),super.destroy(e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null}static fromFrames(e){const r=[];for(let n=0;n<e.length;++n)r.push(oe.from(e[n]));return new rh(r)}static fromImages(e){const r=[];for(let n=0;n<e.length;++n)r.push(oe.from(e[n]));return new rh(r)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(e){if(e[0]instanceof oe)this._textures=e,this._durations=null;else{this._textures=[],this._durations=[];for(let r=0;r<e.length;r++)this._textures.push(e[r].texture),this._durations.push(e[r].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()}get currentFrame(){let e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}set currentFrame(e){if(e<0||e>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);const r=this.currentFrame;this._currentTime=e,r!==this.currentFrame&&this.updateTexture()}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Qt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Qt.shared.add(this.update,this),this._isConnectedToTicker=!0))}}const nu=new Ge;class m_ extends Di{constructor(e,r=100,n=100){super(e),this.tileTransform=new lp,this._width=r,this._height=n,this.uvMatrix=this.texture.uvMatrix||new l_(e),this.pluginName="tilingSprite",this.uvRespectAnchor=!1}get clampMargin(){return this.uvMatrix.clampMargin}set clampMargin(e){this.uvMatrix.clampMargin=e,this.uvMatrix.update(!0)}get tileScale(){return this.tileTransform.scale}set tileScale(e){this.tileTransform.scale.copyFrom(e)}get tilePosition(){return this.tileTransform.position}set tilePosition(e){this.tileTransform.position.copyFrom(e)}_onTextureUpdate(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215}_render(e){const r=this._texture;!r||!r.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),e.batch.setObjectRenderer(e.plugins[this.pluginName]),e.plugins[this.pluginName].render(this))}_calculateBounds(){const e=this._width*-this._anchor._x,r=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,e,r,n,i)}getLocalBounds(e){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new De),e=this._localBoundsRect),this._bounds.getRectangle(e)):super.getLocalBounds.call(this,e)}containsPoint(e){this.worldTransform.applyInverse(e,nu);const r=this._width,n=this._height,i=-r*this.anchor._x;if(nu.x>=i&&nu.x<i+r){const s=-n*this.anchor._y;if(nu.y>=s&&nu.y<s+n)return!0}return!1}destroy(e){super.destroy(e),this.tileTransform=null,this.uvMatrix=null}static from(e,r){const n=e instanceof oe?e:oe.from(e,r);return new m_(n,r.width,r.height)}get width(){return this._width}set width(e){this._width=e}get height(){return this._height}set height(e){this._height=e}}var bO=`#version 300 es
726
+ #define SHADER_NAME Tiling-Sprite-100
727
+
728
+ precision lowp float;
729
+
730
+ in vec2 vTextureCoord;
731
+
732
+ out vec4 fragmentColor;
733
+
734
+ uniform sampler2D uSampler;
735
+ uniform vec4 uColor;
736
+ uniform mat3 uMapCoord;
737
+ uniform vec4 uClampFrame;
738
+ uniform vec2 uClampOffset;
739
+
740
+ void main(void)
741
+ {
742
+ vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
743
+ coord = (uMapCoord * vec3(coord, 1.0)).xy;
744
+ vec2 unclamped = coord;
745
+ coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
746
+
747
+ vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0
748
+
749
+ fragmentColor = texSample * uColor;
750
+ }
751
+ `,TO=`#version 300 es
752
+ #define SHADER_NAME Tiling-Sprite-300
753
+
754
+ precision lowp float;
755
+
756
+ in vec2 aVertexPosition;
757
+ in vec2 aTextureCoord;
758
+
759
+ uniform mat3 projectionMatrix;
760
+ uniform mat3 translationMatrix;
761
+ uniform mat3 uTransform;
762
+
763
+ out vec2 vTextureCoord;
764
+
765
+ void main(void)
766
+ {
767
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
768
+
769
+ vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
770
+ }
771
+ `,AO=`#version 100
772
+ #ifdef GL_EXT_shader_texture_lod
773
+ #extension GL_EXT_shader_texture_lod : enable
774
+ #endif
775
+ #define SHADER_NAME Tiling-Sprite-100
776
+
777
+ precision lowp float;
778
+
779
+ varying vec2 vTextureCoord;
780
+
781
+ uniform sampler2D uSampler;
782
+ uniform vec4 uColor;
783
+ uniform mat3 uMapCoord;
784
+ uniform vec4 uClampFrame;
785
+ uniform vec2 uClampOffset;
786
+
787
+ void main(void)
788
+ {
789
+ vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);
790
+ coord = (uMapCoord * vec3(coord, 1.0)).xy;
791
+ vec2 unclamped = coord;
792
+ coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
793
+
794
+ #ifdef GL_EXT_shader_texture_lod
795
+ vec4 texSample = unclamped == coord
796
+ ? texture2D(uSampler, coord)
797
+ : texture2DLodEXT(uSampler, coord, 0);
798
+ #else
799
+ vec4 texSample = texture2D(uSampler, coord);
800
+ #endif
801
+
802
+ gl_FragColor = texSample * uColor;
803
+ }
804
+ `,HE=`#version 100
805
+ #define SHADER_NAME Tiling-Sprite-100
806
+
807
+ precision lowp float;
808
+
809
+ attribute vec2 aVertexPosition;
810
+ attribute vec2 aTextureCoord;
811
+
812
+ uniform mat3 projectionMatrix;
813
+ uniform mat3 translationMatrix;
814
+ uniform mat3 uTransform;
815
+
816
+ varying vec2 vTextureCoord;
817
+
818
+ void main(void)
819
+ {
820
+ gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
821
+
822
+ vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
823
+ }
824
+ `,CO=`#version 100
825
+ #define SHADER_NAME Tiling-Sprite-Simple-100
826
+
827
+ precision lowp float;
828
+
829
+ varying vec2 vTextureCoord;
830
+
831
+ uniform sampler2D uSampler;
832
+ uniform vec4 uColor;
833
+
834
+ void main(void)
835
+ {
836
+ vec4 texSample = texture2D(uSampler, vTextureCoord);
837
+ gl_FragColor = texSample * uColor;
838
+ }
839
+ `;const Jc=new ot;class BC extends up{constructor(e){super(e),e.runners.contextChange.add(this),this.quad=new QA,this.state=Ni.for2d()}contextChange(){const e=this.renderer,r={globals:e.globalUniforms};this.simpleShader=Ii.from(HE,CO,r),this.shader=e.context.webGLVersion>1?Ii.from(TO,bO,r):Ii.from(HE,AO,r)}render(e){const r=this.renderer,n=this.quad;let i=n.vertices;i[0]=i[6]=e._width*-e.anchor.x,i[1]=i[3]=e._height*-e.anchor.y,i[2]=i[4]=e._width*(1-e.anchor.x),i[5]=i[7]=e._height*(1-e.anchor.y);const s=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;i=n.uvs,i[0]=i[6]=-s,i[1]=i[3]=-o,i[2]=i[4]=1-s,i[5]=i[7]=1-o,n.invalidate();const l=e._texture,h=l.baseTexture,c=h.alphaMode>0,f=e.tileTransform.localTransform,m=e.uvMatrix;let p=h.isPowerOfTwo&&l.frame.width===h.width&&l.frame.height===h.height;p&&(h._glTextures[r.CONTEXT_UID]?p=h.wrapMode!==es.CLAMP:h.wrapMode===es.CLAMP&&(h.wrapMode=es.REPEAT));const v=p?this.simpleShader:this.shader,_=l.width,E=l.height,A=e._width,S=e._height;Jc.set(f.a*_/A,f.b*_/S,f.c*E/A,f.d*E/S,f.tx/A,f.ty/S),Jc.invert(),p?Jc.prepend(m.mapCoord):(v.uniforms.uMapCoord=m.mapCoord.toArray(!0),v.uniforms.uClampFrame=m.uClampFrame,v.uniforms.uClampOffset=m.uClampOffset),v.uniforms.uTransform=Jc.toArray(!0),v.uniforms.uColor=rt.shared.setValue(e.tint).premultiply(e.worldAlpha,c).toArray(v.uniforms.uColor),v.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),v.uniforms.uSampler=l,r.shader.bind(v),r.geometry.bind(n),this.state.blendMode=FA(e.blendMode,c),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}BC.extension={name:"tilingSprite",type:ue.RendererPlugin};Se.add(BC);const LC=class Uv{constructor(e){this.stage=new Pr,e=Object.assign({forceCanvas:!1},e),this.renderer=YN(e),Uv._plugins.forEach(r=>{r.init.call(this,e)})}render(){this.renderer.render(this.stage)}get view(){var e;return(e=this.renderer)==null?void 0:e.view}get screen(){var e;return(e=this.renderer)==null?void 0:e.screen}destroy(e,r){const n=Uv._plugins.slice(0);n.reverse(),n.forEach(i=>{i.destroy.call(this)}),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};LC._plugins=[];let pp=LC;Se.handleByList(ue.Application,pp._plugins);class UC{static init(e){Object.defineProperty(this,"resizeTo",{set(r){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=r,r&&(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 r,n;if(this._resizeTo===globalThis.window)r=globalThis.innerWidth,n=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;r=i,n=s}this.renderer.resize(r,n),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}}UC.extension=ue.Application;Se.add(UC);function tn(t){return tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(t)}function zC(t){var e=function(r,n){if(tn(r)!=="object"||r===null)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var s=i.call(r,n);if(tn(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(r)}(t,"string");return tn(e)==="symbol"?e:String(e)}function At(t,e,r){return(e=zC(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yg(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ls(t){return function(e){if(Array.isArray(e))return Yg(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,r){if(e){if(typeof e=="string")return Yg(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yg(e,r):void 0}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
840
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function bt(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i]}var PO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function IO(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var RO=function(t){return t==null};function fu(t){var e=[];if(t===void 0)return e;if(typeof t=="string")e=t.split(",");else if(typeof t=="number")e=[t];else if(Array.isArray(t))e=ls(t);else{if(t===null||tn(t)!=="object")return e;e=[t&&(t==null?void 0:t.x)||0,t&&(t==null?void 0:t.y)||0]}return e.filter(function(r){return!RO(r)&&!isNaN(r)}).map(Number)}function jE(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Qg(t){return t instanceof Ge||t instanceof bi}var Cf=["click","mousedown","mousemove","mouseout","mouseover","mouseup","mouseupoutside","tap","touchstart","touchmove","touchend","touchendoutside","pointercancel","pointerout","pointerover","pointertap","pointerdown","pointerup","pointerupoutside","pointermove","rightclick","rightdown","rightup","rightupoutside","touchcancel","touchendoutside","touchmove","touchstart"];function Kg(t,e,r){if(Qg(t[e])&&Qg(r))t[e].copyFrom(r);else if(Qg(t[e])){var n=fu(r);bt(n!==void 0&&n.length>0&&n.length<3,"The property `%s` is a `Point` and must be set to a comma-separated string of either coordinates, an array containing coordinates, or a Point.",e,JSON.stringify(r),tn(r)),t[e].set(n.shift(),n.shift())}else t[e]=r}var Sa,GC=function(t){var e,r=t;if(!Array.isArray(r)){if(e=t,Object.prototype.toString.call(e)!=="[object Object]")throw new Error("collection needs to be an Array or Object");r=Object.keys(t)}var n={};return r.forEach(function(i){n[i]=!0}),function(i){return n[i]!==void 0}},HC=function(t){return function(){return!t.apply(void 0,arguments)}},zv="children",MO=(At(Sa={},zv,!0),At(Sa,"parent",!0),At(Sa,"worldAlpha",!0),At(Sa,"worldTransform",!0),At(Sa,"worldVisible",!0),Sa),Gv={alpha:1,buttonMode:!1,cacheAsBitmap:!1,cursor:null,filterArea:null,filters:null,hitArea:null,interactive:!1,mask:null,pivot:0,position:0,renderable:!0,rotation:0,scale:1,skew:0,transform:null,visible:!0,x:0,y:0},Mi=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=function(l){return requestAnimationFrame(function(){var h,c;l==null||(h=l.__reactpixi)===null||h===void 0||(c=h.root)===null||c===void 0||c.emit("__REACT_PIXI_REQUEST_RENDER__")})},i=function(l,h){if(r.hasOwnProperty(l))return bt(h.typeofs.some(function(c){return tn(r[l])===c})||h.instanceofs.some(function(c){return r[l]instanceof c}),"".concat(t," ").concat(l," prop is invalid")),r[l]};if(r.texture)return bt(r.texture instanceof oe,"".concat(t," texture needs to be typeof `Texture`")),r.texture;var s=i("image",{typeofs:["string"],instanceofs:[HTMLImageElement]})||i("video",{typeofs:["string"],instanceofs:[HTMLVideoElement]})||i("source",{typeofs:["string","number"],instanceofs:[HTMLImageElement,HTMLVideoElement,HTMLCanvasElement,oe]});bt(!!s,"".concat(t," could not get texture from props"));var o=oe.from(s);return o.__reactpixi={root:e},o.once("update",n),o.once("loaded",n),o.valid&&n(o),o},kO=HC(GC([].concat(ls(Object.keys(MO)),ls(Cf))));function ki(t,e,r){var n=!1;if(bt(ft.prototype.isPrototypeOf(t),"instance needs to be typeof `DisplayObject`, got `%s`",tn(t)),!r.ignoreEvents)for(var i=typeof t.removeListener=="function",s=typeof t.on=="function",o=0;o<Cf.length;o++){var l=Cf[o];e[l]!==r[l]&&(n=!0,typeof e[l]=="function"&&i&&t.removeListener(l,e[l]),typeof r[l]=="function"&&s&&t.on(l,r[l]))}var h=Object.keys(r||{});if(r.overwriteProps){for(var c=0;c<h.length;c++){var f=h[c];e[f]!==r[f]&&(n=!0,Kg(t,f,r[f]))}return n}for(var m=h.filter(kO),p=0;p<m.length;p++){var v=m[p],_=r[v];r[v]!==e[v]&&(n=!0),_!==void 0?Kg(t,v,_):v in Gv?(console.warn("setting default value: ".concat(v,", from: ").concat(t[v]," to: ").concat(_," for"),t),n=!0,Kg(t,v,Gv[v])):console.warn("ignoring prop: ".concat(v,", from ").concat(t[v]," to ").concat(_," for"),t)}return n}var NO=function(t,e){var r=e.text,n=e.style;return new _D(r,n)},DO=function(){return new Pr};function ao(t,e){if(t==null)return{};var r,n,i=function(o,l){if(o==null)return{};var h,c,f={},m=Object.keys(o);for(c=0;c<m.length;c++)h=m[c],l.indexOf(h)>=0||(f[h]=o[h]);return f}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var OO=["draw","geometry"],FO=function(t,e){var r=e.geometry;bt(!r||r instanceof Mu,"Graphics geometry needs to be a `Graphics`");var n=r?new Mu(r.geometry):new Mu;return n.applyProps=function(i,s,o){var l=o.draw;o.geometry;var h=ki(i,s,ao(o,OO));return s.draw!==l&&typeof l=="function"&&(h=!0,l.call(n,n)),h},n},BO=["image","texture"],LO=function(t,e){var r=e.leftWidth,n=r===void 0?10:r,i=e.topHeight,s=i===void 0?10:i,o=e.rightWidth,l=o===void 0?10:o,h=e.bottomHeight,c=h===void 0?10:h,f=Mi("NineSlicePlane",t,e),m=new vO(f,n,s,l,c);return m.applyProps=function(p,v,_){var E=_.image,A=_.texture,S=ki(p,v,ao(_,BO));return(E||A)&&(A!==v.texture&&(S=!0),p.texture=Mi("NineSlicePlane",t,_)),S},m};function $E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ed(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$E(Object(r),!0).forEach(function(n){At(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$E(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var UO=function(t,e){var r=e.maxSize,n=r===void 0?1500:r,i=e.batchSize,s=i===void 0?16384:i,o=e.autoResize,l=o!==void 0&&o,h=ed(ed({},{vertices:!1,scale:!0,position:!0,rotation:!0,uvs:!0,tint:!0}),e.properties||{}),c=ed(ed({},{children:!1,texture:!1,baseTexture:!1}),e.destroyOptions||{}),f=new wO(n,h,s,l);return f.willUnmount=function(m,p,v){m.destroy(c)},f},zO=["image","texture"],GO=function(t,e){var r=new Di(Mi("Sprite",t,e));return r.applyProps=function(n,i,s){var o=s.image,l=s.texture,h=ki(n,i,ao(s,zO));return(l&&i.texture!==s.texture||o&&i.image!==s.image)&&(i.texture!==s.texture&&(h=!0),n.texture=Mi("Sprite",t,s)),h},r},HO=["textures","isPlaying","initialFrame","images"],jO=function(t,e){var r=e.textures,n=e.images,i=e.isPlaying,s=i===void 0||i,o=e.initialFrame,l=function(c){return c.map(function(f){return bt(f instanceof oe||(f==null?void 0:f.texture),"AnimationSprite texture needs to be an array of `Texture` or `{ texture: Texture, time:\n number }`"),f})},h=n?rh.fromImages(n):new rh(l(r));return h[s?"gotoAndPlay":"gotoAndStop"](o||0),h.applyProps=function(c,f,m){var p=m.textures,v=m.isPlaying,_=m.initialFrame,E=m.images,A=ki(c,f,ao(m,HO));if(E&&f.images!==E){for(var S=[],b=0;b<E.length;++b)S.push(oe.from(E[b]));c.textures=S,A=!0}if(p&&f.textures!==p&&(c.textures=l(p),A=!0),v!==f.isPlaying||_!==f.initialFrame){var w=typeof _=="number"?_:h.currentFrame||0;h[v?"gotoAndPlay":"gotoAndStop"](w),A=!0}return A},h},$O=function(t,e){var r=e.text,n=r===void 0?"":r,i=e.style,s=i===void 0?{}:i,o=e.isSprite,l=new h_(n,s);return o?(l.updateText(),new Di(l.texture)):l},WO=["tileScale","tilePosition","image","texture"],VO=function(t,e){var r=e.width,n=r===void 0?100:r,i=e.height,s=i===void 0?100:i,o=Mi("TilingSprite",t,e),l=new m_(o,n,s);return l.applyProps=function(h,c,f){var m=f.tileScale,p=f.tilePosition,v=f.image,_=f.texture,E=ki(h,c,ao(f,WO));if(p){var A,S=fu(p);(A=h.tilePosition).set.apply(A,ls(S)),E=!jE(fu(c.tilePosition),S)||E}if(m){var b,w=fu(m);(b=h.tileScale).set.apply(b,ls(w)),E=!jE(fu(c.tileScale),w)||E}return(v||_)&&(_!==c.texture&&(E=!0),h.texture=Mi("Sprite",t,f)),E},l},XO=["image","texture"],YO=function(t,e){var r=Mi("Mesh",t,e),n=e.vertices,i=e.uvs,s=e.indices,o=e.drawMode,l=o===void 0?Wn.TRIANGLES:o,h=new _O(r,n,i,s,l);return h.applyProps=function(c,f,m){var p=m.image,v=m.texture,_=ki(c,f,ao(m,XO));return(p||v)&&(v!==f.texture&&(_=!0),c.texture=Mi("Mesh",t,m)),_},h},QO=["image","texture"],KO=function(t,e){var r=Mi("SimpleRope",t,e),n=e.points,i=new xO(r,n);return i.applyProps=function(s,o,l){var h=l.image,c=l.texture,f=ao(l,QO);bt(Array.isArray(l.points),"SimpleRope points needs to be %s","Array<Point>");var m=ki(s,o,f);return(h||c)&&(c!==o.texture&&(m=!0),s.texture=Mi("SimpleRope",t,l)),m},i},qO=Object.freeze({__proto__:null,BitmapText:NO,Container:DO,Graphics:FO,NineSlicePlane:LO,ParticleContainer:UO,Sprite:GO,Text:$O,TilingSprite:VO,SimpleMesh:YO,SimpleRope:KO,AnimatedSprite:jO});function WE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function VE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?WE(Object(r),!0).forEach(function(n){At(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):WE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Wr={BitmapText:"BitmapText",Container:"Container",Graphics:"Graphics",NineSlicePlane:"NineSlicePlane",ParticleContainer:"ParticleContainer",Sprite:"Sprite",AnimatedSprite:"AnimatedSprite",Text:"Text",TilingSprite:"TilingSprite",SimpleMesh:"SimpleMesh",SimpleRope:"SimpleRope"},ZO=Object.keys(Wr).reduce(function(t,e){return VE(VE({},t),{},At({},e,qO[e]))},{}),jC={};function JO(t,e){return bt(!!t,"Expect type to be defined, got `%s`",t),bt(!Wr[t],"Component `%s` could not be created, already exists in default components.",t),jC[t]=e,t}var XE,YE,QE,KE,Hv={},jv={},eF={get exports(){return jv},set exports(t){jv=t}},qE={};function tF(){return YE||(YE=1,eF.exports=(XE||(XE=1,function(t){function e(k,X){var O=k.length;k.push(X);e:for(;0<O;){var G=O-1>>>1,ie=k[G];if(!(0<i(ie,X)))break e;k[G]=X,k[O]=ie,O=G}}function r(k){return k.length===0?null:k[0]}function n(k){if(k.length===0)return null;var X=k[0],O=k.pop();if(O!==X){k[0]=O;e:for(var G=0,ie=k.length,q=ie>>>1;G<q;){var $=2*(G+1)-1,se=k[$],ce=$+1,ve=k[ce];if(0>i(se,O))ce<ie&&0>i(ve,se)?(k[G]=ve,k[ce]=O,G=ce):(k[G]=se,k[$]=O,G=$);else{if(!(ce<ie&&0>i(ve,O)))break e;k[G]=ve,k[ce]=O,G=ce}}}return X}function i(k,X){var O=k.sortIndex-X.sortIndex;return O!==0?O:k.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var h=[],c=[],f=1,m=null,p=3,v=!1,_=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function w(k){for(var X=r(c);X!==null;){if(X.callback===null)n(c);else{if(!(X.startTime<=k))break;n(c),X.sortIndex=X.expirationTime,e(h,X)}X=r(c)}}function T(k){if(E=!1,w(k),!_)if(r(h)!==null)_=!0,fe(R);else{var X=r(c);X!==null&&ae(T,X.startTime-k)}}function R(k,X){_=!1,E&&(E=!1,S(Y),Y=-1),v=!0;var O=p;try{for(w(X),m=r(h);m!==null&&(!(m.expirationTime>X)||k&&!re());){var G=m.callback;if(typeof G=="function"){m.callback=null,p=m.priorityLevel;var ie=G(m.expirationTime<=X);X=t.unstable_now(),typeof ie=="function"?m.callback=ie:m===r(h)&&n(h),w(X)}else n(h);m=r(h)}if(m!==null)var q=!0;else{var $=r(c);$!==null&&ae(T,$.startTime-X),q=!1}return q}finally{m=null,p=O,v=!1}}typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var L,D=!1,M=null,Y=-1,j=5,de=-1;function re(){return!(t.unstable_now()-de<j)}function F(){if(M!==null){var k=t.unstable_now();de=k;var X=!0;try{X=M(!0,k)}finally{X?L():(D=!1,M=null)}}else D=!1}if(typeof b=="function")L=function(){b(F)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,ne=V.port2;V.port1.onmessage=F,L=function(){ne.postMessage(null)}}else L=function(){A(F,0)};function fe(k){M=k,D||(D=!0,L())}function ae(k,X){Y=A(function(){k(t.unstable_now())},X)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(k){k.callback=null},t.unstable_continueExecution=function(){_||v||(_=!0,fe(R))},t.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<k?Math.floor(1e3/k):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(h)},t.unstable_next=function(k){switch(p){case 1:case 2:case 3:var X=3;break;default:X=p}var O=p;p=X;try{return k()}finally{p=O}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var O=p;p=k;try{return X()}finally{p=O}},t.unstable_scheduleCallback=function(k,X,O){var G=t.unstable_now();switch(O=typeof O=="object"&&O!==null&&typeof(O=O.delay)=="number"&&0<O?G+O:G,k){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return k={id:f++,callback:X,priorityLevel:k,startTime:O,expirationTime:ie=O+ie,sortIndex:-1},O>G?(k.sortIndex=O,e(c,k),r(h)===null&&k===r(c)&&(E?(S(Y),Y=-1):E=!0,ae(T,O-G))):(k.sortIndex=ie,e(h,k),_||v||(_=!0,fe(R))),k},t.unstable_shouldYield=re,t.unstable_wrapCallback=function(k){var X=p;return function(){var O=p;p=X;try{return k.apply(this,arguments)}finally{p=O}}}}(qE)),qE)),jv}/**
841
+ * @license React
842
+ * react-reconciler.production.min.js
843
+ *
844
+ * Copyright (c) Facebook, Inc. and its affiliates.
845
+ *
846
+ * This source code is licensed under the MIT license found in the
847
+ * LICENSE file in the root directory of this source tree.
848
+ */function rF(){return KE||(KE=1,QE=function(t){var e={},r=Ti,n=tF(),i=Object.assign;function s(a){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),h=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),v=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),T=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:typeof(a=T&&a[T]||a["@@iterator"])=="function"?a:null}function L(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case c:return"Fragment";case h:return"Portal";case m:return"Profiler";case f:return"StrictMode";case E:return"Suspense";case A:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case v:return(a.displayName||"Context")+".Consumer";case p:return(a._context.displayName||"Context")+".Provider";case _:var u=a.render;return(a=a.displayName)||(a=(a=u.displayName||u.name||"")!==""?"ForwardRef("+a+")":"ForwardRef"),a;case S:return(u=a.displayName||null)!==null?u:L(a.type)||"Memo";case b:u=a._payload,a=a._init;try{return L(a(u))}catch{}}return null}function D(a){var u=a.type;switch(a.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=(a=u.render).displayName||a.name||"",u.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(u);case 8:return u===f?"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 17:case 2:case 14:case 15:if(typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function M(a){var u=a,d=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do 4098&(u=a).flags&&(d=u.return),a=u.return;while(a)}return u.tag===3?d:null}function Y(a){if(M(a)!==a)throw Error(s(188))}function j(a){var u=a.alternate;if(!u){if((u=M(a))===null)throw Error(s(188));return u!==a?null:a}for(var d=a,g=u;;){var y=d.return;if(y===null)break;var x=y.alternate;if(x===null){if((g=y.return)!==null){d=g;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===d)return Y(y),a;if(x===g)return Y(y),u;x=x.sibling}throw Error(s(188))}if(d.return!==g.return)d=y,g=x;else{for(var C=!1,I=y.child;I;){if(I===d){C=!0,d=y,g=x;break}if(I===g){C=!0,g=y,d=x;break}I=I.sibling}if(!C){for(I=x.child;I;){if(I===d){C=!0,d=x,g=y;break}if(I===g){C=!0,g=x,d=y;break}I=I.sibling}if(!C)throw Error(s(189))}}if(d.alternate!==g)throw Error(s(190))}if(d.tag!==3)throw Error(s(188));return d.stateNode.current===d?a:u}function de(a){return(a=j(a))!==null?re(a):null}function re(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var u=re(a);if(u!==null)return u;a=a.sibling}return null}function F(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){if(a.tag!==4){var u=F(a);if(u!==null)return u}a=a.sibling}return null}var V,ne=Array.isArray,fe=t.getPublicInstance,ae=t.getRootHostContext,k=t.getChildHostContext,X=t.prepareForCommit,O=t.resetAfterCommit,G=t.createInstance,ie=t.appendInitialChild,q=t.finalizeInitialChildren,$=t.prepareUpdate,se=t.shouldSetTextContent,ce=t.createTextInstance,ve=t.scheduleTimeout,ke=t.cancelTimeout,Re=t.noTimeout,he=t.isPrimaryRenderer,P=t.supportsMutation,we=t.supportsPersistence,ye=t.supportsHydration,Ve=t.getInstanceFromNode,Qe=t.preparePortalMount,Ke=t.getCurrentEventPriority,Ut=t.detachDeletedInstance,at=t.supportsMicrotasks,Be=t.scheduleMicrotask,Pe=t.supportsTestSelectors,Je=t.findFiberRoot,kt=t.getBoundingRect,xr=t.getTextContent,zt=t.isHiddenSubtree,Zt=t.matchAccessibilityRole,Ze=t.setFocusIfFocusable,Gt=t.setupIntersectionObserver,wr=t.appendChild,hs=t.appendChildToContainer,lt=t.commitTextUpdate,xt=t.commitMount,Mr=t.commitUpdate,kr=t.insertBefore,ur=t.insertInContainerBefore,hr=t.removeChild,In=t.removeChildFromContainer,Nt=t.resetTextContent,Er=t.hideInstance,cr=t.hideTextInstance,Nr=t.unhideInstance,Vr=t.unhideTextInstance,an=t.clearContainer,Jo=t.cloneInstance,El=t.createContainerChildSet,gh=t.appendChildToContainerChildSet,g_=t.finalizeContainerChildren,yh=t.replaceContainerChildren,Sl=t.cloneHiddenInstance,vh=t.cloneHiddenTextInstance,ea=t.canHydrateInstance,_h=t.canHydrateTextInstance,gp=t.canHydrateSuspenseInstance,bl=t.isSuspenseInstancePending,Tl=t.isSuspenseInstanceFallback,xh=t.getSuspenseInstanceFallbackErrorDetails,wh=t.registerSuspenseInstanceRetry,cs=t.getNextHydratableSibling,yp=t.getFirstHydratableChild,vp=t.getFirstHydratableChildWithinContainer,_p=t.getFirstHydratableChildWithinSuspenseInstance,xp=t.hydrateInstance,Eh=t.hydrateTextInstance,Sh=t.hydrateSuspenseInstance,bh=t.getNextHydratableInstanceAfterSuspenseInstance,Oi=t.commitHydratedContainer,y_=t.commitHydratedSuspenseInstance,Th=t.clearSuspenseBoundary,ds=t.clearSuspenseBoundaryFromContainer,Ah=t.shouldDeleteUnhydratedTailInstances,Ch=t.didNotMatchHydratedContainerTextInstance,Oe=t.didNotMatchHydratedTextInstance;function Fi(a){if(V===void 0)try{throw Error()}catch(d){var u=d.stack.trim().match(/\n( *(at )?)/);V=u&&u[1]||""}return`
849
+ `+V+a}var ta=!1;function Jn(a,u){if(!a||ta)return"";ta=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(H){var g=H}Reflect.construct(a,[],u)}else{try{u.call()}catch(H){g=H}a.call(u.prototype)}else{try{throw Error()}catch(H){g=H}a()}}catch(H){if(H&&g&&typeof H.stack=="string"){for(var y=H.stack.split(`
850
+ `),x=g.stack.split(`
851
+ `),C=y.length-1,I=x.length-1;1<=C&&0<=I&&y[C]!==x[I];)I--;for(;1<=C&&0<=I;C--,I--)if(y[C]!==x[I]){if(C!==1||I!==1)do if(C--,0>--I||y[C]!==x[I]){var B=`
852
+ `+y[C].replace(" at new "," at ");return a.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",a.displayName)),B}while(1<=C&&0<=I);break}}}finally{ta=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?Fi(a):""}var fs=Object.prototype.hasOwnProperty,lo=[],ra=-1;function ps(a){return{current:a}}function ut(a){0>ra||(a.current=lo[ra],lo[ra]=null,ra--)}function et(a,u){ra++,lo[ra]=a.current,a.current=u}var ms={},dr=ps(ms),Dr=ps(!1),uo=ms;function na(a,u){var d=a.type.contextTypes;if(!d)return ms;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===u)return g.__reactInternalMemoizedMaskedChildContext;var y,x={};for(y in d)x[y]=u[y];return g&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=u,a.__reactInternalMemoizedMaskedChildContext=x),x}function Xr(a){return(a=a.childContextTypes)!=null}function wp(){ut(Dr),ut(dr)}function v_(a,u,d){if(dr.current!==ms)throw Error(s(168));et(dr,u),et(Dr,d)}function __(a,u,d){var g=a.stateNode;if(u=u.childContextTypes,typeof g.getChildContext!="function")return d;for(var y in g=g.getChildContext())if(!(y in u))throw Error(s(108,D(a)||"Unknown",y));return i({},d,g)}function Ph(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||ms,uo=dr.current,et(dr,a),et(Dr,Dr.current),!0}function x_(a,u,d){var g=a.stateNode;if(!g)throw Error(s(169));d?(a=__(a,u,uo),g.__reactInternalMemoizedMergedChildContext=a,ut(Dr),ut(dr),et(dr,a)):ut(Dr),et(Dr,d)}var Rn=Math.clz32?Math.clz32:function(a){return(a>>>=0)===0?32:31-(c2(a)/d2|0)|0},c2=Math.log,d2=Math.LN2,Ep=64,Sp=4194304;function Al(a){switch(a&-a){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: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 4194240&a;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&a;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ih(a,u){var d=a.pendingLanes;if(d===0)return 0;var g=0,y=a.suspendedLanes,x=a.pingedLanes,C=268435455&d;if(C!==0){var I=C&~y;I!==0?g=Al(I):(x&=C)!==0&&(g=Al(x))}else(C=d&~y)!==0?g=Al(C):x!==0&&(g=Al(x));if(g===0)return 0;if(u!==0&&u!==g&&!(u&y)&&((y=g&-g)>=(x=u&-u)||y===16&&4194240&x))return u;if(4&g&&(g|=16&d),(u=a.entangledLanes)!==0)for(a=a.entanglements,u&=g;0<u;)y=1<<(d=31-Rn(u)),g|=a[d],u&=~y;return g}function f2(a,u){switch(a){case 1:case 2:case 4:return u+250;case 8: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 u+5e3;default:return-1}}function bp(a){return(a=-1073741825&a.pendingLanes)!==0?a:1073741824&a?1073741824:0}function w_(){var a=Ep;return!(4194240&(Ep<<=1))&&(Ep=64),a}function Tp(a){for(var u=[],d=0;31>d;d++)u.push(a);return u}function Cl(a,u,d){a.pendingLanes|=u,u!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),(a=a.eventTimes)[u=31-Rn(u)]=d}function Ap(a,u){var d=a.entangledLanes|=u;for(a=a.entanglements;d;){var g=31-Rn(d),y=1<<g;y&u|a[g]&u&&(a[g]|=u),d&=~y}}var $e=0;function E_(a){return 1<(a&=-a)?4<a?268435455&a?16:536870912:4:1}var Cp=n.unstable_scheduleCallback,S_=n.unstable_cancelCallback,p2=n.unstable_shouldYield,m2=n.unstable_requestPaint,Ht=n.unstable_now,Pp=n.unstable_ImmediatePriority,g2=n.unstable_UserBlockingPriority,b_=n.unstable_NormalPriority,y2=n.unstable_IdlePriority,Rh=null,ei=null,Mn=typeof Object.is=="function"?Object.is:function(a,u){return a===u&&(a!==0||1/a==1/u)||a!=a&&u!=u},Bi=null,Mh=!1,Ip=!1;function T_(a){Bi===null?Bi=[a]:Bi.push(a)}function ti(){if(!Ip&&Bi!==null){Ip=!0;var a=0,u=$e;try{var d=Bi;for($e=1;a<d.length;a++){var g=d[a];do g=g(!0);while(g!==null)}Bi=null,Mh=!1}catch(y){throw Bi!==null&&(Bi=Bi.slice(a+1)),Cp(Pp,ti),y}finally{$e=u,Ip=!1}}return null}var ia=[],sa=0,kh=null,Nh=0,ln=[],un=0,ho=null,ri=1,Li="";function co(a,u){ia[sa++]=Nh,ia[sa++]=kh,kh=a,Nh=u}function A_(a,u,d){ln[un++]=ri,ln[un++]=Li,ln[un++]=ho,ho=a;var g=ri;a=Li;var y=32-Rn(g)-1;g&=~(1<<y),d+=1;var x=32-Rn(u)+y;if(30<x){var C=y-y%5;x=(g&(1<<C)-1).toString(32),g>>=C,y-=C,ri=1<<32-Rn(u)+y|d<<y|g,Li=x+a}else ri=1<<x|d<<y|g,Li=a}function Rp(a){a.return!==null&&(co(a,1),A_(a,1,0))}function Mp(a){for(;a===kh;)kh=ia[--sa],ia[sa]=null,Nh=ia[--sa],ia[sa]=null;for(;a===ho;)ho=ln[--un],ln[un]=null,Li=ln[--un],ln[un]=null,ri=ln[--un],ln[un]=null}var Yr=null,hn=null,ht=!1,Pl=!1,kn=null;function C_(a,u){var d=mn(5,null,null,0);d.elementType="DELETED",d.stateNode=u,d.return=a,(u=a.deletions)===null?(a.deletions=[d],a.flags|=16):u.push(d)}function P_(a,u){switch(a.tag){case 5:return(u=ea(u,a.type,a.pendingProps))!==null&&(a.stateNode=u,Yr=a,hn=yp(u),!0);case 6:return(u=_h(u,a.pendingProps))!==null&&(a.stateNode=u,Yr=a,hn=null,!0);case 13:if((u=gp(u))!==null){var d=ho!==null?{id:ri,overflow:Li}:null;return a.memoizedState={dehydrated:u,treeContext:d,retryLane:1073741824},(d=mn(18,null,null,0)).stateNode=u,d.return=a,a.child=d,Yr=a,hn=null,!0}return!1;default:return!1}}function kp(a){return(1&a.mode)!=0&&(128&a.flags)==0}function Np(a){if(ht){var u=hn;if(u){var d=u;if(!P_(a,u)){if(kp(a))throw Error(s(418));u=cs(d);var g=Yr;u&&P_(a,u)?C_(g,d):(a.flags=-4097&a.flags|2,ht=!1,Yr=a)}}else{if(kp(a))throw Error(s(418));a.flags=-4097&a.flags|2,ht=!1,Yr=a}}}function I_(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Yr=a}function Dh(a){if(!ye||a!==Yr)return!1;if(!ht)return I_(a),ht=!0,!1;if(a.tag!==3&&(a.tag!==5||Ah(a.type)&&!se(a.type,a.memoizedProps))){var u=hn;if(u){if(kp(a))throw R_(),Error(s(418));for(;u;)C_(a,u),u=cs(u)}}if(I_(a),a.tag===13){if(!ye)throw Error(s(316));if(!(a=(a=a.memoizedState)!==null?a.dehydrated:null))throw Error(s(317));hn=bh(a)}else hn=Yr?cs(a.stateNode):null;return!0}function R_(){for(var a=hn;a;)a=cs(a)}function oa(){ye&&(hn=Yr=null,Pl=ht=!1)}function Dp(a){kn===null?kn=[a]:kn.push(a)}var v2=o.ReactCurrentBatchConfig;function Oh(a,u){if(Mn(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var d=Object.keys(a),g=Object.keys(u);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var y=d[g];if(!fs.call(u,y)||!Mn(a[y],u[y]))return!1}return!0}function _2(a){switch(a.tag){case 5:return Fi(a.type);case 16:return Fi("Lazy");case 13:return Fi("Suspense");case 19:return Fi("SuspenseList");case 0:case 2:case 15:return a=Jn(a.type,!1);case 11:return a=Jn(a.type.render,!1);case 1:return a=Jn(a.type,!0);default:return""}}function Nn(a,u){if(a&&a.defaultProps){for(var d in u=i({},u),a=a.defaultProps)u[d]===void 0&&(u[d]=a[d]);return u}return u}var Fh=ps(null),Bh=null,aa=null,Op=null;function Fp(){Op=aa=Bh=null}function M_(a,u,d){he?(et(Fh,u._currentValue),u._currentValue=d):(et(Fh,u._currentValue2),u._currentValue2=d)}function Bp(a){var u=Fh.current;ut(Fh),he?a._currentValue=u:a._currentValue2=u}function Lp(a,u,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),a===d)break;a=a.return}}function la(a,u){Bh=a,Op=aa=null,(a=a.dependencies)!==null&&a.firstContext!==null&&(a.lanes&u&&(Or=!0),a.firstContext=null)}function cn(a){var u=he?a._currentValue:a._currentValue2;if(Op!==a)if(a={context:a,memoizedValue:u,next:null},aa===null){if(Bh===null)throw Error(s(308));aa=a,Bh.dependencies={lanes:0,firstContext:a}}else aa=aa.next=a;return u}var fo=null;function Up(a){fo===null?fo=[a]:fo.push(a)}function k_(a,u,d,g){var y=u.interleaved;return y===null?(d.next=d,Up(u)):(d.next=y.next,y.next=d),u.interleaved=d,ni(a,g)}function ni(a,u){a.lanes|=u;var d=a.alternate;for(d!==null&&(d.lanes|=u),d=a,a=a.return;a!==null;)a.childLanes|=u,(d=a.alternate)!==null&&(d.childLanes|=u),d=a,a=a.return;return d.tag===3?d.stateNode:null}var gs=!1;function zp(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function N_(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Ui(a,u){return{eventTime:a,lane:u,tag:0,payload:null,callback:null,next:null}}function ys(a,u,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(2&He)!=0){var y=g.pending;return y===null?u.next=u:(u.next=y.next,y.next=u),g.pending=u,ni(a,d)}return(y=g.interleaved)===null?(u.next=u,Up(g)):(u.next=y.next,y.next=u),g.interleaved=u,ni(a,d)}function Lh(a,u,d){if((u=u.updateQueue)!==null&&(u=u.shared,(4194240&d)!=0)){var g=u.lanes;d|=g&=a.pendingLanes,u.lanes=d,Ap(a,d)}}function D_(a,u){var d=a.updateQueue,g=a.alternate;if(g!==null&&d===(g=g.updateQueue)){var y=null,x=null;if((d=d.firstBaseUpdate)!==null){do{var C={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};x===null?y=x=C:x=x.next=C,d=d.next}while(d!==null);x===null?y=x=u:x=x.next=u}else y=x=u;return d={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:g.shared,effects:g.effects},void(a.updateQueue=d)}(a=d.lastBaseUpdate)===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=u}function Uh(a,u,d,g){var y=a.updateQueue;gs=!1;var x=y.firstBaseUpdate,C=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var B=I,H=B.next;B.next=null,C===null?x=H:C.next=H,C=B;var Q=a.alternate;Q!==null&&(I=(Q=Q.updateQueue).lastBaseUpdate)!==C&&(I===null?Q.firstBaseUpdate=H:I.next=H,Q.lastBaseUpdate=B)}if(x!==null){var le=y.baseState;for(C=0,Q=H=B=null,I=x;;){var W=I.lane,ee=I.eventTime;if((g&W)===W){Q!==null&&(Q=Q.next={eventTime:ee,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Ee=a,Fe=I;switch(W=u,ee=d,Fe.tag){case 1:if(typeof(Ee=Fe.payload)=="function"){le=Ee.call(ee,le,W);break e}le=Ee;break e;case 3:Ee.flags=-65537&Ee.flags|128;case 0:if((W=typeof(Ee=Fe.payload)=="function"?Ee.call(ee,le,W):Ee)==null)break e;le=i({},le,W);break e;case 2:gs=!0}}I.callback!==null&&I.lane!==0&&(a.flags|=64,(W=y.effects)===null?y.effects=[I]:W.push(I))}else ee={eventTime:ee,lane:W,tag:I.tag,payload:I.payload,callback:I.callback,next:null},Q===null?(H=Q=ee,B=le):Q=Q.next=ee,C|=W;if((I=I.next)===null){if((I=y.shared.pending)===null)break;I=(W=I).next,W.next=null,y.lastBaseUpdate=W,y.shared.pending=null}}if(Q===null&&(B=le),y.baseState=B,y.firstBaseUpdate=H,y.lastBaseUpdate=Q,(u=y.shared.interleaved)!==null){y=u;do C|=y.lane,y=y.next;while(y!==u)}else x===null&&(y.shared.lanes=0);mo|=C,a.lanes=C,a.memoizedState=le}}function O_(a,u,d){if(a=u.effects,u.effects=null,a!==null)for(u=0;u<a.length;u++){var g=a[u],y=g.callback;if(y!==null){if(g.callback=null,g=d,typeof y!="function")throw Error(s(191,y));y.call(g)}}}var F_=new r.Component().refs;function Gp(a,u,d,g){d=(d=d(g,u=a.memoizedState))==null?u:i({},u,d),a.memoizedState=d,a.lanes===0&&(a.updateQueue.baseState=d)}var zh={isMounted:function(a){return!!(a=a._reactInternals)&&M(a)===a},enqueueSetState:function(a,u,d){a=a._reactInternals;var g=mr(),y=ws(a),x=Ui(g,y);x.payload=u,d!=null&&(x.callback=d),(u=ys(a,x,y))!==null&&(pn(u,a,y,g),Lh(u,a,y))},enqueueReplaceState:function(a,u,d){a=a._reactInternals;var g=mr(),y=ws(a),x=Ui(g,y);x.tag=1,x.payload=u,d!=null&&(x.callback=d),(u=ys(a,x,y))!==null&&(pn(u,a,y,g),Lh(u,a,y))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var d=mr(),g=ws(a),y=Ui(d,g);y.tag=2,u!=null&&(y.callback=u),(u=ys(a,y,g))!==null&&(pn(u,a,g,d),Lh(u,a,g))}};function B_(a,u,d,g,y,x,C){return typeof(a=a.stateNode).shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,x,C):!u.prototype||!u.prototype.isPureReactComponent||!Oh(d,g)||!Oh(y,x)}function L_(a,u,d){var g=!1,y=ms,x=u.contextType;return typeof x=="object"&&x!==null?x=cn(x):(y=Xr(u)?uo:dr.current,x=(g=(g=u.contextTypes)!=null)?na(a,y):ms),u=new u(d,x),a.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=zh,a.stateNode=u,u._reactInternals=a,g&&((a=a.stateNode).__reactInternalMemoizedUnmaskedChildContext=y,a.__reactInternalMemoizedMaskedChildContext=x),u}function U_(a,u,d,g){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(d,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(d,g),u.state!==a&&zh.enqueueReplaceState(u,u.state,null)}function Hp(a,u,d,g){var y=a.stateNode;y.props=d,y.state=a.memoizedState,y.refs=F_,zp(a);var x=u.contextType;typeof x=="object"&&x!==null?y.context=cn(x):(x=Xr(u)?uo:dr.current,y.context=na(a,x)),y.state=a.memoizedState,typeof(x=u.getDerivedStateFromProps)=="function"&&(Gp(a,u,x,d),y.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(u=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),u!==y.state&&zh.enqueueReplaceState(y,y.state,null),Uh(a,d,y,g),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308)}function Il(a,u,d){if((a=d.ref)!==null&&typeof a!="function"&&typeof a!="object"){if(d._owner){if(d=d._owner){if(d.tag!==1)throw Error(s(309));var g=d.stateNode}if(!g)throw Error(s(147,a));var y=g,x=""+a;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===x?u.ref:(u=function(C){var I=y.refs;I===F_&&(I=y.refs={}),C===null?delete I[x]:I[x]=C},u._stringRef=x,u)}if(typeof a!="string")throw Error(s(284));if(!d._owner)throw Error(s(290,a))}return a}function Gh(a,u){throw a=Object.prototype.toString.call(u),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a))}function z_(a){return(0,a._init)(a._payload)}function G_(a){function u(K,N){if(a){var z=K.deletions;z===null?(K.deletions=[N],K.flags|=16):z.push(N)}}function d(K,N){if(!a)return null;for(;N!==null;)u(K,N),N=N.sibling;return null}function g(K,N){for(K=new Map;N!==null;)N.key!==null?K.set(N.key,N):K.set(N.index,N),N=N.sibling;return K}function y(K,N){return(K=Ss(K,N)).index=0,K.sibling=null,K}function x(K,N,z){return K.index=z,a?(z=K.alternate)!==null?(z=z.index)<N?(K.flags|=2,N):z:(K.flags|=2,N):(K.flags|=1048576,N)}function C(K){return a&&K.alternate===null&&(K.flags|=2),K}function I(K,N,z,Z){return N===null||N.tag!==6?((N=Pm(z,K.mode,Z)).return=K,N):((N=y(N,z)).return=K,N)}function B(K,N,z,Z){var Ie=z.type;return Ie===c?Q(K,N,z.props.children,Z,z.key):N!==null&&(N.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===b&&z_(Ie)===N.type)?((Z=y(N,z.props)).ref=Il(K,N,z),Z.return=K,Z):((Z=fc(z.type,z.key,z.props,null,K.mode,Z)).ref=Il(K,N,z),Z.return=K,Z)}function H(K,N,z,Z){return N===null||N.tag!==4||N.stateNode.containerInfo!==z.containerInfo||N.stateNode.implementation!==z.implementation?((N=Im(z,K.mode,Z)).return=K,N):((N=y(N,z.children||[])).return=K,N)}function Q(K,N,z,Z,Ie){return N===null||N.tag!==7?((N=vo(z,K.mode,Z,Ie)).return=K,N):((N=y(N,z)).return=K,N)}function le(K,N,z){if(typeof N=="string"&&N!==""||typeof N=="number")return(N=Pm(""+N,K.mode,z)).return=K,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case l:return(z=fc(N.type,N.key,N.props,null,K.mode,z)).ref=Il(K,null,N),z.return=K,z;case h:return(N=Im(N,K.mode,z)).return=K,N;case b:return le(K,(0,N._init)(N._payload),z)}if(ne(N)||R(N))return(N=vo(N,K.mode,z,null)).return=K,N;Gh(K,N)}return null}function W(K,N,z,Z){var Ie=N!==null?N.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return Ie!==null?null:I(K,N,""+z,Z);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case l:return z.key===Ie?B(K,N,z,Z):null;case h:return z.key===Ie?H(K,N,z,Z):null;case b:return W(K,N,(Ie=z._init)(z._payload),Z)}if(ne(z)||R(z))return Ie!==null?null:Q(K,N,z,Z,null);Gh(K,z)}return null}function ee(K,N,z,Z,Ie){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return I(N,K=K.get(z)||null,""+Z,Ie);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case l:return B(N,K=K.get(Z.key===null?z:Z.key)||null,Z,Ie);case h:return H(N,K=K.get(Z.key===null?z:Z.key)||null,Z,Ie);case b:return ee(K,N,z,(0,Z._init)(Z._payload),Ie)}if(ne(Z)||R(Z))return Q(N,K=K.get(z)||null,Z,Ie,null);Gh(N,Z)}return null}function Ee(K,N,z,Z){for(var Ie=null,Xe=null,be=N,We=N=0,er=null;be!==null&&We<z.length;We++){be.index>We?(er=be,be=null):er=be.sibling;var Ye=W(K,be,z[We],Z);if(Ye===null){be===null&&(be=er);break}a&&be&&Ye.alternate===null&&u(K,be),N=x(Ye,N,We),Xe===null?Ie=Ye:Xe.sibling=Ye,Xe=Ye,be=er}if(We===z.length)return d(K,be),ht&&co(K,We),Ie;if(be===null){for(;We<z.length;We++)(be=le(K,z[We],Z))!==null&&(N=x(be,N,We),Xe===null?Ie=be:Xe.sibling=be,Xe=be);return ht&&co(K,We),Ie}for(be=g(K,be);We<z.length;We++)(er=ee(be,K,We,z[We],Z))!==null&&(a&&er.alternate!==null&&be.delete(er.key===null?We:er.key),N=x(er,N,We),Xe===null?Ie=er:Xe.sibling=er,Xe=er);return a&&be.forEach(function(bs){return u(K,bs)}),ht&&co(K,We),Ie}function Fe(K,N,z,Z){var Ie=R(z);if(typeof Ie!="function")throw Error(s(150));if((z=Ie.call(z))==null)throw Error(s(151));for(var Xe=Ie=null,be=N,We=N=0,er=null,Ye=z.next();be!==null&&!Ye.done;We++,Ye=z.next()){be.index>We?(er=be,be=null):er=be.sibling;var bs=W(K,be,Ye.value,Z);if(bs===null){be===null&&(be=er);break}a&&be&&bs.alternate===null&&u(K,be),N=x(bs,N,We),Xe===null?Ie=bs:Xe.sibling=bs,Xe=bs,be=er}if(Ye.done)return d(K,be),ht&&co(K,We),Ie;if(be===null){for(;!Ye.done;We++,Ye=z.next())(Ye=le(K,Ye.value,Z))!==null&&(N=x(Ye,N,We),Xe===null?Ie=Ye:Xe.sibling=Ye,Xe=Ye);return ht&&co(K,We),Ie}for(be=g(K,be);!Ye.done;We++,Ye=z.next())(Ye=ee(be,K,We,Ye.value,Z))!==null&&(a&&Ye.alternate!==null&&be.delete(Ye.key===null?We:Ye.key),N=x(Ye,N,We),Xe===null?Ie=Ye:Xe.sibling=Ye,Xe=Ye);return a&&be.forEach(function(j2){return u(K,j2)}),ht&&co(K,We),Ie}return function K(N,z,Z,Ie){if(typeof Z=="object"&&Z!==null&&Z.type===c&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case l:e:{for(var Xe=Z.key,be=z;be!==null;){if(be.key===Xe){if((Xe=Z.type)===c){if(be.tag===7){d(N,be.sibling),(z=y(be,Z.props.children)).return=N,N=z;break e}}else if(be.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===b&&z_(Xe)===be.type){d(N,be.sibling),(z=y(be,Z.props)).ref=Il(N,be,Z),z.return=N,N=z;break e}d(N,be);break}u(N,be),be=be.sibling}Z.type===c?((z=vo(Z.props.children,N.mode,Ie,Z.key)).return=N,N=z):((Ie=fc(Z.type,Z.key,Z.props,null,N.mode,Ie)).ref=Il(N,z,Z),Ie.return=N,N=Ie)}return C(N);case h:e:{for(be=Z.key;z!==null;){if(z.key===be){if(z.tag===4&&z.stateNode.containerInfo===Z.containerInfo&&z.stateNode.implementation===Z.implementation){d(N,z.sibling),(z=y(z,Z.children||[])).return=N,N=z;break e}d(N,z);break}u(N,z),z=z.sibling}(z=Im(Z,N.mode,Ie)).return=N,N=z}return C(N);case b:return K(N,z,(be=Z._init)(Z._payload),Ie)}if(ne(Z))return Ee(N,z,Z,Ie);if(R(Z))return Fe(N,z,Z,Ie);Gh(N,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,z!==null&&z.tag===6?(d(N,z.sibling),(z=y(z,Z)).return=N,N=z):(d(N,z),(z=Pm(Z,N.mode,Ie)).return=N,N=z),C(N)):d(N,z)}}var ua=G_(!0),H_=G_(!1),Rl={},dn=ps(Rl),Ml=ps(Rl),ha=ps(Rl);function ii(a){if(a===Rl)throw Error(s(174));return a}function jp(a,u){et(ha,u),et(Ml,a),et(dn,Rl),a=ae(u),ut(dn),et(dn,a)}function ca(){ut(dn),ut(Ml),ut(ha)}function j_(a){var u=ii(ha.current),d=ii(dn.current);d!==(u=k(d,a.type,u))&&(et(Ml,a),et(dn,u))}function $p(a){Ml.current===a&&(ut(dn),ut(Ml))}var wt=ps(0);function Hh(a){for(var u=a;u!==null;){if(u.tag===13){var d=u.memoizedState;if(d!==null&&((d=d.dehydrated)===null||bl(d)||Tl(d)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(128&u.flags)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Wp=[];function Vp(){for(var a=0;a<Wp.length;a++){var u=Wp[a];he?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}Wp.length=0}var jh=o.ReactCurrentDispatcher,Xp=o.ReactCurrentBatchConfig,po=0,pt=null,jt=null,$t=null,$h=!1,kl=!1,Nl=0,x2=0;function fr(){throw Error(s(321))}function Yp(a,u){if(u===null)return!1;for(var d=0;d<u.length&&d<a.length;d++)if(!Mn(a[d],u[d]))return!1;return!0}function Qp(a,u,d,g,y,x){if(po=x,pt=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,jh.current=a===null||a.memoizedState===null?b2:T2,a=d(g,y),kl){x=0;do{if(kl=!1,Nl=0,25<=x)throw Error(s(301));x+=1,$t=jt=null,u.updateQueue=null,jh.current=A2,a=d(g,y)}while(kl)}if(jh.current=Xh,u=jt!==null&&jt.next!==null,po=0,$t=jt=pt=null,$h=!1,u)throw Error(s(300));return a}function Kp(){var a=Nl!==0;return Nl=0,a}function si(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?pt.memoizedState=$t=a:$t=$t.next=a,$t}function fn(){if(jt===null){var a=pt.alternate;a=a!==null?a.memoizedState:null}else a=jt.next;var u=$t===null?pt.memoizedState:$t.next;if(u!==null)$t=u,jt=a;else{if(a===null)throw Error(s(310));a={memoizedState:(jt=a).memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},$t===null?pt.memoizedState=$t=a:$t=$t.next=a}return $t}function Dl(a,u){return typeof u=="function"?u(a):u}function qp(a){var u=fn(),d=u.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=a;var g=jt,y=g.baseQueue,x=d.pending;if(x!==null){if(y!==null){var C=y.next;y.next=x.next,x.next=C}g.baseQueue=y=x,d.pending=null}if(y!==null){x=y.next,g=g.baseState;var I=C=null,B=null,H=x;do{var Q=H.lane;if((po&Q)===Q)B!==null&&(B=B.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),g=H.hasEagerState?H.eagerState:a(g,H.action);else{var le={lane:Q,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};B===null?(I=B=le,C=g):B=B.next=le,pt.lanes|=Q,mo|=Q}H=H.next}while(H!==null&&H!==x);B===null?C=g:B.next=I,Mn(g,u.memoizedState)||(Or=!0),u.memoizedState=g,u.baseState=C,u.baseQueue=B,d.lastRenderedState=g}if((a=d.interleaved)!==null){y=a;do x=y.lane,pt.lanes|=x,mo|=x,y=y.next;while(y!==a)}else y===null&&(d.lanes=0);return[u.memoizedState,d.dispatch]}function Zp(a){var u=fn(),d=u.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=a;var g=d.dispatch,y=d.pending,x=u.memoizedState;if(y!==null){d.pending=null;var C=y=y.next;do x=a(x,C.action),C=C.next;while(C!==y);Mn(x,u.memoizedState)||(Or=!0),u.memoizedState=x,u.baseQueue===null&&(u.baseState=x),d.lastRenderedState=x}return[x,g]}function $_(){}function W_(a,u){var d=pt,g=fn(),y=u(),x=!Mn(g.memoizedState,y);if(x&&(g.memoizedState=y,Or=!0),g=g.queue,Jp(Y_.bind(null,d,g,a),[a]),g.getSnapshot!==u||x||$t!==null&&1&$t.memoizedState.tag){if(d.flags|=2048,Ol(9,X_.bind(null,d,g,y,u),void 0,null),Wt===null)throw Error(s(349));30&po||V_(d,u,y)}return y}function V_(a,u,d){a.flags|=16384,a={getSnapshot:u,value:d},(u=pt.updateQueue)===null?(u={lastEffect:null,stores:null},pt.updateQueue=u,u.stores=[a]):(d=u.stores)===null?u.stores=[a]:d.push(a)}function X_(a,u,d,g){u.value=d,u.getSnapshot=g,Q_(u)&&K_(a)}function Y_(a,u,d){return d(function(){Q_(u)&&K_(a)})}function Q_(a){var u=a.getSnapshot;a=a.value;try{var d=u();return!Mn(a,d)}catch{return!0}}function K_(a){var u=ni(a,1);u!==null&&pn(u,a,1,-1)}function q_(a){var u=si();return typeof a=="function"&&(a=a()),u.memoizedState=u.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Dl,lastRenderedState:a},u.queue=a,a=a.dispatch=S2.bind(null,pt,a),[u.memoizedState,a]}function Ol(a,u,d,g){return a={tag:a,create:u,destroy:d,deps:g,next:null},(u=pt.updateQueue)===null?(u={lastEffect:null,stores:null},pt.updateQueue=u,u.lastEffect=a.next=a):(d=u.lastEffect)===null?u.lastEffect=a.next=a:(g=d.next,d.next=a,a.next=g,u.lastEffect=a),a}function Z_(){return fn().memoizedState}function Wh(a,u,d,g){var y=si();pt.flags|=a,y.memoizedState=Ol(1|u,d,void 0,g===void 0?null:g)}function Vh(a,u,d,g){var y=fn();g=g===void 0?null:g;var x=void 0;if(jt!==null){var C=jt.memoizedState;if(x=C.destroy,g!==null&&Yp(g,C.deps))return void(y.memoizedState=Ol(u,d,x,g))}pt.flags|=a,y.memoizedState=Ol(1|u,d,x,g)}function J_(a,u){return Wh(8390656,8,a,u)}function Jp(a,u){return Vh(2048,8,a,u)}function e1(a,u){return Vh(4,2,a,u)}function t1(a,u){return Vh(4,4,a,u)}function r1(a,u){return typeof u=="function"?(a=a(),u(a),function(){u(null)}):u!=null?(a=a(),u.current=a,function(){u.current=null}):void 0}function n1(a,u,d){return d=d!=null?d.concat([a]):null,Vh(4,4,r1.bind(null,u,a),d)}function em(){}function i1(a,u){var d=fn();u=u===void 0?null:u;var g=d.memoizedState;return g!==null&&u!==null&&Yp(u,g[1])?g[0]:(d.memoizedState=[a,u],a)}function s1(a,u){var d=fn();u=u===void 0?null:u;var g=d.memoizedState;return g!==null&&u!==null&&Yp(u,g[1])?g[0]:(a=a(),d.memoizedState=[a,u],a)}function o1(a,u,d){return 21&po?(Mn(d,u)||(d=w_(),pt.lanes|=d,mo|=d,a.baseState=!0),u):(a.baseState&&(a.baseState=!1,Or=!0),a.memoizedState=d)}function w2(a,u){var d=$e;$e=d!==0&&4>d?d:4,a(!0);var g=Xp.transition;Xp.transition={};try{a(!1),u()}finally{$e=d,Xp.transition=g}}function a1(){return fn().memoizedState}function E2(a,u,d){var g=ws(a);d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},l1(a)?u1(u,d):(d=k_(a,u,d,g))!==null&&(pn(d,a,g,mr()),h1(d,u,g))}function S2(a,u,d){var g=ws(a),y={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(l1(a))u1(u,y);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=u.lastRenderedReducer)!==null)try{var C=u.lastRenderedState,I=x(C,d);if(y.hasEagerState=!0,y.eagerState=I,Mn(I,C)){var B=u.interleaved;return B===null?(y.next=y,Up(u)):(y.next=B.next,B.next=y),void(u.interleaved=y)}}catch{}(d=k_(a,u,y,g))!==null&&(pn(d,a,g,y=mr()),h1(d,u,g))}}function l1(a){var u=a.alternate;return a===pt||u!==null&&u===pt}function u1(a,u){kl=$h=!0;var d=a.pending;d===null?u.next=u:(u.next=d.next,d.next=u),a.pending=u}function h1(a,u,d){if(4194240&d){var g=u.lanes;d|=g&=a.pendingLanes,u.lanes=d,Ap(a,d)}}var Xh={readContext:cn,useCallback:fr,useContext:fr,useEffect:fr,useImperativeHandle:fr,useInsertionEffect:fr,useLayoutEffect:fr,useMemo:fr,useReducer:fr,useRef:fr,useState:fr,useDebugValue:fr,useDeferredValue:fr,useTransition:fr,useMutableSource:fr,useSyncExternalStore:fr,useId:fr,unstable_isNewReconciler:!1},b2={readContext:cn,useCallback:function(a,u){return si().memoizedState=[a,u===void 0?null:u],a},useContext:cn,useEffect:J_,useImperativeHandle:function(a,u,d){return d=d!=null?d.concat([a]):null,Wh(4194308,4,r1.bind(null,u,a),d)},useLayoutEffect:function(a,u){return Wh(4194308,4,a,u)},useInsertionEffect:function(a,u){return Wh(4,2,a,u)},useMemo:function(a,u){var d=si();return u=u===void 0?null:u,a=a(),d.memoizedState=[a,u],a},useReducer:function(a,u,d){var g=si();return u=d!==void 0?d(u):u,g.memoizedState=g.baseState=u,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:u},g.queue=a,a=a.dispatch=E2.bind(null,pt,a),[g.memoizedState,a]},useRef:function(a){return a={current:a},si().memoizedState=a},useState:q_,useDebugValue:em,useDeferredValue:function(a){return si().memoizedState=a},useTransition:function(){var a=q_(!1),u=a[0];return a=w2.bind(null,a[1]),si().memoizedState=a,[u,a]},useMutableSource:function(){},useSyncExternalStore:function(a,u,d){var g=pt,y=si();if(ht){if(d===void 0)throw Error(s(407));d=d()}else{if(d=u(),Wt===null)throw Error(s(349));30&po||V_(g,u,d)}y.memoizedState=d;var x={value:d,getSnapshot:u};return y.queue=x,J_(Y_.bind(null,g,x,a),[a]),g.flags|=2048,Ol(9,X_.bind(null,g,x,d,u),void 0,null),d},useId:function(){var a=si(),u=Wt.identifierPrefix;if(ht){var d=Li;u=":"+u+"R"+(d=(ri&~(1<<32-Rn(ri)-1)).toString(32)+d),0<(d=Nl++)&&(u+="H"+d.toString(32)),u+=":"}else u=":"+u+"r"+(d=x2++).toString(32)+":";return a.memoizedState=u},unstable_isNewReconciler:!1},T2={readContext:cn,useCallback:i1,useContext:cn,useEffect:Jp,useImperativeHandle:n1,useInsertionEffect:e1,useLayoutEffect:t1,useMemo:s1,useReducer:qp,useRef:Z_,useState:function(){return qp(Dl)},useDebugValue:em,useDeferredValue:function(a){return o1(fn(),jt.memoizedState,a)},useTransition:function(){return[qp(Dl)[0],fn().memoizedState]},useMutableSource:$_,useSyncExternalStore:W_,useId:a1,unstable_isNewReconciler:!1},A2={readContext:cn,useCallback:i1,useContext:cn,useEffect:Jp,useImperativeHandle:n1,useInsertionEffect:e1,useLayoutEffect:t1,useMemo:s1,useReducer:Zp,useRef:Z_,useState:function(){return Zp(Dl)},useDebugValue:em,useDeferredValue:function(a){var u=fn();return jt===null?u.memoizedState=a:o1(u,jt.memoizedState,a)},useTransition:function(){return[Zp(Dl)[0],fn().memoizedState]},useMutableSource:$_,useSyncExternalStore:W_,useId:a1,unstable_isNewReconciler:!1};function da(a,u){try{var d="",g=u;do d+=_2(g),g=g.return;while(g);var y=d}catch(x){y=`
853
+ Error generating stack: `+x.message+`
854
+ `+x.stack}return{value:a,source:u,stack:y,digest:null}}function tm(a,u,d){return{value:a,source:null,stack:d??null,digest:u??null}}function rm(a,u){try{console.error(u.value)}catch(d){setTimeout(function(){throw d})}}var C2=typeof WeakMap=="function"?WeakMap:Map;function c1(a,u,d){(d=Ui(-1,d)).tag=3,d.payload={element:null};var g=u.value;return d.callback=function(){ac||(ac=!0,wm=g),rm(0,u)},d}function d1(a,u,d){(d=Ui(-1,d)).tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var y=u.value;d.payload=function(){return g(y)},d.callback=function(){rm(0,u)}}var x=a.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(d.callback=function(){rm(0,u),typeof g!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var C=u.stack;this.componentDidCatch(u.value,{componentStack:C!==null?C:""})}),d}function f1(a,u,d){var g=a.pingCache;if(g===null){g=a.pingCache=new C2;var y=new Set;g.set(u,y)}else(y=g.get(u))===void 0&&(y=new Set,g.set(u,y));y.has(d)||(y.add(d),a=F2.bind(null,a,u,d),u.then(a,a))}function p1(a){do{var u;if((u=a.tag===13)&&(u=(u=a.memoizedState)===null||u.dehydrated!==null),u)return a;a=a.return}while(a!==null);return null}function m1(a,u,d,g,y){return 1&a.mode?(a.flags|=65536,a.lanes=y,a):(a===u?a.flags|=65536:(a.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:((u=Ui(-1,1)).tag=2,ys(d,u,1))),d.lanes|=1),a)}var P2=o.ReactCurrentOwner,Or=!1;function Fr(a,u,d,g){u.child=a===null?H_(u,null,d,g):ua(u,a.child,d,g)}function g1(a,u,d,g,y){d=d.render;var x=u.ref;return la(u,y),g=Qp(a,u,d,g,x,y),d=Kp(),a===null||Or?(ht&&d&&Rp(u),u.flags|=1,Fr(a,u,g,y),u.child):(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~y,zi(a,u,y))}function y1(a,u,d,g,y){if(a===null){var x=d.type;return typeof x!="function"||Cm(x)||x.defaultProps!==void 0||d.compare!==null||d.defaultProps!==void 0?((a=fc(d.type,null,g,u,u.mode,y)).ref=u.ref,a.return=u,u.child=a):(u.tag=15,u.type=x,v1(a,u,x,g,y))}if(x=a.child,(a.lanes&y)==0){var C=x.memoizedProps;if((d=(d=d.compare)!==null?d:Oh)(C,g)&&a.ref===u.ref)return zi(a,u,y)}return u.flags|=1,(a=Ss(x,g)).ref=u.ref,a.return=u,u.child=a}function v1(a,u,d,g,y){if(a!==null){var x=a.memoizedProps;if(Oh(x,g)&&a.ref===u.ref){if(Or=!1,u.pendingProps=g=x,(a.lanes&y)==0)return u.lanes=a.lanes,zi(a,u,y);131072&a.flags&&(Or=!0)}}return nm(a,u,d,g,y)}function _1(a,u,d){var g=u.pendingProps,y=g.children,x=a!==null?a.memoizedState:null;if(g.mode==="hidden")if(!(1&u.mode))u.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(pa,Qr),Qr|=d;else{if(!(1073741824&d))return a=x!==null?x.baseLanes|d:d,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:a,cachePool:null,transitions:null},u.updateQueue=null,et(pa,Qr),Qr|=a,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=x!==null?x.baseLanes:d,et(pa,Qr),Qr|=g}else x!==null?(g=x.baseLanes|d,u.memoizedState=null):g=d,et(pa,Qr),Qr|=g;return Fr(a,u,y,d),u.child}function x1(a,u){var d=u.ref;(a===null&&d!==null||a!==null&&a.ref!==d)&&(u.flags|=512,u.flags|=2097152)}function nm(a,u,d,g,y){var x=Xr(d)?uo:dr.current;return x=na(u,x),la(u,y),d=Qp(a,u,d,g,x,y),g=Kp(),a===null||Or?(ht&&g&&Rp(u),u.flags|=1,Fr(a,u,d,y),u.child):(u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~y,zi(a,u,y))}function w1(a,u,d,g,y){if(Xr(d)){var x=!0;Ph(u)}else x=!1;if(la(u,y),u.stateNode===null)qh(a,u),L_(u,d,g),Hp(u,d,g,y),g=!0;else if(a===null){var C=u.stateNode,I=u.memoizedProps;C.props=I;var B=C.context,H=d.contextType;typeof H=="object"&&H!==null?H=cn(H):H=na(u,H=Xr(d)?uo:dr.current);var Q=d.getDerivedStateFromProps,le=typeof Q=="function"||typeof C.getSnapshotBeforeUpdate=="function";le||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(I!==g||B!==H)&&U_(u,C,g,H),gs=!1;var W=u.memoizedState;C.state=W,Uh(u,g,C,y),B=u.memoizedState,I!==g||W!==B||Dr.current||gs?(typeof Q=="function"&&(Gp(u,d,Q,g),B=u.memoizedState),(I=gs||B_(u,d,I,g,W,B,H))?(le||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"&&(u.flags|=4194308)):(typeof C.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=B),C.props=g,C.state=B,C.context=H,g=I):(typeof C.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{C=u.stateNode,N_(a,u),I=u.memoizedProps,H=u.type===u.elementType?I:Nn(u.type,I),C.props=H,le=u.pendingProps,W=C.context,typeof(B=d.contextType)=="object"&&B!==null?B=cn(B):B=na(u,B=Xr(d)?uo:dr.current);var ee=d.getDerivedStateFromProps;(Q=typeof ee=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(I!==le||W!==B)&&U_(u,C,g,B),gs=!1,W=u.memoizedState,C.state=W,Uh(u,g,C,y);var Ee=u.memoizedState;I!==le||W!==Ee||Dr.current||gs?(typeof ee=="function"&&(Gp(u,d,ee,g),Ee=u.memoizedState),(H=gs||B_(u,d,H,g,W,Ee,B)||!1)?(Q||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(g,Ee,B),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(g,Ee,B)),typeof C.componentDidUpdate=="function"&&(u.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof C.componentDidUpdate!="function"||I===a.memoizedProps&&W===a.memoizedState||(u.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||I===a.memoizedProps&&W===a.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=Ee),C.props=g,C.state=Ee,C.context=B,g=H):(typeof C.componentDidUpdate!="function"||I===a.memoizedProps&&W===a.memoizedState||(u.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||I===a.memoizedProps&&W===a.memoizedState||(u.flags|=1024),g=!1)}return im(a,u,d,g,x,y)}function im(a,u,d,g,y,x){x1(a,u);var C=(128&u.flags)!=0;if(!g&&!C)return y&&x_(u,d,!1),zi(a,u,x);g=u.stateNode,P2.current=u;var I=C&&typeof d.getDerivedStateFromError!="function"?null:g.render();return u.flags|=1,a!==null&&C?(u.child=ua(u,a.child,null,x),u.child=ua(u,null,I,x)):Fr(a,u,I,x),u.memoizedState=g.state,y&&x_(u,d,!0),u.child}function E1(a){var u=a.stateNode;u.pendingContext?v_(0,u.pendingContext,u.pendingContext!==u.context):u.context&&v_(0,u.context,!1),jp(a,u.containerInfo)}function S1(a,u,d,g,y){return oa(),Dp(y),u.flags|=256,Fr(a,u,d,g),u.child}var Fl,Bl,Yh,Qh,sm={dehydrated:null,treeContext:null,retryLane:0};function om(a){return{baseLanes:a,cachePool:null,transitions:null}}function b1(a,u,d){var g,y=u.pendingProps,x=wt.current,C=!1,I=(128&u.flags)!=0;if((g=I)||(g=(a===null||a.memoizedState!==null)&&(2&x)!=0),g?(C=!0,u.flags&=-129):a!==null&&a.memoizedState===null||(x|=1),et(wt,1&x),a===null)return Np(u),(a=u.memoizedState)!==null&&(a=a.dehydrated)!==null?(1&u.mode?Tl(a)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(I=y.children,a=y.fallback,C?(y=u.mode,C=u.child,I={mode:"hidden",children:I},!(1&y)&&C!==null?(C.childLanes=0,C.pendingProps=I):C=pc(I,y,0,null),a=vo(a,y,d,null),C.return=u,a.return=u,C.sibling=a,u.child=C,u.child.memoizedState=om(d),u.memoizedState=sm,a):am(u,I));if((x=a.memoizedState)!==null&&(g=x.dehydrated)!==null)return function(H,Q,le,W,ee,Ee,Fe){if(le)return 256&Q.flags?(Q.flags&=-257,Kh(H,Q,Fe,W=tm(Error(s(422))))):Q.memoizedState!==null?(Q.child=H.child,Q.flags|=128,null):(Ee=W.fallback,ee=Q.mode,W=pc({mode:"visible",children:W.children},ee,0,null),(Ee=vo(Ee,ee,Fe,null)).flags|=2,W.return=Q,Ee.return=Q,W.sibling=Ee,Q.child=W,1&Q.mode&&ua(Q,H.child,null,Fe),Q.child.memoizedState=om(Fe),Q.memoizedState=sm,Ee);if(!(1&Q.mode))return Kh(H,Q,Fe,null);if(Tl(ee))return W=xh(ee).digest,Ee=Error(s(419)),W=tm(Ee,W,void 0),Kh(H,Q,Fe,W);if(le=(Fe&H.childLanes)!=0,Or||le){if((W=Wt)!==null){switch(Fe&-Fe){case 4:ee=2;break;case 16:ee=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:ee=32;break;case 536870912:ee=268435456;break;default:ee=0}(ee=ee&(W.suspendedLanes|Fe)?0:ee)!==0&&ee!==Ee.retryLane&&(Ee.retryLane=ee,ni(H,ee),pn(W,H,ee,-1))}return Am(),Kh(H,Q,Fe,W=tm(Error(s(421))))}return bl(ee)?(Q.flags|=128,Q.child=H.child,Q=B2.bind(null,H),wh(ee,Q),null):(H=Ee.treeContext,ye&&(hn=_p(ee),Yr=Q,ht=!0,kn=null,Pl=!1,H!==null&&(ln[un++]=ri,ln[un++]=Li,ln[un++]=ho,ri=H.id,Li=H.overflow,ho=Q)),Q=am(Q,W.children),Q.flags|=4096,Q)}(a,u,I,y,g,x,d);if(C){C=y.fallback,I=u.mode,g=(x=a.child).sibling;var B={mode:"hidden",children:y.children};return!(1&I)&&u.child!==x?((y=u.child).childLanes=0,y.pendingProps=B,u.deletions=null):(y=Ss(x,B)).subtreeFlags=14680064&x.subtreeFlags,g!==null?C=Ss(g,C):(C=vo(C,I,d,null)).flags|=2,C.return=u,y.return=u,y.sibling=C,u.child=y,y=C,C=u.child,I=(I=a.child.memoizedState)===null?om(d):{baseLanes:I.baseLanes|d,cachePool:null,transitions:I.transitions},C.memoizedState=I,C.childLanes=a.childLanes&~d,u.memoizedState=sm,y}return a=(C=a.child).sibling,y=Ss(C,{mode:"visible",children:y.children}),!(1&u.mode)&&(y.lanes=d),y.return=u,y.sibling=null,a!==null&&((d=u.deletions)===null?(u.deletions=[a],u.flags|=16):d.push(a)),u.child=y,u.memoizedState=null,y}function am(a,u){return(u=pc({mode:"visible",children:u},a.mode,0,null)).return=a,a.child=u}function Kh(a,u,d,g){return g!==null&&Dp(g),ua(u,a.child,null,d),(a=am(u,u.pendingProps.children)).flags|=2,u.memoizedState=null,a}function T1(a,u,d){a.lanes|=u;var g=a.alternate;g!==null&&(g.lanes|=u),Lp(a.return,u,d)}function lm(a,u,d,g,y){var x=a.memoizedState;x===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:y}:(x.isBackwards=u,x.rendering=null,x.renderingStartTime=0,x.last=g,x.tail=d,x.tailMode=y)}function A1(a,u,d){var g=u.pendingProps,y=g.revealOrder,x=g.tail;if(Fr(a,u,g.children,d),(2&(g=wt.current))!=0)g=1&g|2,u.flags|=128;else{if(a!==null&&128&a.flags)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&T1(a,d,u);else if(a.tag===19)T1(a,d,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(et(wt,g),(1&u.mode)==0)u.memoizedState=null;else switch(y){case"forwards":for(d=u.child,y=null;d!==null;)(a=d.alternate)!==null&&Hh(a)===null&&(y=d),d=d.sibling;(d=y)===null?(y=u.child,u.child=null):(y=d.sibling,d.sibling=null),lm(u,!1,y,d,x);break;case"backwards":for(d=null,y=u.child,u.child=null;y!==null;){if((a=y.alternate)!==null&&Hh(a)===null){u.child=y;break}a=y.sibling,y.sibling=d,d=y,y=a}lm(u,!0,d,null,x);break;case"together":lm(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function qh(a,u){!(1&u.mode)&&a!==null&&(a.alternate=null,u.alternate=null,u.flags|=2)}function zi(a,u,d){if(a!==null&&(u.dependencies=a.dependencies),mo|=u.lanes,(d&u.childLanes)==0)return null;if(a!==null&&u.child!==a.child)throw Error(s(153));if(u.child!==null){for(d=Ss(a=u.child,a.pendingProps),u.child=d,d.return=u;a.sibling!==null;)a=a.sibling,(d=d.sibling=Ss(a,a.pendingProps)).return=u;d.sibling=null}return u.child}function oi(a){a.flags|=4}function C1(a,u){if(a!==null&&a.child===u.child)return!0;if(16&u.flags)return!1;for(a=u.child;a!==null;){if(12854&a.flags||12854&a.subtreeFlags)return!1;a=a.sibling}return!0}if(P)Fl=function(a,u){for(var d=u.child;d!==null;){if(d.tag===5||d.tag===6)ie(a,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===u)break;for(;d.sibling===null;){if(d.return===null||d.return===u)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Bl=function(){},Yh=function(a,u,d,g,y){if((a=a.memoizedProps)!==g){var x=u.stateNode,C=ii(dn.current);d=$(x,d,a,g,y,C),(u.updateQueue=d)&&oi(u)}},Qh=function(a,u,d,g){d!==g&&oi(u)};else if(we){Fl=function(a,u,d,g){for(var y=u.child;y!==null;){if(y.tag===5){var x=y.stateNode;d&&g&&(x=Sl(x,y.type,y.memoizedProps,y)),ie(a,x)}else if(y.tag===6)x=y.stateNode,d&&g&&(x=vh(x,y.memoizedProps,y)),ie(a,x);else if(y.tag!==4){if(y.tag===22&&y.memoizedState!==null)(x=y.child)!==null&&(x.return=y),Fl(a,y,!0,!0);else if(y.child!==null){y.child.return=y,y=y.child;continue}}if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return}y.sibling.return=y.return,y=y.sibling}};var P1=function(a,u,d,g){for(var y=u.child;y!==null;){if(y.tag===5){var x=y.stateNode;d&&g&&(x=Sl(x,y.type,y.memoizedProps,y)),gh(a,x)}else if(y.tag===6)x=y.stateNode,d&&g&&(x=vh(x,y.memoizedProps,y)),gh(a,x);else if(y.tag!==4){if(y.tag===22&&y.memoizedState!==null)(x=y.child)!==null&&(x.return=y),P1(a,y,!0,!0);else if(y.child!==null){y.child.return=y,y=y.child;continue}}if(y===u)break;for(;y.sibling===null;){if(y.return===null||y.return===u)return;y=y.return}y.sibling.return=y.return,y=y.sibling}};Bl=function(a,u){var d=u.stateNode;if(!C1(a,u)){a=d.containerInfo;var g=El(a);P1(g,u,!1,!1),d.pendingChildren=g,oi(u),g_(a,g)}},Yh=function(a,u,d,g,y){var x=a.stateNode,C=a.memoizedProps;if((a=C1(a,u))&&C===g)u.stateNode=x;else{var I=u.stateNode,B=ii(dn.current),H=null;C!==g&&(H=$(I,d,C,g,y,B)),a&&H===null?u.stateNode=x:(x=Jo(x,H,d,C,g,u,a,I),q(x,d,g,y,B)&&oi(u),u.stateNode=x,a?oi(u):Fl(x,u,!1,!1))}},Qh=function(a,u,d,g){d!==g?(a=ii(ha.current),d=ii(dn.current),u.stateNode=ce(g,a,d,u),oi(u)):u.stateNode=a.stateNode}}else Bl=function(){},Yh=function(){},Qh=function(){};function Ll(a,u){if(!ht)switch(a.tailMode){case"hidden":u=a.tail;for(var d=null;u!==null;)u.alternate!==null&&(d=u),u=u.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Sr(a){var u=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(u)for(var y=a.child;y!==null;)d|=y.lanes|y.childLanes,g|=14680064&y.subtreeFlags,g|=14680064&y.flags,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)d|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=g,a.childLanes=d,u}function I2(a,u,d){var g=u.pendingProps;switch(Mp(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sr(u),null;case 1:case 17:return Xr(u.type)&&wp(),Sr(u),null;case 3:return d=u.stateNode,ca(),ut(Dr),ut(dr),Vp(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),a!==null&&a.child!==null||(Dh(u)?oi(u):a===null||a.memoizedState.isDehydrated&&!(256&u.flags)||(u.flags|=1024,kn!==null&&(bm(kn),kn=null))),Bl(a,u),Sr(u),null;case 5:$p(u),d=ii(ha.current);var y=u.type;if(a!==null&&u.stateNode!=null)Yh(a,u,y,g,d),a.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!g){if(u.stateNode===null)throw Error(s(166));return Sr(u),null}if(a=ii(dn.current),Dh(u)){if(!ye)throw Error(s(175));a=xp(u.stateNode,u.type,u.memoizedProps,d,a,u,!Pl),u.updateQueue=a,a!==null&&oi(u)}else{var x=G(y,g,d,a,u);Fl(x,u,!1,!1),u.stateNode=x,q(x,y,g,d,a)&&oi(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return Sr(u),null;case 6:if(a&&u.stateNode!=null)Qh(a,u,a.memoizedProps,g);else{if(typeof g!="string"&&u.stateNode===null)throw Error(s(166));if(a=ii(ha.current),d=ii(dn.current),Dh(u)){if(!ye)throw Error(s(176));if(a=u.stateNode,d=u.memoizedProps,(g=Eh(a,d,u,!Pl))&&(y=Yr)!==null)switch(y.tag){case 3:Ch(y.stateNode.containerInfo,a,d,(1&y.mode)!=0);break;case 5:Oe(y.type,y.memoizedProps,y.stateNode,a,d,(1&y.mode)!=0)}g&&oi(u)}else u.stateNode=ce(g,a,d,u)}return Sr(u),null;case 13:if(ut(wt),g=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(ht&&hn!==null&&1&u.mode&&!(128&u.flags))R_(),oa(),u.flags|=98560,y=!1;else if(y=Dh(u),g!==null&&g.dehydrated!==null){if(a===null){if(!y)throw Error(s(318));if(!ye)throw Error(s(344));if(!(y=(y=u.memoizedState)!==null?y.dehydrated:null))throw Error(s(317));Sh(y,u)}else oa(),!(128&u.flags)&&(u.memoizedState=null),u.flags|=4;Sr(u),y=!1}else kn!==null&&(bm(kn),kn=null),y=!0;if(!y)return 65536&u.flags?u:null}return 128&u.flags?(u.lanes=d,u):((d=g!==null)!=(a!==null&&a.memoizedState!==null)&&d&&(u.child.flags|=8192,1&u.mode&&(a===null||1&wt.current?Dt===0&&(Dt=3):Am())),u.updateQueue!==null&&(u.flags|=4),Sr(u),null);case 4:return ca(),Bl(a,u),a===null&&Qe(u.stateNode.containerInfo),Sr(u),null;case 10:return Bp(u.type._context),Sr(u),null;case 19:if(ut(wt),(y=u.memoizedState)===null)return Sr(u),null;if(g=(128&u.flags)!=0,(x=y.rendering)===null)if(g)Ll(y,!1);else{if(Dt!==0||a!==null&&128&a.flags)for(a=u.child;a!==null;){if((x=Hh(a))!==null){for(u.flags|=128,Ll(y,!1),(a=x.updateQueue)!==null&&(u.updateQueue=a,u.flags|=4),u.subtreeFlags=0,a=d,d=u.child;d!==null;)y=a,(g=d).flags&=14680066,(x=g.alternate)===null?(g.childLanes=0,g.lanes=y,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=x.childLanes,g.lanes=x.lanes,g.child=x.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=x.memoizedProps,g.memoizedState=x.memoizedState,g.updateQueue=x.updateQueue,g.type=x.type,y=x.dependencies,g.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext}),d=d.sibling;return et(wt,1&wt.current|2),u.child}a=a.sibling}y.tail!==null&&Ht()>xm&&(u.flags|=128,g=!0,Ll(y,!1),u.lanes=4194304)}else{if(!g)if((a=Hh(x))!==null){if(u.flags|=128,g=!0,(a=a.updateQueue)!==null&&(u.updateQueue=a,u.flags|=4),Ll(y,!0),y.tail===null&&y.tailMode==="hidden"&&!x.alternate&&!ht)return Sr(u),null}else 2*Ht()-y.renderingStartTime>xm&&d!==1073741824&&(u.flags|=128,g=!0,Ll(y,!1),u.lanes=4194304);y.isBackwards?(x.sibling=u.child,u.child=x):((a=y.last)!==null?a.sibling=x:u.child=x,y.last=x)}return y.tail!==null?(u=y.tail,y.rendering=u,y.tail=u.sibling,y.renderingStartTime=Ht(),u.sibling=null,a=wt.current,et(wt,g?1&a|2:1&a),u):(Sr(u),null);case 22:case 23:return Tm(),d=u.memoizedState!==null,a!==null&&a.memoizedState!==null!==d&&(u.flags|=8192),d&&1&u.mode?1073741824&Qr&&(Sr(u),P&&6&u.subtreeFlags&&(u.flags|=8192)):Sr(u),null;case 24:case 25:return null}throw Error(s(156,u.tag))}function R2(a,u){switch(Mp(u),u.tag){case 1:return Xr(u.type)&&wp(),65536&(a=u.flags)?(u.flags=-65537&a|128,u):null;case 3:return ca(),ut(Dr),ut(dr),Vp(),65536&(a=u.flags)&&!(128&a)?(u.flags=-65537&a|128,u):null;case 5:return $p(u),null;case 13:if(ut(wt),(a=u.memoizedState)!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(s(340));oa()}return 65536&(a=u.flags)?(u.flags=-65537&a|128,u):null;case 19:return ut(wt),null;case 4:return ca(),null;case 10:return Bp(u.type._context),null;case 22:case 23:return Tm(),null;default:return null}}var Zh=!1,pr=!1,M2=typeof WeakSet=="function"?WeakSet:Set,_e=null;function fa(a,u){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){ct(a,u,g)}else d.current=null}function I1(a,u,d){try{d()}catch(g){ct(a,u,g)}}var R1=!1;function Ul(a,u,d){var g=u.updateQueue;if((g=g!==null?g.lastEffect:null)!==null){var y=g=g.next;do{if((y.tag&a)===a){var x=y.destroy;y.destroy=void 0,x!==void 0&&I1(u,d,x)}y=y.next}while(y!==g)}}function Jh(a,u){if((u=(u=u.updateQueue)!==null?u.lastEffect:null)!==null){var d=u=u.next;do{if((d.tag&a)===a){var g=d.create;d.destroy=g()}d=d.next}while(d!==u)}}function um(a){var u=a.ref;if(u!==null){var d=a.stateNode;a.tag===5?a=fe(d):a=d,typeof u=="function"?u(a):u.current=a}}function M1(a){var u=a.alternate;u!==null&&(a.alternate=null,M1(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode)!==null&&Ut(u),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function k1(a){return a.tag===5||a.tag===3||a.tag===4}function N1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||k1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(2&a.flags||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(2&a.flags))return a.stateNode}}function hm(a,u,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,u?ur(d,a,u):hs(d,a);else if(g!==4&&(a=a.child)!==null)for(hm(a,u,d),a=a.sibling;a!==null;)hm(a,u,d),a=a.sibling}function cm(a,u,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,u?kr(d,a,u):wr(d,a);else if(g!==4&&(a=a.child)!==null)for(cm(a,u,d),a=a.sibling;a!==null;)cm(a,u,d),a=a.sibling}var br=null,ai=!1;function li(a,u,d){for(d=d.child;d!==null;)dm(a,u,d),d=d.sibling}function dm(a,u,d){if(ei&&typeof ei.onCommitFiberUnmount=="function")try{ei.onCommitFiberUnmount(Rh,d)}catch{}switch(d.tag){case 5:pr||fa(d,u);case 6:if(P){var g=br,y=ai;br=null,li(a,u,d),ai=y,(br=g)!==null&&(ai?In(br,d.stateNode):hr(br,d.stateNode))}else li(a,u,d);break;case 18:P&&br!==null&&(ai?ds(br,d.stateNode):Th(br,d.stateNode));break;case 4:P?(g=br,y=ai,br=d.stateNode.containerInfo,ai=!0,li(a,u,d),br=g,ai=y):(we&&(g=d.stateNode.containerInfo,y=El(g),yh(g,y)),li(a,u,d));break;case 0:case 11:case 14:case 15:if(!pr&&(g=d.updateQueue)!==null&&(g=g.lastEffect)!==null){y=g=g.next;do{var x=y,C=x.destroy;x=x.tag,C!==void 0&&(2&x||4&x)&&I1(d,u,C),y=y.next}while(y!==g)}li(a,u,d);break;case 1:if(!pr&&(fa(d,u),typeof(g=d.stateNode).componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(I){ct(d,u,I)}li(a,u,d);break;case 21:li(a,u,d);break;case 22:1&d.mode?(pr=(g=pr)||d.memoizedState!==null,li(a,u,d),pr=g):li(a,u,d);break;default:li(a,u,d)}}function D1(a){var u=a.updateQueue;if(u!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new M2),u.forEach(function(g){var y=L2.bind(null,a,g);d.has(g)||(d.add(g),g.then(y,y))})}}function Dn(a,u){var d=u.deletions;if(d!==null)for(var g=0;g<d.length;g++){var y=d[g];try{var x=a,C=u;if(P){var I=C;e:for(;I!==null;){switch(I.tag){case 5:br=I.stateNode,ai=!1;break e;case 3:case 4:br=I.stateNode.containerInfo,ai=!0;break e}I=I.return}if(br===null)throw Error(s(160));dm(x,C,y),br=null,ai=!1}else dm(x,C,y);var B=y.alternate;B!==null&&(B.return=null),y.return=null}catch(H){ct(y,u,H)}}if(12854&u.subtreeFlags)for(u=u.child;u!==null;)O1(u,a),u=u.sibling}function O1(a,u){var d=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Dn(u,a),ui(a),4&g){try{Ul(3,a,a.return),Jh(3,a)}catch(W){ct(a,a.return,W)}try{Ul(5,a,a.return)}catch(W){ct(a,a.return,W)}}break;case 1:Dn(u,a),ui(a),512&g&&d!==null&&fa(d,d.return);break;case 5:if(Dn(u,a),ui(a),512&g&&d!==null&&fa(d,d.return),P){if(32&a.flags){var y=a.stateNode;try{Nt(y)}catch(W){ct(a,a.return,W)}}if(4&g&&(y=a.stateNode)!=null){var x=a.memoizedProps;if(d=d!==null?d.memoizedProps:x,g=a.type,u=a.updateQueue,a.updateQueue=null,u!==null)try{Mr(y,u,g,d,x,a)}catch(W){ct(a,a.return,W)}}}break;case 6:if(Dn(u,a),ui(a),4&g&&P){if(a.stateNode===null)throw Error(s(162));y=a.stateNode,x=a.memoizedProps,d=d!==null?d.memoizedProps:x;try{lt(y,d,x)}catch(W){ct(a,a.return,W)}}break;case 3:if(Dn(u,a),ui(a),4&g){if(P&&ye&&d!==null&&d.memoizedState.isDehydrated)try{Oi(u.containerInfo)}catch(W){ct(a,a.return,W)}if(we){y=u.containerInfo,x=u.pendingChildren;try{yh(y,x)}catch(W){ct(a,a.return,W)}}}break;case 4:if(Dn(u,a),ui(a),4&g&&we){y=(x=a.stateNode).containerInfo,x=x.pendingChildren;try{yh(y,x)}catch(W){ct(a,a.return,W)}}break;case 13:Dn(u,a),ui(a),8192&(y=a.child).flags&&(x=y.memoizedState!==null,y.stateNode.isHidden=x,!x||y.alternate!==null&&y.alternate.memoizedState!==null||(_m=Ht())),4&g&&D1(a);break;case 22:var C=d!==null&&d.memoizedState!==null;if(1&a.mode?(pr=(d=pr)||C,Dn(u,a),pr=d):Dn(u,a),ui(a),8192&g){if(d=a.memoizedState!==null,(a.stateNode.isHidden=d)&&!C&&(1&a.mode)!=0)for(_e=a,g=a.child;g!==null;){for(u=_e=g;_e!==null;){var I=(C=_e).child;switch(C.tag){case 0:case 11:case 14:case 15:Ul(4,C,C.return);break;case 1:fa(C,C.return);var B=C.stateNode;if(typeof B.componentWillUnmount=="function"){var H=C,Q=C.return;try{var le=H;B.props=le.memoizedProps,B.state=le.memoizedState,B.componentWillUnmount()}catch(W){ct(H,Q,W)}}break;case 5:fa(C,C.return);break;case 22:if(C.memoizedState!==null){L1(u);continue}}I!==null?(I.return=C,_e=I):L1(u)}g=g.sibling}if(P){e:if(g=null,P)for(u=a;;){if(u.tag===5){if(g===null){g=u;try{y=u.stateNode,d?Er(y):Nr(u.stateNode,u.memoizedProps)}catch(W){ct(a,a.return,W)}}}else if(u.tag===6){if(g===null)try{x=u.stateNode,d?cr(x):Vr(x,u.memoizedProps)}catch(W){ct(a,a.return,W)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===a)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break e;for(;u.sibling===null;){if(u.return===null||u.return===a)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}}break;case 19:Dn(u,a),ui(a),4&g&&D1(a);break;case 21:break;default:Dn(u,a),ui(a)}}function ui(a){var u=a.flags;if(2&u){try{if(P){e:{for(var d=a.return;d!==null;){if(k1(d)){var g=d;break e}d=d.return}throw Error(s(160))}switch(g.tag){case 5:var y=g.stateNode;32&g.flags&&(Nt(y),g.flags&=-33),cm(a,N1(a),y);break;case 3:case 4:var x=g.stateNode.containerInfo;hm(a,N1(a),x);break;default:throw Error(s(161))}}}catch(C){ct(a,a.return,C)}a.flags&=-3}4096&u&&(a.flags&=-4097)}function k2(a,u,d){_e=a,F1(a)}function F1(a,u,d){for(var g=(1&a.mode)!=0;_e!==null;){var y=_e,x=y.child;if(y.tag===22&&g){var C=y.memoizedState!==null||Zh;if(!C){var I=y.alternate,B=I!==null&&I.memoizedState!==null||pr;I=Zh;var H=pr;if(Zh=C,(pr=B)&&!H)for(_e=y;_e!==null;)B=(C=_e).child,C.tag===22&&C.memoizedState!==null?U1(y):B!==null?(B.return=C,_e=B):U1(y);for(;x!==null;)_e=x,F1(x),x=x.sibling;_e=y,Zh=I,pr=H}B1(a)}else 8772&y.subtreeFlags&&x!==null?(x.return=y,_e=x):B1(a)}}function B1(a){for(;_e!==null;){var u=_e;if(8772&u.flags){var d=u.alternate;try{if(8772&u.flags)switch(u.tag){case 0:case 11:case 15:pr||Jh(5,u);break;case 1:var g=u.stateNode;if(4&u.flags&&!pr)if(d===null)g.componentDidMount();else{var y=u.elementType===u.type?d.memoizedProps:Nn(u.type,d.memoizedProps);g.componentDidUpdate(y,d.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var x=u.updateQueue;x!==null&&O_(u,x,g);break;case 3:var C=u.updateQueue;if(C!==null){if(d=null,u.child!==null)switch(u.child.tag){case 5:d=fe(u.child.stateNode);break;case 1:d=u.child.stateNode}O_(u,C,d)}break;case 5:var I=u.stateNode;d===null&&4&u.flags&&xt(I,u.type,u.memoizedProps,u);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(ye&&u.memoizedState===null){var B=u.alternate;if(B!==null){var H=B.memoizedState;if(H!==null){var Q=H.dehydrated;Q!==null&&y_(Q)}}}break;default:throw Error(s(163))}pr||512&u.flags&&um(u)}catch(le){ct(u,u.return,le)}}if(u===a){_e=null;break}if((d=u.sibling)!==null){d.return=u.return,_e=d;break}_e=u.return}}function L1(a){for(;_e!==null;){var u=_e;if(u===a){_e=null;break}var d=u.sibling;if(d!==null){d.return=u.return,_e=d;break}_e=u.return}}function U1(a){for(;_e!==null;){var u=_e;try{switch(u.tag){case 0:case 11:case 15:var d=u.return;try{Jh(4,u)}catch(B){ct(u,d,B)}break;case 1:var g=u.stateNode;if(typeof g.componentDidMount=="function"){var y=u.return;try{g.componentDidMount()}catch(B){ct(u,y,B)}}var x=u.return;try{um(u)}catch(B){ct(u,x,B)}break;case 5:var C=u.return;try{um(u)}catch(B){ct(u,C,B)}}}catch(B){ct(u,u.return,B)}if(u===a){_e=null;break}var I=u.sibling;if(I!==null){I.return=u.return,_e=I;break}_e=u.return}}var ec=0,tc=1,rc=2,nc=3,ic=4;if(typeof Symbol=="function"&&Symbol.for){var zl=Symbol.for;ec=zl("selector.component"),tc=zl("selector.has_pseudo_class"),rc=zl("selector.role"),nc=zl("selector.test_id"),ic=zl("selector.text")}function fm(a){var u=Ve(a);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(s(364));return u}if((a=Je(a))===null)throw Error(s(362));return a.stateNode.current}function pm(a,u){switch(u.$$typeof){case ec:if(a.type===u.value)return!0;break;case tc:e:{u=u.value,a=[a,0];for(var d=0;d<a.length;){var g=a[d++],y=a[d++],x=u[y];if(g.tag!==5||!zt(g)){for(;x!=null&&pm(g,x);)x=u[++y];if(y===u.length){u=!0;break e}for(g=g.child;g!==null;)a.push(g,y),g=g.sibling}}u=!1}return u;case rc:if(a.tag===5&&Zt(a.stateNode,u.value))return!0;break;case ic:if((a.tag===5||a.tag===6)&&(a=xr(a))!==null&&0<=a.indexOf(u.value))return!0;break;case nc:if(a.tag===5&&typeof(a=a.memoizedProps["data-testname"])=="string"&&a.toLowerCase()===u.value.toLowerCase())return!0;break;default:throw Error(s(365))}return!1}function mm(a){switch(a.$$typeof){case ec:return"<"+(L(a.value)||"Unknown")+">";case tc:return":has("+(mm(a)||"")+")";case rc:return'[role="'+a.value+'"]';case ic:return'"'+a.value+'"';case nc:return'[data-testname="'+a.value+'"]';default:throw Error(s(365))}}function z1(a,u){var d=[];a=[a,0];for(var g=0;g<a.length;){var y=a[g++],x=a[g++],C=u[x];if(y.tag!==5||!zt(y)){for(;C!=null&&pm(y,C);)C=u[++x];if(x===u.length)d.push(y);else for(y=y.child;y!==null;)a.push(y,x),y=y.sibling}}return d}function gm(a,u){if(!Pe)throw Error(s(363));a=z1(a=fm(a),u),u=[],a=Array.from(a);for(var d=0;d<a.length;){var g=a[d++];if(g.tag===5)zt(g)||u.push(g.stateNode);else for(g=g.child;g!==null;)a.push(g),g=g.sibling}return u}var N2=Math.ceil,sc=o.ReactCurrentDispatcher,ym=o.ReactCurrentOwner,Tt=o.ReactCurrentBatchConfig,He=0,Wt=null,It=null,Jt=0,Qr=0,pa=ps(0),Dt=0,Gl=null,mo=0,oc=0,vm=0,Hl=null,Kr=null,_m=0,xm=1/0,vs=null;function ma(){xm=Ht()+500}var G1,ac=!1,wm=null,_s=null,lc=!1,xs=null,uc=0,jl=0,Em=null,hc=-1,cc=0;function mr(){return 6&He?Ht():hc!==-1?hc:hc=Ht()}function ws(a){return 1&a.mode?2&He&&Jt!==0?Jt&-Jt:v2.transition!==null?(cc===0&&(cc=w_()),cc):(a=$e)!==0?a:Ke():1}function pn(a,u,d,g){if(50<jl)throw jl=0,Em=null,Error(s(185));Cl(a,d,g),2&He&&a===Wt||(a===Wt&&(!(2&He)&&(oc|=d),Dt===4&&Es(a,Jt)),Br(a,g),d===1&&He===0&&!(1&u.mode)&&(ma(),Mh&&ti()))}function Br(a,u){var d=a.callbackNode;(function(y,x){for(var C=y.suspendedLanes,I=y.pingedLanes,B=y.expirationTimes,H=y.pendingLanes;0<H;){var Q=31-Rn(H),le=1<<Q,W=B[Q];W===-1?le&C&&!(le&I)||(B[Q]=f2(le,x)):W<=x&&(y.expiredLanes|=le),H&=~le}})(a,u);var g=Ih(a,a===Wt?Jt:0);if(g===0)d!==null&&S_(d),a.callbackNode=null,a.callbackPriority=0;else if(u=g&-g,a.callbackPriority!==u){if(d!=null&&S_(d),u===1)a.tag===0?function(y){Mh=!0,T_(y)}(j1.bind(null,a)):T_(j1.bind(null,a)),at?Be(function(){!(6&He)&&ti()}):Cp(Pp,ti),d=null;else{switch(E_(g)){case 1:d=Pp;break;case 4:d=g2;break;case 16:default:d=b_;break;case 536870912:d=y2}d=q1(d,H1.bind(null,a))}a.callbackPriority=u,a.callbackNode=d}}function H1(a,u){if(hc=-1,cc=0,(6&He)!=0)throw Error(s(327));var d=a.callbackNode;if(yo()&&a.callbackNode!==d)return null;var g=Ih(a,a===Wt?Jt:0);if(g===0)return null;if(30&g||g&a.expiredLanes||u)u=dc(a,g);else{u=g;var y=He;He|=2;var x=V1();for(Wt===a&&Jt===u||(vs=null,ma(),go(a,u));;)try{O2();break}catch(I){W1(a,I)}Fp(),sc.current=x,He=y,It!==null?u=0:(Wt=null,Jt=0,u=Dt)}if(u!==0){if(u===2&&(y=bp(a))!==0&&(g=y,u=Sm(a,y)),u===1)throw d=Gl,go(a,0),Es(a,g),Br(a,Ht()),d;if(u===6)Es(a,g);else{if(y=a.current.alternate,(30&g)==0&&!function(I){for(var B=I;;){if(16384&B.flags){var H=B.updateQueue;if(H!==null&&(H=H.stores)!==null)for(var Q=0;Q<H.length;Q++){var le=H[Q],W=le.getSnapshot;le=le.value;try{if(!Mn(W(),le))return!1}catch{return!1}}}if(H=B.child,16384&B.subtreeFlags&&H!==null)H.return=B,B=H;else{if(B===I)break;for(;B.sibling===null;){if(B.return===null||B.return===I)return!0;B=B.return}B.sibling.return=B.return,B=B.sibling}}return!0}(y)&&((u=dc(a,g))===2&&(x=bp(a))!==0&&(g=x,u=Sm(a,x)),u===1))throw d=Gl,go(a,0),Es(a,g),Br(a,Ht()),d;switch(a.finishedWork=y,a.finishedLanes=g,u){case 0:case 1:throw Error(s(345));case 2:case 5:ga(a,Kr,vs);break;case 3:if(Es(a,g),(130023424&g)===g&&10<(u=_m+500-Ht())){if(Ih(a,0)!==0)break;if(((y=a.suspendedLanes)&g)!==g){mr(),a.pingedLanes|=a.suspendedLanes&y;break}a.timeoutHandle=ve(ga.bind(null,a,Kr,vs),u);break}ga(a,Kr,vs);break;case 4:if(Es(a,g),(4194240&g)===g)break;for(u=a.eventTimes,y=-1;0<g;){var C=31-Rn(g);x=1<<C,(C=u[C])>y&&(y=C),g&=~x}if(g=y,10<(g=(120>(g=Ht()-g)?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*N2(g/1960))-g)){a.timeoutHandle=ve(ga.bind(null,a,Kr,vs),g);break}ga(a,Kr,vs);break;default:throw Error(s(329))}}}return Br(a,Ht()),a.callbackNode===d?H1.bind(null,a):null}function Sm(a,u){var d=Hl;return a.current.memoizedState.isDehydrated&&(go(a,u).flags|=256),(a=dc(a,u))!==2&&(u=Kr,Kr=d,u!==null&&bm(u)),a}function bm(a){Kr===null?Kr=a:Kr.push.apply(Kr,a)}function Es(a,u){for(u&=~vm,u&=~oc,a.suspendedLanes|=u,a.pingedLanes&=~u,a=a.expirationTimes;0<u;){var d=31-Rn(u),g=1<<d;a[d]=-1,u&=~g}}function j1(a){if(6&He)throw Error(s(327));yo();var u=Ih(a,0);if(!(1&u))return Br(a,Ht()),null;var d=dc(a,u);if(a.tag!==0&&d===2){var g=bp(a);g!==0&&(u=g,d=Sm(a,g))}if(d===1)throw d=Gl,go(a,0),Es(a,u),Br(a,Ht()),d;if(d===6)throw Error(s(345));return a.finishedWork=a.current.alternate,a.finishedLanes=u,ga(a,Kr,vs),Br(a,Ht()),null}function $1(a){xs!==null&&xs.tag===0&&!(6&He)&&yo();var u=He;He|=1;var d=Tt.transition,g=$e;try{if(Tt.transition=null,$e=1,a)return a()}finally{$e=g,Tt.transition=d,!(6&(He=u))&&ti()}}function Tm(){Qr=pa.current,ut(pa)}function go(a,u){a.finishedWork=null,a.finishedLanes=0;var d=a.timeoutHandle;if(d!==Re&&(a.timeoutHandle=Re,ke(d)),It!==null)for(d=It.return;d!==null;){var g=d;switch(Mp(g),g.tag){case 1:(g=g.type.childContextTypes)!=null&&wp();break;case 3:ca(),ut(Dr),ut(dr),Vp();break;case 5:$p(g);break;case 4:ca();break;case 13:case 19:ut(wt);break;case 10:Bp(g.type._context);break;case 22:case 23:Tm()}d=d.return}if(Wt=a,It=a=Ss(a.current,null),Jt=Qr=u,Dt=0,Gl=null,vm=oc=mo=0,Kr=Hl=null,fo!==null){for(u=0;u<fo.length;u++)if((g=(d=fo[u]).interleaved)!==null){d.interleaved=null;var y=g.next,x=d.pending;if(x!==null){var C=x.next;x.next=y,g.next=C}d.pending=g}fo=null}return a}function W1(a,u){for(;;){var d=It;try{if(Fp(),jh.current=Xh,$h){for(var g=pt.memoizedState;g!==null;){var y=g.queue;y!==null&&(y.pending=null),g=g.next}$h=!1}if(po=0,$t=jt=pt=null,kl=!1,Nl=0,ym.current=null,d===null||d.return===null){Dt=1,Gl=u,It=null;break}e:{var x=a,C=d.return,I=d,B=u;if(u=Jt,I.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var H=B,Q=I,le=Q.tag;if(!(1&Q.mode)&&(le===0||le===11||le===15)){var W=Q.alternate;W?(Q.updateQueue=W.updateQueue,Q.memoizedState=W.memoizedState,Q.lanes=W.lanes):(Q.updateQueue=null,Q.memoizedState=null)}var ee=p1(C);if(ee!==null){ee.flags&=-257,m1(ee,C,I,0,u),1&ee.mode&&f1(x,H,u),B=H;var Ee=(u=ee).updateQueue;if(Ee===null){var Fe=new Set;Fe.add(B),u.updateQueue=Fe}else Ee.add(B);break e}if(!(1&u)){f1(x,H,u),Am();break e}B=Error(s(426))}else if(ht&&1&I.mode){var K=p1(C);if(K!==null){!(65536&K.flags)&&(K.flags|=256),m1(K,C,I,0,u),Dp(da(B,I));break e}}x=B=da(B,I),Dt!==4&&(Dt=2),Hl===null?Hl=[x]:Hl.push(x),x=C;do{switch(x.tag){case 3:x.flags|=65536,u&=-u,x.lanes|=u,D_(x,c1(0,B,u));break e;case 1:I=B;var N=x.type,z=x.stateNode;if(!(128&x.flags)&&(typeof N.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(_s===null||!_s.has(z)))){x.flags|=65536,u&=-u,x.lanes|=u,D_(x,d1(x,I,u));break e}}x=x.return}while(x!==null)}Y1(d)}catch(Z){u=Z,It===d&&d!==null&&(It=d=d.return);continue}break}}function V1(){var a=sc.current;return sc.current=Xh,a===null?Xh:a}function Am(){Dt!==0&&Dt!==3&&Dt!==2||(Dt=4),Wt===null||!(268435455&mo)&&!(268435455&oc)||Es(Wt,Jt)}function dc(a,u){var d=He;He|=2;var g=V1();for(Wt===a&&Jt===u||(vs=null,go(a,u));;)try{D2();break}catch(y){W1(a,y)}if(Fp(),He=d,sc.current=g,It!==null)throw Error(s(261));return Wt=null,Jt=0,Dt}function D2(){for(;It!==null;)X1(It)}function O2(){for(;It!==null&&!p2();)X1(It)}function X1(a){var u=G1(a.alternate,a,Qr);a.memoizedProps=a.pendingProps,u===null?Y1(a):It=u,ym.current=null}function Y1(a){var u=a;do{var d=u.alternate;if(a=u.return,(32768&u.flags)==0){if((d=I2(d,u,Qr))!==null)return void(It=d)}else{if((d=R2(d,u))!==null)return d.flags&=32767,void(It=d);if(a===null)return Dt=6,void(It=null);a.flags|=32768,a.subtreeFlags=0,a.deletions=null}if((u=u.sibling)!==null)return void(It=u);It=u=a}while(u!==null);Dt===0&&(Dt=5)}function ga(a,u,d){var g=$e,y=Tt.transition;try{Tt.transition=null,$e=1,function(x,C,I,B){do yo();while(xs!==null);if(6&He)throw Error(s(327));I=x.finishedWork;var H=x.finishedLanes;if(I===null)return null;if(x.finishedWork=null,x.finishedLanes=0,I===x.current)throw Error(s(177));x.callbackNode=null,x.callbackPriority=0;var Q=I.lanes|I.childLanes;if(function(ee,Ee){var Fe=ee.pendingLanes&~Ee;ee.pendingLanes=Ee,ee.suspendedLanes=0,ee.pingedLanes=0,ee.expiredLanes&=Ee,ee.mutableReadLanes&=Ee,ee.entangledLanes&=Ee,Ee=ee.entanglements;var K=ee.eventTimes;for(ee=ee.expirationTimes;0<Fe;){var N=31-Rn(Fe),z=1<<N;Ee[N]=0,K[N]=-1,ee[N]=-1,Fe&=~z}}(x,Q),x===Wt&&(It=Wt=null,Jt=0),!(2064&I.subtreeFlags)&&!(2064&I.flags)||lc||(lc=!0,q1(b_,function(){return yo(),null})),Q=(15990&I.flags)!=0,(15990&I.subtreeFlags)!=0||Q){Q=Tt.transition,Tt.transition=null;var le=$e;$e=1;var W=He;He|=4,ym.current=null,function(ee,Ee){for(X(ee.containerInfo),_e=Ee;_e!==null;)if(Ee=(ee=_e).child,(1028&ee.subtreeFlags)!=0&&Ee!==null)Ee.return=ee,_e=Ee;else for(;_e!==null;){ee=_e;try{var Fe=ee.alternate;if(1024&ee.flags)switch(ee.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(Fe!==null){var K=Fe.memoizedProps,N=Fe.memoizedState,z=ee.stateNode,Z=z.getSnapshotBeforeUpdate(ee.elementType===ee.type?K:Nn(ee.type,K),N);z.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:P&&an(ee.stateNode.containerInfo);break;default:throw Error(s(163))}}catch(Ie){ct(ee,ee.return,Ie)}if((Ee=ee.sibling)!==null){Ee.return=ee.return,_e=Ee;break}_e=ee.return}Fe=R1,R1=!1}(x,I),O1(I,x),O(x.containerInfo),x.current=I,k2(I),m2(),He=W,$e=le,Tt.transition=Q}else x.current=I;if(lc&&(lc=!1,xs=x,uc=H),Q=x.pendingLanes,Q===0&&(_s=null),function(ee){if(ei&&typeof ei.onCommitFiberRoot=="function")try{ei.onCommitFiberRoot(Rh,ee,void 0,(128&ee.current.flags)==128)}catch{}}(I.stateNode),Br(x,Ht()),C!==null)for(B=x.onRecoverableError,I=0;I<C.length;I++)H=C[I],B(H.value,{componentStack:H.stack,digest:H.digest});if(ac)throw ac=!1,x=wm,wm=null,x;1&uc&&x.tag!==0&&yo(),Q=x.pendingLanes,1&Q?x===Em?jl++:(jl=0,Em=x):jl=0,ti()}(a,u,d,g)}finally{Tt.transition=y,$e=g}return null}function yo(){if(xs!==null){var a=E_(uc),u=Tt.transition,d=$e;try{if(Tt.transition=null,$e=16>a?16:a,xs===null)var g=!1;else{if(a=xs,xs=null,uc=0,(6&He)!=0)throw Error(s(331));var y=He;for(He|=4,_e=a.current;_e!==null;){var x=_e,C=x.child;if(16&_e.flags){var I=x.deletions;if(I!==null){for(var B=0;B<I.length;B++){var H=I[B];for(_e=H;_e!==null;){var Q=_e;switch(Q.tag){case 0:case 11:case 15:Ul(8,Q,x)}var le=Q.child;if(le!==null)le.return=Q,_e=le;else for(;_e!==null;){var W=(Q=_e).sibling,ee=Q.return;if(M1(Q),Q===H){_e=null;break}if(W!==null){W.return=ee,_e=W;break}_e=ee}}}var Ee=x.alternate;if(Ee!==null){var Fe=Ee.child;if(Fe!==null){Ee.child=null;do{var K=Fe.sibling;Fe.sibling=null,Fe=K}while(Fe!==null)}}_e=x}}if(2064&x.subtreeFlags&&C!==null)C.return=x,_e=C;else e:for(;_e!==null;){if(2048&(x=_e).flags)switch(x.tag){case 0:case 11:case 15:Ul(9,x,x.return)}var N=x.sibling;if(N!==null){N.return=x.return,_e=N;break e}_e=x.return}}var z=a.current;for(_e=z;_e!==null;){var Z=(C=_e).child;if(2064&C.subtreeFlags&&Z!==null)Z.return=C,_e=Z;else e:for(C=z;_e!==null;){if(2048&(I=_e).flags)try{switch(I.tag){case 0:case 11:case 15:Jh(9,I)}}catch(Xe){ct(I,I.return,Xe)}if(I===C){_e=null;break e}var Ie=I.sibling;if(Ie!==null){Ie.return=I.return,_e=Ie;break e}_e=I.return}}if(He=y,ti(),ei&&typeof ei.onPostCommitFiberRoot=="function")try{ei.onPostCommitFiberRoot(Rh,a)}catch{}g=!0}return g}finally{$e=d,Tt.transition=u}}return!1}function Q1(a,u,d){a=ys(a,u=c1(0,u=da(d,u),1),1),u=mr(),a!==null&&(Cl(a,1,u),Br(a,u))}function ct(a,u,d){if(a.tag===3)Q1(a,a,d);else for(;u!==null;){if(u.tag===3){Q1(u,a,d);break}if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(_s===null||!_s.has(g))){u=ys(u,a=d1(u,a=da(d,a),1),1),a=mr(),u!==null&&(Cl(u,1,a),Br(u,a));break}}u=u.return}}function F2(a,u,d){var g=a.pingCache;g!==null&&g.delete(u),u=mr(),a.pingedLanes|=a.suspendedLanes&d,Wt===a&&(Jt&d)===d&&(Dt===4||Dt===3&&(130023424&Jt)===Jt&&500>Ht()-_m?go(a,0):vm|=d),Br(a,u)}function K1(a,u){u===0&&(1&a.mode?(u=Sp,!(130023424&(Sp<<=1))&&(Sp=4194304)):u=1);var d=mr();(a=ni(a,u))!==null&&(Cl(a,u,d),Br(a,d))}function B2(a){var u=a.memoizedState,d=0;u!==null&&(d=u.retryLane),K1(a,d)}function L2(a,u){var d=0;switch(a.tag){case 13:var g=a.stateNode,y=a.memoizedState;y!==null&&(d=y.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(s(314))}g!==null&&g.delete(u),K1(a,d)}function q1(a,u){return Cp(a,u)}function U2(a,u,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(a,u,d,g){return new U2(a,u,d,g)}function Cm(a){return!(!(a=a.prototype)||!a.isReactComponent)}function Ss(a,u){var d=a.alternate;return d===null?((d=mn(a.tag,u,a.key,a.mode)).elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=u,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=14680064&a.flags,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,u=a.dependencies,d.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function fc(a,u,d,g,y,x){var C=2;if(g=a,typeof a=="function")Cm(a)&&(C=1);else if(typeof a=="string")C=5;else e:switch(a){case c:return vo(d.children,y,x,u);case f:C=8,y|=8;break;case m:return(a=mn(12,d,u,2|y)).elementType=m,a.lanes=x,a;case E:return(a=mn(13,d,u,y)).elementType=E,a.lanes=x,a;case A:return(a=mn(19,d,u,y)).elementType=A,a.lanes=x,a;case w:return pc(d,y,x,u);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case p:C=10;break e;case v:C=9;break e;case _:C=11;break e;case S:C=14;break e;case b:C=16,g=null;break e}throw Error(s(130,a==null?a:typeof a,""))}return(u=mn(C,d,u,y)).elementType=a,u.type=g,u.lanes=x,u}function vo(a,u,d,g){return(a=mn(7,a,g,u)).lanes=d,a}function pc(a,u,d,g){return(a=mn(22,a,g,u)).elementType=w,a.lanes=d,a.stateNode={isHidden:!1},a}function Pm(a,u,d){return(a=mn(6,a,null,u)).lanes=d,a}function Im(a,u,d){return(u=mn(4,a.children!==null?a.children:[],a.key,u)).lanes=d,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}function z2(a,u,d,g,y){this.tag=u,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Re,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Tp(0),this.expirationTimes=Tp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tp(0),this.identifierPrefix=g,this.onRecoverableError=y,ye&&(this.mutableSourceEagerHydrationData=null)}function Z1(a,u,d,g,y,x,C,I,B){return a=new z2(a,u,d,I,B),u===1?(u=1,x===!0&&(u|=8)):u=0,x=mn(3,null,null,u),a.current=x,x.stateNode=a,x.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},zp(x),a}function J1(a){if(!a)return ms;e:{if(M(a=a._reactInternals)!==a||a.tag!==1)throw Error(s(170));var u=a;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(Xr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(s(171))}if(a.tag===1){var d=a.type;if(Xr(d))return __(a,d,u)}return u}function ex(a){var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return(a=de(u))===null?null:a.stateNode}function tx(a,u){if((a=a.memoizedState)!==null&&a.dehydrated!==null){var d=a.retryLane;a.retryLane=d!==0&&d<u?d:u}}function mc(a,u){tx(a,u),(a=a.alternate)&&tx(a,u)}function G2(a){return(a=de(a))===null?null:a.stateNode}function H2(){return null}return G1=function(a,u,d){if(a!==null)if(a.memoizedProps!==u.pendingProps||Dr.current)Or=!0;else{if(!(a.lanes&d)&&!(128&u.flags))return Or=!1,function(le,W,ee){switch(W.tag){case 3:E1(W),oa();break;case 5:j_(W);break;case 1:Xr(W.type)&&Ph(W);break;case 4:jp(W,W.stateNode.containerInfo);break;case 10:M_(0,W.type._context,W.memoizedProps.value);break;case 13:var Ee=W.memoizedState;if(Ee!==null)return Ee.dehydrated!==null?(et(wt,1&wt.current),W.flags|=128,null):ee&W.child.childLanes?b1(le,W,ee):(et(wt,1&wt.current),(le=zi(le,W,ee))!==null?le.sibling:null);et(wt,1&wt.current);break;case 19:if(Ee=(ee&W.childLanes)!=0,(128&le.flags)!=0){if(Ee)return A1(le,W,ee);W.flags|=128}var Fe=W.memoizedState;if(Fe!==null&&(Fe.rendering=null,Fe.tail=null,Fe.lastEffect=null),et(wt,wt.current),Ee)break;return null;case 22:case 23:return W.lanes=0,_1(le,W,ee)}return zi(le,W,ee)}(a,u,d);Or=(131072&a.flags)!=0}else Or=!1,ht&&1048576&u.flags&&A_(u,Nh,u.index);switch(u.lanes=0,u.tag){case 2:var g=u.type;qh(a,u),a=u.pendingProps;var y=na(u,dr.current);la(u,d),y=Qp(null,u,g,a,y,d);var x=Kp();return u.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Xr(g)?(x=!0,Ph(u)):x=!1,u.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,zp(u),y.updater=zh,u.stateNode=y,y._reactInternals=u,Hp(u,g,a,d),u=im(null,u,g,!0,x,d)):(u.tag=0,ht&&x&&Rp(u),Fr(null,u,y,d),u=u.child),u;case 16:g=u.elementType;e:{switch(qh(a,u),a=u.pendingProps,g=(y=g._init)(g._payload),u.type=g,y=u.tag=function(le){if(typeof le=="function")return Cm(le)?1:0;if(le!=null){if((le=le.$$typeof)===_)return 11;if(le===S)return 14}return 2}(g),a=Nn(g,a),y){case 0:u=nm(null,u,g,a,d);break e;case 1:u=w1(null,u,g,a,d);break e;case 11:u=g1(null,u,g,a,d);break e;case 14:u=y1(null,u,g,Nn(g.type,a),d);break e}throw Error(s(306,g,""))}return u;case 0:return g=u.type,y=u.pendingProps,nm(a,u,g,y=u.elementType===g?y:Nn(g,y),d);case 1:return g=u.type,y=u.pendingProps,w1(a,u,g,y=u.elementType===g?y:Nn(g,y),d);case 3:e:{if(E1(u),a===null)throw Error(s(387));g=u.pendingProps,y=(x=u.memoizedState).element,N_(a,u),Uh(u,g,null,d);var C=u.memoizedState;if(g=C.element,ye&&x.isDehydrated){if(x={element:g,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},u.updateQueue.baseState=x,u.memoizedState=x,256&u.flags){u=S1(a,u,g,d,y=da(Error(s(423)),u));break e}if(g!==y){u=S1(a,u,g,d,y=da(Error(s(424)),u));break e}for(ye&&(hn=vp(u.stateNode.containerInfo),Yr=u,ht=!0,kn=null,Pl=!1),d=H_(u,null,g,d),u.child=d;d;)d.flags=-3&d.flags|4096,d=d.sibling}else{if(oa(),g===y){u=zi(a,u,d);break e}Fr(a,u,g,d)}u=u.child}return u;case 5:return j_(u),a===null&&Np(u),g=u.type,y=u.pendingProps,x=a!==null?a.memoizedProps:null,C=y.children,se(g,y)?C=null:x!==null&&se(g,x)&&(u.flags|=32),x1(a,u),Fr(a,u,C,d),u.child;case 6:return a===null&&Np(u),null;case 13:return b1(a,u,d);case 4:return jp(u,u.stateNode.containerInfo),g=u.pendingProps,a===null?u.child=ua(u,null,g,d):Fr(a,u,g,d),u.child;case 11:return g=u.type,y=u.pendingProps,g1(a,u,g,y=u.elementType===g?y:Nn(g,y),d);case 7:return Fr(a,u,u.pendingProps,d),u.child;case 8:case 12:return Fr(a,u,u.pendingProps.children,d),u.child;case 10:e:{if(g=u.type._context,y=u.pendingProps,x=u.memoizedProps,M_(0,g,C=y.value),x!==null)if(Mn(x.value,C)){if(x.children===y.children&&!Dr.current){u=zi(a,u,d);break e}}else for((x=u.child)!==null&&(x.return=u);x!==null;){var I=x.dependencies;if(I!==null){C=x.child;for(var B=I.firstContext;B!==null;){if(B.context===g){if(x.tag===1){(B=Ui(-1,d&-d)).tag=2;var H=x.updateQueue;if(H!==null){var Q=(H=H.shared).pending;Q===null?B.next=B:(B.next=Q.next,Q.next=B),H.pending=B}}x.lanes|=d,(B=x.alternate)!==null&&(B.lanes|=d),Lp(x.return,d,u),I.lanes|=d;break}B=B.next}}else if(x.tag===10)C=x.type===u.type?null:x.child;else if(x.tag===18){if((C=x.return)===null)throw Error(s(341));C.lanes|=d,(I=C.alternate)!==null&&(I.lanes|=d),Lp(C,d,u),C=x.sibling}else C=x.child;if(C!==null)C.return=x;else for(C=x;C!==null;){if(C===u){C=null;break}if((x=C.sibling)!==null){x.return=C.return,C=x;break}C=C.return}x=C}Fr(a,u,y.children,d),u=u.child}return u;case 9:return y=u.type,g=u.pendingProps.children,la(u,d),g=g(y=cn(y)),u.flags|=1,Fr(a,u,g,d),u.child;case 14:return y=Nn(g=u.type,u.pendingProps),y1(a,u,g,y=Nn(g.type,y),d);case 15:return v1(a,u,u.type,u.pendingProps,d);case 17:return g=u.type,y=u.pendingProps,y=u.elementType===g?y:Nn(g,y),qh(a,u),u.tag=1,Xr(g)?(a=!0,Ph(u)):a=!1,la(u,d),L_(u,g,y),Hp(u,g,y,d),im(null,u,g,!0,a,d);case 19:return A1(a,u,d);case 22:return _1(a,u,d)}throw Error(s(156,u.tag))},e.attemptContinuousHydration=function(a){if(a.tag===13){var u=ni(a,134217728);u!==null&&pn(u,a,134217728,mr()),mc(a,134217728)}},e.attemptDiscreteHydration=function(a){if(a.tag===13){var u=ni(a,1);u!==null&&pn(u,a,1,mr()),mc(a,1)}},e.attemptHydrationAtCurrentPriority=function(a){if(a.tag===13){var u=ws(a),d=ni(a,u);d!==null&&pn(d,a,u,mr()),mc(a,u)}},e.attemptSynchronousHydration=function(a){switch(a.tag){case 3:var u=a.stateNode;if(u.current.memoizedState.isDehydrated){var d=Al(u.pendingLanes);d!==0&&(Ap(u,1|d),Br(u,Ht()),!(6&He)&&(ma(),ti()))}break;case 13:$1(function(){var g=ni(a,1);if(g!==null){var y=mr();pn(g,a,1,y)}}),mc(a,1)}},e.batchedUpdates=function(a,u){var d=He;He|=1;try{return a(u)}finally{(He=d)===0&&(ma(),Mh&&ti())}},e.createComponentSelector=function(a){return{$$typeof:ec,value:a}},e.createContainer=function(a,u,d,g,y,x,C){return Z1(a,u,!1,null,0,g,0,x,C)},e.createHasPseudoClassSelector=function(a){return{$$typeof:tc,value:a}},e.createHydrationContainer=function(a,u,d,g,y,x,C,I,B){return(a=Z1(d,g,!0,a,0,x,0,I,B)).context=J1(null),d=a.current,(x=Ui(g=mr(),y=ws(d))).callback=u??null,ys(d,x,y),a.current.lanes=y,Cl(a,y,g),Br(a,g),a},e.createPortal=function(a,u,d){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:g==null?null:""+g,children:a,containerInfo:u,implementation:d}},e.createRoleSelector=function(a){return{$$typeof:rc,value:a}},e.createTestNameSelector=function(a){return{$$typeof:nc,value:a}},e.createTextSelector=function(a){return{$$typeof:ic,value:a}},e.deferredUpdates=function(a){var u=$e,d=Tt.transition;try{return Tt.transition=null,$e=16,a()}finally{$e=u,Tt.transition=d}},e.discreteUpdates=function(a,u,d,g,y){var x=$e,C=Tt.transition;try{return Tt.transition=null,$e=1,a(u,d,g,y)}finally{$e=x,Tt.transition=C,He===0&&ma()}},e.findAllNodes=gm,e.findBoundingRects=function(a,u){if(!Pe)throw Error(s(363));u=gm(a,u),a=[];for(var d=0;d<u.length;d++)a.push(kt(u[d]));for(u=a.length-1;0<u;u--)for(var g=(d=a[u]).x,y=g+d.width,x=d.y,C=x+d.height,I=u-1;0<=I;I--)if(u!==I){var B=a[I],H=B.x,Q=H+B.width,le=B.y,W=le+B.height;if(g>=H&&x>=le&&y<=Q&&C<=W){a.splice(u,1);break}if(!(g!==H||d.width!==B.width||W<x||le>C)){le>x&&(B.height+=le-x,B.y=x),W<C&&(B.height=C-le),a.splice(u,1);break}if(!(x!==le||d.height!==B.height||Q<g||H>y)){H>g&&(B.width+=H-g,B.x=g),Q<y&&(B.width=y-H),a.splice(u,1);break}}return a},e.findHostInstance=ex,e.findHostInstanceWithNoPortals=function(a){return(a=(a=j(a))!==null?F(a):null)===null?null:a.stateNode},e.findHostInstanceWithWarning=function(a){return ex(a)},e.flushControlled=function(a){var u=He;He|=1;var d=Tt.transition,g=$e;try{Tt.transition=null,$e=1,a()}finally{$e=g,Tt.transition=d,(He=u)===0&&(ma(),ti())}},e.flushPassiveEffects=yo,e.flushSync=$1,e.focusWithin=function(a,u){if(!Pe)throw Error(s(363));for(u=z1(a=fm(a),u),u=Array.from(u),a=0;a<u.length;){var d=u[a++];if(!zt(d)){if(d.tag===5&&Ze(d.stateNode))return!0;for(d=d.child;d!==null;)u.push(d),d=d.sibling}}return!1},e.getCurrentUpdatePriority=function(){return $e},e.getFindAllNodesFailureDescription=function(a,u){if(!Pe)throw Error(s(363));var d=0,g=[];a=[fm(a),0];for(var y=0;y<a.length;){var x=a[y++],C=a[y++],I=u[C];if((x.tag!==5||!zt(x))&&(pm(x,I)&&(g.push(mm(I)),++C>d&&(d=C)),C<u.length))for(x=x.child;x!==null;)a.push(x,C),x=x.sibling}if(d<u.length){for(a=[];d<u.length;d++)a.push(mm(u[d]));return`findAllNodes was able to match part of the selector:
855
+ `+g.join(" > ")+`
856
+
857
+ No matching component was found for:
858
+ `+a.join(" > ")}return null},e.getPublicRootInstance=function(a){return(a=a.current).child?a.child.tag===5?fe(a.child.stateNode):a.child.stateNode:null},e.injectIntoDevTools=function(a){if(a={bundleType:a.bundleType,version:a.version,rendererPackageName:a.rendererPackageName,rendererConfig:a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:G2,findFiberByHostInstance:a.findFiberByHostInstance||H2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)a=!0;else{try{Rh=u.inject(a),ei=u}catch{}a=!!u.checkDCE}}return a},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(a,u,d,g){if(!Pe)throw Error(s(363));a=gm(a,u);var y=Gt(a,d,g).disconnect;return{disconnect:function(){y()}}},e.registerMutableSourceForHydration=function(a,u){var d=u._getVersion;d=d(u._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[u,d]:a.mutableSourceEagerHydrationData.push(u,d)},e.runWithPriority=function(a,u){var d=$e;try{return $e=a,u()}finally{$e=d}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(a,u,d,g){var y=u.current,x=mr(),C=ws(y);return d=J1(d),u.context===null?u.context=d:u.pendingContext=d,(u=Ui(x,C)).payload={element:a},(g=g===void 0?null:g)!==null&&(u.callback=g),(a=ys(y,u,C))!==null&&(pn(a,y,C,x),Lh(a,y,C)),C},e}),QE}({get exports(){return Hv},set exports(t){Hv=t}}).exports=rF();var nF=IO(Hv),$C={name:"root",dependencies:{"react-dom":"^18.0.0"}},$v={},td={get exports(){return $v},set exports(t){$v=t}};(function(){var t,e,r,n,i,s;typeof performance<"u"&&performance!==null&&performance.now?td.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(td.exports=function(){return(t()-i)/1e6},e=process.hrtime,n=(t=function(){var o;return 1e9*(o=e())[0]+o[1]})(),s=1e9*process.uptime(),i=n-s):Date.now?(td.exports=function(){return Date.now()-r},r=Date.now()):(td.exports=function(){return new Date().getTime()-r},r=new Date().getTime())}).call(PO);var ZE,Wa={},Eo={};({get exports(){return Wa},set exports(t){Wa=t}}).exports=(ZE||(ZE=1,Eo.ConcurrentRoot=1,Eo.ContinuousEventPriority=4,Eo.DefaultEventPriority=16,Eo.DiscreteEventPriority=1,Eo.IdleEventPriority=536870912,Eo.LegacyRoot=0),Eo);var iF={};function qg(t,e){t.addChild&&(t.addChild(e),typeof e.didMount=="function"&&e.didMount(e,t))}function WC(t,e){var r,n,i;(r=t.willUnmount)===null||r===void 0||r.call(t,t,e),((n=t.config)===null||n===void 0?void 0:n.destroyChildren)!==!1&&(i=t.children)!==null&&i!==void 0&&i.length&&ls(t.children).forEach(function(s){WC(s,t)})}function JE(t,e){var r;WC(e,t),t.removeChild(e);var n=(r=e.config)!==null&&r!==void 0?r:{},i=n.destroy,s=i===void 0||i,o=n.destroyChildren,l=o===void 0||o,h=n.destroyTexture,c=h!==void 0&&h,f=n.destroyBaseTexture,m=f!==void 0&&f;s&&e.destroy({children:l,texture:c,baseTexture:m})}function eS(t,e,r){var n,i;bt(e!==r,"Cannot insert node before itself"),t.children.indexOf(e)!==-1&&t.removeChild(e);var s=t.getChildIndex(r);t.addChildAt(e,s),(n=t.__reactpixi)===null||n===void 0||(i=n.root)===null||i===void 0||i.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"insertBefore"})}var tS=null,Vn=nF({getRootHostContext:function(){return iF},getChildHostContext:function(t){return t},getChildHostContextForEventComponent:function(t){return t},getPublicInstance:function(t){return t},getCurrentEventPriority:function(){return function(){var t,e;if(typeof window>"u")return Wa.DefaultEventPriority;switch((t=window)===null||t===void 0||(e=t.event)===null||e===void 0?void 0:e.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Wa.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Wa.ContinuousEventPriority;default:return Wa.DefaultEventPriority}}()},prepareForCommit:function(){return null},resetAfterCommit:function(){},createInstance:function(t){var e,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=ZO[t];if(typeof s=="function"&&(e=s(i,n)),!e){var o=jC[t];o&&((e=o.create(n,{root:i})).didMount=o.didMount?o.didMount.bind(e):void 0,e.willUnmount=o.willUnmount?o.willUnmount.bind(e):void 0,e.applyProps=o.applyProps?o.applyProps.bind(e):void 0,e.config=o.config)}return e&&(e.__reactpixi={root:i},(typeof((r=e)===null||r===void 0?void 0:r.applyProps)=="function"?e.applyProps:ki)(e,{},n)),e},hideInstance:function(t){t.visible=!1},unhideInstance:function(t,e){var r=e==null||!e.hasOwnProperty("visible")||e.visible;t.visible=r},finalizeInitialChildren:function(t,e,r){return!1},prepareUpdate:function(t,e,r,n,i,s){return tS=function(o,l,h,c){var f=null;for(var m in h)!c.hasOwnProperty(m)&&h.hasOwnProperty(m)&&h[m]!==null&&(m===zv||(f||(f=[]),f.push(m,null)));for(var p in c){var v=c[p],_=h!==null?h[p]:void 0;!c.hasOwnProperty(p)||v===_||v===null&&_===null||p===zv||(f||(f=[]),f.push(p,v))}return f}(0,0,r,n)},shouldSetTextContent:function(t,e){return!1},shouldDeprioritizeSubtree:function(t,e){var r=e.alpha===void 0||e.alpha>0,n=e.renderable===void 0||e.renderable===!0,i=e.visible===void 0||e.visible===!0;return!(r&&n&&i)},createTextInstance:function(t,e,r){bt(!1,'Error trying to add text node "'.concat(t,'"'),"text strings as children of a Pixi component is not supported. To add some text, use &lt;Text text={string} /&gt;")},unhideTextInstance:function(t,e){},mountEventComponent:function(){},updateEventComponent:function(){},handleEventTarget:function(){},scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,warnsIfNotActing:!1,now:$v,isPrimaryRenderer:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,supportsMicrotasks:!0,scheduleMicrotask:queueMicrotask,appendInitialChild:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=qg.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendInitialChild"}),s},appendChild:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=qg.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendChild"}),s},appendChildToContainer:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=qg.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"appendChildToContainer"}),s},removeChild:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=JE.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"removeChild"}),s},removeChildFromContainer:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=JE.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"removeChildFromContainer"}),s},insertBefore:eS,insertInContainerBefore:function(){for(var t,e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=eS.apply(null,n);return(t=n[0].__reactpixi)===null||t===void 0||(e=t.root)===null||e===void 0||e.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"insertInContainerBefore"}),s},commitUpdate:function(t,e,r,n,i){var s,o,l=t&&t.applyProps;typeof l!="function"&&(l=ki),(l(t,n,i)||tS)&&((s=t.__reactpixi)===null||s===void 0||(o=s.root)===null||o===void 0||o.emit("__REACT_PIXI_REQUEST_RENDER__",{detail:"commitUpdate"}))},commitMount:function(t,e,r,n,i){},commitTextUpdate:function(t,e,r){},resetTextContent:function(t){},clearContainer:function(t){},getFundamentalComponentInstance:function(t){throw new Error("Not yet implemented.")},mountFundamentalComponent:function(t){throw new Error("Not yet implemented.")},shouldUpdateFundamentalComponent:function(t){throw new Error("Not yet implemented.")},unmountFundamentalComponent:function(t){throw new Error("Not yet implemented.")},getInstanceFromNode:function(t){throw new Error("Not yet implemented.")},isOpaqueHydratingObject:function(t){throw new Error("Not yet implemented")},makeOpaqueHydratingObject:function(t){throw new Error("Not yet implemented.")},makeClientIdInDEV:function(t){throw new Error("Not yet implemented")},beforeActiveInstanceBlur:function(t){},afterActiveInstanceBlur:function(){},detachDeletedInstance:function(){},preparePortalMount:function(t){}}),sF=$C.dependencies["react-dom"].replace(/[^0-9.]/g,""),oF=$C.name;Vn.injectIntoDevTools({bundleType:0,version:sF,rendererPackageName:oF,findHostInstanceByFiber:Vn.findHostInstance});var Qs=new Map;function VC(t){if(bt(Pr.prototype.isPrototypeOf(t),"Invalid argument `container`, expected instance of `Container`."),Qs.has(t)){var e=Qs.get(t).pixiFiberContainer;Vn.updateContainer(null,e,void 0,function(){Qs.delete(t)})}}function XC(t){bt(Pr.prototype.isPrototypeOf(t),"Invalid argument `container`, expected instance of `Container`.");var e=Qs.get(t);if(bt(!e,"createRoot should only be called once"),!e){var r=Vn.createContainer(t);e={pixiFiberContainer:r,reactRoot:{render:function(n){return Vn.updateContainer(n,r,void 0),Vn.getPublicRootInstance(r)},unmount:function(){VC(t),Qs.delete(t)}}},Qs.set(t,e)}return e.reactRoot}function aF(t,e,r){var n;return console.warn("Pixi React Deprecation Warning: render is deprecated, use createRoot instead"),r!==void 0&&console.warn("Pixi React Deprecation Warning: render callback no longer exists in React 18"),Qs.has(e)?n=Qs.get(e).reactRoot:n=XC(e),n.render(t)}function lF(t){VC(t)}function nh(){return nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nh.apply(this,arguments)}function uF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zC(n.key),n)}}function Wi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pf(t,e){return Pf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Pf(t,e)}function cF(t,e){if(e&&(tn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wi(t)}function If(t){return If=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},If(t)}var mp=Ti.createContext(null),YC=mp.Provider,QC=mp.Consumer,dF=function(t){var e=Ti.forwardRef(function(r,n){return Ti.createElement(QC,null,function(i){return Ti.createElement(t,nh({},r,{ref:n,app:i}))})});return e.displayName="withPIXIApp(".concat(t.displayName||t.name,")"),e};function fF(t){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var r,n=If(t);if(e){var i=If(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return cF(this,r)}}function rS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function rd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rS(Object(r),!0).forEach(function(n){At(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var nS=function(){},KC={width:it.number,height:it.number,onMount:it.func,onUnmount:it.func,raf:it.bool,renderOnComponentChange:it.bool,children:it.node,options:it.shape({autoStart:it.bool,width:it.number,height:it.number,useContextAlpha:it.bool,backgroundAlpha:it.number,autoDensity:it.bool,antialias:it.bool,preserveDrawingBuffer:it.bool,resolution:it.number,forceCanvas:it.bool,backgroundColor:it.number,clearBeforeRender:it.bool,powerPreference:it.string,sharedTicker:it.bool,sharedLoader:it.bool,resizeTo:function(t,e){var r=t[e];r&&bt(r===window||r instanceof HTMLElement,"Invalid prop `resizeTo` of type ".concat(tn(r),", expect `window` or an `HTMLElement`."))},view:function(t,e,r){var n=t[e];n&&bt(n instanceof HTMLCanvasElement,"Invalid prop `view` of type ".concat(tn(n),", supplied to ").concat(r,", expected `<canvas> Element`"))}})},pF={width:800,height:600,onMount:nS,onUnmount:nS,raf:!0,renderOnComponentChange:!0},Wv=function(t){(function(s,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(o&&o.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),o&&Pf(s,o)})(i,Ti.Component);var e,r,n=fF(i);function i(){var s;uF(this,i);for(var o=arguments.length,l=new Array(o),h=0;h<o;h++)l[h]=arguments[h];return At(Wi(s=n.call.apply(n,[this].concat(l))),"_canvas",null),At(Wi(s),"_mediaQuery",null),At(Wi(s),"_ticker",null),At(Wi(s),"_needsUpdate",!0),At(Wi(s),"app",null),At(Wi(s),"updateSize",function(){var c=s.props,f=c.width,m=c.height,p=c.options;p!=null&&p.resolution||(s.app.renderer.resolution=window.devicePixelRatio,s.resetInteractionManager()),s.app.renderer.resize(f,m)}),At(Wi(s),"needsRenderUpdate",function(){s._needsUpdate=!0}),At(Wi(s),"renderStage",function(){var c=s.props,f=c.renderOnComponentChange;!c.raf&&f&&s._needsUpdate&&(s._needsUpdate=!1,s.app.renderer.render(s.app.stage))}),s}return e=i,(r=[{key:"componentDidMount",value:function(){var s=this.props,o=s.onMount,l=s.width,h=s.height,c=s.options,f=s.raf,m=s.renderOnComponentChange;this.app=new pp(rd(rd({width:l,height:h,view:this._canvas},c),{},{autoDensity:(c==null?void 0:c.autoDensity)!==!1})),this.app.ticker.autoStart=!1,this.app.ticker[f?"start":"stop"](),this.app.stage.__reactpixi={root:this.app.stage},this.mountNode=Vn.createContainer(this.app.stage),Vn.updateContainer(this.getChildren(),this.mountNode,this),o(this.app),c!=null&&c.autoDensity&&window.matchMedia&&(c==null?void 0:c.resolution)===void 0&&(this._mediaQuery=window.matchMedia("(-webkit-min-device-pixel-ratio: 1.3), (min-resolution: 120dpi)"),this._mediaQuery.addListener(this.updateSize)),m&&!f&&(this._ticker=new Qt,this._ticker.autoStart=!0,this._ticker.add(this.renderStage),this.app.stage.on("__REACT_PIXI_REQUEST_RENDER__",this.needsRenderUpdate)),this.updateSize(),this.renderStage()}},{key:"componentDidUpdate",value:function(s,o,l){var h,c=this.props,f=c.width,m=c.height,p=c.raf,v=c.renderOnComponentChange,_=c.options;(_==null?void 0:_.resolution)!==void 0&&(s==null?void 0:s.options.resolution)!==(_==null?void 0:_.resolution)&&(this.app.renderer.resolution=_.resolution,this.resetInteractionManager()),s.height===m&&s.width===f&&((h=s.options)===null||h===void 0?void 0:h.resolution)===(_==null?void 0:_.resolution)||this.updateSize(),s.raf!==p&&this.app.ticker[p?"start":"stop"](),Vn.updateContainer(this.getChildren(),this.mountNode,this),s.width===f&&s.height===m&&s.raf===p&&s.renderOnComponentChange===v&&s.options===_||(this._needsUpdate=!0,this.renderStage())}},{key:"resetInteractionManager",value:function(){var s=this.app.renderer.plugins.interaction;s!=null&&s.resolution&&(s.resolution=this.app.renderer.resolution)}},{key:"getChildren",value:function(){var s=this.props.children;return Ti.createElement(YC,{value:this.app},s)}},{key:"componentDidCatch",value:function(s,o){console.error("Error occurred in `Stage`."),console.error(s),console.error(o)}},{key:"componentWillUnmount",value:function(){this.props.onUnmount(this.app),this._ticker&&(this._ticker.remove(this.renderStage),this._ticker.destroy()),this.app.stage.off("__REACT_PIXI_REQUEST_RENDER__",this.needsRenderUpdate),Vn.updateContainer(null,this.mountNode,this),this._mediaQuery&&(this._mediaQuery.removeListener(this.updateSize),this._mediaQuery=null),this.app.destroy()}},{key:"render",value:function(){var s,o,l=this,h=this.props.options;return h&&h.view?(bt(h.view instanceof HTMLCanvasElement,"options.view needs to be a `HTMLCanvasElement`"),null):Ti.createElement("canvas",nh({},(s=this.props,o=[].concat(ls(Object.keys(KC)),ls(Object.keys(Gv))),Object.keys(s).filter(function(c){return!o.includes(c)}).reduce(function(c,f){return rd(rd({},c),{},At({},f,s[f]))},{})),{ref:function(c){return l._canvas=c}}))}}])&&hF(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),i}();Wv.propTypes=KC,Wv.defaultProps=pF;var mF=Wv;function qC(){var t=Ce.useContext(mp);return bt(t instanceof pp,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),t}function gF(t){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=qC();bt(typeof t=="function","`useTick` needs a callback function."),bt(r instanceof pp,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider");var n=Ce.useRef(null);Ce.useEffect(function(){n.current=t},[t]),Ce.useEffect(function(){if(e){var i=function(s){return n.current.apply(r.ticker,[s,r.ticker])};return r.ticker.add(i),function(){r.ticker&&r.ticker.remove(i)}}},[e])}function yF(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vv(t,e,r){return Vv=yF()?Reflect.construct.bind():function(n,i,s){var o=[null];o.push.apply(o,i);var l=new(Function.bind.apply(n,o));return s&&Pf(l,s.prototype),l},Vv.apply(null,arguments)}var vF=["children","apply"];function iS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function nd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iS(Object(r),!0).forEach(function(n){At(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var _F=function(t,e){bt(tn(e)==="object","Second argument needs to be an indexed object with { prop: Filter }");var r=Object.keys(e),n=function(i){var s=i.children,o=i.apply,l=ao(i,vF),h=Ce.useRef(Ce.useMemo(function(){return r.map(function(m){var p,v=(l==null||(p=l[m])===null||p===void 0?void 0:p.construct)||[];return Vv(e[m],ls(v))})},[r])),c=Ce.useMemo(function(){return r.reduce(function(m,p,v){return nd(nd({},m),{},At({},p,h.current[v]))},{})},[r]),f=Ce.useMemo(function(){return Object.keys(l).filter(HC(GC(r))).reduce(function(m,p){return nd(nd({},m),{},At({},p,l[p]))},{})},[l,r]);return r.forEach(function(m,p){return Object.assign(h.current[p],l[m])}),o&&function(){for(var m=arguments.length,p=new Array(m),v=0;v<m;v++)p[v]=arguments[v];return p.every(function(_){return typeof _=="function"})}(o)&&o.call(t,c),Ti.createElement(t,nh({},f,{filters:h.current}),s)};return n.displayName="FilterWrapper",n.propTypes={children:it.node,apply:it.func},n},xF=Wr.BitmapText,wF=Wr.Container,EF=Wr.Graphics,SF=Wr.NineSlicePlane,bF=Wr.ParticleContainer,TF=Wr.Sprite,AF=Wr.AnimatedSprite,CF=Wr.Text,PF=Wr.TilingSprite,IF=Wr.SimpleMesh,RF=Wr.SimpleRope;const MF=Object.freeze(Object.defineProperty({__proto__:null,AnimatedSprite:AF,AppConsumer:QC,AppContext:mp,AppProvider:YC,BitmapText:xF,Container:wF,Graphics:EF,NineSlicePlane:SF,ParticleContainer:bF,PixiComponent:JO,PixiFiber:Vn,SimpleMesh:IF,SimpleRope:RF,Sprite:TF,Stage:mF,TYPES:Wr,Text:CF,TilingSprite:PF,applyDefaultProps:ki,createRoot:XC,eventHandlers:Cf,render:aF,unmountComponentAtNode:lF,useApp:qC,useTick:gF,withFilters:_F,withPixiApp:dF},Symbol.toStringTag,{value:"Module"})),kF=AS(MF);JT.exports=kF;var ir=JT.exports;const ZC=new ot;ft.prototype._cacheAsBitmap=!1;ft.prototype._cacheData=null;ft.prototype._cacheAsBitmapResolution=null;ft.prototype._cacheAsBitmapMultisample=null;class NF{constructor(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}}Object.defineProperties(ft.prototype,{cacheAsBitmapResolution:{get(){return this._cacheAsBitmapResolution},set(t){t!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get(){return this._cacheAsBitmapMultisample},set(t){t!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=t,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get(){return this._cacheAsBitmap},set(t){if(this._cacheAsBitmap===t)return;this._cacheAsBitmap=t;let e;t?(this._cacheData||(this._cacheData=new NF),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}});ft.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))};ft.prototype._initCachedDisplayObject=function(t){var p,v;if((p=this._cacheData)!=null&&p.sprite)return;const e=this.alpha;this.alpha=1,t.batch.flush();const r=this.getLocalBounds(new De,!0);if((v=this.filters)!=null&&v.length){const _=this.filters[0].padding;r.pad(_)}const n=this.cacheAsBitmapResolution||t.resolution;r.ceil(n),r.width=Math.max(r.width,1/n),r.height=Math.max(r.height,1/n);const i=t.renderTexture.current,s=t.renderTexture.sourceFrame.clone(),o=t.renderTexture.destinationFrame.clone(),l=t.projection.transform,h=Zo.create({width:r.width,height:r.height,resolution:n,multisample:this.cacheAsBitmapMultisample??t.multisample}),c=`cacheAsBitmap_${Xo()}`;this._cacheData.textureCacheId=c,Ne.addToCache(h.baseTexture,c),oe.addToCache(h,c);const f=this.transform.localTransform.copyTo(ZC).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,t.render(this,{renderTexture:h,clear:!0,transform:f,skipUpdateTransform:!1}),t.framebuffer.blit(),t.projection.transform=l,t.renderTexture.bind(i,s,o),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=e;const m=new Di(h);m.transform.worldTransform=this.transform.worldTransform,m.anchor.x=-(r.x/r.width),m.anchor.y=-(r.y/r.height),m.alpha=e,m._bounds=this._bounds,this._cacheData.sprite=m,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=m.containsPoint.bind(m)};ft.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))};ft.prototype._initCachedDisplayObjectCanvas=function(t){var f;if((f=this._cacheData)!=null&&f.sprite)return;const e=this.getLocalBounds(new De,!0),r=this.alpha;this.alpha=1;const n=t.canvasContext.activeContext,i=t._projTransform,s=this.cacheAsBitmapResolution||t.resolution;e.ceil(s),e.width=Math.max(e.width,1/s),e.height=Math.max(e.height,1/s);const o=Zo.create({width:e.width,height:e.height,resolution:s}),l=`cacheAsBitmap_${Xo()}`;this._cacheData.textureCacheId=l,Ne.addToCache(o.baseTexture,l),oe.addToCache(o,l);const h=ZC;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=e.x,h.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,{renderTexture:o,clear:!0,transform:h,skipUpdateTransform:!1}),t.canvasContext.activeContext=n,t._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=r;const c=new Di(o);c.transform.worldTransform=this.transform.worldTransform,c.anchor.x=-(e.x/e.width),c.anchor.y=-(e.y/e.height),c.alpha=r,c._bounds=this._bounds,this._cacheData.sprite=c,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=c.containsPoint.bind(c)};ft.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID};ft.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)};ft.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Ne.removeFromCache(this._cacheData.textureCacheId),oe.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null};ft.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)};ft.prototype.name=null;Pr.prototype.getChildByName=function(t,e){for(let r=0,n=this.children.length;r<n;r++)if(this.children[r].name===t)return this.children[r];if(e)for(let r=0,n=this.children.length;r<n;r++){const i=this.children[r];if(!i.getChildByName)continue;const s=i.getChildByName(t,!0);if(s)return s}return null};ft.prototype.getGlobalPosition=function(t=new Ge,e=!1){return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var DF=`varying vec2 vTextureCoord;
859
+
860
+ uniform sampler2D uSampler;
861
+ uniform float uAlpha;
862
+
863
+ void main(void)
864
+ {
865
+ gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
866
+ }
867
+ `;class OF extends Ar{constructor(e=1){super(qN,DF,{uAlpha:1}),this.alpha=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}const FF={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},BF=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
868
+ `);function LF(t){const e=FF[t],r=e.length;let n=BF,i="";const s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let o;for(let l=0;l<t;l++){let h=s.replace("%index%",l.toString());o=l,l>=r&&(o=t-l-1),h=h.replace("%value%",e[o].toString()),i+=h,i+=`
869
+ `}return n=n.replace("%blur%",i),n=n.replace("%size%",t.toString()),n}const UF=`
870
+ attribute vec2 aVertexPosition;
871
+
872
+ uniform mat3 projectionMatrix;
873
+
874
+ uniform float strength;
875
+
876
+ varying vec2 vBlurTexCoords[%size%];
877
+
878
+ uniform vec4 inputSize;
879
+ uniform vec4 outputFrame;
880
+
881
+ vec4 filterVertexPosition( void )
882
+ {
883
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
884
+
885
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
886
+ }
887
+
888
+ vec2 filterTextureCoord( void )
889
+ {
890
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
891
+ }
892
+
893
+ void main(void)
894
+ {
895
+ gl_Position = filterVertexPosition();
896
+
897
+ vec2 textureCoord = filterTextureCoord();
898
+ %blur%
899
+ }`;function zF(t,e){const r=Math.ceil(t/2);let n=UF,i="",s;e?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o<t;o++){let l=s.replace("%index%",o.toString());l=l.replace("%sampleIndex%",`${o-(r-1)}.0`),i+=l,i+=`
900
+ `}return n=n.replace("%blur%",i),n=n.replace("%size%",t.toString()),n}class Xv extends Ar{constructor(e,r=8,n=4,i=Ar.defaultResolution,s=5){const o=zF(s,e),l=LF(s);super(o,l),this.horizontal=e,this.resolution=i,this._quality=0,this.quality=n,this.blur=r}apply(e,r,n,i){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/r.width):this.uniforms.strength=1/n.height*(n.height/r.height):this.horizontal?this.uniforms.strength=1/e.renderer.width*(e.renderer.width/r.width):this.uniforms.strength=1/e.renderer.height*(e.renderer.height/r.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)e.applyFilter(this,r,n,i);else{const s=e.getFilterTexture(),o=e.renderer;let l=r,h=s;this.state.blend=!1,e.applyFilter(this,l,h,_i.CLEAR);for(let c=1;c<this.passes-1;c++){e.bindAndClear(l,_i.BLIT),this.uniforms.uSampler=h;const f=h;h=l,l=f,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,e.applyFilter(this,h,n,i),e.returnFilterTexture(s)}}get blur(){return this.strength}set blur(e){this.padding=1+Math.abs(e)*2,this.strength=e}get quality(){return this._quality}set quality(e){this._quality=e,this.passes=e}}class GF extends Ar{constructor(e=8,r=4,n=Ar.defaultResolution,i=5){super(),this._repeatEdgePixels=!1,this.blurXFilter=new Xv(!0,e,r,n,i),this.blurYFilter=new Xv(!1,e,r,n,i),this.resolution=n,this.quality=r,this.blur=e,this.repeatEdgePixels=!1}apply(e,r,n,i){const s=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(s&&o){const l=e.getFilterTexture();this.blurXFilter.apply(e,r,l,_i.CLEAR),this.blurYFilter.apply(e,l,n,i),e.returnFilterTexture(l)}else o?this.blurYFilter.apply(e,r,n,i):this.blurXFilter.apply(e,r,n,i)}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2}get blur(){return this.blurXFilter.blur}set blur(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding()}get quality(){return this.blurXFilter.quality}set quality(e){this.blurXFilter.quality=this.blurYFilter.quality=e}get blurX(){return this.blurXFilter.blur}set blurX(e){this.blurXFilter.blur=e,this.updatePadding()}get blurY(){return this.blurYFilter.blur}set blurY(e){this.blurYFilter.blur=e,this.updatePadding()}get blendMode(){return this.blurYFilter.blendMode}set blendMode(e){this.blurYFilter.blendMode=e}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(e){this._repeatEdgePixels=e,this.updatePadding()}}var HF=`varying vec2 vTextureCoord;
901
+ uniform sampler2D uSampler;
902
+ uniform float m[20];
903
+ uniform float uAlpha;
904
+
905
+ void main(void)
906
+ {
907
+ vec4 c = texture2D(uSampler, vTextureCoord);
908
+
909
+ if (uAlpha == 0.0) {
910
+ gl_FragColor = c;
911
+ return;
912
+ }
913
+
914
+ // Un-premultiply alpha before applying the color matrix. See issue #3539.
915
+ if (c.a > 0.0) {
916
+ c.rgb /= c.a;
917
+ }
918
+
919
+ vec4 result;
920
+
921
+ result.r = (m[0] * c.r);
922
+ result.r += (m[1] * c.g);
923
+ result.r += (m[2] * c.b);
924
+ result.r += (m[3] * c.a);
925
+ result.r += m[4];
926
+
927
+ result.g = (m[5] * c.r);
928
+ result.g += (m[6] * c.g);
929
+ result.g += (m[7] * c.b);
930
+ result.g += (m[8] * c.a);
931
+ result.g += m[9];
932
+
933
+ result.b = (m[10] * c.r);
934
+ result.b += (m[11] * c.g);
935
+ result.b += (m[12] * c.b);
936
+ result.b += (m[13] * c.a);
937
+ result.b += m[14];
938
+
939
+ result.a = (m[15] * c.r);
940
+ result.a += (m[16] * c.g);
941
+ result.a += (m[17] * c.b);
942
+ result.a += (m[18] * c.a);
943
+ result.a += m[19];
944
+
945
+ vec3 rgb = mix(c.rgb, result.rgb, uAlpha);
946
+
947
+ // Premultiply alpha again.
948
+ rgb *= result.a;
949
+
950
+ gl_FragColor = vec4(rgb, result.a);
951
+ }
952
+ `;class Yv extends Ar{constructor(){const e={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};super(mC,HF,e),this.alpha=1}_loadMatrix(e,r=!1){let n=e;r&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n}_multiply(e,r,n){return e[0]=r[0]*n[0]+r[1]*n[5]+r[2]*n[10]+r[3]*n[15],e[1]=r[0]*n[1]+r[1]*n[6]+r[2]*n[11]+r[3]*n[16],e[2]=r[0]*n[2]+r[1]*n[7]+r[2]*n[12]+r[3]*n[17],e[3]=r[0]*n[3]+r[1]*n[8]+r[2]*n[13]+r[3]*n[18],e[4]=r[0]*n[4]+r[1]*n[9]+r[2]*n[14]+r[3]*n[19]+r[4],e[5]=r[5]*n[0]+r[6]*n[5]+r[7]*n[10]+r[8]*n[15],e[6]=r[5]*n[1]+r[6]*n[6]+r[7]*n[11]+r[8]*n[16],e[7]=r[5]*n[2]+r[6]*n[7]+r[7]*n[12]+r[8]*n[17],e[8]=r[5]*n[3]+r[6]*n[8]+r[7]*n[13]+r[8]*n[18],e[9]=r[5]*n[4]+r[6]*n[9]+r[7]*n[14]+r[8]*n[19]+r[9],e[10]=r[10]*n[0]+r[11]*n[5]+r[12]*n[10]+r[13]*n[15],e[11]=r[10]*n[1]+r[11]*n[6]+r[12]*n[11]+r[13]*n[16],e[12]=r[10]*n[2]+r[11]*n[7]+r[12]*n[12]+r[13]*n[17],e[13]=r[10]*n[3]+r[11]*n[8]+r[12]*n[13]+r[13]*n[18],e[14]=r[10]*n[4]+r[11]*n[9]+r[12]*n[14]+r[13]*n[19]+r[14],e[15]=r[15]*n[0]+r[16]*n[5]+r[17]*n[10]+r[18]*n[15],e[16]=r[15]*n[1]+r[16]*n[6]+r[17]*n[11]+r[18]*n[16],e[17]=r[15]*n[2]+r[16]*n[7]+r[17]*n[12]+r[18]*n[17],e[18]=r[15]*n[3]+r[16]*n[8]+r[17]*n[13]+r[18]*n[18],e[19]=r[15]*n[4]+r[16]*n[9]+r[17]*n[14]+r[18]*n[19]+r[19],e}_colorMatrix(e){const r=new Float32Array(e);return r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,r}brightness(e,r){const n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,r)}tint(e,r){const[n,i,s]=rt.shared.setValue(e).toArray(),o=[n,0,0,0,0,0,i,0,0,0,0,0,s,0,0,0,0,0,1,0];this._loadMatrix(o,r)}greyscale(e,r){const n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,r)}blackAndWhite(e){const r=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(r,e)}hue(e,r){e=(e||0)/180*Math.PI;const n=Math.cos(e),i=Math.sin(e),s=Math.sqrt,o=1/3,l=s(o),h=n+(1-n)*o,c=o*(1-n)-l*i,f=o*(1-n)+l*i,m=o*(1-n)+l*i,p=n+o*(1-n),v=o*(1-n)-l*i,_=o*(1-n)-l*i,E=o*(1-n)+l*i,A=n+o*(1-n),S=[h,c,f,0,0,m,p,v,0,0,_,E,A,0,0,0,0,0,1,0];this._loadMatrix(S,r)}contrast(e,r){const n=(e||0)+1,i=-.5*(n-1),s=[n,0,0,0,i,0,n,0,0,i,0,0,n,0,i,0,0,0,1,0];this._loadMatrix(s,r)}saturate(e=0,r){const n=e*2/3+1,i=(n-1)*-.5,s=[n,i,i,0,0,i,n,i,0,0,i,i,n,0,0,0,0,0,1,0];this._loadMatrix(s,r)}desaturate(){this.saturate(-1)}negative(e){const r=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(r,e)}sepia(e){const r=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(r,e)}technicolor(e){const r=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(r,e)}polaroid(e){const r=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(r,e)}toBGR(e){const r=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(r,e)}kodachrome(e){const r=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(r,e)}browni(e){const r=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(r,e)}vintage(e){const r=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(r,e)}colorTone(e,r,n,i,s){e=e||.2,r=r||.15,n=n||16770432,i=i||3375104;const o=rt.shared,[l,h,c]=o.setValue(n).toArray(),[f,m,p]=o.setValue(i).toArray(),v=[.3,.59,.11,0,0,l,h,c,e,0,f,m,p,r,0,l-f,h-m,c-p,0,0];this._loadMatrix(v,s)}night(e,r){e=e||.1;const n=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(n,r)}predator(e,r){const n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,r)}lsd(e){const r=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(r,e)}reset(){const e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,!1)}get matrix(){return this.uniforms.m}set matrix(e){this.uniforms.m=e}get alpha(){return this.uniforms.uAlpha}set alpha(e){this.uniforms.uAlpha=e}}Yv.prototype.grayscale=Yv.prototype.greyscale;var jF=`varying vec2 vFilterCoord;
953
+ varying vec2 vTextureCoord;
954
+
955
+ uniform vec2 scale;
956
+ uniform mat2 rotation;
957
+ uniform sampler2D uSampler;
958
+ uniform sampler2D mapSampler;
959
+
960
+ uniform highp vec4 inputSize;
961
+ uniform vec4 inputClamp;
962
+
963
+ void main(void)
964
+ {
965
+ vec4 map = texture2D(mapSampler, vFilterCoord);
966
+
967
+ map -= 0.5;
968
+ map.xy = scale * inputSize.zw * (rotation * map.xy);
969
+
970
+ gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
971
+ }
972
+ `,$F=`attribute vec2 aVertexPosition;
973
+
974
+ uniform mat3 projectionMatrix;
975
+ uniform mat3 filterMatrix;
976
+
977
+ varying vec2 vTextureCoord;
978
+ varying vec2 vFilterCoord;
979
+
980
+ uniform vec4 inputSize;
981
+ uniform vec4 outputFrame;
982
+
983
+ vec4 filterVertexPosition( void )
984
+ {
985
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
986
+
987
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
988
+ }
989
+
990
+ vec2 filterTextureCoord( void )
991
+ {
992
+ return aVertexPosition * (outputFrame.zw * inputSize.zw);
993
+ }
994
+
995
+ void main(void)
996
+ {
997
+ gl_Position = filterVertexPosition();
998
+ vTextureCoord = filterTextureCoord();
999
+ vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
1000
+ }
1001
+ `;class WF extends Ar{constructor(e,r){const n=new ot;e.renderable=!1,super($F,jF,{mapSampler:e._texture,filterMatrix:n,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=e,this.maskMatrix=n,r==null&&(r=20),this.scale=new Ge(r,r)}apply(e,r,n,i){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;const s=this.maskSprite.worldTransform,o=Math.sqrt(s.a*s.a+s.b*s.b),l=Math.sqrt(s.c*s.c+s.d*s.d);o!==0&&l!==0&&(this.uniforms.rotation[0]=s.a/o,this.uniforms.rotation[1]=s.b/o,this.uniforms.rotation[2]=s.c/l,this.uniforms.rotation[3]=s.d/l),e.applyFilter(this,r,n,i)}get map(){return this.uniforms.mapSampler}set map(e){this.uniforms.mapSampler=e}}var VF=`varying vec2 v_rgbNW;
1002
+ varying vec2 v_rgbNE;
1003
+ varying vec2 v_rgbSW;
1004
+ varying vec2 v_rgbSE;
1005
+ varying vec2 v_rgbM;
1006
+
1007
+ varying vec2 vFragCoord;
1008
+ uniform sampler2D uSampler;
1009
+ uniform highp vec4 inputSize;
1010
+
1011
+
1012
+ /**
1013
+ Basic FXAA implementation based on the code on geeks3d.com with the
1014
+ modification that the texture2DLod stuff was removed since it's
1015
+ unsupported by WebGL.
1016
+
1017
+ --
1018
+
1019
+ From:
1020
+ https://github.com/mitsuhiko/webgl-meincraft
1021
+
1022
+ Copyright (c) 2011 by Armin Ronacher.
1023
+
1024
+ Some rights reserved.
1025
+
1026
+ Redistribution and use in source and binary forms, with or without
1027
+ modification, are permitted provided that the following conditions are
1028
+ met:
1029
+
1030
+ * Redistributions of source code must retain the above copyright
1031
+ notice, this list of conditions and the following disclaimer.
1032
+
1033
+ * Redistributions in binary form must reproduce the above
1034
+ copyright notice, this list of conditions and the following
1035
+ disclaimer in the documentation and/or other materials provided
1036
+ with the distribution.
1037
+
1038
+ * The names of the contributors may not be used to endorse or
1039
+ promote products derived from this software without specific
1040
+ prior written permission.
1041
+
1042
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1043
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1044
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1045
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1046
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1047
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1048
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1049
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1050
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1051
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1052
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1053
+ */
1054
+
1055
+ #ifndef FXAA_REDUCE_MIN
1056
+ #define FXAA_REDUCE_MIN (1.0/ 128.0)
1057
+ #endif
1058
+ #ifndef FXAA_REDUCE_MUL
1059
+ #define FXAA_REDUCE_MUL (1.0 / 8.0)
1060
+ #endif
1061
+ #ifndef FXAA_SPAN_MAX
1062
+ #define FXAA_SPAN_MAX 8.0
1063
+ #endif
1064
+
1065
+ //optimized version for mobile, where dependent
1066
+ //texture reads can be a bottleneck
1067
+ vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,
1068
+ vec2 v_rgbNW, vec2 v_rgbNE,
1069
+ vec2 v_rgbSW, vec2 v_rgbSE,
1070
+ vec2 v_rgbM) {
1071
+ vec4 color;
1072
+ vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;
1073
+ vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;
1074
+ vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;
1075
+ vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;
1076
+ vec4 texColor = texture2D(tex, v_rgbM);
1077
+ vec3 rgbM = texColor.xyz;
1078
+ vec3 luma = vec3(0.299, 0.587, 0.114);
1079
+ float lumaNW = dot(rgbNW, luma);
1080
+ float lumaNE = dot(rgbNE, luma);
1081
+ float lumaSW = dot(rgbSW, luma);
1082
+ float lumaSE = dot(rgbSE, luma);
1083
+ float lumaM = dot(rgbM, luma);
1084
+ float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
1085
+ float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
1086
+
1087
+ mediump vec2 dir;
1088
+ dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
1089
+ dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
1090
+
1091
+ float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
1092
+ (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
1093
+
1094
+ float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
1095
+ dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
1096
+ max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
1097
+ dir * rcpDirMin)) * inverseVP;
1098
+
1099
+ vec3 rgbA = 0.5 * (
1100
+ texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +
1101
+ texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);
1102
+ vec3 rgbB = rgbA * 0.5 + 0.25 * (
1103
+ texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +
1104
+ texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);
1105
+
1106
+ float lumaB = dot(rgbB, luma);
1107
+ if ((lumaB < lumaMin) || (lumaB > lumaMax))
1108
+ color = vec4(rgbA, texColor.a);
1109
+ else
1110
+ color = vec4(rgbB, texColor.a);
1111
+ return color;
1112
+ }
1113
+
1114
+ void main() {
1115
+
1116
+ vec4 color;
1117
+
1118
+ color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1119
+
1120
+ gl_FragColor = color;
1121
+ }
1122
+ `,XF=`
1123
+ attribute vec2 aVertexPosition;
1124
+
1125
+ uniform mat3 projectionMatrix;
1126
+
1127
+ varying vec2 v_rgbNW;
1128
+ varying vec2 v_rgbNE;
1129
+ varying vec2 v_rgbSW;
1130
+ varying vec2 v_rgbSE;
1131
+ varying vec2 v_rgbM;
1132
+
1133
+ varying vec2 vFragCoord;
1134
+
1135
+ uniform vec4 inputSize;
1136
+ uniform vec4 outputFrame;
1137
+
1138
+ vec4 filterVertexPosition( void )
1139
+ {
1140
+ vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;
1141
+
1142
+ return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
1143
+ }
1144
+
1145
+ void texcoords(vec2 fragCoord, vec2 inverseVP,
1146
+ out vec2 v_rgbNW, out vec2 v_rgbNE,
1147
+ out vec2 v_rgbSW, out vec2 v_rgbSE,
1148
+ out vec2 v_rgbM) {
1149
+ v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;
1150
+ v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;
1151
+ v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;
1152
+ v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;
1153
+ v_rgbM = vec2(fragCoord * inverseVP);
1154
+ }
1155
+
1156
+ void main(void) {
1157
+
1158
+ gl_Position = filterVertexPosition();
1159
+
1160
+ vFragCoord = aVertexPosition * outputFrame.zw;
1161
+
1162
+ texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
1163
+ }
1164
+ `;class YF extends Ar{constructor(){super(XF,VF)}}var QF=`precision highp float;
1165
+
1166
+ varying vec2 vTextureCoord;
1167
+ varying vec4 vColor;
1168
+
1169
+ uniform float uNoise;
1170
+ uniform float uSeed;
1171
+ uniform sampler2D uSampler;
1172
+
1173
+ float rand(vec2 co)
1174
+ {
1175
+ return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);
1176
+ }
1177
+
1178
+ void main()
1179
+ {
1180
+ vec4 color = texture2D(uSampler, vTextureCoord);
1181
+ float randomValue = rand(gl_FragCoord.xy * uSeed);
1182
+ float diff = (randomValue - 0.5) * uNoise;
1183
+
1184
+ // Un-premultiply alpha before applying the color matrix. See issue #3539.
1185
+ if (color.a > 0.0) {
1186
+ color.rgb /= color.a;
1187
+ }
1188
+
1189
+ color.r += diff;
1190
+ color.g += diff;
1191
+ color.b += diff;
1192
+
1193
+ // Premultiply alpha again.
1194
+ color.rgb *= color.a;
1195
+
1196
+ gl_FragColor = color;
1197
+ }
1198
+ `;class KF extends Ar{constructor(e=.5,r=Math.random()){super(mC,QF,{uNoise:0,uSeed:0}),this.noise=e,this.seed=r}get noise(){return this.uniforms.uNoise}set noise(e){this.uniforms.uNoise=e}get seed(){return this.uniforms.uSeed}set seed(e){this.uniforms.uSeed=e}}const sS={AlphaFilter:OF,BlurFilter:GF,BlurFilterPass:Xv,ColorMatrixFilter:Yv,DisplacementFilter:WF,FXAAFilter:YF,NoiseFilter:KF};Object.entries(sS).forEach(([t,e])=>{Object.defineProperty(sS,t,{get(){return Ue("7.1.0",`filters.${t} has moved to ${t}`),e}})});class qF{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||(Qt.system.add(this.tickerUpdate,this,eo.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Qt.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(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY}))}tickerUpdate(e){this._deltaTime+=e,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const Os=new qF;class mh{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=mh.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ge,this.page=new Ge,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,r,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,r,n,i,s){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}}class Rf extends mh{constructor(){super(...arguments),this.client=new Ge,this.movement=new Ge,this.offset=new Ge,this.global=new Ge,this.screen=new Ge}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,r,n){return e.worldTransform.applyInverse(n||this.global,r)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,r,n,i,s,o,l,h,c,f,m,p,v,_,E){throw new Error("Method not implemented.")}}class Un extends Rf{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 ol extends Rf{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}ol.DOM_DELTA_PIXEL=0,ol.DOM_DELTA_LINE=1,ol.DOM_DELTA_PAGE=2;const ZF=2048,JF=new Ge,Zg=new Ge;class eB{constructor(e){this.dispatch=new hh,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,r){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:r,priority:0}),this.mappingTable[e].sort((n,i)=>n.priority-i.priority)}dispatchEvent(e,r){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,r),this.dispatch.emit(r||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const r=this.mappingTable[e.type];if(r)for(let n=0,i=r.length;n<i;n++)r[n].fn(e);else console.warn(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,r){Os.pauseUpdate=!0;const n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",i=this[n](this.rootTarget,this.rootTarget.eventMode,JF.set(e,r),this.hitTestFn,this.hitPruneFn);return i&&i[0]}propagate(e,r){if(!e.target)return;const n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let i=0,s=n.length-1;i<s;i++)if(e.currentTarget=n[i],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,r),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(e.currentTarget=n[i],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,r,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const i=Array.isArray(r)?r:[r];for(let s=n.length-1;s>=0;s--)i.forEach(o=>{e.currentTarget=n[s],this.notifyTarget(e,o)})}propagationPath(e){const r=[e];for(let n=0;n<ZF&&e!==this.rootTarget;n++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");r.push(e.parent),e=e.parent}return r.reverse(),r}hitTestMoveRecursive(e,r,n,i,s,o=!1){let l=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||r==="dynamic")&&(Os.pauseUpdate=!1),e.interactiveChildren&&e.children){const f=e.children;for(let m=f.length-1;m>=0;m--){const p=f[m],v=this.hitTestMoveRecursive(p,this._isInteractive(r)?r:p.eventMode,n,i,s,o||s(e,n));if(v){if(v.length>0&&!v[v.length-1].parent)continue;const _=e.isInteractive();(v.length>0||_)&&(_&&this._allInteractiveElements.push(e),v.push(e)),this._hitElements.length===0&&(this._hitElements=v),l=!0}}}const h=this._isInteractive(r),c=e.isInteractive();return h&&c&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:l?this._hitElements:h&&!s(e,n)&&i(e,n)?c?[e]:[]:null}hitTestRecursive(e,r,n,i,s){if(this._interactivePrune(e)||s(e,n))return null;if((e.eventMode==="dynamic"||r==="dynamic")&&(Os.pauseUpdate=!1),e.interactiveChildren&&e.children){const h=e.children;for(let c=h.length-1;c>=0;c--){const f=h[c],m=this.hitTestRecursive(f,this._isInteractive(r)?r:f.eventMode,n,i,s);if(m){if(m.length>0&&!m[m.length-1].parent)continue;const p=e.isInteractive();return(m.length>0||p)&&m.push(e),m}}}const o=this._isInteractive(r),l=e.isInteractive();return o&&i(e,n)?l?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!!(!e||e.isMask||!e.visible||!e.renderable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren||e.isMask)}hitPruneFn(e,r){var n;if(e.hitArea&&(e.worldTransform.applyInverse(r,Zg),!e.hitArea.contains(Zg.x,Zg.y)))return!0;if(e._mask){const i=e._mask.isMaskData?e._mask.maskObject:e._mask;if(i&&!((n=i.containsPoint)!=null&&n.call(i,r)))return!0}return!1}hitTestFn(e,r){return e.eventMode==="passive"?!1:e.hitArea?!0:e.containsPoint?e.containsPoint(r):!1}notifyTarget(e,r){var s,o;r=r??e.type;const n=`on${r}`;(o=(s=e.currentTarget)[n])==null||o.call(s,e);const i=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${r}capture`:r;this.notifyListeners(e,i),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,r)}mapPointerDown(e){if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.createPointerEvent(e);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(r.pointerType==="mouse"||r.pointerType==="pen"){const i=r.button===2;this.dispatchEvent(r,i?"rightdown":"mousedown")}const n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=r.composedPath(),this.freeEvent(r)}mapPointerMove(e){var h,c;if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const n=r.pointerType==="mouse"||r.pointerType==="pen",i=this.trackingData(e.pointerId),s=this.findMountedTarget(i.overTargets);if(((h=i.overTargets)==null?void 0:h.length)>0&&s!==r.target){const f=e.type==="mousemove"?"mouseout":"pointerout",m=this.createPointerEvent(e,f,s);if(this.dispatchEvent(m,"pointerout"),n&&this.dispatchEvent(m,"mouseout"),!r.composedPath().includes(s)){const p=this.createPointerEvent(e,"pointerleave",s);for(p.eventPhase=p.AT_TARGET;p.target&&!r.composedPath().includes(p.target);)p.currentTarget=p.target,this.notifyTarget(p),n&&this.notifyTarget(p,"mouseleave"),p.target=p.target.parent;this.freeEvent(p)}this.freeEvent(m)}if(s!==r.target){const f=e.type==="mousemove"?"mouseover":"pointerover",m=this.clonePointerEvent(r,f);this.dispatchEvent(m,"pointerover"),n&&this.dispatchEvent(m,"mouseover");let p=s==null?void 0:s.parent;for(;p&&p!==this.rootTarget.parent&&p!==r.target;)p=p.parent;if(!p||p===this.rootTarget.parent){const v=this.clonePointerEvent(r,"pointerenter");for(v.eventPhase=v.AT_TARGET;v.target&&v.target!==s&&v.target!==this.rootTarget.parent;)v.currentTarget=v.target,this.notifyTarget(v),n&&this.notifyTarget(v,"mouseenter"),v.target=v.target.parent;this.freeEvent(v)}this.freeEvent(m)}const o=[],l=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(r,"pointermove"),l&&o.push("globalpointermove"),r.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),l&&o.push("globaltouchmove")),n&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),l&&o.push("globalmousemove"),this.cursor=(c=r.target)==null?void 0:c.cursor),o.length>0&&this.all(r,o),this._allInteractiveElements.length=0,this._hitElements.length=0,i.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(e){var o;if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId),n=this.createPointerEvent(e),i=n.pointerType==="mouse"||n.pointerType==="pen";this.dispatchEvent(n,"pointerover"),i&&this.dispatchEvent(n,"mouseover"),n.pointerType==="mouse"&&(this.cursor=(o=n.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(n,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),i&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;r.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId);if(r.overTargets){const n=e.pointerType==="mouse"||e.pointerType==="pen",i=this.findMountedTarget(r.overTargets),s=this.createPointerEvent(e,"pointerout",i);this.dispatchEvent(s),n&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",i);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),n&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;r.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,"pointerup"),n.pointerType==="touch")this.dispatchEvent(n,"touchend");else if(n.pointerType==="mouse"||n.pointerType==="pen"){const l=n.button===2;this.dispatchEvent(n,l?"rightup":"mouseup")}const i=this.trackingData(e.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[e.button]);let o=s;if(s&&!n.composedPath().includes(s)){let l=s;for(;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch")this.notifyTarget(n,"touchendoutside");else if(n.pointerType==="mouse"||n.pointerType==="pen"){const h=n.button===2;this.notifyTarget(n,h?"rightupoutside":"mouseupoutside")}l=l.parent}delete i.pressTargetsByButton[e.button],o=l}if(o){const l=this.clonePointerEvent(n,"click");l.target=o,l.path=null,i.clicksByButton[e.button]||(i.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:r});const h=i.clicksByButton[e.button];if(h.target===l.target&&r-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=r,l.detail=h.clickCount,l.pointerType==="mouse"){const c=l.button===2;this.dispatchEvent(l,c?"rightclick":"click")}else l.pointerType==="touch"&&this.dispatchEvent(l,"tap");this.dispatchEvent(l,"pointertap"),this.freeEvent(l)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof Un)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const r=this.trackingData(e.pointerId),n=this.findMountedTarget(r.pressTargetsByButton[e.button]),i=this.createPointerEvent(e);if(n){let s=n;for(;s;)i.currentTarget=s,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch"?this.notifyTarget(i,"touchendoutside"):(i.pointerType==="mouse"||i.pointerType==="pen")&&this.notifyTarget(i,i.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete r.pressTargetsByButton[e.button]}this.freeEvent(i)}mapWheel(e){if(!(e instanceof ol)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const r=this.createWheelEvent(e);this.dispatchEvent(r),this.freeEvent(r)}findMountedTarget(e){if(!e)return null;let r=e[0];for(let n=1;n<e.length&&e[n].parent===r;n++)r=e[n];return r}createPointerEvent(e,r,n){const i=this.allocateEvent(Un);return this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,i.target=n??this.hitTest(i.global.x,i.global.y)??this._hitElements[0],typeof r=="string"&&(i.type=r),i}createWheelEvent(e){const r=this.allocateEvent(ol);return this.copyWheelData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=this.hitTest(r.global.x,r.global.y),r}clonePointerEvent(e,r){const n=this.allocateEvent(Un);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=r??n.type,n}copyWheelData(e,r){r.deltaMode=e.deltaMode,r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ}copyPointerData(e,r){e instanceof Un&&r instanceof Un&&(r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pointerType=e.pointerType,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist)}copyMouseData(e,r){e instanceof Rf&&r instanceof Rf&&(r.altKey=e.altKey,r.button=e.button,r.buttons=e.buttons,r.client.copyFrom(e.client),r.ctrlKey=e.ctrlKey,r.metaKey=e.metaKey,r.movement.copyFrom(e.movement),r.screen.copyFrom(e.screen),r.shiftKey=e.shiftKey,r.global.copyFrom(e.global))}copyData(e,r){r.isTrusted=e.isTrusted,r.srcElement=e.srcElement,r.timeStamp=performance.now(),r.type=e.type,r.detail=e.detail,r.view=e.view,r.which=e.which,r.layer.copyFrom(e.layer),r.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 r=this.eventPool.get(e).pop()||new e(this);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=null,r.target=null,r}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const r=e.constructor;this.eventPool.has(r)||this.eventPool.set(r,[]),this.eventPool.get(r).push(e)}notifyListeners(e,r){const n=e.currentTarget._events[r];if(n&&e.currentTarget.isInteractive())if("fn"in n)n.once&&e.currentTarget.removeListener(r,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let i=0,s=n.length;i<s&&!e.propagationImmediatelyStopped;i++)n[i].once&&e.currentTarget.removeListener(r,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,e)}}const tB=1,rB={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Qv=class Kv{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new eB(null),Os.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new Un(null),this.rootWheelEvent=new ol(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Kv.defaultEventFeatures},{set:(r,n,i)=>(n==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=i),r[n]=i,!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{view:r,resolution:n}=this.renderer;this.setTargetElement(r),this.resolution=n,Kv._defaultEventMode=e.eventMode??"auto",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(e){e=e||"default";let r=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(r=!1),this.currentCursor===e)return;this.currentCursor=e;const n=this.cursorStyles[e];if(n)switch(typeof n){case"string":r&&(this.domElement.style.cursor=n);break;case"function":n(e);break;case"object":r&&Object.assign(this.domElement.style,n);break}else r&&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 r=this.normalizeToPointerData(e);this.autoPreventDefault&&r[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let n=0,i=r.length;n<i;n++){const s=r[n],o=this.bootstrapEvent(this.rootPointerEvent,s);this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Os.pointerMoved();const r=this.normalizeToPointerData(e);for(let n=0,i=r.length;n<i;n++){const s=this.bootstrapEvent(this.rootPointerEvent,r[n]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let r=e.target;e.composedPath&&e.composedPath().length>0&&(r=e.composedPath()[0]);const n=r!==this.domElement?"outside":"",i=this.normalizeToPointerData(e);for(let s=0,o=i.length;s<o;s++){const l=this.bootstrapEvent(this.rootPointerEvent,i[s]);l.type+=n,this.rootBoundary.mapEvent(l)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const r=this.normalizeToPointerData(e);for(let n=0,i=r.length;n<i;n++){const s=this.bootstrapEvent(this.rootPointerEvent,r[n]);this.rootBoundary.mapEvent(s)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const r=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(r)}setTargetElement(e){this.removeEvents(),this.domElement=e,Os.domElement=e,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;Os.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;Os.removeTickerListener();const e=this.domElement.style;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,r,n){const i=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=1/this.resolution;e.x=(r-i.left)*(this.domElement.width/i.width)*s,e.y=(n-i.top)*(this.domElement.height/i.height)*s}normalizeToPointerData(e){const r=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,i=e.changedTouches.length;n<i;n++){const s=e.changedTouches[n];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,r.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const n=e;typeof n.isPrimary>"u"&&(n.isPrimary=!0),typeof n.width>"u"&&(n.width=1),typeof n.height>"u"&&(n.height=1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="mouse"),typeof n.pointerId>"u"&&(n.pointerId=tB),typeof n.pressure>"u"&&(n.pressure=.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),n.isNormalized=!0,r.push(n)}else r.push(e);return r}normalizeWheelEvent(e){const r=this.rootWheelEvent;return this.transferMouseData(r,e),r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ,r.deltaMode=e.deltaMode,this.mapPositionToPoint(r.screen,e.clientX,e.clientY),r.global.copyFrom(r.screen),r.offset.copyFrom(r.screen),r.nativeEvent=e,r.type=e.type,r}bootstrapEvent(e,r){return e.originalEvent=null,e.nativeEvent=r,e.pointerId=r.pointerId,e.width=r.width,e.height=r.height,e.isPrimary=r.isPrimary,e.pointerType=r.pointerType,e.pressure=r.pressure,e.tangentialPressure=r.tangentialPressure,e.tiltX=r.tiltX,e.tiltY=r.tiltY,e.twist=r.twist,this.transferMouseData(e,r),this.mapPositionToPoint(e.screen,r.clientX,r.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=r.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=rB[e.type]||e.type),e}transferMouseData(e,r){e.isTrusted=r.isTrusted,e.srcElement=r.srcElement,e.timeStamp=performance.now(),e.type=r.type,e.altKey=r.altKey,e.button=r.button,e.buttons=r.buttons,e.client.x=r.clientX,e.client.y=r.clientY,e.ctrlKey=r.ctrlKey,e.metaKey=r.metaKey,e.movement.x=r.movementX,e.movement.y=r.movementY,e.page.x=r.pageX,e.page.y=r.pageY,e.relatedTarget=null,e.shiftKey=r.shiftKey}};Qv.extension={name:"events",type:[ue.RendererSystem,ue.CanvasRendererSystem]},Qv.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let qv=Qv;Se.add(qv);function oS(t){return t==="dynamic"||t==="static"}const nB={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,_internalInteractive:void 0,get interactive(){return this._internalInteractive??oS(qv.defaultEventMode)},set interactive(t){Ue("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=t,this.eventMode=t?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??qv.defaultEventMode},set eventMode(t){this._internalInteractive=oS(t),this._internalEventMode=t},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(t,e,r){const n=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,i=typeof r=="object"?r.signal:void 0,s=typeof r=="object"?r.once===!0:!1,o=typeof e=="function"?void 0:e;t=n?`${t}capture`:t;const l=typeof e=="function"?e:e.handleEvent,h=this;i&&i.addEventListener("abort",()=>{h.off(t,l,o)}),s?h.once(t,l,o):h.on(t,l,o)},removeEventListener(t,e,r){const n=typeof r=="boolean"&&r||typeof r=="object"&&r.capture,i=typeof e=="function"?void 0:e;t=n?`${t}capture`:t,e=typeof e=="function"?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof mh))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};ft.mixin(nB);const iB={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};ft.mixin(iB);const sB=9,id=100,oB=0,aB=0,aS=2,lS=1,lB=-1e3,uB=-1e3,hB=2;class JC{constructor(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(qi.tablet||qi.phone)&&this.createTouchHook();const r=document.createElement("div");r.style.width=`${id}px`,r.style.height=`${id}px`,r.style.position="absolute",r.style.top=`${oB}px`,r.style.left=`${aB}px`,r.style.zIndex=aS.toString(),this.div=r,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const e=document.createElement("button");e.style.width=`${lS}px`,e.style.height=`${lS}px`,e.style.position="absolute",e.style.top=`${lB}px`,e.style.left=`${uB}px`,e.style.zIndex=hB.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(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)==null||e.appendChild(this.div))}deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)==null||e.removeChild(this.div))}updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);const r=e.children;if(r)for(let n=0;n<r.length;n++)this.updateAccessibleObjects(r[n])}update(){const e=performance.now();if(qi.android.device&&e<this.androidUpdateCount||(this.androidUpdateCount=e+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:r,y:n,width:i,height:s}=this.renderer.view.getBoundingClientRect(),{width:o,height:l,resolution:h}=this.renderer,c=i/o*h,f=s/l*h;let m=this.div;m.style.left=`${r}px`,m.style.top=`${n}px`,m.style.width=`${o}px`,m.style.height=`${l}px`;for(let p=0;p<this.children.length;p++){const v=this.children[p];if(v.renderId!==this.renderId)v._accessibleActive=!1,rl(this.children,p,1),this.div.removeChild(v._accessibleDiv),this.pool.push(v._accessibleDiv),v._accessibleDiv=null,p--;else{m=v._accessibleDiv;let _=v.hitArea;const E=v.worldTransform;v.hitArea?(m.style.left=`${(E.tx+_.x*E.a)*c}px`,m.style.top=`${(E.ty+_.y*E.d)*f}px`,m.style.width=`${_.width*E.a*c}px`,m.style.height=`${_.height*E.d*f}px`):(_=v.getBounds(),this.capHitArea(_),m.style.left=`${_.x*c}px`,m.style.top=`${_.y*f}px`,m.style.width=`${_.width*c}px`,m.style.height=`${_.height*f}px`,m.title!==v.accessibleTitle&&v.accessibleTitle!==null&&(m.title=v.accessibleTitle),m.getAttribute("aria-label")!==v.accessibleHint&&v.accessibleHint!==null&&m.setAttribute("aria-label",v.accessibleHint)),(v.accessibleTitle!==m.title||v.tabIndex!==m.tabIndex)&&(m.title=v.accessibleTitle,m.tabIndex=v.tabIndex,this.debug&&this.updateDebugHTML(m))}}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:r,height:n}=this.renderer;e.x+e.width>r&&(e.width=r-e.x),e.y+e.height>n&&(e.height=n-e.y)}addChild(e){let r=this.pool.pop();r||(r=document.createElement("button"),r.style.width=`${id}px`,r.style.height=`${id}px`,r.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",r.style.position="absolute",r.style.zIndex=aS.toString(),r.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?r.setAttribute("aria-live","off"):r.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?r.setAttribute("aria-relevant","additions"):r.setAttribute("aria-relevant","text"),r.addEventListener("click",this._onClick.bind(this)),r.addEventListener("focus",this._onFocus.bind(this)),r.addEventListener("focusout",this._onFocusOut.bind(this))),r.style.pointerEvents=e.accessiblePointerEvents,r.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?r.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(r.title=`displayObject ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&r.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(r),e._accessibleActive=!0,e._accessibleDiv=r,r.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,r){const{displayObject:n}=e.target,i=this.renderer.events.rootBoundary,s=Object.assign(new mh(i),{target:n});i.rootTarget=this.renderer.lastObjectRendered,r.forEach(o=>i.dispatchEvent(s,o))}_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===sB&&this.activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}JC.extension={name:"accessibility",type:[ue.RendererPlugin,ue.CanvasRendererPlugin]};Se.add(JC);var rr=(t=>(t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",t[t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",t[t.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",t[t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",t[t.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",t[t.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",t[t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",t[t.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",t[t.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",t[t.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",t[t.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",t[t.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",t))(rr||{});const Mf={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let gi,Pa;function uS(){Pa={bptc:gi.getExtension("EXT_texture_compression_bptc"),astc:gi.getExtension("WEBGL_compressed_texture_astc"),etc:gi.getExtension("WEBGL_compressed_texture_etc"),s3tc:gi.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:gi.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:gi.getExtension("WEBGL_compressed_texture_pvrtc")||gi.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:gi.getExtension("WEBGL_compressed_texture_etc1"),atc:gi.getExtension("WEBGL_compressed_texture_atc")}}const cB={extension:{type:ue.DetectionParser,priority:2},test:async()=>{const t=pe.ADAPTER.createCanvas().getContext("webgl");return t?(gi=t,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async t=>{Pa||uS();const e=[];for(const r in Pa)Pa[r]&&e.push(r);return[...e,...t]},remove:async t=>(Pa||uS(),t.filter(e=>!(e in Pa)))};Se.add(cB);class dB extends ip{constructor(e,r={width:1,height:1,autoLoad:!0}){let n,i;typeof e=="string"?(n=e,i=new Uint8Array):(n=null,i=e),super(i,r),this.origin=n,this.buffer=i?new gv(i):null,this._load=null,this.loaded=!1,this.origin!==null&&r.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(e){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(e=>e.blob()).then(e=>e.arrayBuffer()).then(e=>(this.data=new Uint32Array(e),this.buffer=new gv(e),this.loaded=!0,this.onBlobLoaded(e),this.update(),this)),this._load)}}class zo extends dB{constructor(e,r){super(e,r),this.format=r.format,this.levels=r.levels||1,this._width=r.width,this._height=r.height,this._extension=zo._formatToExtension(this.format),(r.levelBuffers||this.buffer)&&(this._levelBuffers=r.levelBuffers||zo._createLevelBuffers(e instanceof Uint8Array?e:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(e,r,n){const i=e.gl;if(!e.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;i.pixelStorei(i.UNPACK_ALIGNMENT,4);for(let s=0,o=this.levels;s<o;s++){const{levelID:l,levelWidth:h,levelHeight:c,levelBuffer:f}=this._levelBuffers[s];i.compressedTexImage2D(i.TEXTURE_2D,l,this.format,h,c,0,f)}return!0}onBlobLoaded(){this._levelBuffers=zo._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(e){if(e>=33776&&e<=33779)return"s3tc";if(e>=35916&&e<=35919)return"s3tc_sRGB";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e===36196)return"etc1";if(e===35986||e===35987||e===34798)return"atc";if(e>=36492&&e<=36495)return"bptc";if(e===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${e}`)}static _createLevelBuffers(e,r,n,i,s,o,l){const h=new Array(n);let c=e.byteOffset,f=o,m=l,p=f+i-1&~(i-1),v=m+s-1&~(s-1),_=p*v*Mf[r];for(let E=0;E<n;E++)h[E]={levelID:E,levelWidth:n>1?f:p,levelHeight:n>1?m:v,levelBuffer:new Uint8Array(e.buffer,c,_)},c+=_,f=f>>1||1,m=m>>1||1,p=f+i-1&~(i-1),v=m+s-1&~(s-1),_=p*v*Mf[r];return h}}const Jg=4,sd=124,fB=32,hS=20,pB=542327876,od={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},mB={FOURCC:2},ad={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},gB=1,yB=2,vB=4,_B=64,xB=512,wB=131072,EB=827611204,SB=861165636,bB=894720068,TB=808540228,AB=4,CB={[EB]:rr.COMPRESSED_RGBA_S3TC_DXT1_EXT,[SB]:rr.COMPRESSED_RGBA_S3TC_DXT3_EXT,[bB]:rr.COMPRESSED_RGBA_S3TC_DXT5_EXT},PB={70:rr.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:rr.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:rr.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:rr.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:rr.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:rr.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:rr.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:rr.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:rr.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:rr.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:rr.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:rr.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:rr.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function IB(t){const e=new Uint32Array(t);if(e[0]!==pB)throw new Error("Invalid DDS file magic word");const r=new Uint32Array(t,0,sd/Uint32Array.BYTES_PER_ELEMENT),n=r[od.HEIGHT],i=r[od.WIDTH],s=r[od.MIPMAP_COUNT],o=new Uint32Array(t,od.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,fB/Uint32Array.BYTES_PER_ELEMENT),l=o[gB];if(l&vB){const h=o[mB.FOURCC];if(h!==TB){const b=CB[h],w=Jg+sd,T=new Uint8Array(t,w);return[new zo(T,{format:b,width:i,height:n,levels:s})]}const c=Jg+sd,f=new Uint32Array(e.buffer,c,hS/Uint32Array.BYTES_PER_ELEMENT),m=f[ad.DXGI_FORMAT],p=f[ad.RESOURCE_DIMENSION],v=f[ad.MISC_FLAG],_=f[ad.ARRAY_SIZE],E=PB[m];if(E===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${m}`);if(v===AB)throw new Error("DDSParser does not support cubemap textures");if(p===6)throw new Error("DDSParser does not supported 3D texture data");const A=new Array,S=Jg+sd+hS;if(_===1)A.push(new Uint8Array(t,S));else{const b=Mf[E];let w=0,T=i,R=n;for(let D=0;D<s;D++){const M=Math.max(1,T+3&-4),Y=Math.max(1,R+3&-4),j=M*Y*b;w+=j,T=T>>>1,R=R>>>1}let L=S;for(let D=0;D<_;D++)A.push(new Uint8Array(t,L,w)),L+=w}return A.map(b=>new zo(b,{format:E,width:i,height:n,levels:s}))}throw l&_B?new Error("DDSParser does not support uncompressed texture data."):l&xB?new Error("DDSParser does not supported YUV uncompressed texture data."):l&wB?new Error("DDSParser does not support single-channel (lumninance) texture data!"):l&yB?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const cS=[171,75,84,88,32,49,49,187,13,10,26,10],RB=67305985,Bn={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Zv=64,dS={[Ae.UNSIGNED_BYTE]:1,[Ae.UNSIGNED_SHORT]:2,[Ae.INT]:4,[Ae.UNSIGNED_INT]:4,[Ae.FLOAT]:4,[Ae.HALF_FLOAT]:8},MB={[te.RGBA]:4,[te.RGB]:3,[te.RG]:2,[te.RED]:1,[te.LUMINANCE]:1,[te.LUMINANCE_ALPHA]:2,[te.ALPHA]:1},kB={[Ae.UNSIGNED_SHORT_4_4_4_4]:2,[Ae.UNSIGNED_SHORT_5_5_5_1]:2,[Ae.UNSIGNED_SHORT_5_6_5]:2};function NB(t,e,r=!1){const n=new DataView(e);if(!DB(t,n))return null;const i=n.getUint32(Bn.ENDIANNESS,!0)===RB,s=n.getUint32(Bn.GL_TYPE,i),o=n.getUint32(Bn.GL_FORMAT,i),l=n.getUint32(Bn.GL_INTERNAL_FORMAT,i),h=n.getUint32(Bn.PIXEL_WIDTH,i),c=n.getUint32(Bn.PIXEL_HEIGHT,i)||1,f=n.getUint32(Bn.PIXEL_DEPTH,i)||1,m=n.getUint32(Bn.NUMBER_OF_ARRAY_ELEMENTS,i)||1,p=n.getUint32(Bn.NUMBER_OF_FACES,i),v=n.getUint32(Bn.NUMBER_OF_MIPMAP_LEVELS,i),_=n.getUint32(Bn.BYTES_OF_KEY_VALUE_DATA,i);if(c===0||f!==1)throw new Error("Only 2D textures are supported");if(p!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(m!==1)throw new Error("WebGL does not support array textures");const E=4,A=4,S=h+3&-4,b=c+3&-4,w=new Array(m);let T=h*c;s===0&&(T=S*b);let R;if(s!==0?dS[s]?R=dS[s]*MB[o]:R=kB[s]:R=Mf[l],R===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const L=r?FB(n,_,i):null;let D=T*R,M=h,Y=c,j=S,de=b,re=Zv+_;for(let F=0;F<v;F++){const V=n.getUint32(re,i);let ne=re+4;for(let fe=0;fe<m;fe++){let ae=w[fe];ae||(ae=w[fe]=new Array(v)),ae[F]={levelID:F,levelWidth:v>1||s!==0?M:j,levelHeight:v>1||s!==0?Y:de,levelBuffer:new Uint8Array(e,ne,D)},ne+=D}re+=V+4,re=re%4!==0?re+4-re%4:re,M=M>>1||1,Y=Y>>1||1,j=M+E-1&-4,de=Y+A-1&-4,D=j*de*R}return s!==0?{uncompressed:w.map(F=>{let V=F[0].levelBuffer,ne=!1;return s===Ae.FLOAT?V=new Float32Array(F[0].levelBuffer.buffer,F[0].levelBuffer.byteOffset,F[0].levelBuffer.byteLength/4):s===Ae.UNSIGNED_INT?(ne=!0,V=new Uint32Array(F[0].levelBuffer.buffer,F[0].levelBuffer.byteOffset,F[0].levelBuffer.byteLength/4)):s===Ae.INT&&(ne=!0,V=new Int32Array(F[0].levelBuffer.buffer,F[0].levelBuffer.byteOffset,F[0].levelBuffer.byteLength/4)),{resource:new ip(V,{width:F[0].levelWidth,height:F[0].levelHeight}),type:s,format:ne?OB(o):o}}),kvData:L}:{compressed:w.map(F=>new zo(null,{format:l,width:h,height:c,levels:v,levelBuffers:F})),kvData:L}}function DB(t,e){for(let r=0;r<cS.length;r++)if(e.getUint8(r)!==cS[r])return console.error(`${t} is not a valid *.ktx file!`),!1;return!0}function OB(t){switch(t){case te.RGBA:return te.RGBA_INTEGER;case te.RGB:return te.RGB_INTEGER;case te.RG:return te.RG_INTEGER;case te.RED:return te.RED_INTEGER;default:return t}}function FB(t,e,r){const n=new Map;let i=0;for(;i<e;){const s=t.getUint32(Zv+i,r),o=Zv+i+4,l=3-(s+3)%4;if(s===0||s>e-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h<s&&t.getUint8(o+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const c=new TextDecoder().decode(new Uint8Array(t.buffer,o,h)),f=new DataView(t.buffer,o+h+1,s-h-1);n.set(c,f),i+=4+s+l}return n}const BB={extension:{type:ue.LoadParser,priority:Zn.High},name:"loadDDS",test(t){return oo(t,".dds")},async load(t,e,r){const n=await(await pe.ADAPTER.fetch(t)).arrayBuffer(),i=IB(n).map(s=>{const o=new Ne(s,{mipmap:Ri.OFF,alphaMode:Gr.NO_PREMULTIPLIED_ALPHA,resolution:os(t),...e.data});return ph(o,r,t)});return i.length===1?i[0]:i},unload(t){Array.isArray(t)?t.forEach(e=>e.destroy(!0)):t.destroy(!0)}};Se.add(BB);const LB={extension:{type:ue.LoadParser,priority:Zn.High},name:"loadKTX",test(t){return oo(t,".ktx")},async load(t,e,r){const n=await(await pe.ADAPTER.fetch(t)).arrayBuffer(),{compressed:i,uncompressed:s,kvData:o}=NB(t,n),l=i??s,h={mipmap:Ri.OFF,alphaMode:Gr.NO_PREMULTIPLIED_ALPHA,resolution:os(t),...e.data},c=l.map(f=>{l===s&&Object.assign(h,{type:f.type,format:f.format});const m=f.resource??f,p=new Ne(m,h);return p.ktxKeyValueData=o,ph(p,r,t)});return c.length===1?c[0]:c},unload(t){Array.isArray(t)?t.forEach(e=>e.destroy(!0)):t.destroy(!0)}};Se.add(LB);const UB=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],zB={extension:ue.ResolveParser,test:t=>{const e=qt.extname(t).slice(1);return["basis","ktx","dds"].includes(e)},parse:t=>{var n,i;const e=t.split("."),r=e.pop();if(["ktx","dds"].includes(r)){const s=e.pop();if(UB.includes(s))return{resolution:parseFloat(((n=pe.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:s,src:t}}return{resolution:parseFloat(((i=pe.RETINA_PREFIX.exec(t))==null?void 0:i[1])??"1"),format:r,src:t}}};Se.add(zB);const ld=new De,GB=4,e2=class pu{constructor(e){this.renderer=e,this._rendererPremultipliedAlpha=!1}contextChange(){var r;const e=(r=this.renderer)==null?void 0:r.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(e&&e.alpha&&e.premultipliedAlpha)}async image(e,r,n,i){const s=new Image;return s.src=await this.base64(e,r,n,i),s}async base64(e,r,n,i){const s=this.canvas(e,i);if(s.toBlob!==void 0)return new Promise((o,l)=>{s.toBlob(h=>{if(!h){l(new Error("ICanvas.toBlob failed!"));return}const c=new FileReader;c.onload=()=>o(c.result),c.onerror=l,c.readAsDataURL(h)},r,n)});if(s.toDataURL!==void 0)return s.toDataURL(r,n);if(s.convertToBlob!==void 0){const o=await s.convertToBlob({type:r,quality:n});return new Promise((l,h)=>{const c=new FileReader;c.onload=()=>l(c.result),c.onerror=h,c.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e,r){const{pixels:n,width:i,height:s,flipY:o,premultipliedAlpha:l}=this._rawPixels(e,r);o&&pu._flipY(n,i,s),l&&pu._unpremultiplyAlpha(n);const h=new F4(i,s,1),c=new ImageData(new Uint8ClampedArray(n.buffer),i,s);return h.context.putImageData(c,0,0),h.canvas}pixels(e,r){const{pixels:n,width:i,height:s,flipY:o,premultipliedAlpha:l}=this._rawPixels(e,r);return o&&pu._flipY(n,i,s),l&&pu._unpremultiplyAlpha(n),n}_rawPixels(e,r){const n=this.renderer;if(!n)throw new Error("The Extract has already been destroyed");let i,s=!1,o=!1,l,h=!1;e&&(e instanceof Zo?l=e:(l=n.generateTexture(e,{region:r,resolution:n.resolution,multisample:n.multisample}),h=!0,r&&(ld.width=r.width,ld.height=r.height,r=ld)));const c=n.gl;if(l){if(i=l.baseTexture.resolution,r=r??l.frame,s=!1,o=l.baseTexture.alphaMode>0&&l.baseTexture.format===te.RGBA,!h){n.renderTexture.bind(l);const v=l.framebuffer.glFramebuffers[n.CONTEXT_UID];v.blitFramebuffer&&n.framebuffer.bind(v.blitFramebuffer)}}else i=n.resolution,r||(r=ld,r.width=n.width/i,r.height=n.height/i),s=!0,o=this._rendererPremultipliedAlpha,n.renderTexture.bind();const f=Math.max(Math.round(r.width*i),1),m=Math.max(Math.round(r.height*i),1),p=new Uint8Array(GB*f*m);return c.readPixels(Math.round(r.x*i),Math.round(r.y*i),f,m,c.RGBA,c.UNSIGNED_BYTE,p),h&&(l==null||l.destroy(!0)),{pixels:p,width:f,height:m,flipY:s,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(e,r,n){const i=r<<2,s=n>>1,o=new Uint8Array(i);for(let l=0;l<s;l++){const h=l*i,c=(n-l-1)*i;o.set(e.subarray(h,h+i)),e.copyWithin(h,c,c+i),e.set(o,c)}}static _unpremultiplyAlpha(e){e instanceof Uint8ClampedArray&&(e=new Uint8Array(e.buffer));const r=e.length;for(let n=0;n<r;n+=4){const i=e[n+3];if(i!==0){const s=255.001/i;e[n]=e[n]*s+.5,e[n+1]=e[n+1]*s+.5,e[n+2]=e[n+2]*s+.5}}}};e2.extension={name:"extract",type:ue.RendererSystem};let HB=e2;Se.add(HB);class jB{constructor(e){this.maxItemsPerFrame=e,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function $B(t,e){var n;let r=!1;if((n=t==null?void 0:t._textures)!=null&&n.length){for(let i=0;i<t._textures.length;i++)if(t._textures[i]instanceof oe){const s=t._textures[i].baseTexture;e.includes(s)||(e.push(s),r=!0)}}return r}function WB(t,e){if(t.baseTexture instanceof Ne){const r=t.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function VB(t,e){if(t._texture&&t._texture instanceof oe){const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function XB(t,e){return e instanceof h_?(e.updateText(!0),!0):!1}function YB(t,e){if(e instanceof Ur){const r=e.toFontString();return wn.measureFont(r),!0}return!1}function QB(t,e){if(t instanceof h_){e.includes(t.style)||e.push(t.style),e.includes(t)||e.push(t);const r=t._texture.baseTexture;return e.includes(r)||e.push(r),!0}return!1}function KB(t,e){return t instanceof Ur?(e.includes(t)||e.push(t),!0):!1}const t2=class r2{constructor(e){this.limiter=new jB(r2.uploadsPerFrame),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(QB),this.registerFindHook(KB),this.registerFindHook($B),this.registerFindHook(WB),this.registerFindHook(VB),this.registerUploadHook(XB),this.registerUploadHook(YB)}upload(e){return new Promise(r=>{e&&this.add(e),this.queue.length?(this.completes.push(r),this.ticking||(this.ticking=!0,Qt.system.addOnce(this.tick,this,eo.UTILITY))):r()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const e=this.queue[0];let r=!1;if(e&&!e._destroyed){for(let n=0,i=this.uploadHooks.length;n<i;n++)if(this.uploadHooks[n](this.uploadHookHelper,e)){this.queue.shift(),r=!0;break}}r||this.queue.shift()}if(this.queue.length)Qt.system.addOnce(this.tick,this,eo.UTILITY);else{this.ticking=!1;const e=this.completes.slice(0);this.completes.length=0;for(let r=0,n=e.length;r<n;r++)e[r]()}}registerFindHook(e){return e&&this.addHooks.push(e),this}registerUploadHook(e){return e&&this.uploadHooks.push(e),this}add(e){for(let r=0,n=this.addHooks.length;r<n&&!this.addHooks[r](e,this.queue);r++);if(e instanceof Pr)for(let r=e.children.length-1;r>=0;r--)this.add(e.children[r]);return this}destroy(){this.ticking&&Qt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};t2.uploadsPerFrame=4;let Jv=t2;Object.defineProperties(pe,{UPLOADS_PER_FRAME:{get(){return Jv.uploadsPerFrame},set(t){Ue("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Jv.uploadsPerFrame=t}}});function n2(t,e){return e instanceof Ne?(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0):!1}function qB(t,e){if(!(e instanceof Mu))return!1;const{geometry:r}=e;e.finishPoly(),r.updateBatches();const{batches:n}=r;for(let i=0;i<n.length;i++){const{texture:s}=n[i].style;s&&n2(t,s.baseTexture)}return r.batchable||t.geometry.bind(r,e._resolveDirectShader(t)),!0}function ZB(t,e){return t instanceof Mu?(e.push(t),!0):!1}class i2 extends Jv{constructor(e){super(e),this.uploadHookHelper=this.renderer,this.registerFindHook(ZB),this.registerUploadHook(n2),this.registerUploadHook(qB)}}i2.extension={name:"prepare",type:ue.RendererSystem};Se.add(i2);const s2=class mu{constructor(e,r,n){this.linkedSheets=[],(e instanceof Ne||e instanceof oe)&&(e={texture:e,data:r,resolutionFilename:n});const{texture:i,data:s,resolutionFilename:o=null,cachePrefix:l=""}=e;this.cachePrefix=l,this._texture=i instanceof oe?i:null,this.baseTexture=i instanceof Ne?i:this._texture.baseTexture,this.textures={},this.animations={},this.data=s;const h=this.baseTexture.resource;this.resolution=this._updateResolution(o||(h?h.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(e=null){const{scale:r}=this.data.meta;let n=os(e,null);return n===null&&(n=typeof r=="number"?r:parseFloat(r??"1")),n!==1&&this.baseTexture.setResolution(n),n}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=mu.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let r=e;const n=mu.BATCH_SIZE;for(;r-e<n&&r<this._frameKeys.length;){const i=this._frameKeys[r],s=this._frames[i],o=s.frame;if(o){let l=null,h=null;const c=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,f=new De(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);s.rotated?l=new De(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):l=new De(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new De(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[i]=new oe(this.baseTexture,l,f,h,s.rotated?2:0,s.anchor,s.borders),oe.addToCache(this.textures[i],this.cachePrefix+i.toString())}r++}}_processAnimations(){const e=this.data.animations||{};for(const r in e){this.animations[r]=[];for(let n=0;n<e[r].length;n++){const i=e[r][n];this.animations[r].push(this.textures[i])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*mu.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*mu.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var r;for(const n in this.textures)this.textures[n].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((r=this._texture)==null||r.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};s2.BATCH_SIZE=1e3;let fS=s2;const JB=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function o2(t,e,r){const n={};if(t.forEach(i=>{n[i]=e}),Object.keys(e.textures).forEach(i=>{n[`${e.cachePrefix}${i}`]=e.textures[i]}),!r){const i=qt.dirname(t[0]);e.linkedSheets.forEach((s,o)=>{Object.assign(n,o2([`${i}/${e.data.meta.related_multi_packs[o]}`],s,!0))})}return n}const eL={extension:ue.Asset,cache:{test:t=>t instanceof fS,getCacheableAssets:(t,e)=>o2(t,e,!1)},resolver:{test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),n=e.pop();return r==="json"&&JB.includes(n)},parse:t=>{var r;const e=t.split(".");return{resolution:parseFloat(((r=pe.RETINA_PREFIX.exec(t))==null?void 0:r[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",extension:{type:ue.LoadParser,priority:Zn.Normal},async testParse(t,e){return qt.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,r){var f,m;const{texture:n,imageFilename:i,cachePrefix:s}=(e==null?void 0:e.data)??{};let o=qt.dirname(e.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let l;if(n&&n.baseTexture)l=n;else{const p=Fv(o+(i??t.meta.image),e.src);l=(await r.load([p]))[p]}const h=new fS({texture:l.baseTexture,data:t,resolutionFilename:e.src,cachePrefix:s});await h.parse();const c=(f=t==null?void 0:t.meta)==null?void 0:f.related_multi_packs;if(Array.isArray(c)){const p=[];for(const _ of c){if(typeof _!="string")continue;let E=o+_;(m=e.data)!=null&&m.ignoreMultiPack||(E=Fv(E,e.src),p.push(r.load({src:E,data:{ignoreMultiPack:!0}})))}const v=await Promise.all(p);h.linkedSheets=v,v.forEach(_=>{_.linkedSheets=[h].concat(h.linkedSheets.filter(E=>E!==_))})}return h},unload(t){t.destroy(!0)}}};Se.add(eL);const e0=class Ia extends Ur{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(e){return new Ia(Object.keys(Ia.defaultOptions).reduce((r,n)=>({...r,[n]:e[n]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(e=>{URL.revokeObjectURL(e.src),e.refs--,e.refs===0&&(e.fontFace&&document.fonts.delete(e.fontFace),delete Ia.availableFonts[e.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(e,r={}){const{availableFonts:n}=Ia;if(n[e]){const i=n[e];return this._fonts.push(i),i.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return pe.ADAPTER.fetch(e).then(i=>i.blob()).then(async i=>new Promise((s,o)=>{const l=URL.createObjectURL(i),h=new FileReader;h.onload=()=>s([l,h.result]),h.onerror=o,h.readAsDataURL(i)})).then(async([i,s])=>{const o=Object.assign({family:qt.basename(e,qt.extname(e)),weight:"normal",style:"normal",display:"auto",src:i,dataSrc:s,refs:1,originalUrl:e,fontFace:null},r);n[e]=o,this._fonts.push(o),this.styleID++;const l=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=l,await l.load(),document.fonts.add(l),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...e){const r=e.filter(n=>!this._overrides.includes(n));r.length>0&&(this._overrides.push(...r),this.styleID++)}removeOverride(...e){const r=e.filter(n=>this._overrides.includes(n));r.length>0&&(this._overrides=this._overrides.filter(n=>!r.includes(n)),this.styleID++)}toCSS(e){return[`transform: scale(${e})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((e,r)=>`${e}
1199
+ @font-face {
1200
+ font-family: "${r.family}";
1201
+ src: url('${r.dataSrc}');
1202
+ font-weight: ${r.weight};
1203
+ font-style: ${r.style};
1204
+ font-display: ${r.display};
1205
+ }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(e){this._stylesheet!==e&&(this._stylesheet=e,this.styleID++)}normalizeColor(e){return Array.isArray(e)&&(e=k4(e)),typeof e=="number"?M4(e):e}dropShadowToCSS(){let e=this.normalizeColor(this.dropShadowColor);const r=this.dropShadowAlpha,n=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),i=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);e.startsWith("#")&&r<1&&(e+=(r*255|0).toString(16).padStart(2,"0"));const s=`${n}px ${i}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${e}`:`text-shadow: ${s} ${e}`}reset(){Object.assign(this,Ia.defaultOptions)}onBeforeDraw(){const{fontsDirty:e}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&e?new Promise(r=>setTimeout(r,100)):Promise.resolve()}get isSafari(){const{userAgent:e}=pe.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(e)}set fillGradientStops(e){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(e){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(e){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(e){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(e){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(e){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(e){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};e0.availableFonts={},e0.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let ey=e0;const ud=class Ra extends Di{constructor(e="",r={}){super(oe.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const n=new Image,i=oe.from(n,{scaleMode:pe.SCALE_MODE,resourceOptions:{autoLoad:!1}});i.orig=new De,i.trim=new De,this.texture=i;const s="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",l=document.createElementNS(s,"svg"),h=document.createElementNS(s,"foreignObject"),c=document.createElementNS(o,"div"),f=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",l.appendChild(h),this.maxWidth=Ra.defaultMaxWidth,this.maxHeight=Ra.defaultMaxHeight,this._domElement=c,this._styleElement=f,this._svgRoot=l,this._foreignObject=h,this._foreignObject.appendChild(f),this._foreignObject.appendChild(c),this._image=n,this._loadImage=new Image,this._autoResolution=Ra.defaultAutoResolution,this._resolution=Ra.defaultResolution??pe.RESOLUTION,this.text=e,this.style=r}measureText(e){var f,m;const{text:r,style:n,resolution:i}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},e);Object.assign(this._domElement,{innerHTML:r,style:n.toCSS(i)}),this._styleElement.textContent=n.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:l}=s;(o>this.maxWidth||l>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),c=Math.min(this.maxHeight,Math.ceil(l));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",c.toString()),r!==this._text&&(this._domElement.innerHTML=this._text),n!==this._style&&(Object.assign(this._domElement,{style:(f=this._style)==null?void 0:f.toCSS(i)}),this._styleElement.textContent=(m=this._style)==null?void 0:m.toGlobalCSS()),{width:h+n.padding*2,height:c+n.padding*2}}async updateText(e=!0){const{style:r,_image:n,_loadImage:i}=this;if(this.localStyleID!==r.styleID&&(this.dirty=!0,this.localStyleID=r.styleID),!this.dirty&&e)return;const{width:s,height:o}=this.measureText();n.width=i.width=Math.ceil(Math.max(1,s)),n.height=i.height=Math.ceil(Math.max(1,o)),this._updateID++;const l=this._updateID;await new Promise(h=>{i.onload=async()=>{if(l<this._updateID){h();return}await r.onBeforeDraw(),n.src=i.src,i.onload=null,i.src="",this.updateTexture(),h()};const c=new XMLSerializer().serializeToString(this._svgRoot);i.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(c)}`})}get source(){return this._image}updateTexture(){const{style:e,texture:r,_image:n,resolution:i}=this,{padding:s}=e,{baseTexture:o}=r;r.trim.width=r._frame.width=n.width/i,r.trim.height=r._frame.height=n.height/i,r.trim.x=-s,r.trim.y=-s,r.orig.width=r._frame.width-s*2,r.orig.height=r._frame.height-s*2,this._onTextureUpdate(),o.setRealSize(n.width,n.height,i),this.dirty=!1}_render(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._render(e)}_renderCanvas(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(e)}getLocalBounds(e){return this.updateText(!0),super.getLocalBounds(e)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(e){var n,i,s,o,l;typeof e=="boolean"&&(e={children:e}),e=Object.assign({},Ra.defaultDestroyOptions,e),super.destroy(e);const r=null;this.ownsStyle&&((n=this._style)==null||n.cleanFonts()),this._style=r,(i=this._svgRoot)==null||i.remove(),this._svgRoot=r,(s=this._domElement)==null||s.remove(),this._domElement=r,(o=this._foreignObject)==null||o.remove(),this._foreignObject=r,(l=this._styleElement)==null||l.remove(),this._styleElement=r,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=r,this._image.src="",this._image=r}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(e){this.updateText(!0);const r=Us(this.scale.x)||1;this.scale.x=r*e/this._image.width/this.resolution,this._width=e}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(e){this.updateText(!0);const r=Us(this.scale.y)||1;this.scale.y=r*e/this._image.height/this.resolution,this._height=e}get style(){return this._style}set style(e){this._style!==e&&(e=e||{},e instanceof ey?(this.ownsStyle=!1,this._style=e):e instanceof Ur?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=ey.from(e)):(this.ownsStyle=!0,this._style=new ey(e)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(e){e=String(e===""||e===null||e===void 0?" ":e),e=this.sanitiseText(e),this._text!==e&&(this._text=e,this.dirty=!0)}get resolution(){return this._resolution}set resolution(e){this._autoResolution=!1,this._resolution!==e&&(this._resolution=e,this.dirty=!0)}sanitiseText(e){return e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};ud.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},ud.defaultMaxWidth=2024,ud.defaultMaxHeight=2024,ud.defaultAutoResolution=!0;const Va=(t,e,r,n,i,s,o,l,h=1)=>{t.beginFill(o),t.drawRoundedRect(e,r,n,i,s),t.endFill(),l!==void 0&&(t.lineStyle(h,l,1),t.drawRoundedRect(e,r,n,i,s),t.lineStyle(0,0,0))},tL=({bubble:t,style:e})=>U.jsxs(U.Fragment,{children:[U.jsx(ir.Graphics,{draw:r=>{r.clear(),t.show&&Va(r,t.x,t.y,t.size,t.size,6,15856639,5925536,1)}}),t.show&&U.jsx(ir.Text,{text:t.emoji,x:t.textX,y:t.textY,style:e})]}),rL=({bubble:t,style:e})=>U.jsxs(U.Fragment,{children:[U.jsx(ir.Graphics,{draw:r=>{r.clear(),t.show&&Va(r,t.x,t.y,t.width,t.height,4,15859699,3824444,1.5)}}),t.show&&U.jsx(ir.Text,{text:t.lines.join(`
1206
+ `),x:t.textX,y:t.textY,style:e})]}),nL=t=>[{row:t.row+1,col:t.col},{row:t.row-1,col:t.col},{row:t.row,col:t.col+1},{row:t.row,col:t.col-1}],pS=(t,e)=>Math.abs(t.row-e.row)+Math.abs(t.col-e.col),hd=t=>`${t.row},${t.col}`,ty=(t,e,r)=>{const n=t.length,i=n>0?t[0].length:0,s=p=>p.row>=0&&p.col>=0&&p.row<n&&p.col<i,o=p=>t[p.row][p.col]>0,l=new Set([hd(e)]),h=new Map,c=new Map([[hd(e),0]]),f=new Map([[hd(e),pS(e,r)]]),m=()=>{let p=null,v=Number.POSITIVE_INFINITY;return l.forEach(_=>{const E=f.get(_)??Number.POSITIVE_INFINITY;E<v&&(v=E,p=_)}),p};for(;l.size>0;){const p=m();if(p===null)break;const[v,_]=p.split(",").map(Number);if(v===r.row&&_===r.col){const E=[];let A=p;for(;A;){const[S,b]=A.split(",").map(Number);E.push({row:S,col:b}),A=h.get(A)}return E.reverse()}l.delete(p),nL({row:v,col:_}).forEach(E=>{if(!s(E)||!o(E))return;const A=hd(E),S=(c.get(p)??Number.POSITIVE_INFINITY)+1;S<(c.get(A)??Number.POSITIVE_INFINITY)&&(h.set(A,p),c.set(A,S),f.set(A,S+pS(E,r)),l.add(A))})}return[]};pe.SCALE_MODE=Sn.NEAREST;pe.ROUND_PIXELS=!0;const me=4,a2=0,l2=0,u2=960,h2=540,mS=Math.floor(u2/me),gS=Math.floor(h2/me),ry={text:16446173,shadow:1776171,link:10352064},yS=[15901297,8118258,12185996,16116064,11767284,15895714,9225727,16234872],iL=3e3,sL=800,vS=140,oL=48,aL=10,cd=6,lL=1400,ny=4e3,uL={"command.executed":15909198,"installation.updated":8036568,"lsp.client.diagnostics":15755882,"lsp.updated":8036568,"message.removed":10134450,"message.part.removed":10134450,"permission.asked":12819424,"permission.replied":8376218,"server.connected":7067073,"tui.prompt.append":8377343,"tui.command.execute":8377343,"tui.toast.show":8377343},_S=1400,hL=t=>{let e=0;for(let r=0;r<t.length;r+=1)e=(e*31+t.charCodeAt(r))%997;return e},xS=(t,e,r)=>!e||e.length===0?r:e[hL(t)%e.length],wS=(t,e)=>`${t},${e}`,cL=12,dL=-4,dd=5,ES=(t,e,r)=>{const n=(l,h)=>l>=0&&h>=0&&l<r.length&&h<r[0].length,i=(l,h)=>r[l][h]>0;let s=e[0]||t,o=Number.POSITIVE_INFINITY;return e.forEach(l=>{for(let h=-dd;h<=dd;h+=1)for(let c=-dd;c<=dd;c+=1){const f=l.row+h,m=l.col+c;if(!n(f,m)||!i(f,m))continue;const p=Math.abs(f-t.row)+Math.abs(m-t.col);p<o&&(o=p,s={row:f,col:m})}}),s},iy=t=>{if(t.length<=2)return t;const e=[t[0]];let r=t[0],n={row:t[1].row-r.row,col:t[1].col-r.col};for(let i=1;i<t.length-1;i+=1){const s=t[i],o=t[i+1],l={row:o.row-s.row,col:o.col-s.col};(l.row!==n.row||l.col!==n.col)&&(e.push(s),n=l),r=s}return e.push(t[t.length-1]),e},Ps=t=>({x:t.col*me+me/2+l2,y:t.row*me+me/2+a2}),$i=(t,e)=>({col:Math.round((t-l2-me/2)/me),row:Math.round((e-a2-me/2)/me)}),SS=()=>({row:48*2,col:48*2}),fL=t=>{switch(t){case"idle":return .35;case"thinking":return .55;case"planning":return .5;case"error":return .35;case"working":default:return .7}},bS=t=>t!=="idle"&&t!=="",pL=t=>{const e=t.id||"";let r=0;for(let n=0;n<e.length;n+=1)r=(r*31+e.charCodeAt(n))%997;return yS[r%yS.length]},sy=[[2841148,7590543],[3820139,8036312],[5913178,12750802],[5917227,13805683],[3824218,7586498],[5909306,13792137],[4868666,11053176],[3816026,8947906]],mL=t=>{if(!t)return sy[0];let e=0;for(let r=0;r<t.length;r+=1)e=(e*31+t.charCodeAt(r))%997;return sy[e%sy.length]},gL=t=>{switch(t){case"idle":return"idle";case"thinking":return"thinking";case"planning":return"planning";case"working":return"working";case"error":return"error";default:return"working"}},yL=(t,e,r,n)=>{if(!t)return[""];const i=t.split(/\s+/),s=[];let o="";if(i.forEach(l=>{const h=o?`${o} ${l}`:l;wn.measureText(h,r).width<=e?o=h:(o&&s.push(o),o=l)}),o&&s.push(o),s.length>n){const l=s.slice(s.length-n);return l[0]=`...${l[0]}`,l}return s},vL=t=>{const e=document.createElement("canvas");e.width=me,e.height=me;const r=e.getContext("2d");if(!r)return null;const n=(s,o,l,h,c)=>{r.fillStyle=s,r.fillRect(o,l,h,c)};switch(t){case"grass":n("#a8d070",0,0,me,me),n("#b7de7c",0,0,me,4),n("#8bb85f",0,me-12,me,12),n("#7aa44f",0,me-4,me,4),n("#96c86a",8,8,8,8),n("#96c86a",36,24,8,8);break;case"path":n("#d4c4a8",0,0,me,me),n("#e4d7bf",0,0,me,4),n("#bfae94",0,me-10,me,10),n("#ac9b82",0,me-4,me,4),n("#c9b89e",12,12,8,8),n("#c9b89e",40,28,8,8);break;case"wall_face":n("#4a4a5c",0,0,me,20),n("#5a5a6e",0,0,me,4),n("#3a3a4a",0,16,me,4),n("#6e6e82",0,20,me,me-28),n("#4a4a5c",0,me-8,me,8);break;case"partition_h":case"partition_h_top":t==="partition_h"?n("#e8dcc8",0,0,me,me):n("#121212",0,24,me,me-24);const s=24,o=t==="partition_h_top"?0:(me-s)/2;n("#4a4a5c",0,o,me,s),n("#5a5a6e",0,o+4,me,s-8),n("#3a3a4a",0,o+s-4,me,4);break;case"partition_v":case"partition_v_left":case"partition_v_right":const l=24;let h=(me-l)/2;t==="partition_v_left"&&(h=0),t==="partition_v_right"&&(h=me-l),t==="partition_v"?n("#e8dcc8",0,0,me,me):t==="partition_v_left"?n("#121212",24,0,me-24,me):t==="partition_v_right"&&n("#121212",0,0,me-24,me),n("#4a4a5c",h,0,l,me),n("#5a5a6e",h+4,0,l-8,me),n("#3a3a4a",h+l-4,0,4,me);break;case"floor":n("#e8dcc8",0,0,me,me),n("#f3ead9",0,0,me,4),n("#d9ccb5",0,me-4,me,4),n("#c7b59f",0,me-2,me,2),n("#f0e6d6",4,4,4,4),n("#f0e6d6",36,36,4,4);break;default:r.clearRect(0,0,me,me)}const i=oe.from(e);return i.baseTexture.scaleMode=Sn.NEAREST,i},_L=({x:t,y:e,activeTab:r})=>{const n=r==="claude"?"Claude Office":"OpenCode Office",i=Ce.useMemo(()=>new Ur({fill:16777215,fontFamily:"Courier New",fontSize:11,fontWeight:"bold",letterSpacing:1}),[]),s=wn.measureText(n,i).width,o=10,l=5,h=s+o*2,c=18;return U.jsxs(ir.Container,{x:t,y:e,children:[U.jsx(ir.Graphics,{draw:f=>{f.clear(),f.beginFill(1710638,.5),f.drawRoundedRect(2,2,h,c,4),f.endFill(),f.beginFill(2964047),f.drawRoundedRect(0,0,h,c,4),f.endFill(),f.beginFill(4016735),f.drawRoundedRect(0,0,h,6,4),f.endFill(),f.lineStyle(1,4872815),f.drawRoundedRect(0,0,h,c,4),f.lineStyle(0),f.beginFill(7321087),f.drawCircle(8,c/2,2),f.endFill()}}),U.jsx(ir.Text,{text:n,x:o+4,y:l-1,style:i})]})},xL=({agents:t,interactions:e,sessions:r,activeSessionId:n,lastTodoSummary:i,selectedAgentId:s,onSelectAgent:o,activeTab:l,sceneWidth:h,sceneHeight:c,setDimensions:f})=>{var ie;const[m,p]=Ce.useState(0),v=Ce.useRef(0),_=Ce.useRef(new Map),E=Ce.useRef(new Map),[A,S]=Ce.useState({});Ce.useEffect(()=>{_.current.clear(),E.current.clear()},[l]);const[b,w]=Ce.useState(()=>Array.from({length:gS},()=>Array.from({length:mS},()=>""))),[T,R]=Ce.useState(null),L=(q,$)=>T?q<0||$<0||q>=T.cols||$>=T.rows?!1:T.grid[$][q]>0:q>=0&&$>=0&&$<gS&&q<mS,D=q=>{if(!T)return{row:32,col:32};for(let $=0;$<80;$++){const se=Math.floor(Math.random()*T.rows),ce=Math.floor(Math.random()*T.cols),ve=T.grid[se][ce];if(!(ve<=0)&&ve!==2)return{row:se,col:ce}}return{row:32,col:32}};Ce.useEffect(()=>{const q=new Image;q.src="/office_floor.png",q.onload=()=>{const $=q.width,se=q.height;f({width:$,height:se});const ce=Math.floor($/me),ve=Math.floor(se/me),ke=document.createElement("canvas");ke.width=$,ke.height=se;const Re=ke.getContext("2d");if(!Re)return;Re.drawImage(q,0,0);const he=Re.getImageData(0,0,$,se).data,P=[];for(let Be=0;Be<ve;Be++){const Pe=[];for(let Je=0;Je<ce;Je++){let kt=0,xr=0,zt=0,Zt=0,Ze=0;const Gt=Je*me,wr=Be*me;for(let ur=1;ur<me;ur+=2)for(let hr=1;hr<me;hr+=2){const In=Gt+hr,Nt=wr+ur;if(In<0||In>=$||Nt<0||Nt>=se){Ze++;continue}const Er=(Math.floor(Nt)*$+Math.floor(In))*4;if(Er>=0&&Er<he.length){const cr=he[Er],Nr=he[Er+1],Vr=he[Er+2],an=he[Er+3];Vr>200&&cr<50&&Nr<50?xr++:Nr>200&&cr<50&&Vr<50?zt++:cr>200&&Nr<50&&Vr<50?Zt++:an<50&&kt++}Ze++}const hs=Ze>0?xr/Ze:0,lt=Ze>0?zt/Ze:0,xt=Ze>0?Zt/Ze:0,Mr=Ze>0?kt/Ze:0;let kr=0;xt>.3?kr=5:lt>.3?kr=4:hs>.3?kr=2:Mr>.6&&(kr=1),Pe.push(kr)}P.push(Pe)}const we=[],ye=[],Ve=[],Qe=[];for(let Be=0;Be<ve;Be++)for(let Pe=0;Pe<ce;Pe++){const Je=P[Be][Pe];Je===2&&we.push({row:Be,col:Pe}),Je===4&&Ve.push({row:Be,col:Pe}),Je===5&&Qe.push({row:Be,col:Pe})}const Ke=Array.from({length:ve},()=>Array.from({length:ce},()=>!1)),Ut=(Be,Pe)=>Be>=0&&Pe>=0&&Be<ve&&Pe<ce,at=[{row:1,col:0},{row:-1,col:0},{row:0,col:1},{row:0,col:-1}];for(let Be=0;Be<ve;Be+=1)for(let Pe=0;Pe<ce;Pe+=1){if(Ke[Be][Pe]||P[Be][Pe]!==2)continue;const Je=[{row:Be,col:Pe}],kt=[];for(Ke[Be][Pe]=!0;Je.length>0;){const xr=Je.pop();if(!xr)break;kt.push(xr),at.forEach(zt=>{const Zt=xr.row+zt.row,Ze=xr.col+zt.col;Ut(Zt,Ze)&&(Ke[Zt][Ze]||P[Zt][Ze]===2&&(Ke[Zt][Ze]=!0,Je.push({row:Zt,col:Ze})))})}if(kt.length>0){const xr=kt.reduce((Gt,wr)=>Gt+wr.row,0)/kt.length,zt=kt.reduce((Gt,wr)=>Gt+wr.col,0)/kt.length;let Zt=kt[0],Ze=Number.POSITIVE_INFINITY;kt.forEach(Gt=>{const wr=Math.abs(Gt.row-xr)+Math.abs(Gt.col-zt);wr<Ze&&(Ze=wr,Zt=Gt)}),ye.push(Zt)}}w(()=>{const Be=Array.from({length:ve},()=>Array.from({length:ce},()=>""));return Ve.forEach(Pe=>{Pe.row<Be.length&&Pe.col<Be[0].length&&(Be[Pe.row][Pe.col]="door_closed")}),Be}),R({rows:ve,cols:ce,grid:P,workNodes:we,workCenters:ye,doorNodes:Ve,exitNodes:Qe}),console.log("Generated Collision Map",{width:$,height:se,rows:ve,cols:ce})}},[]),Ce.useMemo(()=>{const q=["floor"],$={};return q.forEach(se=>{$[se]=vL(se)}),$.door_open=$.floor,$.door_closed=null,$},[]);const M=Ce.useMemo(()=>r.find(q=>q.id===n)||null,[r,n]),Y=Ce.useMemo(()=>new Ur({fill:ry.text,fontFamily:"Courier New",fontSize:10}),[]),j=Ce.useMemo(()=>new Ur({fill:13694431,fontFamily:"Courier New",fontSize:10}),[]);Ce.useMemo(()=>new Ur({fill:2834268,fontFamily:"Courier New",fontSize:10}),[]);const de=Ce.useMemo(()=>new Ur({fill:3824444,fontFamily:"Courier New",fontSize:9}),[]),re=Ce.useMemo(()=>new Ur({fill:2834268,fontFamily:"Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji",fontSize:12}),[]);Ce.useEffect(()=>{const q=(se,ce)=>new Promise((ve,ke)=>{const Re=Ne.from(se);Re.scaleMode=Sn.NEAREST;const he=()=>{const P=Math.floor(Re.width/ce),we=Math.floor(Re.height/3),ye=Ve=>{const Qe=[];for(let Ke=0;Ke<ce;Ke+=1)Qe.push(new oe(Re,new De(Ke*P,Ve*we,P,we)));return Qe};ve({right:ye(0),down:ye(1),up:ye(2)})};Re.valid?he():(Re.once("loaded",he),Re.once("error",ke))});(async()=>{try{const[se,ce,ve,ke]=await Promise.all([q("/idle.png",4),q("/walk.png",8),q("/run.png",8),q("/jump.png",6)]);S({idle:se,walk:ce,run:ve,jump:ke})}catch{S({})}})()},[]),Ce.useEffect(()=>{var ke;const q=_.current,$=E.current,se=Date.now(),ce=new Set(t.map(Re=>Re.id)),ve=((ke=T==null?void 0:T.exitNodes)==null?void 0:ke[0])??SS();t.forEach(Re=>{$.set(Re.id,Re)});for(const Re of q.keys())if(!ce.has(Re)){const he=q.get(Re);if(he&&!he.exiting){const P=T?ES($i(he.x,he.y),T.exitNodes,T.grid):ve,we=Ps(P),ye={x:we.x+cL,y:we.y+dL};q.set(Re,{...he,exiting:!0,exitAt:se,goodbyeUntil:void 0,removeAt:void 0,targetX:ye.x,targetY:ye.y,targetKind:"exit",targetTile:P,path:T?iy(ty(T.grid,$i(he.x,he.y),P)):[],pathIndex:1,direction:"front"})}}t.forEach(Re=>{var ye,Ve;if(q.has(Re.id))return;const he={row:32,col:32},P=(ye=T==null?void 0:T.workCenters)!=null&&ye.length?xS(Re.id,T.workCenters,he):(Ve=T==null?void 0:T.workNodes)!=null&&Ve.length?xS(Re.id,T.workNodes,he):he,we=Ps(P);q.set(Re.id,{x:we.x,y:we.y,targetX:we.x,targetY:we.y,homeTile:{row:P.row,col:P.col},direction:"front"})})},[t,T]),ir.useTick(q=>{var Re;v.current+=q*16;const $=_.current,se=E.current,ce=new Set(t.map(he=>he.id)),ve=new Map;t.forEach(he=>{const P=$.get(he.id);if(!P||P.exiting)return;const we=$i(P.x,P.y);ve.set(wS(we.row,we.col),he.id)}),t.forEach(he=>{var hs;const P=$.get(he.id);if(!P)return;Ps(P.homeTile);const we=$i(P.x,P.y),ye=bS(he.status||"working"),Ve=lt=>{const xt=ve.get(wS(lt.row,lt.col));return xt&&xt!==he.id};let Qe=P.homeTile;const Ke=(hs=T==null?void 0:T.workCenters)!=null&&hs.length?T.workCenters:(T==null?void 0:T.workNodes)||[];if(Ke.length){let lt=null,xt=Number.POSITIVE_INFINITY,Mr=null,kr=Number.POSITIVE_INFINITY;Ke.forEach(ur=>{const hr=Math.abs(ur.row-we.row)+Math.abs(ur.col-we.col);hr<kr&&(Mr=ur,kr=hr),!Ve(ur)&&hr<xt&&(lt=ur,xt=hr)}),Qe=lt||Mr||P.homeTile}const Ut=D();let at=ye?"work":"wander",Be=ye?Qe:Ut;const Pe=Date.now(),Je=Math.hypot(P.targetX-P.x,P.targetY-P.y),kt=Je<.6,xr=P.idlePauseUntil&&Pe<P.idlePauseUntil;if(!ye){if(xr){P.targetX=P.x,P.targetY=P.y;return}P.idlePauseUntil&&Pe>=P.idlePauseUntil&&(P.idlePauseUntil=void 0,P.wanderUntil=Pe+3e3+Math.floor(Math.random()*2e3),P.path=[],P.pathIndex=void 0,P.targetTile=void 0,P.targetKind=void 0,P.retargetAt=0),P.wanderUntil||(P.idlePauseUntil=Pe+2e3,P.path=[],P.pathIndex=void 0,P.targetTile=void 0,P.targetKind=void 0,P.retargetAt=0)}const zt=P.workLockUntil&&Pe<P.workLockUntil,Zt=!P.targetTile||!zt&&P.targetKind!==at||(ye?kt:!P.wanderUntil||Pe>P.wanderUntil);if(T&&Zt&&(!P.path||P.path.length===0)){P.targetKind=at,P.targetTile=Be;let lt=ty(T.grid,we,Be);if(lt.length===0&&at==="work"){const xt=Ps(Be);P.x=xt.x,P.y=xt.y,P.targetX=xt.x,P.targetY=xt.y,P.path=[],P.pathIndex=void 0}else P.path=iy(lt);P.pathIndex=P.path.length>1?1:0,P.retargetAt=Pe+1400,ye&&(P.workLockUntil=Pe+2200)}if(P.path&&P.path.length>0&&P.pathIndex!==void 0){const lt=Math.min(P.pathIndex,P.path.length-1),xt=P.path[lt];xt.row===we.row&&xt.col===we.col&&P.pathIndex<P.path.length-1&&(P.pathIndex+=1);const Mr=Ps(xt);P.targetX=Mr.x,P.targetY=Mr.y}const Ze=P.targetX-P.x,Gt=P.targetY-P.y,wr=fL(he.status||"working");if(Je>.1){const lt=Math.min(wr,Je,.4),xt=P.x+Ze/Je*lt,Mr=P.y+Gt/Je*lt,kr=Je<2?.4:1,ur=P.x+(xt-P.x)*kr,hr=P.y+(Mr-P.y)*kr,In=$i(ur,hr);let Nt=!0;if(T!=null&&T.doorNodes){const Er=(Vr,an)=>T.doorNodes.some(Jo=>Jo.col===Vr&&Jo.row===an),cr=Math.floor(P.x/me),Nr=Math.floor(P.y/me);Er(cr,Nr)&&b[Nr][cr]!=="door_open"&&w(Vr=>{const an=[...Vr];return an[Nr]=[...Vr[Nr]],an[Nr][cr]="door_open",an})}if(T&&!L(In.col,In.row)&&(Nt=!1),Nt){P.x=ur,P.y=hr;const Er=P.lastPosX??P.x,cr=P.lastPosY??P.y;(P.lastPosX===void 0||Math.hypot(P.x-Er,P.y-cr)>.05)&&(P.lastPosX=P.x,P.lastPosY=P.y,P.lastMoveAt=Pe),(!P.dirLockUntil||Pe>P.dirLockUntil)&&Je>3&&(Math.abs(Ze)>Math.abs(Gt)?Math.abs(Ze)>4&&(P.direction=Ze>0?"right":"left",P.dirLockUntil=Pe+250):Math.abs(Gt)>4&&(P.direction=Gt>0?"front":"back",P.dirLockUntil=Pe+250))}else P.targetX=P.x,P.targetY=P.y,P.direction="front"}else Je<.2&&(bS(he.status||"working")?P.direction="back":P.direction="front");if(ye&&P.lastMoveAt&&Pe-P.lastMoveAt>1500){const lt=Ps(Qe);P.x=lt.x,P.y=lt.y,P.targetX=lt.x,P.targetY=lt.y,P.path=[],P.pathIndex=void 0,P.lastMoveAt=Pe}Je<.2&&P.path&&P.pathIndex!==void 0&&(P.pathIndex<P.path.length-1?P.pathIndex+=1:(P.path=[],P.pathIndex=void 0,ye||(P.idlePauseUntil=Pe+2e3,P.wanderUntil=void 0)))}),T!=null&&T.doorNodes&&T.doorNodes.forEach(he=>{!t.some(we=>{const ye=$.get(we.id);if(!ye)return!1;const Ve=Math.floor(ye.x/me),Qe=Math.floor(ye.y/me);return Ve===he.col&&Qe===he.row})&&b[he.row][he.col]==="door_open"&&w(we=>{if(we[he.row][he.col]!=="door_closed"){const ye=[...we];return ye[he.row]=[...we[he.row]],ye[he.row][he.col]="door_closed",ye}return we})});const ke=((Re=T==null?void 0:T.exitNodes)==null?void 0:Re[0])??SS();for(const[he,P]of $.entries()){if(!P.exiting||ce.has(he))continue;const we=T?ES($i(P.x,P.y),T.exitNodes,T.grid):ke,ye=Ps(we);if(T&&(!P.path||P.path.length===0)){const at=$i(P.x,P.y);P.path=iy(ty(T.grid,at,we)),P.pathIndex=P.path.length>1?1:0}if(P.path&&P.path.length>0&&P.pathIndex!==void 0){const at=Math.min(P.pathIndex,P.path.length-1),Be=P.path[at],Pe=Ps(Be);P.targetX=Pe.x,P.targetY=Pe.y}else P.targetX=ye.x,P.targetY=ye.y;const Ve=P.targetX-P.x,Qe=P.targetY-P.y,Ke=Math.hypot(Ve,Qe),Ut=Math.min(.85,Ke);if(Ke>.1){const at=P.x+Ve/Ke*Ut,Be=P.y+Qe/Ke*Ut,Pe=$i(at,Be);(!T||L(Pe.col,Pe.row))&&(P.x=at,P.y=Be)}if(P.direction=Qe>0?"front":"back",P.exitAt||(P.exitAt=Date.now()),Ke<.2&&!P.goodbyeUntil&&(!P.path||P.path.length===0)){const at=Date.now();P.goodbyeUntil=at+_S,P.removeAt=at+_S}Ke<.2&&P.path&&P.pathIndex!==void 0&&(P.pathIndex<P.path.length-1?P.pathIndex+=1:(P.path=[],P.pathIndex=void 0)),Ke<1&&(!P.goodbyeUntil||Date.now()>P.goodbyeUntil)&&P.removeAt&&Date.now()>P.removeAt&&($.delete(he),se.delete(he))}p(he=>he+1)});const F=v.current,V=M!=null&&M.status?M.status.toLowerCase():"",ne=(M==null?void 0:M.updatedAt)||0,fe=ne&&F-ne<ny,ae=V==="busy"||V==="working"?15906638:V==="idle"?7067035:V==="error"?15755882:8036568,k=(i==null?void 0:i.updatedAt)&&F-i.updatedAt<ny,X=n?(ie=t.find(q=>q.sessionId===n))==null?void 0:ie.id:void 0,O=[],G=new Map(t.map(q=>[q.id,q]));for(const[q,$]of _.current.entries())$&&(G.has(q)||$.exiting)&&O.push({type:"agent",id:q,y:$.y});return O.sort((q,$)=>q.y-$.y),U.jsxs(U.Fragment,{children:[U.jsx(ir.Container,{children:U.jsx(ir.Sprite,{texture:oe.from("/office.png"),x:0,y:0})}),U.jsx(U.Fragment,{}),U.jsx(_L,{x:8,y:8,activeTab:l}),U.jsx(ir.Graphics,{draw:q=>{if(q.clear(),M&&V){const $=h-26,se=10;q.lineStyle(2,4874086,1),q.beginFill(ae,fe?1:.6),q.drawRoundedRect($,se,10,10,3),q.endFill(),fe&&(q.lineStyle(2,ae,.5),q.drawRoundedRect($-3,se-3,16,16,4)),q.lineStyle(0,0,0)}}}),U.jsx(ir.Graphics,{draw:q=>{q.clear(),e.forEach($=>{const se=_.current.get($.from),ce=_.current.get($.to);!se||!ce||(q.lineStyle(2,ry.link,1),q.moveTo(se.x,se.y-8),q.lineTo(ce.x,ce.y-8),q.lineStyle(0,0,0))})}}),O.map(q=>{var Ah,Ch;if(q.type!=="agent")return null;const $=t.find(Oe=>Oe.id===q.id)||E.current.get(q.id);if(!$)return null;const se=_.current.get($.id);if(!se)return null;const ce=se.x-8,ve=se.y-12,ke=0,Re=se.direction||"front",he=Math.hypot(se.targetX-se.x,se.targetY-se.y),P=he>.8,we=he>.2,ye=$i(se.x,se.y),Ve=!!((Ah=T==null?void 0:T.workNodes)!=null&&Ah.some(Oe=>Oe.row===ye.row&&Oe.col===ye.col)),Ke=$.status==="thinking"&&Ve?"jump":P?"run":we?"walk":"idle",Ut=A[Ke]||A.idle,at=(Ut==null?void 0:Ut.right.length)||1,Pe=Math.floor(F/(P?90:we?120:200))%at,Je=Ut?Re==="back"?Ut.up:Re==="front"?Ut.down:Ut.right:null,kt=Je?Je[Pe]:null,xr=Re==="left"?-1:1,zt=($.alias||$.name||$.id||"Agent").slice(0,10).toUpperCase(),[Zt,Ze]=mL($.sessionId),Gt=(Ch=$.lastEventType)!=null&&Ch.startsWith("message.")&&$.lastEventAt||0,wr=$.lastMessageAt||Gt||0,hs=wr&&Date.now()-wr<iL,lt=$.lastStreamingAt&&Date.now()-$.lastStreamingAt<sL;gL($.status||"working");const xt=$.lastMessageSnippet||"",Mr=!!(se.goodbyeUntil&&Date.now()<se.goodbyeUntil),ur=Mr?"bye":lt?".".repeat(Math.max(1,Math.floor(F/250)%4)):xt,hr=Date.now(),In=$.lastFileEditAt&&hr-$.lastFileEditAt<lL,Nt=$.lastEventType||"",Er=$.lastEventAt||$.lastActivityAt||0,cr=Er&&hr-Er<ny,Nr=Nt==="message.updated"||Nt==="message.part.updated",Vr=Nt.startsWith("session."),an=cr&&(Nt==="tool.execute.before"||Nt==="tool.execute.after"),Jo=Nt==="tool.execute.before"?15906638:8036568,El=uL[Nt],gh=cr&&!an&&!In&&!Nr&&!Vr&&El!==void 0,Sl=cr&&Nt==="permission.asked"?"❓":cr&&Nt==="tui.toast.show"?"⏳":In?"✏️":$.status==="thinking"?"💭":$.status==="working"?"🛠️":"",vh=!!Sl,ea=yL(ur,vS,de,aL),_h=ea.map(Oe=>wn.measureText(Oe,de).width),gp=_h.length?Math.max(..._h):0,bl=Math.max(oL,Math.min(gp,vS))+cd*2,Tl=(Number(de.fontSize)||9)+2,xh=ea.length*Tl+cd*2,wh=se.x-bl/2,cs=ve-56+ke-(ea.length-1)*6,yp=wh+cd,vp=cs+cd,_p=4,xp=12,Eh=ve+34+ke,Sh=18,bh=se.x-Sh/2,Oi={show:!!(Mr||$.lastMessageSnippet&&hs),x:wh,y:cs,width:bl,height:xh,textX:yp,textY:vp,lines:ea},Th=Oi.show?cs+xh+4:ve-28+ke,ds={show:vh,x:bh,y:Th,size:Sh,emoji:Sl,textX:bh+3,textY:Th+1};return U.jsxs(ir.Container,{eventMode:"static",cursor:"pointer",onpointerdown:()=>o($.id),children:[U.jsx(ir.Graphics,{draw:Oe=>{if(Oe.clear(),Oe.beginFill(ry.shadow),Oe.drawRect(ce+2,ve+18+ke,12,4),Oe.endFill(),!kt){const Jn=pL($);Oe.beginFill(Jn),Oe.drawRect(ce-8,ve+ke-8,32,28),Oe.drawRect(ce-4,ve-20+ke,24,16),Oe.endFill(),Oe.beginFill(1250074),Re==="front"?(Oe.drawRect(ce+4,ve-12+ke,4,4),Oe.drawRect(ce+16,ve-12+ke,4,4)):Re==="right"?Oe.drawRect(ce+16,ve-12+ke,4,4):Re==="left"&&Oe.drawRect(ce+4,ve-12+ke,4,4),Oe.endFill()}if(an){const fs=se.x+12,lo=ve-24+ke;Oe.beginFill(Jo,.95),Oe.lineStyle(1,16777215,.8),Oe.drawRoundedRect(fs,lo,6,6,1),Oe.endFill(),Oe.lineStyle(0,0,0)}if(gh){const fs=se.x+10,lo=ve-26+ke;Va(Oe,fs,lo,8,8,2,15856639,El,1)}const Fi=wn.measureText(zt,Y).width+_p*2,ta=se.x-Fi/2;if(Va(Oe,ta,Eh-10,Fi,xp,6,Zt,Ze),k&&$.id===X){const Jn=ta+Fi+6,fs=Eh-12;Oe.beginFill(16249044),Oe.lineStyle(2,4874086,1),Oe.drawRoundedRect(Jn,fs+4,14,14,3),Oe.endFill(),Oe.beginFill(4874086),Oe.drawRect(Jn+4,fs,6,6),Oe.endFill(),Oe.lineStyle(0,0,0)}Oi.show&&Va(Oe,Oi.x,Oi.y,Oi.width,Oi.height,4,15859699,3824444,1.5),ds.show&&Va(Oe,ds.x,ds.y,ds.size,ds.size,6,15856639,5925536,1)}}),kt&&U.jsx(ir.Sprite,{texture:kt,anchor:.5,x:se.x,y:se.y+ke,scale:{x:xr*2,y:2}}),U.jsx(ir.Text,{text:zt,anchor:.5,x:ce+8,y:ve+30+ke,style:j}),U.jsx(rL,{bubble:Oi,style:de}),U.jsx(tL,{bubble:ds,style:re})]},$.id)})]})},wL=t=>{const[e,r]=Ce.useState({width:u2,height:h2});return U.jsx(ir.Stage,{width:e.width,height:e.height,style:{display:"block"},options:{antialias:!1,backgroundColor:1054229,preserveDrawingBuffer:!0},children:U.jsx(xL,{...t,sceneWidth:e.width,sceneHeight:e.height,setDimensions:r})})},EL=({message:t,status:e})=>U.jsxs("div",{className:"boss-message-box",children:[U.jsxs("div",{className:"flex justify-between items-baseline mb-2",children:[U.jsx("div",{className:"text-[9px] uppercase tracking-widest font-bold",children:"Boss Says"}),e?U.jsx("div",{className:"text-[8px] uppercase px-2 py-0.5 bg-amber-200/50 rounded border border-amber-700/30",children:e}):null]}),U.jsx("p",{className:"text-[10px] leading-relaxed",children:t})]}),SL=({bossMessageText:t,bossStatus:e,agents:r,interactions:n,sessions:i,activeSessionId:s,lastTodoSummary:o,selectedAgentId:l,onSelectAgent:h,activeTab:c})=>U.jsxs("div",{className:"flex flex-col gap-4",children:[U.jsx(EL,{message:t,status:e}),U.jsx("div",{className:"pixi-wrapper",children:U.jsx("div",{className:"w-full flex justify-center bg-[#101615] rounded-lg overflow-hidden",children:U.jsx(wL,{agents:r,interactions:n,sessions:i,activeSessionId:s,lastTodoSummary:o,selectedAgentId:l,onSelectAgent:h,activeTab:c})})})]}),TS=t=>{var n;const e=((n=t.directory)==null?void 0:n.split("/").pop())||t.title||t.slug||"",r=t.id.slice(0,6);return e?`${e} · ${r}`:r},bL=({sessions:t,activeLabel:e,version:r,todoSummary:n,selectedSessionId:i,selectedSession:s,onSelectSession:o})=>{const l=[...t].filter(h=>h.id).sort((h,c)=>{if(h.id===i)return-1;if(c.id===i)return 1;const f=(c.updatedAt||0)-(h.updatedAt||0);if(f!==0)return f;const m=h.title||h.slug||h.id,p=c.title||c.slug||c.id;return m.localeCompare(p)});return U.jsxs("div",{className:"data-panel",children:[U.jsx("div",{className:"gamish-panel-title",children:U.jsx("span",{children:"MISSION LOG"})}),U.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4 text-[10px] text-muted-foreground",children:[U.jsxs("div",{className:"flex flex-col",children:[U.jsx("span",{className:"text-[8px] uppercase tracking-wider text-slate-500",children:"Active Session"}),U.jsx("span",{className:"text-secondary-foreground font-bold",children:e})]}),U.jsxs("div",{className:"flex flex-col",children:[U.jsx("span",{className:"text-[8px] uppercase tracking-wider text-slate-500",children:"System Ver"}),U.jsx("span",{className:"text-secondary-foreground",children:r})]}),U.jsxs("div",{className:"flex flex-col",children:[U.jsx("span",{className:"text-[8px] uppercase tracking-wider text-slate-500",children:"Objectives"}),U.jsx("span",{className:"text-secondary-foreground",children:n})]})]}),U.jsxs("div",{className:"mb-4",children:[U.jsx("div",{className:"text-[8px] uppercase tracking-wider text-slate-500 mb-2",children:"Available Sessions"}),U.jsx("div",{className:"flex flex-col max-h-[220px] overflow-y-auto pr-1 space-y-1",children:l.length===0?U.jsx("span",{className:"text-muted-foreground text-[9px] italic",children:"No active signals..."}):l.map(h=>U.jsxs("button",{type:"button",className:`session-item ${h.id===i?"active":""}`,onClick:()=>o(h.id),children:[U.jsx("span",{className:"truncate",children:TS(h)}),h.id===i&&U.jsx("div",{className:"w-1.5 h-1.5 bg-emerald-400 rounded-full animate-pulse"})]},h.id))})]}),U.jsxs("div",{className:"pt-4 border-t border-slate-700",children:[U.jsx("div",{className:"text-[8px] uppercase tracking-wider text-slate-500 mb-2",children:"Session Intel"}),s?U.jsxs("div",{className:"space-y-1.5",children:[U.jsxs("div",{className:"flex flex-col",children:[U.jsx("span",{className:"text-[8px] text-slate-500",children:"Identifier"}),U.jsx("span",{className:"text-[9px] text-slate-300 break-all",children:TS(s)})]}),s.status&&U.jsxs("div",{className:"flex justify-between items-center",children:[U.jsx("span",{className:"text-[8px] text-slate-500",children:"Status"}),U.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-slate-800 border border-slate-600 inline-block",children:s.status})]}),s.version&&U.jsxs("div",{className:"flex justify-between",children:[U.jsx("span",{className:"text-[8px] text-slate-500",children:"Core Ver"}),U.jsx("span",{className:"text-[9px] text-slate-400",children:s.version})]}),s.directory&&U.jsxs("div",{className:"flex flex-col mt-1",children:[U.jsx("span",{className:"text-[8px] text-slate-500",children:"Path"}),U.jsx("span",{className:"text-[8px] font-mono text-slate-500 truncate",children:s.directory})]})]}):U.jsx("span",{className:"text-[9px] text-slate-600 italic",children:"No session selected"})]})]})},TL=({todos:t})=>U.jsxs("div",{className:"data-panel",children:[U.jsx("div",{className:"gamish-panel-title",children:U.jsx("span",{children:"QUEST LOG"})}),U.jsx("div",{className:"flex flex-col gap-1 max-h-[300px] overflow-y-auto pr-1",children:t.length===0?U.jsx("div",{className:"p-4 text-center border-2 border-dashed border-slate-700 rounded-lg",children:U.jsx("span",{className:"text-slate-600 text-[9px] uppercase",children:"No active quests"})}):t.map(e=>U.jsxs("div",{className:`todo-item text-[10px] ${e.status==="completed"?"done":""} ${e.status==="in_progress"?"active":""}`,children:[U.jsxs("div",{className:"flex justify-between items-start gap-2",children:[U.jsx("span",{className:"leading-snug",children:e.content}),e.priority&&e.priority!=="medium"&&U.jsx("span",{className:`text-[8px] uppercase font-bold px-1 rounded ${e.priority==="high"?"text-red-400 bg-red-900/30":e.priority==="low"?"text-emerald-400 bg-emerald-900/30":""}`,children:e.priority.slice(0,1)})]}),U.jsx("div",{className:"flex gap-2 mt-1",children:e.status==="in_progress"&&U.jsx("span",{className:"text-[8px] text-amber-500 animate-pulse",children:"▶ IN PROGRESS"})})]},e.id))})]}),AL=()=>`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`,CL=()=>{const[t,e]=Ce.useState([]),[r,n]=Ce.useState([]),[i,s]=Ce.useState([]),[o,l]=Ce.useState([]),[h,c]=Ce.useState(!1),[f,m]=Ce.useState(null),[p,v]=Ce.useState(null),[_,E]=Ce.useState(null),[A,S]=Ce.useState(null),[b,w]=Ce.useState(null),[T,R]=Ce.useState(null),[L,D]=Ce.useState(null);Ce.useEffect(()=>{let j=null,de=null;const re=()=>{j=new WebSocket(AL()),j.addEventListener("open",()=>c(!0)),j.addEventListener("close",()=>{c(!1),de=window.setTimeout(re,2e3)}),j.addEventListener("message",F=>{try{const V=JSON.parse(F.data);if(V.type==="state"&&V.state){const ne=V.state;if(e(ne.agents||[]),n(ne.sessions||[]),s(ne.todos||[]),l(ne.interactions||[]),m(ne.activeSessionId||null),S(ne.appVersion||null),w(ne.lastTodoSummary||null),R(ne.bossMessage||null),D(ne.networkIp||null),ne.activeSessionId){const fe=ne.activeSessionId??null;v(ae=>ae??fe)}}}catch(V){console.error("Failed to parse websocket message",V)}})};return re(),()=>{j&&j.close(),de&&window.clearTimeout(de)}},[]),Ce.useEffect(()=>{_&&(t.some(de=>de.id===_)||E(null))},[t,_]),Ce.useEffect(()=>{p&&(r.some(de=>de.id===p)||v(null))},[r,p]);const M=Ce.useMemo(()=>r.find(j=>j.id===p)||null,[r,p]),Y=Ce.useMemo(()=>t.find(j=>j.id===_)||null,[t,_]);return{agents:t,sessions:r,todos:i,interactions:o,connected:h,activeSessionId:f,selectedSessionId:p,selectedAgentId:_,selectedSession:M,selectedAgent:Y,appVersion:A,lastTodoSummary:b,bossMessage:T,networkIp:L,setSelectedAgentId:E,setSelectedSessionId:v}},PL=()=>{var ne;const{agents:t,sessions:e,todos:r,interactions:n,connected:i,activeSessionId:s,selectedSessionId:o,selectedAgentId:l,selectedSession:h,selectedAgent:c,appVersion:f,lastTodoSummary:m,bossMessage:p,networkIp:v,setSelectedAgentId:_,setSelectedSessionId:E}=CL(),[A,S]=Ce.useState(!1),[b,w]=Ce.useState("opencode"),T=Ce.useMemo(()=>t.filter(fe=>(fe.source||"opencode")===b),[t,b]),R=Ce.useMemo(()=>{const fe=new Set(T.map(ae=>ae.id));return n.filter(ae=>fe.has(ae.from)||fe.has(ae.to))},[n,T]),L=Ce.useMemo(()=>t.filter(fe=>(fe.source||"opencode")==="opencode").length,[t]),D=Ce.useMemo(()=>t.filter(fe=>fe.source==="claude").length,[t]),M=e.find(fe=>fe.id===s),Y=((ne=M==null?void 0:M.directory)==null?void 0:ne.split("/").pop())||(M==null?void 0:M.title)||(M==null?void 0:M.slug)||"",j=M?Y?`${Y} · ${s==null?void 0:s.slice(0,6)}`:(s==null?void 0:s.slice(0,6))||"N/A":"N/A",de=f?`v${f}`:"v1.0.0",re=m?`${m.completed}/${m.total}`:"0/0",F=(p==null?void 0:p.text)||"Awaiting mission updates...",V=p!=null&&p.status?p.status.toUpperCase():"IDLE";return U.jsxs("div",{className:"app",children:[U.jsxs("header",{children:[U.jsx("div",{className:"gamish-card logo-card",children:U.jsxs("div",{className:"flex flex-col",children:[U.jsx("h1",{className:"text-sm text-primary mb-1 tracking-widest",children:"PIXEL OFFICE"}),U.jsxs("p",{className:"text-[9px] text-muted-foreground",children:["AI AGENT OPS // ",de]})]})}),U.jsxs("div",{className:"flex gap-1",children:[U.jsxs("button",{onClick:()=>w("opencode"),className:`office-tab ${b==="opencode"?"active":""}`,children:[U.jsx("span",{className:"tab-icon",children:"◈"}),U.jsx("span",{children:"OpenCode"}),L>0&&U.jsx("span",{className:"tab-badge",children:L})]}),U.jsxs("button",{onClick:()=>w("claude"),className:`office-tab ${b==="claude"?"active":""}`,children:[U.jsx("span",{className:"tab-icon",children:"◇"}),U.jsx("span",{children:"Claude"}),D>0&&U.jsx("span",{className:"tab-badge",children:D})]})]}),U.jsxs("div",{className:`status-badge ${i?"live":""}`,children:[U.jsx("span",{className:"text-[8px] opacity-70 mb-1",children:"SYSTEM STATUS"}),U.jsx("span",{className:"font-bold",children:i?"ONLINE":"OFFLINE"}),v&&i&&U.jsxs("div",{className:"relative mt-2 border-t border-white/20 pt-1 flex flex-col items-center",children:[U.jsxs("button",{onClick:()=>S(!A),className:"text-[8px] font-normal opacity-80 hover:opacity-100 hover:text-accent cursor-pointer underline decoration-dotted",title:"Click to scan QR code",children:["http://",v,":5100"]}),A&&U.jsxs("div",{className:"absolute top-8 right-0 bg-white p-2 border-2 border-foreground shadow-[4px_4px_0_rgba(0,0,0,0.2)] z-50",children:[U.jsx("div",{style:{height:"auto",margin:"0 auto",maxWidth:128,width:"100%"},children:U.jsx($R,{size:256,style:{height:"auto",maxWidth:"100%",width:"100%"},value:`http://${v}:5100`,viewBox:"0 0 256 256"})}),U.jsx("div",{className:"text-[8px] text-center mt-1 text-foreground font-bold",children:"SCAN ME"})]})]})]})]}),U.jsxs("main",{children:[U.jsx(SL,{bossMessageText:F,bossStatus:V,agents:T,interactions:R,sessions:e,activeSessionId:s,lastTodoSummary:m,selectedAgentId:l,onSelectAgent:_,activeTab:b}),U.jsxs("aside",{className:"sidebar-stack",children:[U.jsx(bL,{sessions:e,activeLabel:j,version:de,todoSummary:re,selectedSessionId:o,selectedSession:h,onSelectSession:E}),U.jsx(TL,{todos:r}),U.jsx(WR,{selectedAgent:c})]})]})]})};oy.createRoot(document.getElementById("root")).render(U.jsx(Ti.StrictMode,{children:U.jsx(PL,{})}));