claude-live 1.1.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.claude-plugin/hooks/hooks.json +161 -0
  2. package/.claude-plugin/marketplace.json +27 -0
  3. package/.claude-plugin/plugin.json +14 -0
  4. package/README.md +82 -0
  5. package/bin/cli.js +18 -0
  6. package/bin/hook.js +24 -0
  7. package/client/dist/assets/BufferResource-B3YcFk1L.js +185 -0
  8. package/client/dist/assets/CanvasRenderer-B7cP3KcG.js +1 -0
  9. package/client/dist/assets/Filter-BXkJkOCD.js +1 -0
  10. package/client/dist/assets/RenderTargetSystem-DkV5EZ2H.js +172 -0
  11. package/client/dist/assets/WebGLRenderer-Cgmusykq.js +156 -0
  12. package/client/dist/assets/WebGPURenderer-B_Gw9-ml.js +41 -0
  13. package/client/dist/assets/browserAll-wXmCMyRg.js +14 -0
  14. package/client/dist/assets/index-BGs_09Jl.js +318 -0
  15. package/client/dist/assets/index-DjcKbX6b.css +1 -0
  16. package/client/dist/assets/webworkerAll-Hyzs6HuJ.js +83 -0
  17. package/client/dist/chords/chord_01.ogg +0 -0
  18. package/client/dist/chords/chord_02.ogg +0 -0
  19. package/client/dist/chords/chord_03.ogg +0 -0
  20. package/client/dist/chords/chord_04.ogg +0 -0
  21. package/client/dist/chords/chord_05.ogg +0 -0
  22. package/client/dist/chords/chord_06.ogg +0 -0
  23. package/client/dist/chords/chord_07.ogg +0 -0
  24. package/client/dist/chords/chord_08.ogg +0 -0
  25. package/client/dist/chords/chord_09.ogg +0 -0
  26. package/client/dist/chords/chord_10.ogg +0 -0
  27. package/client/dist/chords/chord_11.ogg +0 -0
  28. package/client/dist/chords/chord_12.ogg +0 -0
  29. package/client/dist/chords/chord_13.ogg +0 -0
  30. package/client/dist/chords/chord_14.ogg +0 -0
  31. package/client/dist/chords/chord_15.ogg +0 -0
  32. package/client/dist/chords/chord_16.ogg +0 -0
  33. package/client/dist/index.html +20 -0
  34. package/commands/claude-live.md +145 -0
  35. package/package.json +27 -11
  36. package/server/index.js +93 -0
  37. package/bin/claude-live.js +0 -42
@@ -0,0 +1,318 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-wXmCMyRg.js","assets/webworkerAll-Hyzs6HuJ.js","assets/Filter-BXkJkOCD.js","assets/WebGPURenderer-B_Gw9-ml.js","assets/BufferResource-B3YcFk1L.js","assets/RenderTargetSystem-DkV5EZ2H.js","assets/WebGLRenderer-Cgmusykq.js","assets/CanvasRenderer-B7cP3KcG.js"])))=>i.map(i=>d[i]);
2
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $f={exports:{}},Wo={},Uf={exports:{}},X={};/**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var si=Symbol.for("react.element"),G0=Symbol.for("react.portal"),j0=Symbol.for("react.fragment"),z0=Symbol.for("react.strict_mode"),W0=Symbol.for("react.profiler"),$0=Symbol.for("react.provider"),U0=Symbol.for("react.context"),H0=Symbol.for("react.forward_ref"),V0=Symbol.for("react.suspense"),X0=Symbol.for("react.memo"),Y0=Symbol.for("react.lazy"),Yu=Symbol.iterator;function q0(t){return t===null||typeof t!="object"?null:(t=Yu&&t[Yu]||t["@@iterator"],typeof t=="function"?t:null)}var Hf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vf=Object.assign,Xf={};function Hs(t,e,n){this.props=t,this.context=e,this.refs=Xf,this.updater=n||Hf}Hs.prototype.isReactComponent={};Hs.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")};Hs.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Yf(){}Yf.prototype=Hs.prototype;function Dc(t,e,n){this.props=t,this.context=e,this.refs=Xf,this.updater=n||Hf}var Nc=Dc.prototype=new Yf;Nc.constructor=Dc;Vf(Nc,Hs.prototype);Nc.isPureReactComponent=!0;var qu=Array.isArray,qf=Object.prototype.hasOwnProperty,Gc={current:null},Kf={key:!0,ref:!0,__self:!0,__source:!0};function Qf(t,e,n){var s,r={},i=null,o=null;if(e!=null)for(s in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)qf.call(e,s)&&!Kf.hasOwnProperty(s)&&(r[s]=e[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];r.children=c}if(t&&t.defaultProps)for(s in a=t.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return{$$typeof:si,type:t,key:i,ref:o,props:r,_owner:Gc.current}}function K0(t,e){return{$$typeof:si,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function jc(t){return typeof t=="object"&&t!==null&&t.$$typeof===si}function Q0(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Ku=/\/+/g;function ua(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Q0(""+t.key):e.toString(36)}function qi(t,e,n,s,r){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case si:case G0:o=!0}}if(o)return o=t,r=r(o),t=s===""?"."+ua(o,0):s,qu(r)?(n="",t!=null&&(n=t.replace(Ku,"$&/")+"/"),qi(r,e,n,"",function(u){return u})):r!=null&&(jc(r)&&(r=K0(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(Ku,"$&/")+"/")+t)),e.push(r)),1;if(o=0,s=s===""?".":s+":",qu(t))for(var a=0;a<t.length;a++){i=t[a];var c=s+ua(i,a);o+=qi(i,e,n,c,r)}else if(c=q0(t),typeof c=="function")for(t=c.call(t),a=0;!(i=t.next()).done;)i=i.value,c=s+ua(i,a++),o+=qi(i,e,n,c,r);else if(i==="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 ui(t,e,n){if(t==null)return t;var s=[],r=0;return qi(t,s,"","",function(i){return e.call(n,i,r++)}),s}function Z0(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Ue={current:null},Ki={transition:null},J0={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Ki,ReactCurrentOwner:Gc};function Zf(){throw Error("act(...) is not supported in production builds of React.")}X.Children={map:ui,forEach:function(t,e,n){ui(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ui(t,function(){e++}),e},toArray:function(t){return ui(t,function(e){return e})||[]},only:function(t){if(!jc(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};X.Component=Hs;X.Fragment=j0;X.Profiler=W0;X.PureComponent=Dc;X.StrictMode=z0;X.Suspense=V0;X.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J0;X.act=Zf;X.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=Vf({},t.props),r=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Gc.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(c in e)qf.call(e,c)&&!Kf.hasOwnProperty(c)&&(s[c]=e[c]===void 0&&a!==void 0?a[c]:e[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];s.children=a}return{$$typeof:si,type:t.type,key:r,ref:i,props:s,_owner:o}};X.createContext=function(t){return t={$$typeof:U0,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:$0,_context:t},t.Consumer=t};X.createElement=Qf;X.createFactory=function(t){var e=Qf.bind(null,t);return e.type=t,e};X.createRef=function(){return{current:null}};X.forwardRef=function(t){return{$$typeof:H0,render:t}};X.isValidElement=jc;X.lazy=function(t){return{$$typeof:Y0,_payload:{_status:-1,_result:t},_init:Z0}};X.memo=function(t,e){return{$$typeof:X0,type:t,compare:e===void 0?null:e}};X.startTransition=function(t){var e=Ki.transition;Ki.transition={};try{t()}finally{Ki.transition=e}};X.unstable_act=Zf;X.useCallback=function(t,e){return Ue.current.useCallback(t,e)};X.useContext=function(t){return Ue.current.useContext(t)};X.useDebugValue=function(){};X.useDeferredValue=function(t){return Ue.current.useDeferredValue(t)};X.useEffect=function(t,e){return Ue.current.useEffect(t,e)};X.useId=function(){return Ue.current.useId()};X.useImperativeHandle=function(t,e,n){return Ue.current.useImperativeHandle(t,e,n)};X.useInsertionEffect=function(t,e){return Ue.current.useInsertionEffect(t,e)};X.useLayoutEffect=function(t,e){return Ue.current.useLayoutEffect(t,e)};X.useMemo=function(t,e){return Ue.current.useMemo(t,e)};X.useReducer=function(t,e,n){return Ue.current.useReducer(t,e,n)};X.useRef=function(t){return Ue.current.useRef(t)};X.useState=function(t){return Ue.current.useState(t)};X.useSyncExternalStore=function(t,e,n){return Ue.current.useSyncExternalStore(t,e,n)};X.useTransition=function(){return Ue.current.useTransition()};X.version="18.3.1";Uf.exports=X;var H=Uf.exports;/**
11
+ * @license React
12
+ * react-jsx-runtime.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var e_=H,t_=Symbol.for("react.element"),n_=Symbol.for("react.fragment"),s_=Object.prototype.hasOwnProperty,r_=e_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i_={key:!0,ref:!0,__self:!0,__source:!0};function Jf(t,e,n){var s,r={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(s in e)s_.call(e,s)&&!i_.hasOwnProperty(s)&&(r[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)r[s]===void 0&&(r[s]=e[s]);return{$$typeof:t_,type:t,key:i,ref:o,props:r,_owner:r_.current}}Wo.Fragment=n_;Wo.jsx=Jf;Wo.jsxs=Jf;$f.exports=Wo;var M=$f.exports,ep={exports:{}},ct={},tp={exports:{}},np={};/**
19
+ * @license React
20
+ * scheduler.production.min.js
21
+ *
22
+ * Copyright (c) Facebook, Inc. and its affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */(function(t){function e(E,A){var D=E.length;E.push(A);e:for(;0<D;){var $=D-1>>>1,z=E[$];if(0<r(z,A))E[$]=A,E[D]=z,D=$;else break e}}function n(E){return E.length===0?null:E[0]}function s(E){if(E.length===0)return null;var A=E[0],D=E.pop();if(D!==A){E[0]=D;e:for(var $=0,z=E.length,G=z>>>1;$<G;){var W=2*($+1)-1,j=E[W],ne=W+1,Q=E[ne];if(0>r(j,D))ne<z&&0>r(Q,j)?(E[$]=Q,E[ne]=D,$=ne):(E[$]=j,E[W]=D,$=W);else if(ne<z&&0>r(Q,D))E[$]=Q,E[ne]=D,$=ne;else break e}}return A}function r(E,A){var D=E.sortIndex-A.sortIndex;return D!==0?D:E.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],u=[],d=1,l=null,h=3,f=!1,p=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(E){for(var A=n(u);A!==null;){if(A.callback===null)s(u);else if(A.startTime<=E)s(u),A.sortIndex=A.expirationTime,e(c,A);else break;A=n(u)}}function v(E){if(_=!1,x(E),!p)if(n(c)!==null)p=!0,O(S);else{var A=n(u);A!==null&&B(v,A.startTime-E)}}function S(E,A){p=!1,_&&(_=!1,m(k),k=-1),f=!0;var D=h;try{for(x(A),l=n(c);l!==null&&(!(l.expirationTime>A)||E&&!P());){var $=l.callback;if(typeof $=="function"){l.callback=null,h=l.priorityLevel;var z=$(l.expirationTime<=A);A=t.unstable_now(),typeof z=="function"?l.callback=z:l===n(c)&&s(c),x(A)}else s(c);l=n(c)}if(l!==null)var G=!0;else{var W=n(u);W!==null&&B(v,W.startTime-A),G=!1}return G}finally{l=null,h=D,f=!1}}var w=!1,b=null,k=-1,T=5,C=-1;function P(){return!(t.unstable_now()-C<T)}function R(){if(b!==null){var E=t.unstable_now();C=E;var A=!0;try{A=b(!0,E)}finally{A?F():(w=!1,b=null)}}else w=!1}var F;if(typeof g=="function")F=function(){g(R)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,J=L.port2;L.port1.onmessage=R,F=function(){J.postMessage(null)}}else F=function(){y(R,0)};function O(E){b=E,w||(w=!0,F())}function B(E,A){k=y(function(){E(t.unstable_now())},A)}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(E){E.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,O(S))},t.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<E?Math.floor(1e3/E):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(E){switch(h){case 1:case 2:case 3:var A=3;break;default:A=h}var D=h;h=A;try{return E()}finally{h=D}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(E,A){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var D=h;h=E;try{return A()}finally{h=D}},t.unstable_scheduleCallback=function(E,A,D){var $=t.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?$+D:$):D=$,E){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=D+z,E={id:d++,callback:A,priorityLevel:E,startTime:D,expirationTime:z,sortIndex:-1},D>$?(E.sortIndex=D,e(u,E),n(c)===null&&E===n(u)&&(_?(m(k),k=-1):_=!0,B(v,D-$))):(E.sortIndex=z,e(c,E),p||f||(p=!0,O(S))),E},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(E){var A=h;return function(){var D=h;h=A;try{return E.apply(this,arguments)}finally{h=D}}}})(np);tp.exports=np;var o_=tp.exports;/**
27
+ * @license React
28
+ * react-dom.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var a_=H,lt=o_;function I(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);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 sp=new Set,Fr={};function ns(t,e){Is(t,e),Is(t+"Capture",e)}function Is(t,e){for(Fr[t]=e,t=0;t<e.length;t++)sp.add(e[t])}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vl=Object.prototype.hasOwnProperty,l_=/^[: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]*$/,Qu={},Zu={};function c_(t){return vl.call(Zu,t)?!0:vl.call(Qu,t)?!1:l_.test(t)?Zu[t]=!0:(Qu[t]=!0,!1)}function u_(t,e,n,s){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function h_(t,e,n,s){if(e===null||typeof e>"u"||u_(t,e,n,s))return!0;if(s)return!1;if(n!==null)switch(n.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 He(t,e,n,s,r,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Fe[t]=new He(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Fe[e]=new He(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Fe[t]=new He(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Fe[t]=new He(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){Fe[t]=new He(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Fe[t]=new He(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Fe[t]=new He(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Fe[t]=new He(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Fe[t]=new He(t,5,!1,t.toLowerCase(),null,!1,!1)});var zc=/[\-:]([a-z])/g;function Wc(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(zc,Wc);Fe[e]=new He(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(zc,Wc);Fe[e]=new He(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(zc,Wc);Fe[e]=new He(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Fe[t]=new He(t,1,!1,t.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new He("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Fe[t]=new He(t,1,!1,t.toLowerCase(),null,!0,!0)});function $c(t,e,n,s){var r=Fe.hasOwnProperty(e)?Fe[e]:null;(r!==null?r.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(h_(e,n,r,s)&&(n=null),s||r===null?c_(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):r.mustUseProperty?t[r.propertyName]=n===null?r.type===3?!1:"":n:(e=r.attributeName,s=r.attributeNamespace,n===null?t.removeAttribute(e):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?t.setAttributeNS(s,e,n):t.setAttribute(e,n))))}var sn=a_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hi=Symbol.for("react.element"),hs=Symbol.for("react.portal"),ds=Symbol.for("react.fragment"),Uc=Symbol.for("react.strict_mode"),wl=Symbol.for("react.profiler"),rp=Symbol.for("react.provider"),ip=Symbol.for("react.context"),Hc=Symbol.for("react.forward_ref"),Sl=Symbol.for("react.suspense"),bl=Symbol.for("react.suspense_list"),Vc=Symbol.for("react.memo"),ln=Symbol.for("react.lazy"),op=Symbol.for("react.offscreen"),Ju=Symbol.iterator;function Ks(t){return t===null||typeof t!="object"?null:(t=Ju&&t[Ju]||t["@@iterator"],typeof t=="function"?t:null)}var fe=Object.assign,ha;function dr(t){if(ha===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);ha=e&&e[1]||""}return`
35
+ `+ha+t}var da=!1;function fa(t,e){if(!t||da)return"";da=!0;var n=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(u){var s=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){s=u}t.call(e.prototype)}else{try{throw Error()}catch(u){s=u}t()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
36
+ `),i=s.stack.split(`
37
+ `),o=r.length-1,a=i.length-1;1<=o&&0<=a&&r[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==i[a]){var c=`
38
+ `+r[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{da=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?dr(t):""}function d_(t){switch(t.tag){case 5:return dr(t.type);case 16:return dr("Lazy");case 13:return dr("Suspense");case 19:return dr("SuspenseList");case 0:case 2:case 15:return t=fa(t.type,!1),t;case 11:return t=fa(t.type.render,!1),t;case 1:return t=fa(t.type,!0),t;default:return""}}function kl(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 ds:return"Fragment";case hs:return"Portal";case wl:return"Profiler";case Uc:return"StrictMode";case Sl:return"Suspense";case bl:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ip:return(t.displayName||"Context")+".Consumer";case rp:return(t._context.displayName||"Context")+".Provider";case Hc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Vc:return e=t.displayName||null,e!==null?e:kl(t.type)||"Memo";case ln:e=t._payload,t=t._init;try{return kl(t(e))}catch{}}return null}function f_(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 kl(e);case 8:return e===Uc?"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 bn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ap(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function p_(t){var e=ap(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),s=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function di(t){t._valueTracker||(t._valueTracker=p_(t))}function lp(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),s="";return t&&(s=ap(t)?t.checked?"true":"false":t.value),t=s,t!==n?(e.setValue(t),!0):!1}function ho(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 Tl(t,e){var n=e.checked;return fe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function eh(t,e){var n=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;n=bn(e.value!=null?e.value:n),t._wrapperState={initialChecked:s,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function cp(t,e){e=e.checked,e!=null&&$c(t,"checked",e,!1)}function Cl(t,e){cp(t,e);var n=bn(e.value),s=e.type;if(n!=null)s==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(s==="submit"||s==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Ml(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ml(t,e.type,bn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function th(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var s=e.type;if(!(s!=="submit"&&s!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Ml(t,e,n){(e!=="number"||ho(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var fr=Array.isArray;function Cs(t,e,n,s){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&s&&(t[n].defaultSelected=!0)}else{for(n=""+bn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,s&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Pl(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(I(91));return fe({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function nh(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(I(92));if(fr(n)){if(1<n.length)throw Error(I(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:bn(n)}}function up(t,e){var n=bn(e.value),s=bn(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),s!=null&&(t.defaultValue=""+s)}function sh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function hp(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 Al(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?hp(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var fi,dp=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,s,r){MSApp.execUnsafeLocalFunction(function(){return t(e,n,s,r)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(fi=fi||document.createElement("div"),fi.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=fi.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Or(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var xr={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},m_=["Webkit","ms","Moz","O"];Object.keys(xr).forEach(function(t){m_.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),xr[e]=xr[t]})});function fp(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||xr.hasOwnProperty(t)&&xr[t]?(""+e).trim():e+"px"}function pp(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=fp(n,e[n],s);n==="float"&&(n="cssFloat"),s?t.setProperty(n,r):t[n]=r}}var g_=fe({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 El(t,e){if(e){if(g_[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(I(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(I(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(I(61))}if(e.style!=null&&typeof e.style!="object")throw Error(I(62))}}function Rl(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 Il=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ll=null,Ms=null,Ps=null;function rh(t){if(t=oi(t)){if(typeof Ll!="function")throw Error(I(280));var e=t.stateNode;e&&(e=Xo(e),Ll(t.stateNode,t.type,e))}}function mp(t){Ms?Ps?Ps.push(t):Ps=[t]:Ms=t}function gp(){if(Ms){var t=Ms,e=Ps;if(Ps=Ms=null,rh(t),e)for(t=0;t<e.length;t++)rh(e[t])}}function _p(t,e){return t(e)}function yp(){}var pa=!1;function xp(t,e,n){if(pa)return t(e,n);pa=!0;try{return _p(t,e,n)}finally{pa=!1,(Ms!==null||Ps!==null)&&(yp(),gp())}}function Br(t,e){var n=t.stateNode;if(n===null)return null;var s=Xo(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(I(231,e,typeof n));return n}var Fl=!1;if(Qt)try{var Qs={};Object.defineProperty(Qs,"passive",{get:function(){Fl=!0}}),window.addEventListener("test",Qs,Qs),window.removeEventListener("test",Qs,Qs)}catch{Fl=!1}function __(t,e,n,s,r,i,o,a,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var vr=!1,fo=null,po=!1,Ol=null,y_={onError:function(t){vr=!0,fo=t}};function x_(t,e,n,s,r,i,o,a,c){vr=!1,fo=null,__.apply(y_,arguments)}function v_(t,e,n,s,r,i,o,a,c){if(x_.apply(this,arguments),vr){if(vr){var u=fo;vr=!1,fo=null}else throw Error(I(198));po||(po=!0,Ol=u)}}function ss(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function vp(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 ih(t){if(ss(t)!==t)throw Error(I(188))}function w_(t){var e=t.alternate;if(!e){if(e=ss(t),e===null)throw Error(I(188));return e!==t?null:t}for(var n=t,s=e;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return ih(r),t;if(i===s)return ih(r),e;i=i.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=i;else{for(var o=!1,a=r.child;a;){if(a===n){o=!0,n=r,s=i;break}if(a===s){o=!0,s=r,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,s=r;break}if(a===s){o=!0,s=i,n=r;break}a=a.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?t:e}function wp(t){return t=w_(t),t!==null?Sp(t):null}function Sp(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Sp(t);if(e!==null)return e;t=t.sibling}return null}var bp=lt.unstable_scheduleCallback,oh=lt.unstable_cancelCallback,S_=lt.unstable_shouldYield,b_=lt.unstable_requestPaint,ve=lt.unstable_now,k_=lt.unstable_getCurrentPriorityLevel,Yc=lt.unstable_ImmediatePriority,kp=lt.unstable_UserBlockingPriority,mo=lt.unstable_NormalPriority,T_=lt.unstable_LowPriority,Tp=lt.unstable_IdlePriority,$o=null,Bt=null;function C_(t){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot($o,t,void 0,(t.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:A_,M_=Math.log,P_=Math.LN2;function A_(t){return t>>>=0,t===0?32:31-(M_(t)/P_|0)|0}var pi=64,mi=4194304;function pr(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 go(t,e){var n=t.pendingLanes;if(n===0)return 0;var s=0,r=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~r;a!==0?s=pr(a):(i&=o,i!==0&&(s=pr(i)))}else o=n&~r,o!==0?s=pr(o):i!==0&&(s=pr(i));if(s===0)return 0;if(e!==0&&e!==s&&!(e&r)&&(r=s&-s,i=e&-e,r>=i||r===16&&(i&4194240)!==0))return e;if(s&4&&(s|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=s;0<e;)n=31-Pt(e),r=1<<n,s|=t[n],e&=~r;return s}function E_(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 R_(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,r=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Pt(i),a=1<<o,c=r[o];c===-1?(!(a&n)||a&s)&&(r[o]=E_(a,e)):c<=e&&(t.expiredLanes|=a),i&=~a}}function Bl(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Cp(){var t=pi;return pi<<=1,!(pi&4194240)&&(pi=64),t}function ma(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ri(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Pt(e),t[e]=n}function I_(t,e){var n=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 s=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-Pt(n),i=1<<r;e[r]=0,s[r]=-1,t[r]=-1,n&=~i}}function qc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var s=31-Pt(n),r=1<<s;r&e|t[s]&e&&(t[s]|=e),n&=~r}}var te=0;function Mp(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Pp,Kc,Ap,Ep,Rp,Dl=!1,gi=[],mn=null,gn=null,_n=null,Dr=new Map,Nr=new Map,un=[],L_="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 ah(t,e){switch(t){case"focusin":case"focusout":mn=null;break;case"dragenter":case"dragleave":gn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":Dr.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Nr.delete(e.pointerId)}}function Zs(t,e,n,s,r,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},e!==null&&(e=oi(e),e!==null&&Kc(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function F_(t,e,n,s,r){switch(e){case"focusin":return mn=Zs(mn,t,e,n,s,r),!0;case"dragenter":return gn=Zs(gn,t,e,n,s,r),!0;case"mouseover":return _n=Zs(_n,t,e,n,s,r),!0;case"pointerover":var i=r.pointerId;return Dr.set(i,Zs(Dr.get(i)||null,t,e,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Nr.set(i,Zs(Nr.get(i)||null,t,e,n,s,r)),!0}return!1}function Ip(t){var e=Un(t.target);if(e!==null){var n=ss(e);if(n!==null){if(e=n.tag,e===13){if(e=vp(n),e!==null){t.blockedOn=e,Rp(t.priority,function(){Ap(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Qi(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Nl(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var s=new n.constructor(n.type,n);Il=s,n.target.dispatchEvent(s),Il=null}else return e=oi(n),e!==null&&Kc(e),t.blockedOn=n,!1;e.shift()}return!0}function lh(t,e,n){Qi(t)&&n.delete(e)}function O_(){Dl=!1,mn!==null&&Qi(mn)&&(mn=null),gn!==null&&Qi(gn)&&(gn=null),_n!==null&&Qi(_n)&&(_n=null),Dr.forEach(lh),Nr.forEach(lh)}function Js(t,e){t.blockedOn===e&&(t.blockedOn=null,Dl||(Dl=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,O_)))}function Gr(t){function e(r){return Js(r,t)}if(0<gi.length){Js(gi[0],t);for(var n=1;n<gi.length;n++){var s=gi[n];s.blockedOn===t&&(s.blockedOn=null)}}for(mn!==null&&Js(mn,t),gn!==null&&Js(gn,t),_n!==null&&Js(_n,t),Dr.forEach(e),Nr.forEach(e),n=0;n<un.length;n++)s=un[n],s.blockedOn===t&&(s.blockedOn=null);for(;0<un.length&&(n=un[0],n.blockedOn===null);)Ip(n),n.blockedOn===null&&un.shift()}var As=sn.ReactCurrentBatchConfig,_o=!0;function B_(t,e,n,s){var r=te,i=As.transition;As.transition=null;try{te=1,Qc(t,e,n,s)}finally{te=r,As.transition=i}}function D_(t,e,n,s){var r=te,i=As.transition;As.transition=null;try{te=4,Qc(t,e,n,s)}finally{te=r,As.transition=i}}function Qc(t,e,n,s){if(_o){var r=Nl(t,e,n,s);if(r===null)Ta(t,e,s,yo,n),ah(t,s);else if(F_(r,t,e,n,s))s.stopPropagation();else if(ah(t,s),e&4&&-1<L_.indexOf(t)){for(;r!==null;){var i=oi(r);if(i!==null&&Pp(i),i=Nl(t,e,n,s),i===null&&Ta(t,e,s,yo,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Ta(t,e,s,null,n)}}var yo=null;function Nl(t,e,n,s){if(yo=null,t=Xc(s),t=Un(t),t!==null)if(e=ss(t),e===null)t=null;else if(n=e.tag,n===13){if(t=vp(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return yo=t,null}function Lp(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(k_()){case Yc:return 1;case kp:return 4;case mo:case T_:return 16;case Tp:return 536870912;default:return 16}default:return 16}}var dn=null,Zc=null,Zi=null;function Fp(){if(Zi)return Zi;var t,e=Zc,n=e.length,s,r="value"in dn?dn.value:dn.textContent,i=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(s=1;s<=o&&e[n-s]===r[i-s];s++);return Zi=r.slice(t,1<s?1-s:void 0)}function Ji(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 _i(){return!0}function ch(){return!1}function ut(t){function e(n,s,r,i,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?_i:ch,this.isPropagationStopped=ch,this}return fe(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=_i)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_i)},persist:function(){},isPersistent:_i}),e}var Vs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jc=ut(Vs),ii=fe({},Vs,{view:0,detail:0}),N_=ut(ii),ga,_a,er,Uo=fe({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eu,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!==er&&(er&&t.type==="mousemove"?(ga=t.screenX-er.screenX,_a=t.screenY-er.screenY):_a=ga=0,er=t),ga)},movementY:function(t){return"movementY"in t?t.movementY:_a}}),uh=ut(Uo),G_=fe({},Uo,{dataTransfer:0}),j_=ut(G_),z_=fe({},ii,{relatedTarget:0}),ya=ut(z_),W_=fe({},Vs,{animationName:0,elapsedTime:0,pseudoElement:0}),$_=ut(W_),U_=fe({},Vs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),H_=ut(U_),V_=fe({},Vs,{data:0}),hh=ut(V_),X_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y_={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"},q_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K_(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=q_[t])?!!e[t]:!1}function eu(){return K_}var Q_=fe({},ii,{key:function(t){if(t.key){var e=X_[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Ji(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Y_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eu,charCode:function(t){return t.type==="keypress"?Ji(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ji(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Z_=ut(Q_),J_=fe({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=ut(J_),ey=fe({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eu}),ty=ut(ey),ny=fe({},Vs,{propertyName:0,elapsedTime:0,pseudoElement:0}),sy=ut(ny),ry=fe({},Uo,{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}),iy=ut(ry),oy=[9,13,27,32],tu=Qt&&"CompositionEvent"in window,wr=null;Qt&&"documentMode"in document&&(wr=document.documentMode);var ay=Qt&&"TextEvent"in window&&!wr,Op=Qt&&(!tu||wr&&8<wr&&11>=wr),fh=" ",ph=!1;function Bp(t,e){switch(t){case"keyup":return oy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dp(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var fs=!1;function ly(t,e){switch(t){case"compositionend":return Dp(e);case"keypress":return e.which!==32?null:(ph=!0,fh);case"textInput":return t=e.data,t===fh&&ph?null:t;default:return null}}function cy(t,e){if(fs)return t==="compositionend"||!tu&&Bp(t,e)?(t=Fp(),Zi=Zc=dn=null,fs=!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 Op&&e.locale!=="ko"?null:e.data;default:return null}}var uy={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 mh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!uy[t.type]:e==="textarea"}function Np(t,e,n,s){mp(s),e=xo(e,"onChange"),0<e.length&&(n=new Jc("onChange","change",null,n,s),t.push({event:n,listeners:e}))}var Sr=null,jr=null;function hy(t){qp(t,0)}function Ho(t){var e=gs(t);if(lp(e))return t}function dy(t,e){if(t==="change")return e}var Gp=!1;if(Qt){var xa;if(Qt){var va="oninput"in document;if(!va){var gh=document.createElement("div");gh.setAttribute("oninput","return;"),va=typeof gh.oninput=="function"}xa=va}else xa=!1;Gp=xa&&(!document.documentMode||9<document.documentMode)}function _h(){Sr&&(Sr.detachEvent("onpropertychange",jp),jr=Sr=null)}function jp(t){if(t.propertyName==="value"&&Ho(jr)){var e=[];Np(e,jr,t,Xc(t)),xp(hy,e)}}function fy(t,e,n){t==="focusin"?(_h(),Sr=e,jr=n,Sr.attachEvent("onpropertychange",jp)):t==="focusout"&&_h()}function py(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ho(jr)}function my(t,e){if(t==="click")return Ho(e)}function gy(t,e){if(t==="input"||t==="change")return Ho(e)}function _y(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Et=typeof Object.is=="function"?Object.is:_y;function zr(t,e){if(Et(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!vl.call(e,r)||!Et(t[r],e[r]))return!1}return!0}function yh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xh(t,e){var n=yh(t);t=0;for(var s;n;){if(n.nodeType===3){if(s=t+n.textContent.length,t<=e&&s>=e)return{node:n,offset:e-t};t=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yh(n)}}function zp(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?zp(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Wp(){for(var t=window,e=ho();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ho(t.document)}return e}function nu(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 yy(t){var e=Wp(),n=t.focusedElem,s=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&zp(n.ownerDocument.documentElement,n)){if(s!==null&&nu(n)){if(e=s.start,t=s.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,i=Math.min(s.start,r);s=s.end===void 0?i:Math.min(s.end,r),!t.extend&&i>s&&(r=s,s=i,i=r),r=xh(n,i);var o=xh(n,s);r&&o&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),i>s?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var xy=Qt&&"documentMode"in document&&11>=document.documentMode,ps=null,Gl=null,br=null,jl=!1;function vh(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jl||ps==null||ps!==ho(s)||(s=ps,"selectionStart"in s&&nu(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),br&&zr(br,s)||(br=s,s=xo(Gl,"onSelect"),0<s.length&&(e=new Jc("onSelect","select",null,e,n),t.push({event:e,listeners:s}),e.target=ps)))}function yi(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var ms={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionend:yi("Transition","TransitionEnd")},wa={},$p={};Qt&&($p=document.createElement("div").style,"AnimationEvent"in window||(delete ms.animationend.animation,delete ms.animationiteration.animation,delete ms.animationstart.animation),"TransitionEvent"in window||delete ms.transitionend.transition);function Vo(t){if(wa[t])return wa[t];if(!ms[t])return t;var e=ms[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in $p)return wa[t]=e[n];return t}var Up=Vo("animationend"),Hp=Vo("animationiteration"),Vp=Vo("animationstart"),Xp=Vo("transitionend"),Yp=new Map,wh="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 Tn(t,e){Yp.set(t,e),ns(e,[t])}for(var Sa=0;Sa<wh.length;Sa++){var ba=wh[Sa],vy=ba.toLowerCase(),wy=ba[0].toUpperCase()+ba.slice(1);Tn(vy,"on"+wy)}Tn(Up,"onAnimationEnd");Tn(Hp,"onAnimationIteration");Tn(Vp,"onAnimationStart");Tn("dblclick","onDoubleClick");Tn("focusin","onFocus");Tn("focusout","onBlur");Tn(Xp,"onTransitionEnd");Is("onMouseEnter",["mouseout","mouseover"]);Is("onMouseLeave",["mouseout","mouseover"]);Is("onPointerEnter",["pointerout","pointerover"]);Is("onPointerLeave",["pointerout","pointerover"]);ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ns("onBeforeInput",["compositionend","keypress","textInput","paste"]);ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mr="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(" "),Sy=new Set("cancel close invalid load scroll toggle".split(" ").concat(mr));function Sh(t,e,n){var s=t.type||"unknown-event";t.currentTarget=n,v_(s,e,void 0,t),t.currentTarget=null}function qp(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var s=t[n],r=s.event;s=s.listeners;e:{var i=void 0;if(e)for(var o=s.length-1;0<=o;o--){var a=s[o],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&r.isPropagationStopped())break e;Sh(r,a,u),i=c}else for(o=0;o<s.length;o++){if(a=s[o],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&r.isPropagationStopped())break e;Sh(r,a,u),i=c}}}if(po)throw t=Ol,po=!1,Ol=null,t}function ae(t,e){var n=e[Hl];n===void 0&&(n=e[Hl]=new Set);var s=t+"__bubble";n.has(s)||(Kp(e,t,2,!1),n.add(s))}function ka(t,e,n){var s=0;e&&(s|=4),Kp(n,t,s,e)}var xi="_reactListening"+Math.random().toString(36).slice(2);function Wr(t){if(!t[xi]){t[xi]=!0,sp.forEach(function(n){n!=="selectionchange"&&(Sy.has(n)||ka(n,!1,t),ka(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[xi]||(e[xi]=!0,ka("selectionchange",!1,e))}}function Kp(t,e,n,s){switch(Lp(e)){case 1:var r=B_;break;case 4:r=D_;break;default:r=Qc}n=r.bind(null,e,n,t),r=void 0,!Fl||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),s?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Ta(t,e,n,s,r){var i=s;if(!(e&1)&&!(e&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var a=s.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;o=o.return}for(;a!==null;){if(o=Un(a),o===null)return;if(c=o.tag,c===5||c===6){s=i=o;continue e}a=a.parentNode}}s=s.return}xp(function(){var u=i,d=Xc(n),l=[];e:{var h=Yp.get(t);if(h!==void 0){var f=Jc,p=t;switch(t){case"keypress":if(Ji(n)===0)break e;case"keydown":case"keyup":f=Z_;break;case"focusin":p="focus",f=ya;break;case"focusout":p="blur",f=ya;break;case"beforeblur":case"afterblur":f=ya;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=uh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=j_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=ty;break;case Up:case Hp:case Vp:f=$_;break;case Xp:f=sy;break;case"scroll":f=N_;break;case"wheel":f=iy;break;case"copy":case"cut":case"paste":f=H_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=dh}var _=(e&4)!==0,y=!_&&t==="scroll",m=_?h!==null?h+"Capture":null:h;_=[];for(var g=u,x;g!==null;){x=g;var v=x.stateNode;if(x.tag===5&&v!==null&&(x=v,m!==null&&(v=Br(g,m),v!=null&&_.push($r(g,v,x)))),y)break;g=g.return}0<_.length&&(h=new f(h,p,null,n,d),l.push({event:h,listeners:_}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",h&&n!==Il&&(p=n.relatedTarget||n.fromElement)&&(Un(p)||p[Zt]))break e;if((f||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,f?(p=n.relatedTarget||n.toElement,f=u,p=p?Un(p):null,p!==null&&(y=ss(p),p!==y||p.tag!==5&&p.tag!==6)&&(p=null)):(f=null,p=u),f!==p)){if(_=uh,v="onMouseLeave",m="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(_=dh,v="onPointerLeave",m="onPointerEnter",g="pointer"),y=f==null?h:gs(f),x=p==null?h:gs(p),h=new _(v,g+"leave",f,n,d),h.target=y,h.relatedTarget=x,v=null,Un(d)===u&&(_=new _(m,g+"enter",p,n,d),_.target=x,_.relatedTarget=y,v=_),y=v,f&&p)t:{for(_=f,m=p,g=0,x=_;x;x=rs(x))g++;for(x=0,v=m;v;v=rs(v))x++;for(;0<g-x;)_=rs(_),g--;for(;0<x-g;)m=rs(m),x--;for(;g--;){if(_===m||m!==null&&_===m.alternate)break t;_=rs(_),m=rs(m)}_=null}else _=null;f!==null&&bh(l,h,f,_,!1),p!==null&&y!==null&&bh(l,y,p,_,!0)}}e:{if(h=u?gs(u):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var S=dy;else if(mh(h))if(Gp)S=gy;else{S=py;var w=fy}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=my);if(S&&(S=S(t,u))){Np(l,S,n,d);break e}w&&w(t,h,u),t==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Ml(h,"number",h.value)}switch(w=u?gs(u):window,t){case"focusin":(mh(w)||w.contentEditable==="true")&&(ps=w,Gl=u,br=null);break;case"focusout":br=Gl=ps=null;break;case"mousedown":jl=!0;break;case"contextmenu":case"mouseup":case"dragend":jl=!1,vh(l,n,d);break;case"selectionchange":if(xy)break;case"keydown":case"keyup":vh(l,n,d)}var b;if(tu)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else fs?Bp(t,n)&&(k="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Op&&n.locale!=="ko"&&(fs||k!=="onCompositionStart"?k==="onCompositionEnd"&&fs&&(b=Fp()):(dn=d,Zc="value"in dn?dn.value:dn.textContent,fs=!0)),w=xo(u,k),0<w.length&&(k=new hh(k,t,null,n,d),l.push({event:k,listeners:w}),b?k.data=b:(b=Dp(n),b!==null&&(k.data=b)))),(b=ay?ly(t,n):cy(t,n))&&(u=xo(u,"onBeforeInput"),0<u.length&&(d=new hh("onBeforeInput","beforeinput",null,n,d),l.push({event:d,listeners:u}),d.data=b))}qp(l,e)})}function $r(t,e,n){return{instance:t,listener:e,currentTarget:n}}function xo(t,e){for(var n=e+"Capture",s=[];t!==null;){var r=t,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Br(t,n),i!=null&&s.unshift($r(t,i,r)),i=Br(t,e),i!=null&&s.push($r(t,i,r))),t=t.return}return s}function rs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function bh(t,e,n,s,r){for(var i=e._reactName,o=[];n!==null&&n!==s;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===s)break;a.tag===5&&u!==null&&(a=u,r?(c=Br(n,i),c!=null&&o.unshift($r(n,c,a))):r||(c=Br(n,i),c!=null&&o.push($r(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var by=/\r\n?/g,ky=/\u0000|\uFFFD/g;function kh(t){return(typeof t=="string"?t:""+t).replace(by,`
39
+ `).replace(ky,"")}function vi(t,e,n){if(e=kh(e),kh(t)!==e&&n)throw Error(I(425))}function vo(){}var zl=null,Wl=null;function $l(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 Ul=typeof setTimeout=="function"?setTimeout:void 0,Ty=typeof clearTimeout=="function"?clearTimeout:void 0,Th=typeof Promise=="function"?Promise:void 0,Cy=typeof queueMicrotask=="function"?queueMicrotask:typeof Th<"u"?function(t){return Th.resolve(null).then(t).catch(My)}:Ul;function My(t){setTimeout(function(){throw t})}function Ca(t,e){var n=e,s=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){t.removeChild(r),Gr(e);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Gr(e)}function yn(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 Ch(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Xs=Math.random().toString(36).slice(2),Ot="__reactFiber$"+Xs,Ur="__reactProps$"+Xs,Zt="__reactContainer$"+Xs,Hl="__reactEvents$"+Xs,Py="__reactListeners$"+Xs,Ay="__reactHandles$"+Xs;function Un(t){var e=t[Ot];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Zt]||n[Ot]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Ch(t);t!==null;){if(n=t[Ot])return n;t=Ch(t)}return e}t=n,n=t.parentNode}return null}function oi(t){return t=t[Ot]||t[Zt],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function gs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(I(33))}function Xo(t){return t[Ur]||null}var Vl=[],_s=-1;function Cn(t){return{current:t}}function le(t){0>_s||(t.current=Vl[_s],Vl[_s]=null,_s--)}function oe(t,e){_s++,Vl[_s]=t.current,t.current=e}var kn={},Ge=Cn(kn),Ke=Cn(!1),Kn=kn;function Ls(t,e){var n=t.type.contextTypes;if(!n)return kn;var s=t.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===e)return s.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=e[i];return s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function Qe(t){return t=t.childContextTypes,t!=null}function wo(){le(Ke),le(Ge)}function Mh(t,e,n){if(Ge.current!==kn)throw Error(I(168));oe(Ge,e),oe(Ke,n)}function Qp(t,e,n){var s=t.stateNode;if(e=e.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in e))throw Error(I(108,f_(t)||"Unknown",r));return fe({},n,s)}function So(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||kn,Kn=Ge.current,oe(Ge,t),oe(Ke,Ke.current),!0}function Ph(t,e,n){var s=t.stateNode;if(!s)throw Error(I(169));n?(t=Qp(t,e,Kn),s.__reactInternalMemoizedMergedChildContext=t,le(Ke),le(Ge),oe(Ge,t)):le(Ke),oe(Ke,n)}var Ut=null,Yo=!1,Ma=!1;function Zp(t){Ut===null?Ut=[t]:Ut.push(t)}function Ey(t){Yo=!0,Zp(t)}function Mn(){if(!Ma&&Ut!==null){Ma=!0;var t=0,e=te;try{var n=Ut;for(te=1;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}Ut=null,Yo=!1}catch(r){throw Ut!==null&&(Ut=Ut.slice(t+1)),bp(Yc,Mn),r}finally{te=e,Ma=!1}}return null}var ys=[],xs=0,bo=null,ko=0,dt=[],ft=0,Qn=null,Vt=1,Xt="";function On(t,e){ys[xs++]=ko,ys[xs++]=bo,bo=t,ko=e}function Jp(t,e,n){dt[ft++]=Vt,dt[ft++]=Xt,dt[ft++]=Qn,Qn=t;var s=Vt;t=Xt;var r=32-Pt(s)-1;s&=~(1<<r),n+=1;var i=32-Pt(e)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,Vt=1<<32-Pt(e)+r|n<<r|s,Xt=i+t}else Vt=1<<i|n<<r|s,Xt=t}function su(t){t.return!==null&&(On(t,1),Jp(t,1,0))}function ru(t){for(;t===bo;)bo=ys[--xs],ys[xs]=null,ko=ys[--xs],ys[xs]=null;for(;t===Qn;)Qn=dt[--ft],dt[ft]=null,Xt=dt[--ft],dt[ft]=null,Vt=dt[--ft],dt[ft]=null}var it=null,rt=null,ce=!1,Ct=null;function em(t,e){var n=pt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Ah(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,it=t,rt=yn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,it=t,rt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Qn!==null?{id:Vt,overflow:Xt}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=pt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,it=t,rt=null,!0):!1;default:return!1}}function Xl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Yl(t){if(ce){var e=rt;if(e){var n=e;if(!Ah(t,e)){if(Xl(t))throw Error(I(418));e=yn(n.nextSibling);var s=it;e&&Ah(t,e)?em(s,n):(t.flags=t.flags&-4097|2,ce=!1,it=t)}}else{if(Xl(t))throw Error(I(418));t.flags=t.flags&-4097|2,ce=!1,it=t}}}function Eh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;it=t}function wi(t){if(t!==it)return!1;if(!ce)return Eh(t),ce=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!$l(t.type,t.memoizedProps)),e&&(e=rt)){if(Xl(t))throw tm(),Error(I(418));for(;e;)em(t,e),e=yn(e.nextSibling)}if(Eh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(I(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){rt=yn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}rt=null}}else rt=it?yn(t.stateNode.nextSibling):null;return!0}function tm(){for(var t=rt;t;)t=yn(t.nextSibling)}function Fs(){rt=it=null,ce=!1}function iu(t){Ct===null?Ct=[t]:Ct.push(t)}var Ry=sn.ReactCurrentBatchConfig;function tr(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(I(309));var s=n.stateNode}if(!s)throw Error(I(147,t));var r=s,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=r.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,t))}return t}function Si(t,e){throw t=Object.prototype.toString.call(e),Error(I(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Rh(t){var e=t._init;return e(t._payload)}function nm(t){function e(m,g){if(t){var x=m.deletions;x===null?(m.deletions=[g],m.flags|=16):x.push(g)}}function n(m,g){if(!t)return null;for(;g!==null;)e(m,g),g=g.sibling;return null}function s(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function r(m,g){return m=Sn(m,g),m.index=0,m.sibling=null,m}function i(m,g,x){return m.index=x,t?(x=m.alternate,x!==null?(x=x.index,x<g?(m.flags|=2,g):x):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function a(m,g,x,v){return g===null||g.tag!==6?(g=Fa(x,m.mode,v),g.return=m,g):(g=r(g,x),g.return=m,g)}function c(m,g,x,v){var S=x.type;return S===ds?d(m,g,x.props.children,v,x.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ln&&Rh(S)===g.type)?(v=r(g,x.props),v.ref=tr(m,g,x),v.return=m,v):(v=oo(x.type,x.key,x.props,null,m.mode,v),v.ref=tr(m,g,x),v.return=m,v)}function u(m,g,x,v){return g===null||g.tag!==4||g.stateNode.containerInfo!==x.containerInfo||g.stateNode.implementation!==x.implementation?(g=Oa(x,m.mode,v),g.return=m,g):(g=r(g,x.children||[]),g.return=m,g)}function d(m,g,x,v,S){return g===null||g.tag!==7?(g=qn(x,m.mode,v,S),g.return=m,g):(g=r(g,x),g.return=m,g)}function l(m,g,x){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Fa(""+g,m.mode,x),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case hi:return x=oo(g.type,g.key,g.props,null,m.mode,x),x.ref=tr(m,null,g),x.return=m,x;case hs:return g=Oa(g,m.mode,x),g.return=m,g;case ln:var v=g._init;return l(m,v(g._payload),x)}if(fr(g)||Ks(g))return g=qn(g,m.mode,x,null),g.return=m,g;Si(m,g)}return null}function h(m,g,x,v){var S=g!==null?g.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:a(m,g,""+x,v);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case hi:return x.key===S?c(m,g,x,v):null;case hs:return x.key===S?u(m,g,x,v):null;case ln:return S=x._init,h(m,g,S(x._payload),v)}if(fr(x)||Ks(x))return S!==null?null:d(m,g,x,v,null);Si(m,x)}return null}function f(m,g,x,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(x)||null,a(g,m,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hi:return m=m.get(v.key===null?x:v.key)||null,c(g,m,v,S);case hs:return m=m.get(v.key===null?x:v.key)||null,u(g,m,v,S);case ln:var w=v._init;return f(m,g,x,w(v._payload),S)}if(fr(v)||Ks(v))return m=m.get(x)||null,d(g,m,v,S,null);Si(g,v)}return null}function p(m,g,x,v){for(var S=null,w=null,b=g,k=g=0,T=null;b!==null&&k<x.length;k++){b.index>k?(T=b,b=null):T=b.sibling;var C=h(m,b,x[k],v);if(C===null){b===null&&(b=T);break}t&&b&&C.alternate===null&&e(m,b),g=i(C,g,k),w===null?S=C:w.sibling=C,w=C,b=T}if(k===x.length)return n(m,b),ce&&On(m,k),S;if(b===null){for(;k<x.length;k++)b=l(m,x[k],v),b!==null&&(g=i(b,g,k),w===null?S=b:w.sibling=b,w=b);return ce&&On(m,k),S}for(b=s(m,b);k<x.length;k++)T=f(b,m,k,x[k],v),T!==null&&(t&&T.alternate!==null&&b.delete(T.key===null?k:T.key),g=i(T,g,k),w===null?S=T:w.sibling=T,w=T);return t&&b.forEach(function(P){return e(m,P)}),ce&&On(m,k),S}function _(m,g,x,v){var S=Ks(x);if(typeof S!="function")throw Error(I(150));if(x=S.call(x),x==null)throw Error(I(151));for(var w=S=null,b=g,k=g=0,T=null,C=x.next();b!==null&&!C.done;k++,C=x.next()){b.index>k?(T=b,b=null):T=b.sibling;var P=h(m,b,C.value,v);if(P===null){b===null&&(b=T);break}t&&b&&P.alternate===null&&e(m,b),g=i(P,g,k),w===null?S=P:w.sibling=P,w=P,b=T}if(C.done)return n(m,b),ce&&On(m,k),S;if(b===null){for(;!C.done;k++,C=x.next())C=l(m,C.value,v),C!==null&&(g=i(C,g,k),w===null?S=C:w.sibling=C,w=C);return ce&&On(m,k),S}for(b=s(m,b);!C.done;k++,C=x.next())C=f(b,m,k,C.value,v),C!==null&&(t&&C.alternate!==null&&b.delete(C.key===null?k:C.key),g=i(C,g,k),w===null?S=C:w.sibling=C,w=C);return t&&b.forEach(function(R){return e(m,R)}),ce&&On(m,k),S}function y(m,g,x,v){if(typeof x=="object"&&x!==null&&x.type===ds&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case hi:e:{for(var S=x.key,w=g;w!==null;){if(w.key===S){if(S=x.type,S===ds){if(w.tag===7){n(m,w.sibling),g=r(w,x.props.children),g.return=m,m=g;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ln&&Rh(S)===w.type){n(m,w.sibling),g=r(w,x.props),g.ref=tr(m,w,x),g.return=m,m=g;break e}n(m,w);break}else e(m,w);w=w.sibling}x.type===ds?(g=qn(x.props.children,m.mode,v,x.key),g.return=m,m=g):(v=oo(x.type,x.key,x.props,null,m.mode,v),v.ref=tr(m,g,x),v.return=m,m=v)}return o(m);case hs:e:{for(w=x.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(m,g.sibling),g=r(g,x.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else e(m,g);g=g.sibling}g=Oa(x,m.mode,v),g.return=m,m=g}return o(m);case ln:return w=x._init,y(m,g,w(x._payload),v)}if(fr(x))return p(m,g,x,v);if(Ks(x))return _(m,g,x,v);Si(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(m,g.sibling),g=r(g,x),g.return=m,m=g):(n(m,g),g=Fa(x,m.mode,v),g.return=m,m=g),o(m)):n(m,g)}return y}var Os=nm(!0),sm=nm(!1),To=Cn(null),Co=null,vs=null,ou=null;function au(){ou=vs=Co=null}function lu(t){var e=To.current;le(To),t._currentValue=e}function ql(t,e,n){for(;t!==null;){var s=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,s!==null&&(s.childLanes|=e)):s!==null&&(s.childLanes&e)!==e&&(s.childLanes|=e),t===n)break;t=t.return}}function Es(t,e){Co=t,ou=vs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(qe=!0),t.firstContext=null)}function yt(t){var e=t._currentValue;if(ou!==t)if(t={context:t,memoizedValue:e,next:null},vs===null){if(Co===null)throw Error(I(308));vs=t,Co.dependencies={lanes:0,firstContext:t}}else vs=vs.next=t;return e}var Hn=null;function cu(t){Hn===null?Hn=[t]:Hn.push(t)}function rm(t,e,n,s){var r=e.interleaved;return r===null?(n.next=n,cu(e)):(n.next=r.next,r.next=n),e.interleaved=n,Jt(t,s)}function Jt(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var cn=!1;function uu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function im(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 Yt(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function xn(t,e,n){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,K&2){var r=s.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),s.pending=e,Jt(t,n)}return r=s.interleaved,r===null?(e.next=e,cu(s)):(e.next=r.next,r.next=e),s.interleaved=e,Jt(t,n)}function eo(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,qc(t,n)}}function Ih(t,e){var n=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?r=i=e:i=i.next=e}else r=i=e;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:s.shared,effects:s.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Mo(t,e,n,s){var r=t.updateQueue;cn=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var c=a,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=c))}if(i!==null){var l=r.baseState;o=0,d=u=c=null,a=i;do{var h=a.lane,f=a.eventTime;if((s&h)===h){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,_=a;switch(h=e,f=n,_.tag){case 1:if(p=_.payload,typeof p=="function"){l=p.call(f,l,h);break e}l=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=_.payload,h=typeof p=="function"?p.call(f,l,h):p,h==null)break e;l=fe({},l,h);break e;case 2:cn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=f,c=l):d=d.next=f,o|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);if(d===null&&(c=l),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else i===null&&(r.shared.lanes=0);Jn|=o,t.lanes=o,t.memoizedState=l}}function Lh(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var s=t[e],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(I(191,r));r.call(s)}}}var ai={},Dt=Cn(ai),Hr=Cn(ai),Vr=Cn(ai);function Vn(t){if(t===ai)throw Error(I(174));return t}function hu(t,e){switch(oe(Vr,e),oe(Hr,t),oe(Dt,ai),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Al(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Al(e,t)}le(Dt),oe(Dt,e)}function Bs(){le(Dt),le(Hr),le(Vr)}function om(t){Vn(Vr.current);var e=Vn(Dt.current),n=Al(e,t.type);e!==n&&(oe(Hr,t),oe(Dt,n))}function du(t){Hr.current===t&&(le(Dt),le(Hr))}var ue=Cn(0);function Po(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 Pa=[];function fu(){for(var t=0;t<Pa.length;t++)Pa[t]._workInProgressVersionPrimary=null;Pa.length=0}var to=sn.ReactCurrentDispatcher,Aa=sn.ReactCurrentBatchConfig,Zn=0,de=null,ke=null,Pe=null,Ao=!1,kr=!1,Xr=0,Iy=0;function Oe(){throw Error(I(321))}function pu(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Et(t[n],e[n]))return!1;return!0}function mu(t,e,n,s,r,i){if(Zn=i,de=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,to.current=t===null||t.memoizedState===null?By:Dy,t=n(s,r),kr){i=0;do{if(kr=!1,Xr=0,25<=i)throw Error(I(301));i+=1,Pe=ke=null,e.updateQueue=null,to.current=Ny,t=n(s,r)}while(kr)}if(to.current=Eo,e=ke!==null&&ke.next!==null,Zn=0,Pe=ke=de=null,Ao=!1,e)throw Error(I(300));return t}function gu(){var t=Xr!==0;return Xr=0,t}function Ft(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?de.memoizedState=Pe=t:Pe=Pe.next=t,Pe}function xt(){if(ke===null){var t=de.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=Pe===null?de.memoizedState:Pe.next;if(e!==null)Pe=e,ke=t;else{if(t===null)throw Error(I(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Pe===null?de.memoizedState=Pe=t:Pe=Pe.next=t}return Pe}function Yr(t,e){return typeof e=="function"?e(t):e}function Ea(t){var e=xt(),n=e.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=t;var s=ke,r=s.baseQueue,i=n.pending;if(i!==null){if(r!==null){var o=r.next;r.next=i.next,i.next=o}s.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,s=s.baseState;var a=o=null,c=null,u=i;do{var d=u.lane;if((Zn&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:t(s,u.action);else{var l={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=l,o=s):c=c.next=l,de.lanes|=d,Jn|=d}u=u.next}while(u!==null&&u!==i);c===null?o=s:c.next=a,Et(s,e.memoizedState)||(qe=!0),e.memoizedState=s,e.baseState=o,e.baseQueue=c,n.lastRenderedState=s}if(t=n.interleaved,t!==null){r=t;do i=r.lane,de.lanes|=i,Jn|=i,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ra(t){var e=xt(),n=e.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=t;var s=n.dispatch,r=n.pending,i=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do i=t(i,o.action),o=o.next;while(o!==r);Et(i,e.memoizedState)||(qe=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,s]}function am(){}function lm(t,e){var n=de,s=xt(),r=e(),i=!Et(s.memoizedState,r);if(i&&(s.memoizedState=r,qe=!0),s=s.queue,_u(hm.bind(null,n,s,t),[t]),s.getSnapshot!==e||i||Pe!==null&&Pe.memoizedState.tag&1){if(n.flags|=2048,qr(9,um.bind(null,n,s,r,e),void 0,null),Ee===null)throw Error(I(349));Zn&30||cm(n,e,r)}return r}function cm(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=de.updateQueue,e===null?(e={lastEffect:null,stores:null},de.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function um(t,e,n,s){e.value=n,e.getSnapshot=s,dm(e)&&fm(t)}function hm(t,e,n){return n(function(){dm(e)&&fm(t)})}function dm(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Et(t,n)}catch{return!0}}function fm(t){var e=Jt(t,1);e!==null&&At(e,t,1,-1)}function Fh(t){var e=Ft();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yr,lastRenderedState:t},e.queue=t,t=t.dispatch=Oy.bind(null,de,t),[e.memoizedState,t]}function qr(t,e,n,s){return t={tag:t,create:e,destroy:n,deps:s,next:null},e=de.updateQueue,e===null?(e={lastEffect:null,stores:null},de.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(s=n.next,n.next=t,t.next=s,e.lastEffect=t)),t}function pm(){return xt().memoizedState}function no(t,e,n,s){var r=Ft();de.flags|=t,r.memoizedState=qr(1|e,n,void 0,s===void 0?null:s)}function qo(t,e,n,s){var r=xt();s=s===void 0?null:s;var i=void 0;if(ke!==null){var o=ke.memoizedState;if(i=o.destroy,s!==null&&pu(s,o.deps)){r.memoizedState=qr(e,n,i,s);return}}de.flags|=t,r.memoizedState=qr(1|e,n,i,s)}function Oh(t,e){return no(8390656,8,t,e)}function _u(t,e){return qo(2048,8,t,e)}function mm(t,e){return qo(4,2,t,e)}function gm(t,e){return qo(4,4,t,e)}function _m(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 ym(t,e,n){return n=n!=null?n.concat([t]):null,qo(4,4,_m.bind(null,e,t),n)}function yu(){}function xm(t,e){var n=xt();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&pu(e,s[1])?s[0]:(n.memoizedState=[t,e],t)}function vm(t,e){var n=xt();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&pu(e,s[1])?s[0]:(t=t(),n.memoizedState=[t,e],t)}function wm(t,e,n){return Zn&21?(Et(n,e)||(n=Cp(),de.lanes|=n,Jn|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,qe=!0),t.memoizedState=n)}function Ly(t,e){var n=te;te=n!==0&&4>n?n:4,t(!0);var s=Aa.transition;Aa.transition={};try{t(!1),e()}finally{te=n,Aa.transition=s}}function Sm(){return xt().memoizedState}function Fy(t,e,n){var s=wn(t);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},bm(t))km(e,n);else if(n=rm(t,e,n,s),n!==null){var r=We();At(n,t,s,r),Tm(n,e,s)}}function Oy(t,e,n){var s=wn(t),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(bm(t))km(e,r);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(r.hasEagerState=!0,r.eagerState=a,Et(a,o)){var c=e.interleaved;c===null?(r.next=r,cu(e)):(r.next=c.next,c.next=r),e.interleaved=r;return}}catch{}finally{}n=rm(t,e,r,s),n!==null&&(r=We(),At(n,t,s,r),Tm(n,e,s))}}function bm(t){var e=t.alternate;return t===de||e!==null&&e===de}function km(t,e){kr=Ao=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Tm(t,e,n){if(n&4194240){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,qc(t,n)}}var Eo={readContext:yt,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useInsertionEffect:Oe,useLayoutEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useMutableSource:Oe,useSyncExternalStore:Oe,useId:Oe,unstable_isNewReconciler:!1},By={readContext:yt,useCallback:function(t,e){return Ft().memoizedState=[t,e===void 0?null:e],t},useContext:yt,useEffect:Oh,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,no(4194308,4,_m.bind(null,e,t),n)},useLayoutEffect:function(t,e){return no(4194308,4,t,e)},useInsertionEffect:function(t,e){return no(4,2,t,e)},useMemo:function(t,e){var n=Ft();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var s=Ft();return e=n!==void 0?n(e):e,s.memoizedState=s.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},s.queue=t,t=t.dispatch=Fy.bind(null,de,t),[s.memoizedState,t]},useRef:function(t){var e=Ft();return t={current:t},e.memoizedState=t},useState:Fh,useDebugValue:yu,useDeferredValue:function(t){return Ft().memoizedState=t},useTransition:function(){var t=Fh(!1),e=t[0];return t=Ly.bind(null,t[1]),Ft().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var s=de,r=Ft();if(ce){if(n===void 0)throw Error(I(407));n=n()}else{if(n=e(),Ee===null)throw Error(I(349));Zn&30||cm(s,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,Oh(hm.bind(null,s,i,t),[t]),s.flags|=2048,qr(9,um.bind(null,s,i,n,e),void 0,null),n},useId:function(){var t=Ft(),e=Ee.identifierPrefix;if(ce){var n=Xt,s=Vt;n=(s&~(1<<32-Pt(s)-1)).toString(32)+n,e=":"+e+"R"+n,n=Xr++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Iy++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Dy={readContext:yt,useCallback:xm,useContext:yt,useEffect:_u,useImperativeHandle:ym,useInsertionEffect:mm,useLayoutEffect:gm,useMemo:vm,useReducer:Ea,useRef:pm,useState:function(){return Ea(Yr)},useDebugValue:yu,useDeferredValue:function(t){var e=xt();return wm(e,ke.memoizedState,t)},useTransition:function(){var t=Ea(Yr)[0],e=xt().memoizedState;return[t,e]},useMutableSource:am,useSyncExternalStore:lm,useId:Sm,unstable_isNewReconciler:!1},Ny={readContext:yt,useCallback:xm,useContext:yt,useEffect:_u,useImperativeHandle:ym,useInsertionEffect:mm,useLayoutEffect:gm,useMemo:vm,useReducer:Ra,useRef:pm,useState:function(){return Ra(Yr)},useDebugValue:yu,useDeferredValue:function(t){var e=xt();return ke===null?e.memoizedState=t:wm(e,ke.memoizedState,t)},useTransition:function(){var t=Ra(Yr)[0],e=xt().memoizedState;return[t,e]},useMutableSource:am,useSyncExternalStore:lm,useId:Sm,unstable_isNewReconciler:!1};function kt(t,e){if(t&&t.defaultProps){e=fe({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Kl(t,e,n,s){e=t.memoizedState,n=n(s,e),n=n==null?e:fe({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Ko={isMounted:function(t){return(t=t._reactInternals)?ss(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var s=We(),r=wn(t),i=Yt(s,r);i.payload=e,n!=null&&(i.callback=n),e=xn(t,i,r),e!==null&&(At(e,t,r,s),eo(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var s=We(),r=wn(t),i=Yt(s,r);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=xn(t,i,r),e!==null&&(At(e,t,r,s),eo(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=We(),s=wn(t),r=Yt(n,s);r.tag=2,e!=null&&(r.callback=e),e=xn(t,r,s),e!==null&&(At(e,t,s,n),eo(e,t,s))}};function Bh(t,e,n,s,r,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,i,o):e.prototype&&e.prototype.isPureReactComponent?!zr(n,s)||!zr(r,i):!0}function Cm(t,e,n){var s=!1,r=kn,i=e.contextType;return typeof i=="object"&&i!==null?i=yt(i):(r=Qe(e)?Kn:Ge.current,s=e.contextTypes,i=(s=s!=null)?Ls(t,r):kn),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Ko,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=i),e}function Dh(t,e,n,s){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,s),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,s),e.state!==t&&Ko.enqueueReplaceState(e,e.state,null)}function Ql(t,e,n,s){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},uu(t);var i=e.contextType;typeof i=="object"&&i!==null?r.context=yt(i):(i=Qe(e)?Kn:Ge.current,r.context=Ls(t,i)),r.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Kl(t,e,i,n),r.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&Ko.enqueueReplaceState(r,r.state,null),Mo(t,n,r,s),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function Ds(t,e){try{var n="",s=e;do n+=d_(s),s=s.return;while(s);var r=n}catch(i){r=`
40
+ Error generating stack: `+i.message+`
41
+ `+i.stack}return{value:t,source:e,stack:r,digest:null}}function Ia(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Zl(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Gy=typeof WeakMap=="function"?WeakMap:Map;function Mm(t,e,n){n=Yt(-1,n),n.tag=3,n.payload={element:null};var s=e.value;return n.callback=function(){Io||(Io=!0,lc=s),Zl(t,e)},n}function Pm(t,e,n){n=Yt(-1,n),n.tag=3;var s=t.type.getDerivedStateFromError;if(typeof s=="function"){var r=e.value;n.payload=function(){return s(r)},n.callback=function(){Zl(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Zl(t,e),typeof s!="function"&&(vn===null?vn=new Set([this]):vn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Nh(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new Gy;var r=new Set;s.set(e,r)}else r=s.get(e),r===void 0&&(r=new Set,s.set(e,r));r.has(n)||(r.add(n),t=Jy.bind(null,t,e,n),e.then(t,t))}function Gh(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 jh(t,e,n,s,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Yt(-1,1),e.tag=2,xn(n,e,1))),n.lanes|=1),t)}var jy=sn.ReactCurrentOwner,qe=!1;function je(t,e,n,s){e.child=t===null?sm(e,null,n,s):Os(e,t.child,n,s)}function zh(t,e,n,s,r){n=n.render;var i=e.ref;return Es(e,r),s=mu(t,e,n,s,i,r),n=gu(),t!==null&&!qe?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,en(t,e,r)):(ce&&n&&su(e),e.flags|=1,je(t,e,s,r),e.child)}function Wh(t,e,n,s,r){if(t===null){var i=n.type;return typeof i=="function"&&!Cu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,Am(t,e,i,s,r)):(t=oo(n.type,null,s,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&r)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:zr,n(o,s)&&t.ref===e.ref)return en(t,e,r)}return e.flags|=1,t=Sn(i,s),t.ref=e.ref,t.return=e,e.child=t}function Am(t,e,n,s,r){if(t!==null){var i=t.memoizedProps;if(zr(i,s)&&t.ref===e.ref)if(qe=!1,e.pendingProps=s=i,(t.lanes&r)!==0)t.flags&131072&&(qe=!0);else return e.lanes=t.lanes,en(t,e,r)}return Jl(t,e,n,s,r)}function Em(t,e,n){var s=e.pendingProps,r=s.children,i=t!==null?t.memoizedState:null;if(s.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(Ss,st),st|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,oe(Ss,st),st|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,oe(Ss,st),st|=s}else i!==null?(s=i.baseLanes|n,e.memoizedState=null):s=n,oe(Ss,st),st|=s;return je(t,e,r,n),e.child}function Rm(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Jl(t,e,n,s,r){var i=Qe(n)?Kn:Ge.current;return i=Ls(e,i),Es(e,r),n=mu(t,e,n,s,i,r),s=gu(),t!==null&&!qe?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,en(t,e,r)):(ce&&s&&su(e),e.flags|=1,je(t,e,n,r),e.child)}function $h(t,e,n,s,r){if(Qe(n)){var i=!0;So(e)}else i=!1;if(Es(e,r),e.stateNode===null)so(t,e),Cm(e,n,s),Ql(e,n,s,r),s=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=yt(u):(u=Qe(n)?Kn:Ge.current,u=Ls(e,u));var d=n.getDerivedStateFromProps,l=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";l||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==s||c!==u)&&Dh(e,o,s,u),cn=!1;var h=e.memoizedState;o.state=h,Mo(e,s,o,r),c=e.memoizedState,a!==s||h!==c||Ke.current||cn?(typeof d=="function"&&(Kl(e,n,d,s),c=e.memoizedState),(a=cn||Bh(e,n,a,s,h,c,u))?(l||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=s,e.memoizedState=c),o.props=s,o.state=c,o.context=u,s=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{o=e.stateNode,im(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:kt(e.type,a),o.props=u,l=e.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=yt(c):(c=Qe(n)?Kn:Ge.current,c=Ls(e,c));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==l||h!==c)&&Dh(e,o,s,c),cn=!1,h=e.memoizedState,o.state=h,Mo(e,s,o,r);var p=e.memoizedState;a!==l||h!==p||Ke.current||cn?(typeof f=="function"&&(Kl(e,n,f,s),p=e.memoizedState),(u=cn||Bh(e,n,u,s,h,p,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,p,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,p,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=p),o.props=s,o.state=p,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),s=!1)}return ec(t,e,n,s,i,r)}function ec(t,e,n,s,r,i){Rm(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return r&&Ph(e,n,!1),en(t,e,i);s=e.stateNode,jy.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=Os(e,t.child,null,i),e.child=Os(e,null,a,i)):je(t,e,a,i),e.memoizedState=s.state,r&&Ph(e,n,!0),e.child}function Im(t){var e=t.stateNode;e.pendingContext?Mh(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Mh(t,e.context,!1),hu(t,e.containerInfo)}function Uh(t,e,n,s,r){return Fs(),iu(r),e.flags|=256,je(t,e,n,s),e.child}var tc={dehydrated:null,treeContext:null,retryLane:0};function nc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Lm(t,e,n){var s=e.pendingProps,r=ue.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(r&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),oe(ue,r&1),t===null)return Yl(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=s.children,t=s.fallback,i?(s=e.mode,i=e.child,o={mode:"hidden",children:o},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jo(o,s,0,null),t=qn(t,s,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=nc(n),e.memoizedState=tc,t):xu(e,o));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return zy(t,e,o,s,a,r,n);if(i){i=s.fallback,o=e.mode,r=t.child,a=r.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&e.child!==r?(s=e.child,s.childLanes=0,s.pendingProps=c,e.deletions=null):(s=Sn(r,c),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=Sn(a,i):(i=qn(i,o,n,null),i.flags|=2),i.return=e,s.return=e,s.sibling=i,e.child=s,s=i,i=e.child,o=t.child.memoizedState,o=o===null?nc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=tc,s}return i=t.child,t=i.sibling,s=Sn(i,{mode:"visible",children:s.children}),!(e.mode&1)&&(s.lanes=n),s.return=e,s.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=s,e.memoizedState=null,s}function xu(t,e){return e=Jo({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function bi(t,e,n,s){return s!==null&&iu(s),Os(e,t.child,null,n),t=xu(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zy(t,e,n,s,r,i,o){if(n)return e.flags&256?(e.flags&=-257,s=Ia(Error(I(422))),bi(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=s.fallback,r=e.mode,s=Jo({mode:"visible",children:s.children},r,0,null),i=qn(i,r,o,null),i.flags|=2,s.return=e,i.return=e,s.sibling=i,e.child=s,e.mode&1&&Os(e,t.child,null,o),e.child.memoizedState=nc(o),e.memoizedState=tc,i);if(!(e.mode&1))return bi(t,e,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(I(419)),s=Ia(i,s,void 0),bi(t,e,o,s)}if(a=(o&t.childLanes)!==0,qe||a){if(s=Ee,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Jt(t,r),At(s,t,r,-1))}return Tu(),s=Ia(Error(I(421))),bi(t,e,o,s)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=ex.bind(null,t),r._reactRetry=e,null):(t=i.treeContext,rt=yn(r.nextSibling),it=e,ce=!0,Ct=null,t!==null&&(dt[ft++]=Vt,dt[ft++]=Xt,dt[ft++]=Qn,Vt=t.id,Xt=t.overflow,Qn=e),e=xu(e,s.children),e.flags|=4096,e)}function Hh(t,e,n){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),ql(t.return,e,n)}function La(t,e,n,s,r){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function Fm(t,e,n){var s=e.pendingProps,r=s.revealOrder,i=s.tail;if(je(t,e,s.children,n),s=ue.current,s&2)s=s&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&&Hh(t,n,e);else if(t.tag===19)Hh(t,n,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}s&=1}if(oe(ue,s),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Po(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),La(e,!1,r,n,i);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Po(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}La(e,!0,n,null,i);break;case"together":La(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function so(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function en(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Jn|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(I(153));if(e.child!==null){for(t=e.child,n=Sn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Sn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Wy(t,e,n){switch(e.tag){case 3:Im(e),Fs();break;case 5:om(e);break;case 1:Qe(e.type)&&So(e);break;case 4:hu(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,r=e.memoizedProps.value;oe(To,s._currentValue),s._currentValue=r;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(oe(ue,ue.current&1),e.flags|=128,null):n&e.child.childLanes?Lm(t,e,n):(oe(ue,ue.current&1),t=en(t,e,n),t!==null?t.sibling:null);oe(ue,ue.current&1);break;case 19:if(s=(n&e.childLanes)!==0,t.flags&128){if(s)return Fm(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),oe(ue,ue.current),s)break;return null;case 22:case 23:return e.lanes=0,Em(t,e,n)}return en(t,e,n)}var Om,sc,Bm,Dm;Om=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sc=function(){};Bm=function(t,e,n,s){var r=t.memoizedProps;if(r!==s){t=e.stateNode,Vn(Dt.current);var i=null;switch(n){case"input":r=Tl(t,r),s=Tl(t,s),i=[];break;case"select":r=fe({},r,{value:void 0}),s=fe({},s,{value:void 0}),i=[];break;case"textarea":r=Pl(t,r),s=Pl(t,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=vo)}El(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fr.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in s){var c=s[u];if(a=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fr.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ae("scroll",t),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Dm=function(t,e,n,s){n!==s&&(e.flags|=4)};function nr(t,e){if(!ce)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Be(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,s=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=s,t.childLanes=n,e}function $y(t,e,n){var s=e.pendingProps;switch(ru(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(e),null;case 1:return Qe(e.type)&&wo(),Be(e),null;case 3:return s=e.stateNode,Bs(),le(Ke),le(Ge),fu(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(wi(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ct!==null&&(hc(Ct),Ct=null))),sc(t,e),Be(e),null;case 5:du(e);var r=Vn(Vr.current);if(n=e.type,t!==null&&e.stateNode!=null)Bm(t,e,n,s,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(I(166));return Be(e),null}if(t=Vn(Dt.current),wi(e)){s=e.stateNode,n=e.type;var i=e.memoizedProps;switch(s[Ot]=e,s[Ur]=i,t=(e.mode&1)!==0,n){case"dialog":ae("cancel",s),ae("close",s);break;case"iframe":case"object":case"embed":ae("load",s);break;case"video":case"audio":for(r=0;r<mr.length;r++)ae(mr[r],s);break;case"source":ae("error",s);break;case"img":case"image":case"link":ae("error",s),ae("load",s);break;case"details":ae("toggle",s);break;case"input":eh(s,i),ae("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},ae("invalid",s);break;case"textarea":nh(s,i),ae("invalid",s)}El(n,i),r=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?s.textContent!==a&&(i.suppressHydrationWarning!==!0&&vi(s.textContent,a,t),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&vi(s.textContent,a,t),r=["children",""+a]):Fr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ae("scroll",s)}switch(n){case"input":di(s),th(s,i,!0);break;case"textarea":di(s),sh(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=vo)}s=r,e.updateQueue=s,s!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=hp(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof s.is=="string"?t=o.createElement(n,{is:s.is}):(t=o.createElement(n),n==="select"&&(o=t,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):t=o.createElementNS(t,n),t[Ot]=e,t[Ur]=s,Om(t,e,!1,!1),e.stateNode=t;e:{switch(o=Rl(n,s),n){case"dialog":ae("cancel",t),ae("close",t),r=s;break;case"iframe":case"object":case"embed":ae("load",t),r=s;break;case"video":case"audio":for(r=0;r<mr.length;r++)ae(mr[r],t);r=s;break;case"source":ae("error",t),r=s;break;case"img":case"image":case"link":ae("error",t),ae("load",t),r=s;break;case"details":ae("toggle",t),r=s;break;case"input":eh(t,s),r=Tl(t,s),ae("invalid",t);break;case"option":r=s;break;case"select":t._wrapperState={wasMultiple:!!s.multiple},r=fe({},s,{value:void 0}),ae("invalid",t);break;case"textarea":nh(t,s),r=Pl(t,s),ae("invalid",t);break;default:r=s}El(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?pp(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dp(t,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Or(t,c):typeof c=="number"&&Or(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fr.hasOwnProperty(i)?c!=null&&i==="onScroll"&&ae("scroll",t):c!=null&&$c(t,i,c,o))}switch(n){case"input":di(t),th(t,s,!1);break;case"textarea":di(t),sh(t);break;case"option":s.value!=null&&t.setAttribute("value",""+bn(s.value));break;case"select":t.multiple=!!s.multiple,i=s.value,i!=null?Cs(t,!!s.multiple,i,!1):s.defaultValue!=null&&Cs(t,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=vo)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Be(e),null;case 6:if(t&&e.stateNode!=null)Dm(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(I(166));if(n=Vn(Vr.current),Vn(Dt.current),wi(e)){if(s=e.stateNode,n=e.memoizedProps,s[Ot]=e,(i=s.nodeValue!==n)&&(t=it,t!==null))switch(t.tag){case 3:vi(s.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&vi(s.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Ot]=e,e.stateNode=s}return Be(e),null;case 13:if(le(ue),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ce&&rt!==null&&e.mode&1&&!(e.flags&128))tm(),Fs(),e.flags|=98560,i=!1;else if(i=wi(e),s!==null&&s.dehydrated!==null){if(t===null){if(!i)throw Error(I(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(I(317));i[Ot]=e}else Fs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Be(e),i=!1}else Ct!==null&&(hc(Ct),Ct=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(s=s!==null,s!==(t!==null&&t.memoizedState!==null)&&s&&(e.child.flags|=8192,e.mode&1&&(t===null||ue.current&1?Te===0&&(Te=3):Tu())),e.updateQueue!==null&&(e.flags|=4),Be(e),null);case 4:return Bs(),sc(t,e),t===null&&Wr(e.stateNode.containerInfo),Be(e),null;case 10:return lu(e.type._context),Be(e),null;case 17:return Qe(e.type)&&wo(),Be(e),null;case 19:if(le(ue),i=e.memoizedState,i===null)return Be(e),null;if(s=(e.flags&128)!==0,o=i.rendering,o===null)if(s)nr(i,!1);else{if(Te!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Po(t),o!==null){for(e.flags|=128,nr(i,!1),s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),e.subtreeFlags=0,s=n,n=e.child;n!==null;)i=n,t=s,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return oe(ue,ue.current&1|2),e.child}t=t.sibling}i.tail!==null&&ve()>Ns&&(e.flags|=128,s=!0,nr(i,!1),e.lanes=4194304)}else{if(!s)if(t=Po(o),t!==null){if(e.flags|=128,s=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),nr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ce)return Be(e),null}else 2*ve()-i.renderingStartTime>Ns&&n!==1073741824&&(e.flags|=128,s=!0,nr(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ve(),e.sibling=null,n=ue.current,oe(ue,s?n&1|2:n&1),e):(Be(e),null);case 22:case 23:return ku(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?st&1073741824&&(Be(e),e.subtreeFlags&6&&(e.flags|=8192)):Be(e),null;case 24:return null;case 25:return null}throw Error(I(156,e.tag))}function Uy(t,e){switch(ru(e),e.tag){case 1:return Qe(e.type)&&wo(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bs(),le(Ke),le(Ge),fu(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return du(e),null;case 13:if(le(ue),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(I(340));Fs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return le(ue),null;case 4:return Bs(),null;case 10:return lu(e.type._context),null;case 22:case 23:return ku(),null;case 24:return null;default:return null}}var ki=!1,De=!1,Hy=typeof WeakSet=="function"?WeakSet:Set,N=null;function ws(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){me(t,e,s)}else n.current=null}function rc(t,e,n){try{n()}catch(s){me(t,e,s)}}var Vh=!1;function Vy(t,e){if(zl=_o,t=Wp(),nu(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,u=0,d=0,l=t,h=null;t:for(;;){for(var f;l!==n||r!==0&&l.nodeType!==3||(a=o+r),l!==i||s!==0&&l.nodeType!==3||(c=o+s),l.nodeType===3&&(o+=l.nodeValue.length),(f=l.firstChild)!==null;)h=l,l=f;for(;;){if(l===t)break t;if(h===n&&++u===r&&(a=o),h===i&&++d===s&&(c=o),(f=l.nextSibling)!==null)break;l=h,h=l.parentNode}l=f}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wl={focusedElem:t,selectionRange:n},_o=!1,N=e;N!==null;)if(e=N,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,N=t;else for(;N!==null;){e=N;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var _=p.memoizedProps,y=p.memoizedState,m=e.stateNode,g=m.getSnapshotBeforeUpdate(e.elementType===e.type?_:kt(e.type,_),y);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(v){me(e,e.return,v)}if(t=e.sibling,t!==null){t.return=e.return,N=t;break}N=e.return}return p=Vh,Vh=!1,p}function Tr(t,e,n){var s=e.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&t)===t){var i=r.destroy;r.destroy=void 0,i!==void 0&&rc(e,n,i)}r=r.next}while(r!==s)}}function Qo(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var s=n.create;n.destroy=s()}n=n.next}while(n!==e)}}function ic(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Nm(t){var e=t.alternate;e!==null&&(t.alternate=null,Nm(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ot],delete e[Ur],delete e[Hl],delete e[Py],delete e[Ay])),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 Gm(t){return t.tag===5||t.tag===3||t.tag===4}function Xh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Gm(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 oc(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=vo));else if(s!==4&&(t=t.child,t!==null))for(oc(t,e,n),t=t.sibling;t!==null;)oc(t,e,n),t=t.sibling}function ac(t,e,n){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(s!==4&&(t=t.child,t!==null))for(ac(t,e,n),t=t.sibling;t!==null;)ac(t,e,n),t=t.sibling}var Re=null,Tt=!1;function on(t,e,n){for(n=n.child;n!==null;)jm(t,e,n),n=n.sibling}function jm(t,e,n){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount($o,n)}catch{}switch(n.tag){case 5:De||ws(n,e);case 6:var s=Re,r=Tt;Re=null,on(t,e,n),Re=s,Tt=r,Re!==null&&(Tt?(t=Re,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Tt?(t=Re,n=n.stateNode,t.nodeType===8?Ca(t.parentNode,n):t.nodeType===1&&Ca(t,n),Gr(t)):Ca(Re,n.stateNode));break;case 4:s=Re,r=Tt,Re=n.stateNode.containerInfo,Tt=!0,on(t,e,n),Re=s,Tt=r;break;case 0:case 11:case 14:case 15:if(!De&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var i=r,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&rc(n,e,o),r=r.next}while(r!==s)}on(t,e,n);break;case 1:if(!De&&(ws(n,e),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){me(n,e,a)}on(t,e,n);break;case 21:on(t,e,n);break;case 22:n.mode&1?(De=(s=De)||n.memoizedState!==null,on(t,e,n),De=s):on(t,e,n);break;default:on(t,e,n)}}function Yh(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Hy),e.forEach(function(s){var r=tx.bind(null,t,s);n.has(s)||(n.add(s),s.then(r,r))})}}function St(t,e){var n=e.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,Tt=!1;break e;case 3:Re=a.stateNode.containerInfo,Tt=!0;break e;case 4:Re=a.stateNode.containerInfo,Tt=!0;break e}a=a.return}if(Re===null)throw Error(I(160));jm(i,o,r),Re=null,Tt=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){me(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)zm(e,t),e=e.sibling}function zm(t,e){var n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(St(e,t),Rt(t),s&4){try{Tr(3,t,t.return),Qo(3,t)}catch(_){me(t,t.return,_)}try{Tr(5,t,t.return)}catch(_){me(t,t.return,_)}}break;case 1:St(e,t),Rt(t),s&512&&n!==null&&ws(n,n.return);break;case 5:if(St(e,t),Rt(t),s&512&&n!==null&&ws(n,n.return),t.flags&32){var r=t.stateNode;try{Or(r,"")}catch(_){me(t,t.return,_)}}if(s&4&&(r=t.stateNode,r!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&cp(r,i),Rl(a,o);var u=Rl(a,i);for(o=0;o<c.length;o+=2){var d=c[o],l=c[o+1];d==="style"?pp(r,l):d==="dangerouslySetInnerHTML"?dp(r,l):d==="children"?Or(r,l):$c(r,d,l,u)}switch(a){case"input":Cl(r,i);break;case"textarea":up(r,i);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var f=i.value;f!=null?Cs(r,!!i.multiple,f,!1):h!==!!i.multiple&&(i.defaultValue!=null?Cs(r,!!i.multiple,i.defaultValue,!0):Cs(r,!!i.multiple,i.multiple?[]:"",!1))}r[Ur]=i}catch(_){me(t,t.return,_)}}break;case 6:if(St(e,t),Rt(t),s&4){if(t.stateNode===null)throw Error(I(162));r=t.stateNode,i=t.memoizedProps;try{r.nodeValue=i}catch(_){me(t,t.return,_)}}break;case 3:if(St(e,t),Rt(t),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Gr(e.containerInfo)}catch(_){me(t,t.return,_)}break;case 4:St(e,t),Rt(t);break;case 13:St(e,t),Rt(t),r=t.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Su=ve())),s&4&&Yh(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(De=(u=De)||d,St(e,t),De=u):St(e,t),Rt(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(N=t,d=t.child;d!==null;){for(l=N=d;N!==null;){switch(h=N,f=h.child,h.tag){case 0:case 11:case 14:case 15:Tr(4,h,h.return);break;case 1:ws(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){s=h,n=h.return;try{e=s,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(_){me(s,n,_)}}break;case 5:ws(h,h.return);break;case 22:if(h.memoizedState!==null){Kh(l);continue}}f!==null?(f.return=h,N=f):Kh(l)}d=d.sibling}e:for(d=null,l=t;;){if(l.tag===5){if(d===null){d=l;try{r=l.stateNode,u?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=l.stateNode,c=l.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=fp("display",o))}catch(_){me(t,t.return,_)}}}else if(l.tag===6){if(d===null)try{l.stateNode.nodeValue=u?"":l.memoizedProps}catch(_){me(t,t.return,_)}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===t)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}}break;case 19:St(e,t),Rt(t),s&4&&Yh(t);break;case 21:break;default:St(e,t),Rt(t)}}function Rt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(Gm(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Or(r,""),s.flags&=-33);var i=Xh(t);ac(t,i,r);break;case 3:case 4:var o=s.stateNode.containerInfo,a=Xh(t);oc(t,a,o);break;default:throw Error(I(161))}}catch(c){me(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Xy(t,e,n){N=t,Wm(t)}function Wm(t,e,n){for(var s=(t.mode&1)!==0;N!==null;){var r=N,i=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||ki;if(!o){var a=r.alternate,c=a!==null&&a.memoizedState!==null||De;a=ki;var u=De;if(ki=o,(De=c)&&!u)for(N=r;N!==null;)o=N,c=o.child,o.tag===22&&o.memoizedState!==null?Qh(r):c!==null?(c.return=o,N=c):Qh(r);for(;i!==null;)N=i,Wm(i),i=i.sibling;N=r,ki=a,De=u}qh(t)}else r.subtreeFlags&8772&&i!==null?(i.return=r,N=i):qh(t)}}function qh(t){for(;N!==null;){var e=N;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:De||Qo(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!De)if(n===null)s.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:kt(e.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Lh(e,i,s);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Lh(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var l=d.dehydrated;l!==null&&Gr(l)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}De||e.flags&512&&ic(e)}catch(h){me(e,e.return,h)}}if(e===t){N=null;break}if(n=e.sibling,n!==null){n.return=e.return,N=n;break}N=e.return}}function Kh(t){for(;N!==null;){var e=N;if(e===t){N=null;break}var n=e.sibling;if(n!==null){n.return=e.return,N=n;break}N=e.return}}function Qh(t){for(;N!==null;){var e=N;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Qo(4,e)}catch(c){me(e,n,c)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var r=e.return;try{s.componentDidMount()}catch(c){me(e,r,c)}}var i=e.return;try{ic(e)}catch(c){me(e,i,c)}break;case 5:var o=e.return;try{ic(e)}catch(c){me(e,o,c)}}}catch(c){me(e,e.return,c)}if(e===t){N=null;break}var a=e.sibling;if(a!==null){a.return=e.return,N=a;break}N=e.return}}var Yy=Math.ceil,Ro=sn.ReactCurrentDispatcher,vu=sn.ReactCurrentOwner,_t=sn.ReactCurrentBatchConfig,K=0,Ee=null,be=null,Le=0,st=0,Ss=Cn(0),Te=0,Kr=null,Jn=0,Zo=0,wu=0,Cr=null,Xe=null,Su=0,Ns=1/0,Wt=null,Io=!1,lc=null,vn=null,Ti=!1,fn=null,Lo=0,Mr=0,cc=null,ro=-1,io=0;function We(){return K&6?ve():ro!==-1?ro:ro=ve()}function wn(t){return t.mode&1?K&2&&Le!==0?Le&-Le:Ry.transition!==null?(io===0&&(io=Cp()),io):(t=te,t!==0||(t=window.event,t=t===void 0?16:Lp(t.type)),t):1}function At(t,e,n,s){if(50<Mr)throw Mr=0,cc=null,Error(I(185));ri(t,n,s),(!(K&2)||t!==Ee)&&(t===Ee&&(!(K&2)&&(Zo|=n),Te===4&&hn(t,Le)),Ze(t,s),n===1&&K===0&&!(e.mode&1)&&(Ns=ve()+500,Yo&&Mn()))}function Ze(t,e){var n=t.callbackNode;R_(t,e);var s=go(t,t===Ee?Le:0);if(s===0)n!==null&&oh(n),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(n!=null&&oh(n),e===1)t.tag===0?Ey(Zh.bind(null,t)):Zp(Zh.bind(null,t)),Cy(function(){!(K&6)&&Mn()}),n=null;else{switch(Mp(s)){case 1:n=Yc;break;case 4:n=kp;break;case 16:n=mo;break;case 536870912:n=Tp;break;default:n=mo}n=Km(n,$m.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function $m(t,e){if(ro=-1,io=0,K&6)throw Error(I(327));var n=t.callbackNode;if(Rs()&&t.callbackNode!==n)return null;var s=go(t,t===Ee?Le:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Fo(t,s);else{e=s;var r=K;K|=2;var i=Hm();(Ee!==t||Le!==e)&&(Wt=null,Ns=ve()+500,Yn(t,e));do try{Qy();break}catch(a){Um(t,a)}while(!0);au(),Ro.current=i,K=r,be!==null?e=0:(Ee=null,Le=0,e=Te)}if(e!==0){if(e===2&&(r=Bl(t),r!==0&&(s=r,e=uc(t,r))),e===1)throw n=Kr,Yn(t,0),hn(t,s),Ze(t,ve()),n;if(e===6)hn(t,s);else{if(r=t.current.alternate,!(s&30)&&!qy(r)&&(e=Fo(t,s),e===2&&(i=Bl(t),i!==0&&(s=i,e=uc(t,i))),e===1))throw n=Kr,Yn(t,0),hn(t,s),Ze(t,ve()),n;switch(t.finishedWork=r,t.finishedLanes=s,e){case 0:case 1:throw Error(I(345));case 2:Bn(t,Xe,Wt);break;case 3:if(hn(t,s),(s&130023424)===s&&(e=Su+500-ve(),10<e)){if(go(t,0)!==0)break;if(r=t.suspendedLanes,(r&s)!==s){We(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=Ul(Bn.bind(null,t,Xe,Wt),e);break}Bn(t,Xe,Wt);break;case 4:if(hn(t,s),(s&4194240)===s)break;for(e=t.eventTimes,r=-1;0<s;){var o=31-Pt(s);i=1<<o,o=e[o],o>r&&(r=o),s&=~i}if(s=r,s=ve()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Yy(s/1960))-s,10<s){t.timeoutHandle=Ul(Bn.bind(null,t,Xe,Wt),s);break}Bn(t,Xe,Wt);break;case 5:Bn(t,Xe,Wt);break;default:throw Error(I(329))}}}return Ze(t,ve()),t.callbackNode===n?$m.bind(null,t):null}function uc(t,e){var n=Cr;return t.current.memoizedState.isDehydrated&&(Yn(t,e).flags|=256),t=Fo(t,e),t!==2&&(e=Xe,Xe=n,e!==null&&hc(e)),t}function hc(t){Xe===null?Xe=t:Xe.push.apply(Xe,t)}function qy(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],i=r.getSnapshot;r=r.value;try{if(!Et(i(),r))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;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 hn(t,e){for(e&=~wu,e&=~Zo,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Pt(e),s=1<<n;t[n]=-1,e&=~s}}function Zh(t){if(K&6)throw Error(I(327));Rs();var e=go(t,0);if(!(e&1))return Ze(t,ve()),null;var n=Fo(t,e);if(t.tag!==0&&n===2){var s=Bl(t);s!==0&&(e=s,n=uc(t,s))}if(n===1)throw n=Kr,Yn(t,0),hn(t,e),Ze(t,ve()),n;if(n===6)throw Error(I(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Bn(t,Xe,Wt),Ze(t,ve()),null}function bu(t,e){var n=K;K|=1;try{return t(e)}finally{K=n,K===0&&(Ns=ve()+500,Yo&&Mn())}}function es(t){fn!==null&&fn.tag===0&&!(K&6)&&Rs();var e=K;K|=1;var n=_t.transition,s=te;try{if(_t.transition=null,te=1,t)return t()}finally{te=s,_t.transition=n,K=e,!(K&6)&&Mn()}}function ku(){st=Ss.current,le(Ss)}function Yn(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Ty(n)),be!==null)for(n=be.return;n!==null;){var s=n;switch(ru(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&wo();break;case 3:Bs(),le(Ke),le(Ge),fu();break;case 5:du(s);break;case 4:Bs();break;case 13:le(ue);break;case 19:le(ue);break;case 10:lu(s.type._context);break;case 22:case 23:ku()}n=n.return}if(Ee=t,be=t=Sn(t.current,null),Le=st=e,Te=0,Kr=null,wu=Zo=Jn=0,Xe=Cr=null,Hn!==null){for(e=0;e<Hn.length;e++)if(n=Hn[e],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,i=n.pending;if(i!==null){var o=i.next;i.next=r,s.next=o}n.pending=s}Hn=null}return t}function Um(t,e){do{var n=be;try{if(au(),to.current=Eo,Ao){for(var s=de.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Ao=!1}if(Zn=0,Pe=ke=de=null,kr=!1,Xr=0,vu.current=null,n===null||n.return===null){Te=1,Kr=e,be=null;break}e:{var i=t,o=n.return,a=n,c=e;if(e=Le,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=a,l=d.tag;if(!(d.mode&1)&&(l===0||l===11||l===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=Gh(o);if(f!==null){f.flags&=-257,jh(f,o,a,i,e),f.mode&1&&Nh(i,u,e),e=f,c=u;var p=e.updateQueue;if(p===null){var _=new Set;_.add(c),e.updateQueue=_}else p.add(c);break e}else{if(!(e&1)){Nh(i,u,e),Tu();break e}c=Error(I(426))}}else if(ce&&a.mode&1){var y=Gh(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),jh(y,o,a,i,e),iu(Ds(c,a));break e}}i=c=Ds(c,a),Te!==4&&(Te=2),Cr===null?Cr=[i]:Cr.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var m=Mm(i,c,e);Ih(i,m);break e;case 1:a=c;var g=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(vn===null||!vn.has(x)))){i.flags|=65536,e&=-e,i.lanes|=e;var v=Pm(i,a,e);Ih(i,v);break e}}i=i.return}while(i!==null)}Xm(n)}catch(S){e=S,be===n&&n!==null&&(be=n=n.return);continue}break}while(!0)}function Hm(){var t=Ro.current;return Ro.current=Eo,t===null?Eo:t}function Tu(){(Te===0||Te===3||Te===2)&&(Te=4),Ee===null||!(Jn&268435455)&&!(Zo&268435455)||hn(Ee,Le)}function Fo(t,e){var n=K;K|=2;var s=Hm();(Ee!==t||Le!==e)&&(Wt=null,Yn(t,e));do try{Ky();break}catch(r){Um(t,r)}while(!0);if(au(),K=n,Ro.current=s,be!==null)throw Error(I(261));return Ee=null,Le=0,Te}function Ky(){for(;be!==null;)Vm(be)}function Qy(){for(;be!==null&&!S_();)Vm(be)}function Vm(t){var e=qm(t.alternate,t,st);t.memoizedProps=t.pendingProps,e===null?Xm(t):be=e,vu.current=null}function Xm(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Uy(n,e),n!==null){n.flags&=32767,be=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Te=6,be=null;return}}else if(n=$y(n,e,st),n!==null){be=n;return}if(e=e.sibling,e!==null){be=e;return}be=e=t}while(e!==null);Te===0&&(Te=5)}function Bn(t,e,n){var s=te,r=_t.transition;try{_t.transition=null,te=1,Zy(t,e,n,s)}finally{_t.transition=r,te=s}return null}function Zy(t,e,n,s){do Rs();while(fn!==null);if(K&6)throw Error(I(327));n=t.finishedWork;var r=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(I(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(I_(t,i),t===Ee&&(be=Ee=null,Le=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ti||(Ti=!0,Km(mo,function(){return Rs(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=_t.transition,_t.transition=null;var o=te;te=1;var a=K;K|=4,vu.current=null,Vy(t,n),zm(n,t),yy(Wl),_o=!!zl,Wl=zl=null,t.current=n,Xy(n),b_(),K=a,te=o,_t.transition=i}else t.current=n;if(Ti&&(Ti=!1,fn=t,Lo=r),i=t.pendingLanes,i===0&&(vn=null),C_(n.stateNode),Ze(t,ve()),e!==null)for(s=t.onRecoverableError,n=0;n<e.length;n++)r=e[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(Io)throw Io=!1,t=lc,lc=null,t;return Lo&1&&t.tag!==0&&Rs(),i=t.pendingLanes,i&1?t===cc?Mr++:(Mr=0,cc=t):Mr=0,Mn(),null}function Rs(){if(fn!==null){var t=Mp(Lo),e=_t.transition,n=te;try{if(_t.transition=null,te=16>t?16:t,fn===null)var s=!1;else{if(t=fn,fn=null,Lo=0,K&6)throw Error(I(331));var r=K;for(K|=4,N=t.current;N!==null;){var i=N,o=i.child;if(N.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(N=u;N!==null;){var d=N;switch(d.tag){case 0:case 11:case 15:Tr(8,d,i)}var l=d.child;if(l!==null)l.return=d,N=l;else for(;N!==null;){d=N;var h=d.sibling,f=d.return;if(Nm(d),d===u){N=null;break}if(h!==null){h.return=f,N=h;break}N=f}}}var p=i.alternate;if(p!==null){var _=p.child;if(_!==null){p.child=null;do{var y=_.sibling;_.sibling=null,_=y}while(_!==null)}}N=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,N=o;else e:for(;N!==null;){if(i=N,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Tr(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,N=m;break e}N=i.return}}var g=t.current;for(N=g;N!==null;){o=N;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,N=x;else e:for(o=g;N!==null;){if(a=N,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Qo(9,a)}}catch(S){me(a,a.return,S)}if(a===o){N=null;break e}var v=a.sibling;if(v!==null){v.return=a.return,N=v;break e}N=a.return}}if(K=r,Mn(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot($o,t)}catch{}s=!0}return s}finally{te=n,_t.transition=e}}return!1}function Jh(t,e,n){e=Ds(n,e),e=Mm(t,e,1),t=xn(t,e,1),e=We(),t!==null&&(ri(t,1,e),Ze(t,e))}function me(t,e,n){if(t.tag===3)Jh(t,t,n);else for(;e!==null;){if(e.tag===3){Jh(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(vn===null||!vn.has(s))){t=Ds(n,t),t=Pm(e,t,1),e=xn(e,t,1),t=We(),e!==null&&(ri(e,1,t),Ze(e,t));break}}e=e.return}}function Jy(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),e=We(),t.pingedLanes|=t.suspendedLanes&n,Ee===t&&(Le&n)===n&&(Te===4||Te===3&&(Le&130023424)===Le&&500>ve()-Su?Yn(t,0):wu|=n),Ze(t,e)}function Ym(t,e){e===0&&(t.mode&1?(e=mi,mi<<=1,!(mi&130023424)&&(mi=4194304)):e=1);var n=We();t=Jt(t,e),t!==null&&(ri(t,e,n),Ze(t,n))}function ex(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Ym(t,n)}function tx(t,e){var n=0;switch(t.tag){case 13:var s=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=t.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(e),Ym(t,n)}var qm;qm=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ke.current)qe=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return qe=!1,Wy(t,e,n);qe=!!(t.flags&131072)}else qe=!1,ce&&e.flags&1048576&&Jp(e,ko,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;so(t,e),t=e.pendingProps;var r=Ls(e,Ge.current);Es(e,n),r=mu(null,e,s,t,r,n);var i=gu();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Qe(s)?(i=!0,So(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,uu(e),r.updater=Ko,e.stateNode=r,r._reactInternals=e,Ql(e,s,t,n),e=ec(null,e,s,!0,i,n)):(e.tag=0,ce&&i&&su(e),je(null,e,r,n),e=e.child),e;case 16:s=e.elementType;e:{switch(so(t,e),t=e.pendingProps,r=s._init,s=r(s._payload),e.type=s,r=e.tag=sx(s),t=kt(s,t),r){case 0:e=Jl(null,e,s,t,n);break e;case 1:e=$h(null,e,s,t,n);break e;case 11:e=zh(null,e,s,t,n);break e;case 14:e=Wh(null,e,s,kt(s.type,t),n);break e}throw Error(I(306,s,""))}return e;case 0:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:kt(s,r),Jl(t,e,s,r,n);case 1:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:kt(s,r),$h(t,e,s,r,n);case 3:e:{if(Im(e),t===null)throw Error(I(387));s=e.pendingProps,i=e.memoizedState,r=i.element,im(t,e),Mo(e,s,null,n);var o=e.memoizedState;if(s=o.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){r=Ds(Error(I(423)),e),e=Uh(t,e,s,n,r);break e}else if(s!==r){r=Ds(Error(I(424)),e),e=Uh(t,e,s,n,r);break e}else for(rt=yn(e.stateNode.containerInfo.firstChild),it=e,ce=!0,Ct=null,n=sm(e,null,s,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fs(),s===r){e=en(t,e,n);break e}je(t,e,s,n)}e=e.child}return e;case 5:return om(e),t===null&&Yl(e),s=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,o=r.children,$l(s,r)?o=null:i!==null&&$l(s,i)&&(e.flags|=32),Rm(t,e),je(t,e,o,n),e.child;case 6:return t===null&&Yl(e),null;case 13:return Lm(t,e,n);case 4:return hu(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=Os(e,null,s,n):je(t,e,s,n),e.child;case 11:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:kt(s,r),zh(t,e,s,r,n);case 7:return je(t,e,e.pendingProps,n),e.child;case 8:return je(t,e,e.pendingProps.children,n),e.child;case 12:return je(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(s=e.type._context,r=e.pendingProps,i=e.memoizedProps,o=r.value,oe(To,s._currentValue),s._currentValue=o,i!==null)if(Et(i.value,o)){if(i.children===r.children&&!Ke.current){e=en(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var c=a.firstContext;c!==null;){if(c.context===s){if(i.tag===1){c=Yt(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),ql(i.return,n,e),a.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(I(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ql(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}je(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,s=e.pendingProps.children,Es(e,n),r=yt(r),s=s(r),e.flags|=1,je(t,e,s,n),e.child;case 14:return s=e.type,r=kt(s,e.pendingProps),r=kt(s.type,r),Wh(t,e,s,r,n);case 15:return Am(t,e,e.type,e.pendingProps,n);case 17:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:kt(s,r),so(t,e),e.tag=1,Qe(s)?(t=!0,So(e)):t=!1,Es(e,n),Cm(e,s,r),Ql(e,s,r,n),ec(null,e,s,!0,t,n);case 19:return Fm(t,e,n);case 22:return Em(t,e,n)}throw Error(I(156,e.tag))};function Km(t,e){return bp(t,e)}function nx(t,e,n,s){this.tag=t,this.key=n,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(t,e,n,s){return new nx(t,e,n,s)}function Cu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function sx(t){if(typeof t=="function")return Cu(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Hc)return 11;if(t===Vc)return 14}return 2}function Sn(t,e){var n=t.alternate;return n===null?(n=pt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function oo(t,e,n,s,r,i){var o=2;if(s=t,typeof t=="function")Cu(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ds:return qn(n.children,r,i,e);case Uc:o=8,r|=8;break;case wl:return t=pt(12,n,e,r|2),t.elementType=wl,t.lanes=i,t;case Sl:return t=pt(13,n,e,r),t.elementType=Sl,t.lanes=i,t;case bl:return t=pt(19,n,e,r),t.elementType=bl,t.lanes=i,t;case op:return Jo(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case rp:o=10;break e;case ip:o=9;break e;case Hc:o=11;break e;case Vc:o=14;break e;case ln:o=16,s=null;break e}throw Error(I(130,t==null?t:typeof t,""))}return e=pt(o,n,e,r),e.elementType=t,e.type=s,e.lanes=i,e}function qn(t,e,n,s){return t=pt(7,t,s,e),t.lanes=n,t}function Jo(t,e,n,s){return t=pt(22,t,s,e),t.elementType=op,t.lanes=n,t.stateNode={isHidden:!1},t}function Fa(t,e,n){return t=pt(6,t,null,e),t.lanes=n,t}function Oa(t,e,n){return e=pt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function rx(t,e,n,s,r){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=ma(0),this.expirationTimes=ma(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ma(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Mu(t,e,n,s,r,i,o,a,c){return t=new rx(t,e,n,a,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=pt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},uu(i),t}function ix(t,e,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hs,key:s==null?null:""+s,children:t,containerInfo:e,implementation:n}}function Qm(t){if(!t)return kn;t=t._reactInternals;e:{if(ss(t)!==t||t.tag!==1)throw Error(I(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Qe(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(I(171))}if(t.tag===1){var n=t.type;if(Qe(n))return Qp(t,n,e)}return e}function Zm(t,e,n,s,r,i,o,a,c){return t=Mu(n,s,!0,t,r,i,o,a,c),t.context=Qm(null),n=t.current,s=We(),r=wn(n),i=Yt(s,r),i.callback=e??null,xn(n,i,r),t.current.lanes=r,ri(t,r,s),Ze(t,s),t}function ea(t,e,n,s){var r=e.current,i=We(),o=wn(r);return n=Qm(n),e.context===null?e.context=n:e.pendingContext=n,e=Yt(i,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=xn(r,e,o),t!==null&&(At(t,r,o,i),eo(t,r,o)),o}function Oo(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 ed(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Pu(t,e){ed(t,e),(t=t.alternate)&&ed(t,e)}function ox(){return null}var Jm=typeof reportError=="function"?reportError:function(t){console.error(t)};function Au(t){this._internalRoot=t}ta.prototype.render=Au.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(I(409));ea(t,e,null,null)};ta.prototype.unmount=Au.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;es(function(){ea(null,t,null,null)}),e[Zt]=null}};function ta(t){this._internalRoot=t}ta.prototype.unstable_scheduleHydration=function(t){if(t){var e=Ep();t={blockedOn:null,target:t,priority:e};for(var n=0;n<un.length&&e!==0&&e<un[n].priority;n++);un.splice(n,0,t),n===0&&Ip(t)}};function Eu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function na(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function td(){}function ax(t,e,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=Oo(o);i.call(u)}}var o=Zm(e,s,t,0,null,!1,!1,"",td);return t._reactRootContainer=o,t[Zt]=o.current,Wr(t.nodeType===8?t.parentNode:t),es(),o}for(;r=t.lastChild;)t.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=Oo(c);a.call(u)}}var c=Mu(t,0,!1,null,null,!1,!1,"",td);return t._reactRootContainer=c,t[Zt]=c.current,Wr(t.nodeType===8?t.parentNode:t),es(function(){ea(e,c,n,s)}),c}function sa(t,e,n,s,r){var i=n._reactRootContainer;if(i){var o=i;if(typeof r=="function"){var a=r;r=function(){var c=Oo(o);a.call(c)}}ea(e,o,t,r)}else o=ax(n,e,t,r,s);return Oo(o)}Pp=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=pr(e.pendingLanes);n!==0&&(qc(e,n|1),Ze(e,ve()),!(K&6)&&(Ns=ve()+500,Mn()))}break;case 13:es(function(){var s=Jt(t,1);if(s!==null){var r=We();At(s,t,1,r)}}),Pu(t,1)}};Kc=function(t){if(t.tag===13){var e=Jt(t,134217728);if(e!==null){var n=We();At(e,t,134217728,n)}Pu(t,134217728)}};Ap=function(t){if(t.tag===13){var e=wn(t),n=Jt(t,e);if(n!==null){var s=We();At(n,t,e,s)}Pu(t,e)}};Ep=function(){return te};Rp=function(t,e){var n=te;try{return te=t,e()}finally{te=n}};Ll=function(t,e,n){switch(e){case"input":if(Cl(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var s=n[e];if(s!==t&&s.form===t.form){var r=Xo(s);if(!r)throw Error(I(90));lp(s),Cl(s,r)}}}break;case"textarea":up(t,n);break;case"select":e=n.value,e!=null&&Cs(t,!!n.multiple,e,!1)}};_p=bu;yp=es;var lx={usingClientEntryPoint:!1,Events:[oi,gs,Xo,mp,gp,bu]},sr={findFiberByHostInstance:Un,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cx={bundleType:sr.bundleType,version:sr.version,rendererPackageName:sr.rendererPackageName,rendererConfig:sr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=wp(t),t===null?null:t.stateNode},findFiberByHostInstance:sr.findFiberByHostInstance||ox,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 Ci=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ci.isDisabled&&Ci.supportsFiber)try{$o=Ci.inject(cx),Bt=Ci}catch{}}ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lx;ct.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Eu(e))throw Error(I(200));return ix(t,e,null,n)};ct.createRoot=function(t,e){if(!Eu(t))throw Error(I(299));var n=!1,s="",r=Jm;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=Mu(t,1,!1,null,null,n,!1,s,r),t[Zt]=e.current,Wr(t.nodeType===8?t.parentNode:t),new Au(e)};ct.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(I(188)):(t=Object.keys(t).join(","),Error(I(268,t)));return t=wp(e),t=t===null?null:t.stateNode,t};ct.flushSync=function(t){return es(t)};ct.hydrate=function(t,e,n){if(!na(e))throw Error(I(200));return sa(null,t,e,!0,n)};ct.hydrateRoot=function(t,e,n){if(!Eu(t))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",o=Jm;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=Zm(e,null,t,1,n??null,r,!1,i,o),t[Zt]=e.current,Wr(t),s)for(t=0;t<s.length;t++)n=s[t],r=n._getVersion,r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r);return new ta(e)};ct.render=function(t,e,n){if(!na(e))throw Error(I(200));return sa(null,t,e,!1,n)};ct.unmountComponentAtNode=function(t){if(!na(t))throw Error(I(40));return t._reactRootContainer?(es(function(){sa(null,null,t,!1,function(){t._reactRootContainer=null,t[Zt]=null})}),!0):!1};ct.unstable_batchedUpdates=bu;ct.unstable_renderSubtreeIntoContainer=function(t,e,n,s){if(!na(n))throw Error(I(200));if(t==null||t._reactInternals===void 0)throw Error(I(38));return sa(t,e,n,!1,s)};ct.version="18.3.1-next-f1338f8080-20240426";function eg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eg)}catch(t){console.error(t)}}eg(),ep.exports=ct;var ux=ep.exports,tg,nd=ux;tg=nd.createRoot,nd.hydrateRoot;class hx{constructor(){this.listeners=new Map}on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n)}off(e,n){var s;(s=this.listeners.get(e))==null||s.delete(n)}emit(e,n){var s;(s=this.listeners.get(e))==null||s.forEach(r=>r(n))}clear(){this.listeners.clear()}}const ie=new hx;class Gt{static process(e,n,s){if(s&&e.hook_event_name==="SessionStart"&&ie.emit("node:created",{sessionId:e.session_id,node:s}),s&&["PostToolUse","PostToolUseFailure"].includes(e.hook_event_name)&&e.tool_name&&ie.emit("tool:used",{sessionId:e.session_id,nodeKey:s.key,tool:e.tool_name,colorHex:s.colorHex,inbound:!1,agentId:null}),e.hook_event_name==="UserPromptSubmit"&&e.prompt){const r=e.prompt.trim().split(/\s+/).filter(o=>o.length>0);r.length>0&&ie.emit("prompt:submitted",{sessionId:e.session_id,words:r,color:"#b0c8f0"})}if(e.hook_event_name==="Stop"&&e.last_assistant_message){const r=e.last_assistant_message.trim().split(/\s+/).filter(i=>i.length>0).slice(0,8);r.length>0&&ie.emit("response:received",{sessionId:e.session_id,words:r,color:"#aab8f0"})}e.hook_event_name==="SessionStart"&&ie.emit("cluster:created",{cluster:n}),e.hook_event_name==="SessionEnd"&&ie.emit("cluster:removed",{sessionId:e.session_id}),e.hook_event_name==="PreCompact"&&ie.emit("compact:pre",{sessionId:e.session_id}),e.hook_event_name==="PostCompact"&&ie.emit("compact:post",{sessionId:e.session_id}),e.hook_event_name==="PermissionRequest"&&ie.emit("permission:request",{sessionId:e.session_id}),e.hook_event_name==="SubagentStart"&&e.agent_id&&ie.emit("subagent:start",{sessionId:e.session_id,agentId:e.agent_id,agentType:e.agent_type||"agent"}),e.hook_event_name==="SubagentStop"&&e.agent_id&&ie.emit("subagent:stop",{sessionId:e.session_id,agentId:e.agent_id}),e.hook_event_name==="SessionEnd"&&ie.emit("session:end",{sessionId:e.session_id}),e.hook_event_name==="Notification"&&s&&ie.emit("notification",{sessionId:e.session_id,nodeKey:s.key,title:e.title||"notification"})}}const ot=[70,120,175,225],Ba=[4,8,18,20],sd=15,dx=2;function Mi(t){const e=t.toLowerCase().replace("claude-","");return e.startsWith("opus")?"opus":e.startsWith("sonnet")?"sonnet":e.startsWith("haiku")?"haiku":"unknown"}const tt={opus:{base:[1,.45,.12],bright:[1,.75,.4],glow:15757344,core:16759654,brightHex:16764040},sonnet:{base:[.25,.5,1],bright:[.5,.75,1],glow:4227327,core:8433919,brightHex:11194623},haiku:{base:[.2,.85,.45],bright:[.5,1,.7],glow:3201136,core:7405488,brightHex:10551240},unknown:{base:[.78,.84,.94],bright:[.94,.96,1],glow:13161968,core:15791615,brightHex:16777215}};function fx(t){let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0)%15-7}const px=100,Pr=6,mx={Read:"#4ade80",Edit:"#60a5fa",Write:"#60a5fa",Bash:"#f59e0b",Grep:"#a78bfa",Glob:"#a78bfa",WebFetch:"#f472b6",Stop:"#888888",Notification:"#34d399"},gx="#555555";function _x(t){const e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),s=parseInt(t.slice(5,7),16),r=Math.round(e*.3+190*.7),i=Math.round(n*.3+190*.7),o=Math.round(s*.3+190*.7);return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function rd(t){return parseInt(t.replace("#",""),16)}const id=[.0015,.001,6e-4,4e-4],Pi=typeof window<"u"?window.innerWidth:1280,Ai=typeof window<"u"?window.innerHeight:800;function yx(t){for(let s=0;s<Ba.length;s++)if(s>=t.ringCounts.length&&(t.ringCounts[s]=0),t.ringCounts[s]<Ba[s])return s;let e=null,n=1/0;for(const[s,r]of t.nodes)r.lastTimestamp<n&&(n=r.lastTimestamp,e=s);if(e){const r=t.nodes.get(e).orbitRing;return t.nodes.delete(e),r>=0&&r<t.ringCounts.length&&(t.ringCounts[r]=Math.max(0,t.ringCounts[r]-1)),t.edges=t.edges.filter(i=>i.fromKey!==e&&i.toKey!==e),r}return Ba.length-1}function xx(t,e){const n=[...t.nodes.values()].filter(d=>d.orbitRing===e),s=n.length;if(s===0||s===1)return;const r=n.sort((d,l)=>{const h=d.targetOrbitAngle??d.orbitAngle,f=l.targetOrbitAngle??l.orbitAngle;return h-f}),i=Math.PI*2/s;let o=0,a=0;for(const d of r){const l=d.targetOrbitAngle??d.orbitAngle;o+=Math.sin(l),a+=Math.cos(l)}const u=Math.atan2(o/s,a/s)-i*(s-1)/2;r.forEach((d,l)=>{const h=u+l*i,f=d.targetOrbitAngle??d.orbitAngle,p=Math.atan2(Math.sin(h-f),Math.cos(h-f));Math.abs(p)>.05&&(d.targetOrbitAngle=h)})}function Da(t){var s;const e=t.tool_name;if(!e)return t.hook_event_name==="Stop"?"session:stop":t.hook_event_name==="Notification"?`notification:${(((s=t.tool_input)==null?void 0:s.message)||"").slice(0,20)}`:(t.hook_event_name==="PermissionRequest",null);const n=t.tool_input;if(["Read","Edit","Write","Glob","Grep"].includes(e)){const r=(n==null?void 0:n.file_path)||(n==null?void 0:n.path)||null;return r?`file:${r}`:null}if(e==="Bash")return`bash:${(n==null?void 0:n.command)||""}`;if(e==="WebFetch")try{return`web:${new URL((n==null?void 0:n.url)||"").hostname}`}catch{return"web:unknown"}return`tool:${e}`}function ng(t){if(t.startsWith("mcp_")){const e=t.split("__");return e[e.length-1].replace(/_/g," ")}return t}function vx(t){var s;const e=t.tool_name,n=t.tool_input;if(["Read","Edit","Write","Glob","Grep"].includes(e||"")){const r=(n==null?void 0:n.file_path)||(n==null?void 0:n.path)||"";return r.split("/").pop()||r}if(e==="Bash")return`$ ${((n==null?void 0:n.command)||"").slice(0,22)}`;if(e==="WebFetch")try{return`↗ ${new URL((n==null?void 0:n.url)||"").hostname}`}catch{return"↗ web"}return t.hook_event_name==="Stop"?"✓ done":t.hook_event_name==="Notification"?(((s=t.tool_input)==null?void 0:s.message)||"notification").slice(0,24):e&&e.startsWith("mcp_")?ng(e).slice(0,20):e||t.hook_event_name||"?"}function od(t,e){var a,c;const n=t.tool_name||t.hook_event_name||"?",s=t.tool_input,r=t.tool_response,i=n.startsWith("mcp_")?ng(n).slice(0,14):n,o=e?` ${e}`:"";if(t.hook_event_name==="PostToolUseFailure"&&t.is_interrupt)return`⏹ interrupted${o}`;if(t.hook_event_name==="PostToolUse"&&r){if(n==="Bash"){const u=r.exitCode??r.exit_code??r.code;if(u!=null)return u===0?`${i} ✓${o}`:`${i} ✗ ${u}${o}`}if(n==="Grep"){const u=r.count??r.numMatches??r.total;if(u!==void 0)return`${i} ${u} hits${o}`}if(n==="Glob"){const u=Array.isArray(r)?r.length:((a=r.files)==null?void 0:a.length)??r.count;if(u!==void 0)return`${i} ${u} files${o}`}}if(s){if(n==="Edit"){const u=s.new_string||"",d=s.old_string||"",l=u.split(`
42
+ `).length,h=d.split(`
43
+ `).length;return l!==h?`${i} +${l} -${h}${o}`:`${i} ${l}L${o}`}if(n==="Write"){const d=(s.content||"").split(`
44
+ `).length;return`${i} ${d}L${o}`}if(n==="Read"){const u=s.limit,d=s.offset;if(d)return`${i} @${d}${o}`;if(u)return`${i} ${u}L${o}`}if(n==="Bash")return`$ ${((c=(s.command||"").split(/\s+/)[0])==null?void 0:c.split("/").pop())||""}${o}`;if(n==="Grep")return`${i} /${(s.pattern||"").toString().slice(0,10)}/${o}`}return i+o}function wx(t){const e=t.tool_name;return["Read","Edit","Write","Glob","Grep"].includes(e||"")?"file":e==="Bash"?"bash":e==="WebFetch"?"web":t.hook_event_name==="Stop"?"stop":t.hook_event_name==="Notification"?"notification":"tool"}function Na(t){const e=Math.max(0,t.ringCounts.length-1);return ot[Math.min(e,ot.length-1)]}function Sx(t,e){const n=(o,a)=>{const c=Na(o),u=Na(a);return(c+u)*2+100};for(let o=0;o<24;o++){const a=(t+o/24)/Math.max(Pr,1)*Math.PI*2,u=(e.length>0?e.reduce((p,_)=>p+Na(_),0)/e.length:ot[0])*4/Math.sin(Math.PI/Math.max(Pr,2)),d=Math.max(u,Math.min(Pi,Ai)*.38),l=Pi/2+Math.cos(a)*d,h=Ai/2+Math.sin(a)*d;if(!e.some(p=>{const _=n(p,{ringCounts:[]});return Math.hypot(p.centerX-l,p.centerY-h)<_}))return{x:l,y:h}}const r=t/Math.max(Pr,1)*Math.PI*2,i=Math.min(Pi,Ai)*.38;return{x:Pi/2+Math.cos(r)*i,y:Ai/2+Math.sin(r)*i}}function bx(){const t=[],e=new Map,n=new Map;function s(){const i=new Map;for(let o=0;o<t.length;o++){const a=t[o],c=Da(a);c&&(i.has(a.session_id)||i.set(a.session_id,new Map),i.get(a.session_id).set(c,o))}for(const[o,a]of e){const c=i.get(o);for(const[u,d]of a.nodes){if(!(c!=null&&c.has(u)))continue;const l=c.get(u),h=t.length-1-l;d.age=a.stopping&&d.age>=80?d.age:h,d.lastEventIndex=l}a.stopping&&a.nodes.size===0&&e.delete(o)}}function r(i){var y,m;if(t.push(i),t.length>px&&t.shift(),!e.has(i.session_id)){if(e.size>=Pr){const L=e.keys().next().value;L!==void 0&&e.delete(L)}const g=e.size,x=i.session_id,v=x.startsWith("unknown-")?`#${x.slice(8,12)}`:x.slice(0,8);let S=null;const w=x.match(/^([a-f0-9-]{36})[-_]sub[-_]/i)||x.match(/^([a-f0-9-]{36})\//i);if(w)S=w[1];else if(x.includes("_sub_")||x.includes("-sub-")){const L=x.indexOf("_sub_")!==-1?x.indexOf("_sub_"):x.indexOf("-sub-");S=x.slice(0,L)}const b=S?e.get(S)??null:null,k=b!==null,T=k?[...e.values()].filter(L=>L.parentSessionId===S).length:0;let C,P=g/Math.max(Pr,1)*Math.PI*2;if(b){const L=T/3*Math.PI*2-Math.PI/4;C={x:b.centerX+Math.cos(L)*480,y:b.centerY+Math.sin(L)*480},P=L}else C=Sx(g,[...e.values()]);const R={sessionId:i.session_id,label:v,centerX:C.x,centerY:C.y,nodes:new Map,edges:[],stopping:!1,lastFileKey:null,parentSessionId:S,ringCounts:[],layoutAngle:P,isChild:k,childIndex:T,compacting:0,compacted:0,promptSnakes:[],agentPositionMap:new Map},F=fx(i.session_id);R.ringSpeeds=id.map((L,J)=>L*(1+(F+(J*2-1))/7*.2)),e.set(i.session_id,R)}const o=e.get(i.session_id);if(o.eventCount=(o.eventCount||0)+1,i.model&&i.model!==o.model&&(o.model=i.model),o.label.length<=8||o.label.startsWith("#")){let g="";if(i.cwd){const x=i.cwd.split("/").filter(Boolean);g=x[x.length-1]||""}if(!g){const x=((y=i.tool_input)==null?void 0:y.file_path)||((m=i.tool_input)==null?void 0:m.path)||"";if(x.includes("/")){const v=x.split("/").filter(Boolean),S=v.lastIndexOf("src");S>0?g=v[S-1]:v.length>=3&&(g=v[v.length-3])}}g&&g.length>1&&(o.label=g)}if(i.hook_event_name==="Stop"){o.stopping=!0;for(const g of o.nodes.values())g.age=Math.max(g.age,80)}if(i.hook_event_name==="PermissionRequest"&&(o.awaitingPermission=!0),(i.hook_event_name==="PostToolUse"||i.hook_event_name==="PreToolUse")&&(o.awaitingPermission=!1),i.hook_event_name==="PreToolUse"&&i.tool_use_id&&n.set(i.tool_use_id,i.timestamp),i.hook_event_name==="SubagentStart"){const g=i.agent_id||`${i.session_id}-sub`,x=`agent:${g}`;if(!o.nodes.has(x)){const v=Math.random()*Math.PI*2;o.nodes.set(x,{key:x,label:i.agent_type||"agent",nodeType:"agent",baseRadius:3,color:rd("#c084fc"),colorHex:"#c084fc",x:o.centerX+Math.cos(v)*32,y:o.centerY+Math.sin(v)*32,vx:0,vy:0,age:0,lastEventIndex:t.length-1,lastTool:null,lastTimestamp:i.timestamp,eventCount:1,awaitingPermission:!1,orbitRing:-1,orbitAngle:v,orbitSpeed:.007,orbitRadius:32,life:1,entry:0,impactType:null,impactTime:0,actionLabel:null,actionFade:0,marks:[]});const S=o.nodes.get(x);o.agentPositionMap.set(g,{x:S.x,y:S.y}),console.log(`[Store] Agent ${g} registered at (${S.x.toFixed(0)}, ${S.y.toFixed(0)})`)}s(),Gt.process(i,o,null);return}if(i.hook_event_name==="SubagentStop"){const g=i.agent_id||`${i.session_id}-sub`,x=`agent:${g}`,v=o.nodes.get(x);v&&(v.life=.08,v.impactType="fade",v.impactTime=1,o.agentPositionMap.delete(g)),s(),Gt.process(i,o,null);return}if(i.hook_event_name==="SessionEnd"){e.delete(i.session_id),Gt.process(i,o,null);return}if(i.hook_event_name==="UserPromptSubmit"){o.coreAct=1,s(),Gt.process(i,o,null);return}if(i.hook_event_name==="ConfigChange"){i.model&&(o.model=i.model),o.coreAct=1,s(),Gt.process(i,o,null);return}if(i.hook_event_name==="SessionStart"){i.model&&(o.model=i.model),i.source&&(o.source=i.source),o.coreAct=1,s(),Gt.process(i,o,null);return}if(i.hook_event_name==="PreCompact"){o.coreAct=1,o.compacting=1,s(),Gt.process(i,o,null);return}if(i.hook_event_name==="PostCompact"){o.coreAct=1,o.compacted=1,o.eventCount=Math.floor((o.eventCount||0)*.25),s(),Gt.process(i,o,null);return}const a=Da(i);if(!a){s();return}const c=mx[i.tool_name||i.hook_event_name]??gx,u=_x(c),d=rd(u),l=wx(i),h=l==="file";let f="";if((i.hook_event_name==="PostToolUse"||i.hook_event_name==="PostToolUseFailure")&&i.tool_use_id){const g=n.get(i.tool_use_id);if(g){const x=i.timestamp-g;f=x<1e3?`${x}ms`:`${(x/1e3).toFixed(1)}s`,n.delete(i.tool_use_id)}}if(o.nodes.has(a)){const g=o.nodes.get(a);if(g.lastTool=i.tool_name||i.hook_event_name||null,g.lastTimestamp=i.timestamp,g.eventCount++,g.colorHex=u,g.color=d,h&&(g.baseRadius=Math.min(8,g.baseRadius+.3)),i.hook_event_name==="PostToolUseFailure")g.impactType="fail",g.impactTime=1,i.is_interrupt?g.actionLabel="⏹ interrupted"+(f?` ${f}`:""):g.actionLabel="✗ error"+(f?` ${f}`:""),g.actionFade=0;else if(i.hook_event_name==="PostToolUse"){const x=i.tool_name||"";["Read","Grep","Glob"].includes(x)?g.impactType="scan":["Edit","Write"].includes(x)?g.impactType="morph":x==="Bash"?g.impactType="spark":g.impactType="scan",g.impactTime=1;const v=od(i,f||void 0);v!==x&&(g.actionLabel=v)}else{const x=i.tool_name||i.hook_event_name||"";["Read","Grep","Glob"].includes(x)?g.impactType="scan":["Edit","Write"].includes(x)?g.impactType="morph":x==="Bash"?g.impactType="spark":x==="Notification"?g.impactType="ping":x==="Stop"?g.impactType="fade":g.impactType="scan",g.impactTime=1,g.actionLabel=od(i),g.actionFade=i.hook_event_name==="Stop"||i.hook_event_name==="Notification"?1:0}}else{const g=yx(o);o.ringCounts[g]++;const x=o.ringSpeeds,v=x?x[g]:id[g],S=ot[g],w=[...o.nodes.values()].filter(k=>k.orbitRing===g);let b=Math.random()*Math.PI*2;if(w.length>0){const k=w.map(P=>P.targetOrbitAngle??P.orbitAngle).sort((P,R)=>P-R);let T=0,C=0;for(let P=0;P<k.length;P++){const F=(P+1<k.length?k[P+1]:k[0]+Math.PI*2)-k[P];F>T&&(T=F,C=k[P]+F/2)}b=C}if(o.nodes.set(a,{key:a,label:vx(i),nodeType:l,baseRadius:h?2.5+Math.min(9,1)*.45:4,color:d,colorHex:u,x:o.centerX+Math.cos(b)*S,y:o.centerY+Math.sin(b)*S,vx:0,vy:0,age:0,lastEventIndex:t.length-1,lastTool:i.tool_name||i.hook_event_name||null,lastTimestamp:i.timestamp,eventCount:1,awaitingPermission:!1,orbitRing:g,orbitAngle:b,orbitSpeed:v,orbitRadius:S,life:1,entry:0,impactType:null,impactTime:0,actionLabel:null,actionFade:0,marks:[]}),xx(o,g),i.hook_event_name==="PostToolUseFailure"){const k=o.nodes.get(a);k.impactType="fail",k.impactTime=1,i.is_interrupt?k.actionLabel="⏹ interrupted"+(f?` ${f}`:""):k.actionLabel="✗ error"+(f?` ${f}`:""),k.actionFade=0}else if(i.hook_event_name==="Stop"||i.hook_event_name==="Notification"){const k=o.nodes.get(a);k.actionLabel=i.tool_name||i.hook_event_name,k.actionFade=1}}a&&h&&(o.lastFileKey&&o.lastFileKey!==a&&o.nodes.has(o.lastFileKey)&&(o.edges.some(x=>x.fromKey===o.lastFileKey&&x.toKey===a)||o.edges.push({fromKey:o.lastFileKey,toKey:a,color:d,colorHex:u,age:0})),o.lastFileKey=a),s();const p=Da(i),_=p?o.nodes.get(p)??null:null;Gt.process(i,o,_)}return{addEvent:r,getBuffer:()=>[...t],getSessions:()=>e}}const kx="modulepreload",Tx=function(t){return"/"+t},ad={},Ar=function(e,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Tx(c),c in ad)return;ad[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const l=document.createElement("link");if(l.rel=u?"stylesheet":kx,u||(l.as="script"),l.crossOrigin="",l.href=c,a&&l.setAttribute("nonce",a),document.head.appendChild(l),u)return new Promise((h,f)=>{l.addEventListener("load",h),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};var V=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(V||{});const dc=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},Ei=(t,e)=>dc(t).priority??e,Se={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(dc).forEach(e=>{e.type.forEach(n=>{var s,r;return(r=(s=this._removeHandlers)[n])==null?void 0:r.call(s,e)})}),this},add(...t){return t.map(dc).forEach(e=>{e.type.forEach(n=>{var i,o;const s=this._addHandlers,r=this._queue;s[n]?(o=s[n])==null||o.call(s,e):(r[n]=r[n]||[],(i=r[n])==null||i.push(e))})}),this},handle(t,e,n){var o;const s=this._addHandlers,r=this._removeHandlers;if(s[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);s[t]=e,r[t]=n;const i=this._queue;return i[t]&&((o=i[t])==null||o.forEach(a=>e(a)),delete i[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,s=>{e.findIndex(i=>i.name===s.name)>=0||(e.push({name:s.name,value:s.ref}),e.sort((i,o)=>Ei(o.value,n)-Ei(i.value,n)))},s=>{const r=e.findIndex(i=>i.name===s.name);r!==-1&&e.splice(r,1)})},handleByList(t,e,n=-1){return this.handle(t,s=>{e.includes(s.ref)||(e.push(s.ref),e.sort((r,i)=>Ei(i,n)-Ei(r,n)))},s=>{const r=e.indexOf(s.ref);r!==-1&&e.splice(r,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},Cx={extension:{type:V.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Ar(()=>import("./browserAll-wXmCMyRg.js"),__vite__mapDeps([0,1,2]))}},Mx={extension:{type:V.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Ar(()=>import("./webworkerAll-Hyzs6HuJ.js"),__vite__mapDeps([1,2]))}};class Ie{constructor(e,n,s){this._x=n||0,this._y=s||0,this._observer=e}clone(e){return new Ie(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var sg={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function r(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,l,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new r(d,l||c,h),p=n?n+u:u;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],f]:c._events[p].push(f):(c._events[p]=f,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new s:delete c._events[u]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var u=[],d,l;if(this._eventsCount===0)return u;for(l in d=this._events)e.call(d,l)&&u.push(n?l.slice(1):l);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},a.prototype.listeners=function(u){var d=n?n+u:u,l=this._events[d];if(!l)return[];if(l.fn)return[l.fn];for(var h=0,f=l.length,p=new Array(f);h<f;h++)p[h]=l[h].fn;return p},a.prototype.listenerCount=function(u){var d=n?n+u:u,l=this._events[d];return l?l.fn?1:l.length:0},a.prototype.emit=function(u,d,l,h,f,p){var _=n?n+u:u;if(!this._events[_])return!1;var y=this._events[_],m=arguments.length,g,x;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),m){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,l),!0;case 4:return y.fn.call(y.context,d,l,h),!0;case 5:return y.fn.call(y.context,d,l,h,f),!0;case 6:return y.fn.call(y.context,d,l,h,f,p),!0}for(x=1,g=new Array(m-1);x<m;x++)g[x-1]=arguments[x];y.fn.apply(y.context,g)}else{var v=y.length,S;for(x=0;x<v;x++)switch(y[x].once&&this.removeListener(u,y[x].fn,void 0,!0),m){case 1:y[x].fn.call(y[x].context);break;case 2:y[x].fn.call(y[x].context,d);break;case 3:y[x].fn.call(y[x].context,d,l);break;case 4:y[x].fn.call(y[x].context,d,l,h);break;default:if(!g)for(S=1,g=new Array(m-1);S<m;S++)g[S-1]=arguments[S];y[x].fn.apply(y[x].context,g)}}return!0},a.prototype.on=function(u,d,l){return i(this,u,d,l,!1)},a.prototype.once=function(u,d,l){return i(this,u,d,l,!0)},a.prototype.removeListener=function(u,d,l,h){var f=n?n+u:u;if(!this._events[f])return this;if(!d)return o(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!h||p.once)&&(!l||p.context===l)&&o(this,f);else{for(var _=0,y=[],m=p.length;_<m;_++)(p[_].fn!==d||h&&!p[_].once||l&&p[_].context!==l)&&y.push(p[_]);y.length?this._events[f]=y.length===1?y[0]:y:o(this,f)}return this},a.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(sg);var Px=sg.exports;const Nt=Wf(Px),Ax=Math.PI*2,Ex=180/Math.PI,Rx=Math.PI/180;class Ne{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new Ne(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,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Ga.x=0,Ga.y=0,Ga}}const Ga=new Ne;class Y{constructor(e=1,n=0,s=0,r=1,i=0,o=0){this.array=null,this.a=e,this.b=n,this.c=s,this.d=r,this.tx=i,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,n,s,r,i,o){return this.a=e,this.b=n,this.c=s,this.d=r,this.tx=i,this.ty=o,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const s=n||this.array;return e?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(e,n){n=n||new Ne;const s=e.x,r=e.y;return n.x=this.a*s+this.c*r+this.tx,n.y=this.b*s+this.d*r+this.ty,n}applyInverse(e,n){n=n||new Ne;const s=this.a,r=this.b,i=this.c,o=this.d,a=this.tx,c=this.ty,u=1/(s*o+i*-r),d=e.x,l=e.y;return n.x=o*u*d+-i*u*l+(c*i-a*o)*u,n.y=s*u*l+-r*u*d+(-c*s+a*r)*u,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),r=this.a,i=this.c,o=this.tx;return this.a=r*n-this.b*s,this.b=r*s+this.b*n,this.c=i*n-this.d*s,this.d=i*s+this.d*n,this.tx=o*n-this.ty*s,this.ty=o*s+this.ty*n,this}append(e){const n=this.a,s=this.b,r=this.c,i=this.d;return this.a=e.a*n+e.b*r,this.b=e.a*s+e.b*i,this.c=e.c*n+e.d*r,this.d=e.c*s+e.d*i,this.tx=e.tx*n+e.ty*r+this.tx,this.ty=e.tx*s+e.ty*i+this.ty,this}appendFrom(e,n){const s=e.a,r=e.b,i=e.c,o=e.d,a=e.tx,c=e.ty,u=n.a,d=n.b,l=n.c,h=n.d;return this.a=s*u+r*l,this.b=s*d+r*h,this.c=i*u+o*l,this.d=i*d+o*h,this.tx=a*u+c*l+n.tx,this.ty=a*d+c*h+n.ty,this}setTransform(e,n,s,r,i,o,a,c,u){return this.a=Math.cos(a+u)*i,this.b=Math.sin(a+u)*i,this.c=-Math.sin(a-c)*o,this.d=Math.cos(a-c)*o,this.tx=e-(s*this.a+r*this.c),this.ty=n-(s*this.b+r*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const s=this.a,r=this.c;this.a=s*e.a+this.b*e.c,this.b=s*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,s=this.b,r=this.c,i=this.d,o=e.pivot,a=-Math.atan2(-r,i),c=Math.atan2(s,n),u=Math.abs(a+c);return u<1e-5||Math.abs(Ax-u)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=c),e.scale.x=Math.sqrt(n*n+s*s),e.scale.y=Math.sqrt(r*r+i*i),e.position.x=this.tx+(o.x*n+o.y*r),e.position.y=this.ty+(o.x*s+o.y*i),e}invert(){const e=this.a,n=this.b,s=this.c,r=this.d,i=this.tx,o=e*r-n*s;return this.a=r/o,this.b=-n/o,this.c=-s/o,this.d=e/o,this.tx=(s*this.ty-r*i)/o,this.ty=-(e*this.ty-n*i)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Y;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Lx.identity()}static get shared(){return Ix.identity()}}const Ix=new Y,Lx=new Y,Dn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Nn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Gn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],jn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],fc=[],rg=[],Ri=Math.sign;function Fx(){for(let t=0;t<16;t++){const e=[];fc.push(e);for(let n=0;n<16;n++){const s=Ri(Dn[t]*Dn[n]+Gn[t]*Nn[n]),r=Ri(Nn[t]*Dn[n]+jn[t]*Nn[n]),i=Ri(Dn[t]*Gn[n]+Gn[t]*jn[n]),o=Ri(Nn[t]*Gn[n]+jn[t]*jn[n]);for(let a=0;a<16;a++)if(Dn[a]===s&&Nn[a]===r&&Gn[a]===i&&jn[a]===o){e.push(a);break}}}for(let t=0;t<16;t++){const e=new Y;e.set(Dn[t],Nn[t],Gn[t],jn[t],0,0),rg.push(e)}}Fx();const re={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=>Dn[t],uY:t=>Nn[t],vX:t=>Gn[t],vY:t=>jn[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>fc[t][e],sub:(t,e)=>fc[t][re.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?re.S:re.N:Math.abs(e)*2<=Math.abs(t)?t>0?re.E:re.W:e>0?t>0?re.SE:re.SW:t>0?re.NE:re.NW,matrixAppendRotationInv:(t,e,n=0,s=0,r=0,i=0)=>{const o=rg[re.inv(e)],a=o.a,c=o.b,u=o.c,d=o.d,l=n-Math.min(0,a*r,u*i,a*r+u*i),h=s-Math.min(0,c*r,d*i,c*r+d*i),f=t.a,p=t.b,_=t.c,y=t.d;t.a=a*f+c*_,t.b=a*p+c*y,t.c=u*f+d*_,t.d=u*p+d*y,t.tx=l*f+h*_+t.tx,t.ty=l*p+h*y+t.ty},transformRectCoords:(t,e,n,s)=>{const{x:r,y:i,width:o,height:a}=t,{x:c,y:u,width:d,height:l}=e;return n===re.E?(s.set(r+c,i+u,o,a),s):n===re.S?s.set(d-i-a+c,r+u,a,o):n===re.W?s.set(d-r-o+c,l-i-a+u,o,a):n===re.N?s.set(i+c,l-r-o+u,a,o):s.set(r+c,i+u,o,a)}},Ii=[new Ne,new Ne,new Ne,new Ne];class we{constructor(e=0,n=0,s=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(s),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new we(0,0,0,0)}clone(){return new we(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,s,r=.5){const{width:i,height:o}=this;if(i<=0||o<=0)return!1;const a=this.x,c=this.y,u=s*(1-r),d=s-u,l=a-u,h=a+i+u,f=c-u,p=c+o+u,_=a+d,y=a+i-d,m=c+d,g=c+o-d;return e>=l&&e<=h&&n>=f&&n<=p&&!(e>_&&e<y&&n>m&&n<g)}intersects(e,n){if(!n){const k=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=k)return!1;const C=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>C}const s=this.left,r=this.right,i=this.top,o=this.bottom;if(r<=s||o<=i)return!1;const a=Ii[0].set(e.left,e.top),c=Ii[1].set(e.left,e.bottom),u=Ii[2].set(e.right,e.top),d=Ii[3].set(e.right,e.bottom);if(u.x<=a.x||c.y<=a.y)return!1;const l=Math.sign(n.a*n.d-n.b*n.c);if(l===0||(n.apply(a,a),n.apply(c,c),n.apply(u,u),n.apply(d,d),Math.max(a.x,c.x,u.x,d.x)<=s||Math.min(a.x,c.x,u.x,d.x)>=r||Math.max(a.y,c.y,u.y,d.y)<=i||Math.min(a.y,c.y,u.y,d.y)>=o))return!1;const h=l*(c.y-a.y),f=l*(a.x-c.x),p=h*s+f*i,_=h*r+f*i,y=h*s+f*o,m=h*r+f*o;if(Math.max(p,_,y,m)<=h*a.x+f*a.y||Math.min(p,_,y,m)>=h*d.x+f*d.y)return!1;const g=l*(a.y-u.y),x=l*(u.x-a.x),v=g*s+x*i,S=g*r+x*i,w=g*s+x*o,b=g*r+x*o;return!(Math.max(v,S,w,b)<=g*a.x+x*a.y||Math.min(v,S,w,b)>=g*d.x+x*d.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),s=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),i=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(s-n,0),this.y=r,this.height=Math.max(i-r,0),this}ceil(e=1,n=.001){const s=Math.ceil((this.x+this.width-n)*e)/e,r=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=s-this.x,this.height=r-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),s=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),i=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=s-n,this.y=r,this.height=i-r,this}getBounds(e){return e||(e=new we),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,s=e.y,r=e.x+e.width,i=e.y+e.height;return n>=this.x&&n<this.x+this.width&&s>=this.y&&s<this.y+this.height&&r>=this.x&&r<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(e,n,s,r){return this.x=e,this.y=n,this.width=s,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ja={default:-1};function _e(t="default"){return ja[t]===void 0&&(ja[t]=-1),++ja[t]}const ld=new Set,ge="8.0.0",Ox="8.3.4",bs={quiet:!1,noColor:!1},q=(t,e,n=3)=>{if(bs.quiet||ld.has(e))return;let s=new Error().stack;const r=`${e}
45
+ Deprecated since v${t}`,i=typeof console.groupCollapsed=="function"&&!bs.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",r):(s=s.split(`
46
+ `).splice(n).join(`
47
+ `),i?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(s))),ld.add(e)};Object.defineProperties(q,{quiet:{get:()=>bs.quiet,set:t=>{bs.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>bs.noColor,set:t=>{bs.noColor=t},enumerable:!0,configurable:!1}});const ig=()=>{};function Gs(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 cd(t){return!(t&t-1)&&!!t}function og(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const ud=Object.create(null);function Bx(t){const e=ud[t];return e===void 0&&(ud[t]=_e("resource")),e}const ag=class lg extends Nt{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...lg.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){q(ge,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=Bx(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};ag.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let js=ag;const cg=class ug extends Nt{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=_e("textureSource"),this._resourceType="textureSource",this._resourceId=_e("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...ug.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new js(og(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var n,s;this.style!==e&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=e,(s=this._style)==null||s.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var e,n;this._resourceId=_e("resource"),this.emit("change",this),this.emit("unload",this);for(const s in this._gpuData)(n=(e=this._gpuData[s])==null?void 0:e.destroy)==null||n.call(e);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,s){s||(s=this._resolution),e||(e=this.width),n||(n=this.height);const r=Math.round(e*s),i=Math.round(n*s);return this.width=r/s,this.height=i/s,this._resolution=s,this.pixelWidth===r&&this.pixelHeight===i?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=i,this.emit("resize",this),this._resourceId=_e("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=cd(this.pixelWidth)&&cd(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};cg.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let wt=cg;class Ru extends wt{constructor(e){const n=e.resource||new Float32Array(e.width*e.height*4);let s=e.format;s||(n instanceof Float32Array?s="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?s="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?s="rgba16uint":(n instanceof Int8Array,s="bgra8unorm")),super({...e,resource:n,format:s}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}Ru.extension=V.TextureSource;const hd=new Y;class Dx{constructor(e,n){this.mapCoord=new Y,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var n;this.texture!==e&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,n){n===void 0&&(n=e);const s=this.mapCoord;for(let r=0;r<e.length;r+=2){const i=e[r],o=e[r+1];n[r]=i*s.a+o*s.c+s.tx,n[r+1]=i*s.b+o*s.d+s.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const s=e.orig,r=e.trim;r&&(hd.set(s.width/r.width,0,0,s.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(hd));const i=e.source,o=this.uClampFrame,a=this.clampMargin/i._resolution,c=this.clampOffset/i._resolution;return o[0]=(e.frame.x+a+c)/i.width,o[1]=(e.frame.y+a+c)/i.height,o[2]=(e.frame.x+e.frame.width-a+c)/i.width,o[3]=(e.frame.y+e.frame.height-a+c)/i.height,this.uClampOffset[0]=this.clampOffset/i.pixelWidth,this.uClampOffset[1]=this.clampOffset/i.pixelHeight,this.isSimple=e.frame.width===i.width&&e.frame.height===i.height&&e.rotate===0,!0}}class ee extends Nt{constructor({source:e,label:n,frame:s,orig:r,trim:i,defaultAnchor:o,defaultBorders:a,rotate:c,dynamic:u}={}){if(super(),this.uid=_e("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new we,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(e==null?void 0:e.source)??new wt,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:d,height:l}=this._source;this.frame.width=d,this.frame.height=l}this.orig=r||this.frame,this.trim=i,this.rotate=c??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=u||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Dx(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:s,height:r}=this._source,i=n.x/s,o=n.y/r,a=n.width/s,c=n.height/r;let u=this.rotate;if(u){const d=a/2,l=c/2,h=i+d,f=o+l;u=re.add(u,re.NW),e.x0=h+d*re.uX(u),e.y0=f+l*re.uY(u),u=re.add(u,2),e.x1=h+d*re.uX(u),e.y1=f+l*re.uY(u),u=re.add(u,2),e.x2=h+d*re.uX(u),e.y2=f+l*re.uY(u),u=re.add(u,2),e.x3=h+d*re.uX(u),e.y3=f+l*re.uY(u)}else e.x0=i,e.y0=o,e.x1=i+a,e.y1=o,e.x2=i+a,e.y2=o+c,e.x3=i,e.y3=o+c}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return q(ge,"Texture.baseTexture is now Texture.source"),this._source}}ee.EMPTY=new ee({label:"EMPTY",source:new wt({label:"EMPTY"})});ee.EMPTY.destroy=ig;ee.WHITE=new ee({source:new Ru({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});ee.WHITE.destroy=ig;function hg(t,e,n){const{width:s,height:r}=n.orig,i=n.trim;if(i){const o=i.width,a=i.height;t.minX=i.x-e._x*s,t.maxX=t.minX+o,t.minY=i.y-e._y*r,t.maxY=t.minY+a}else t.minX=-e._x*s,t.maxX=t.minX+s,t.minY=-e._y*r,t.maxY=t.minY+r}const dd=new Y;class vt{constructor(e=1/0,n=1/0,s=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=dd,this.minX=e,this.minY=n,this.maxX=s,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new we);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=dd,this}set(e,n,s,r){this.minX=e,this.minY=n,this.maxX=s,this.maxY=r}addFrame(e,n,s,r,i){i||(i=this.matrix);const o=i.a,a=i.b,c=i.c,u=i.d,d=i.tx,l=i.ty;let h=this.minX,f=this.minY,p=this.maxX,_=this.maxY,y=o*e+c*n+d,m=a*e+u*n+l;y<h&&(h=y),m<f&&(f=m),y>p&&(p=y),m>_&&(_=m),y=o*s+c*n+d,m=a*s+u*n+l,y<h&&(h=y),m<f&&(f=m),y>p&&(p=y),m>_&&(_=m),y=o*e+c*r+d,m=a*e+u*r+l,y<h&&(h=y),m<f&&(f=m),y>p&&(p=y),m>_&&(_=m),y=o*s+c*r+d,m=a*s+u*r+l,y<h&&(h=y),m<f&&(f=m),y>p&&(p=y),m>_&&(_=m),this.minX=h,this.minY=f,this.maxX=p,this.maxY=_}addRect(e,n){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,n)}addBounds(e,n){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,n)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const n=this.minX,s=this.minY,r=this.maxX,i=this.maxY,{a:o,b:a,c,d:u,tx:d,ty:l}=e;let h=o*n+c*s+d,f=a*n+u*s+l;this.minX=h,this.minY=f,this.maxX=h,this.maxY=f,h=o*r+c*s+d,f=a*r+u*s+l,this.minX=h<this.minX?h:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=h>this.maxX?h:this.maxX,this.maxY=f>this.maxY?f:this.maxY,h=o*n+c*i+d,f=a*n+u*i+l,this.minX=h<this.minX?h:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=h>this.maxX?h:this.maxX,this.maxY=f>this.maxY?f:this.maxY,h=o*r+c*i+d,f=a*r+u*i+l,this.minX=h<this.minX?h:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=h>this.maxX?h:this.maxX,this.maxY=f>this.maxY?f:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,n,s,r){return this.minX<e&&(this.minX=e),this.maxX>n&&(this.maxX=n),this.minY<s&&(this.minY=s),this.maxY>r&&(this.maxY=r),this}pad(e,n=e){return this.minX-=e,this.maxX+=e,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new vt(this.minX,this.minY,this.maxX,this.maxY)}scale(e,n=e){return this.minX*=e,this.minY*=n,this.maxX*=e,this.maxY*=n,this}get x(){return this.minX}set x(e){const n=this.maxX-this.minX;this.minX=e,this.maxX=e+n}get y(){return this.minY}set y(e){const n=this.maxY-this.minY;this.minY=e,this.maxY=e+n}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,n,s,r){let i=this.minX,o=this.minY,a=this.maxX,c=this.maxY;r||(r=this.matrix);const u=r.a,d=r.b,l=r.c,h=r.d,f=r.tx,p=r.ty;for(let _=n;_<s;_+=2){const y=e[_],m=e[_+1],g=u*y+l*m+f,x=d*y+h*m+p;i=g<i?g:i,o=x<o?x:o,a=g>a?g:a,c=x>c?x:c}this.minX=i,this.minY=o,this.maxX=a,this.maxY=c}containsPoint(e,n){return this.minX<=e&&this.minY<=n&&this.maxX>=e&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var Nx={grad:.9,turn:360,rad:360/(2*Math.PI)},jt=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Ae=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},mt=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},dg=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},fd=function(t){return{r:mt(t.r,0,255),g:mt(t.g,0,255),b:mt(t.b,0,255),a:mt(t.a)}},za=function(t){return{r:Ae(t.r),g:Ae(t.g),b:Ae(t.b),a:Ae(t.a,3)}},Gx=/^#([0-9a-f]{3,8})$/i,Li=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},fg=function(t){var e=t.r,n=t.g,s=t.b,r=t.a,i=Math.max(e,n,s),o=i-Math.min(e,n,s),a=o?i===e?(n-s)/o:i===n?2+(s-e)/o:4+(e-n)/o:0;return{h:60*(a<0?a+6:a),s:i?o/i*100:0,v:i/255*100,a:r}},pg=function(t){var e=t.h,n=t.s,s=t.v,r=t.a;e=e/360*6,n/=100,s/=100;var i=Math.floor(e),o=s*(1-n),a=s*(1-(e-i)*n),c=s*(1-(1-e+i)*n),u=i%6;return{r:255*[s,a,o,o,c,s][u],g:255*[c,s,s,a,o,o][u],b:255*[o,o,c,s,s,a][u],a:r}},pd=function(t){return{h:dg(t.h),s:mt(t.s,0,100),l:mt(t.l,0,100),a:mt(t.a)}},md=function(t){return{h:Ae(t.h),s:Ae(t.s),l:Ae(t.l),a:Ae(t.a,3)}},gd=function(t){return pg((n=(e=t).s,{h:e.h,s:(n*=((s=e.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:e.a}));var e,n,s},Er=function(t){return{h:(e=fg(t)).h,s:(r=(200-(n=e.s))*(s=e.v)/100)>0&&r<200?n*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,n,s,r},jx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$x=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pc={string:[[function(t){var e=Gx.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?Ae(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?Ae(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=Wx.exec(t)||$x.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:fd({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=jx.exec(t)||zx.exec(t);if(!e)return null;var n,s,r=pd({h:(n=e[1],s=e[2],s===void 0&&(s="deg"),Number(n)*(Nx[s]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return gd(r)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,s=t.b,r=t.a,i=r===void 0?1:r;return jt(e)&&jt(n)&&jt(s)?fd({r:Number(e),g:Number(n),b:Number(s),a:Number(i)}):null},"rgb"],[function(t){var e=t.h,n=t.s,s=t.l,r=t.a,i=r===void 0?1:r;if(!jt(e)||!jt(n)||!jt(s))return null;var o=pd({h:Number(e),s:Number(n),l:Number(s),a:Number(i)});return gd(o)},"hsl"],[function(t){var e=t.h,n=t.s,s=t.v,r=t.a,i=r===void 0?1:r;if(!jt(e)||!jt(n)||!jt(s))return null;var o=function(a){return{h:dg(a.h),s:mt(a.s,0,100),v:mt(a.v,0,100),a:mt(a.a)}}({h:Number(e),s:Number(n),v:Number(s),a:Number(i)});return pg(o)},"hsv"]]},_d=function(t,e){for(var n=0;n<e.length;n++){var s=e[n][0](t);if(s)return[s,e[n][1]]}return[null,void 0]},Ux=function(t){return typeof t=="string"?_d(t.trim(),pc.string):typeof t=="object"&&t!==null?_d(t,pc.object):[null,void 0]},Wa=function(t,e){var n=Er(t);return{h:n.h,s:mt(n.s+100*e,0,100),l:n.l,a:n.a}},$a=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},yd=function(t,e){var n=Er(t);return{h:n.h,s:n.s,l:mt(n.l+100*e,0,100),a:n.a}},mc=function(){function t(e){this.parsed=Ux(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 Ae($a(this.rgba),2)},t.prototype.isDark=function(){return $a(this.rgba)<.5},t.prototype.isLight=function(){return $a(this.rgba)>=.5},t.prototype.toHex=function(){return e=za(this.rgba),n=e.r,s=e.g,r=e.b,o=(i=e.a)<1?Li(Ae(255*i)):"","#"+Li(n)+Li(s)+Li(r)+o;var e,n,s,r,i,o},t.prototype.toRgb=function(){return za(this.rgba)},t.prototype.toRgbString=function(){return e=za(this.rgba),n=e.r,s=e.g,r=e.b,(i=e.a)<1?"rgba("+n+", "+s+", "+r+", "+i+")":"rgb("+n+", "+s+", "+r+")";var e,n,s,r,i},t.prototype.toHsl=function(){return md(Er(this.rgba))},t.prototype.toHslString=function(){return e=md(Er(this.rgba)),n=e.h,s=e.s,r=e.l,(i=e.a)<1?"hsla("+n+", "+s+"%, "+r+"%, "+i+")":"hsl("+n+", "+s+"%, "+r+"%)";var e,n,s,r,i},t.prototype.toHsv=function(){return e=fg(this.rgba),{h:Ae(e.h),s:Ae(e.s),v:Ae(e.v),a:Ae(e.a,3)};var e},t.prototype.invert=function(){return It({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),It(Wa(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),It(Wa(this.rgba,-e))},t.prototype.grayscale=function(){return It(Wa(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),It(yd(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),It(yd(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"?It({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):Ae(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=Er(this.rgba);return typeof e=="number"?It({h:e,s:n.s,l:n.l,a:n.a}):Ae(n.h)},t.prototype.isEqual=function(e){return this.toHex()===It(e).toHex()},t}(),It=function(t){return t instanceof mc?t:new mc(t)},xd=[],Hx=function(t){t.forEach(function(e){xd.indexOf(e)<0&&(e(mc,pc),xd.push(e))})};function Vx(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in n)s[n[r]]=r;var i={};t.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,u=s[this.toHex()];if(u)return u;if(o!=null&&o.closest){var d=this.toRgb(),l=1/0,h="black";if(!i.length)for(var f in n)i[f]=new t(n[f]).toRgb();for(var p in n){var _=(a=d,c=i[p],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));_<l&&(l=_,h=p)}return h}},e.string.push([function(o){var a=o.toLowerCase(),c=a==="transparent"?"#0000":n[a];return c?new t(c).toRgb():null},"name"])}Hx([Vx]);const zs=class gr{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 gr)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,n){const s=typeof e;if(s!==typeof n)return!1;if(s==="number"||s==="string"||e instanceof Number)return e===n;if(Array.isArray(e)&&Array.isArray(n)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(n))return e.length!==n.length?!1:e.every((i,o)=>i===n[o]);if(e!==null&&n!==null){const i=Object.keys(e),o=Object.keys(n);return i.length!==o.length?!1:i.every(a=>e[a]===n[a])}return e===n}toRgba(){const[e,n,s,r]=this._components;return{r:e,g:n,b:s,a:r}}toRgb(){const[e,n,s]=this._components;return{r:e,g:n,b:s}}toRgbaString(){const[e,n,s]=this.toUint8RgbArray();return`rgba(${e},${n},${s},${this.alpha})`}toUint8RgbArray(e){const[n,s,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(n*255),e[1]=Math.round(s*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[n,s,r,i]=this._components;return e[0]=n,e[1]=s,e[2]=r,e[3]=i,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[n,s,r]=this._components;return e[0]=n,e[1]=s,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,n,s]=this.toUint8RgbArray();return(s<<16)+(n<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[n,s,r,i]=gr._temp.setValue(e)._components;return this._components[0]*=n,this._components[1]*=s,this._components[2]*=r,this._components[3]*=i,this._refreshInt(),this._value=null,this}premultiply(e,n=!0){return n&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,n=!0){if(e===1)return(255<<24)+this._int;if(e===0)return n?0:this._int;let s=this._int>>16&255,r=this._int>>8&255,i=this._int&255;return n&&(s=s*e+.5|0,r=r*e+.5|0,i=i*e+.5|0),(e*255<<24)+(s<<16)+(r<<8)+i}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(e){let n,s,r,i;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const o=e;n=(o>>16&255)/255,s=(o>>8&255)/255,r=(o&255)/255,i=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[n,s,r,i=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[n,s,r,i=255]=e,n/=255,s/=255,r/=255,i/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const a=gr.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`)}const o=It(e);o.isValid()&&({r:n,g:s,b:r,a:i}=o.rgba,n/=255,s/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=s,this._components[2]=r,this._components[3]=i,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,n,s]=this._components;this._int=(e*255<<16)+(n*255<<8)+(s*255|0)}_clamp(e,n=0,s=1){return typeof e=="number"?Math.min(Math.max(e,n),s):(e.forEach((r,i)=>{e[i]=Math.min(Math.max(r,n),s)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof gr||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};zs.shared=new zs;zs._temp=new zs;zs.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ce=zs;const Xx={cullArea:null,cullable:!1,cullableChildren:!0};let Ua=0;const vd=500;function $e(...t){Ua!==vd&&(Ua++,Ua===vd?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}const li={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}};class Yx{constructor(e,n){this._pool=[],this._count=0,this._index=0,this._classType=e,n&&this.prepopulate(n)}prepopulate(e){for(let n=0;n<e;n++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var s;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(s=n.init)==null||s.call(n,e),n}return(e){var n;(n=e.reset)==null||n.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class qx{constructor(){this._poolsByClass=new Map}prepopulate(e,n){this.getPool(e).prepopulate(n)}get(e,n){return this.getPool(e).get(n)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Yx(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(n=>{const s=e[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;e[s]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const Je=new qx;li.register(Je);const Kx={get isCachedAsTexture(){var t;return!!((t=this.renderGroup)!=null&&t.isCachedAsTexture)},cacheAsTexture(t){typeof t=="boolean"&&t===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(t===!0?{}:t))},updateCacheTexture(){var t;(t=this.renderGroup)==null||t.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){q("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};function Qx(t,e,n){const s=t.length;let r;if(e>=s||n===0)return;n=e+n>s?s-e:n;const i=s-n;for(r=e;r<i;++r)t[r]=t[r+n];t.length=i}const Zx={allowChildren:!0,removeChildren(t=0,e){var i;const n=e??this.children.length,s=n-t,r=[];if(s>0&&s<=n){for(let a=n-1;a>=t;a--){const c=this.children[a];c&&(r.push(c),c.parent=null)}Qx(this.children,t,n);const o=this.renderGroup||this.parentRenderGroup;o&&o.removeChildren(r);for(let a=0;a<r.length;++a){const c=r[a];(i=c.parentRenderLayer)==null||i.detach(c),this.emit("childRemoved",c,this,a),r[a].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(s===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||q(ge,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(e<0||e>n.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);const s=t.parent===this;if(t.parent){const i=t.parent.children.indexOf(t);if(s){if(i===e)return t;t.parent.children.splice(i,1)}else t.removeFromParent()}e===n.length?n.push(t):n.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(t),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const n=this.getChildIndex(t),s=this.getChildIndex(e);this.children[n]=e,this.children[s]=t;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)},reparentChild(...t){return t.length===1?this.reparentChildAt(t[0],this.children.length):(t.forEach(e=>this.reparentChildAt(e,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const n=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const s=this.worldTransform.clone();return s.invert(),n.prepend(s),t.setFromMatrix(n),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},Jx={collectRenderables(t,e,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,n):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,n))},collectRenderablesSimple(t,e,n){const s=this.children,r=s.length;for(let i=0;i<r;i++)s[i].collectRenderables(t,e,n)},collectRenderablesWithEffects(t,e,n){const{renderPipes:s}=e;for(let r=0;r<this.effects.length;r++){const i=this.effects[r];s[i.pipe].push(i,this,t)}this.collectRenderablesSimple(t,e,n);for(let r=this.effects.length-1;r>=0;r--){const i=this.effects[r];s[i.pipe].pop(i,this,t)}}};class wd{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class e1{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const s=this._tests[n];if(s.test(e))return Je.get(s.maskClass,e)}return e}returnMaskEffect(e){Je.return(e)}}const gc=new e1;Se.handleByList(V.MaskEffect,gc._effectClasses);const t1={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){this.effects.indexOf(t)===-1&&(this.effects.push(t),this.effects.sort((n,s)=>n.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;(e==null?void 0:e.mask)!==t&&(e&&(this.removeEffect(e),gc.returnMaskEffect(e),this._maskEffect=null),t!=null&&(this._maskEffect=gc.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){var t;return(t=this._maskEffect)==null?void 0:t.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){var i;!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new wd);t=t;const n=(t==null?void 0:t.length)>0,s=((i=e.filters)==null?void 0:i.length)>0,r=n!==s;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),r&&(n?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){var t;return(t=this._filterEffect)==null?void 0:t.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new wd),this._filterEffect.filterArea=t},get filterArea(){var t;return(t=this._filterEffect)==null?void 0:t.filterArea}},n1={label:null,get name(){return q(ge,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){q(ge,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const n=this.children;for(let s=0;s<n.length;s++){const r=n[s];if(r.label===t||t instanceof RegExp&&t.test(r.label))return r}if(e)for(let s=0;s<n.length;s++){const i=n[s].getChildByLabel(t,!0);if(i)return i}return null},getChildrenByLabel(t,e=!1,n=[]){const s=this.children;for(let r=0;r<s.length;r++){const i=s[r];(i.label===t||t instanceof RegExp&&t.test(i.label))&&n.push(i)}if(e)for(let r=0;r<s.length;r++)s[r].getChildrenByLabel(t,!0,n);return n}},ze=Je.getPool(Y),qt=Je.getPool(vt),s1=new Y,r1={getFastGlobalBounds(t,e){e||(e=new vt),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(n.worldTransform),e},_getGlobalBoundsRecursive(t,e,n){let s=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(s=qt.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const o=this.bounds;s.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}const i=this.children;for(let o=0;o<i.length;o++)i[o]._getGlobalBoundsRecursive(t,s,n)}if(r){let i=!1;const o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(i||(i=!0,s.applyMatrix(o.worldTransform)),this.effects[a].addBounds(s,!0));i&&s.applyMatrix(o.worldTransform.copyTo(s1).invert()),e.addBounds(s),qt.return(s)}else this.renderGroup&&(e.addBounds(s,this.relativeGroupTransform),qt.return(s))}};function mg(t,e,n){n.clear();let s,r;return t.parent?e?s=t.parent.worldTransform:(r=ze.get().identity(),s=Iu(t,r)):s=Y.IDENTITY,gg(t,n,s,e),r&&ze.return(r),n.isValid||n.set(0,0,0,0),n}function gg(t,e,n,s){var a,c;if(!t.visible||!t.measurable)return;let r;s?r=t.worldTransform:(t.updateLocalTransform(),r=ze.get(),r.appendFrom(t.localTransform,n));const i=e,o=!!t.effects.length;if(o&&(e=qt.get().clear()),t.boundsArea)e.addRect(t.boundsArea,r);else{const u=t.bounds;u&&!u.isEmpty()&&(e.matrix=r,e.addBounds(u));for(let d=0;d<t.children.length;d++)gg(t.children[d],e,r,s)}if(o){for(let u=0;u<t.effects.length;u++)(c=(a=t.effects[u]).addBounds)==null||c.call(a,e);i.addBounds(e,Y.IDENTITY),qt.return(e)}s||ze.return(r)}function Iu(t,e){const n=t.parent;return n&&(Iu(n,e),n.updateLocalTransform(),e.append(n.localTransform)),e}function _g(t,e){if(t===16777215||!e)return e;if(e===16777215||!t)return t;const n=t>>16&255,s=t>>8&255,r=t&255,i=e>>16&255,o=e>>8&255,a=e&255,c=n*i/255|0,u=s*o/255|0,d=r*a/255|0;return(c<<16)+(u<<8)+d}const Sd=16777215;function bd(t,e){return t===Sd?e:e===Sd?t:_g(t,e)}function ao(t){return((t&255)<<16)+(t&65280)+(t>>16&255)}const i1={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,n=this.parent;for(;n;)e*=n.alpha,n=n.parent;return e},getGlobalTransform(t=new Y,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const n=Iu(this,ze.get().identity());return t.appendFrom(this.localTransform,n),ze.return(n),t},getGlobalTint(t){if(t)return this.renderGroup?ao(this.renderGroup.worldColor):this.parentRenderGroup?ao(bd(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,n=this.parent;for(;n;)e=bd(e,n.localColor),n=n.parent;return ao(e)}};function yg(t,e,n){return e.clear(),n||(n=Y.IDENTITY),xg(t,e,n,t,!0),e.isValid||e.set(0,0,0,0),e}function xg(t,e,n,s,r){var c,u;let i;if(r)i=ze.get(),i=n.copyTo(i);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const d=t.localTransform;i=ze.get(),i.appendFrom(d,n)}const o=e,a=!!t.effects.length;if(a&&(e=qt.get().clear()),t.boundsArea)e.addRect(t.boundsArea,i);else{t.renderPipeId&&(e.matrix=i,e.addBounds(t.bounds));const d=t.children;for(let l=0;l<d.length;l++)xg(d[l],e,i,s,!1)}if(a){for(let d=0;d<t.effects.length;d++)(u=(c=t.effects[d]).addLocalBounds)==null||u.call(c,e,s);o.addBounds(e,Y.IDENTITY),qt.return(e)}ze.return(i)}function vg(t,e){const n=t.children;for(let s=0;s<n.length;s++){const r=n[s],i=r.uid,o=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,a=e.index;(e.data[a]!==i||e.data[a+1]!==o)&&(e.data[e.index]=i,e.data[e.index+1]=o,e.didChange=!0),e.index=a+2,r.children.length&&vg(r,e)}return e.didChange}const o1=new Y,a1={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const n=Math.sign(this.scale.x)||1;e!==0?this.scale.x=t/e*n:this.scale.x=n},_setHeight(t,e){const n=Math.sign(this.scale.y)||1;e!==0?this.scale.y=t/e*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new vt});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),vg(this,t),t.didChange&&yg(this,t.localBounds,o1),t.localBounds},getBounds(t,e){return mg(this,t,e||new vt)}},l1={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},c1={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(u1))}};function u1(t,e){return t._zIndex-e._zIndex}const h1={getGlobalPosition(t=new Ne,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,n=!1){const s=this.getGlobalTransform(ze.get(),n);return e=s.apply(t,e),ze.return(s),e},toLocal(t,e,n,s){e&&(t=e.toGlobal(t,n,s));const r=this.getGlobalTransform(ze.get(),s);return n=r.applyInverse(t,n),ze.return(r),n}};class Lu{constructor(){this.uid=_e("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let d1=0;class f1{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new js(this.textureOptions)}createTexture(e,n,s,r){const i=new wt({...this.textureOptions,width:e,height:n,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new ee({source:i,label:`texturePool_${d1++}`})}getOptimalTexture(e,n,s=1,r,i=!1){let o=Math.ceil(e*s-1e-6),a=Math.ceil(n*s-1e-6);o=Gs(o),a=Gs(a);const c=r?1:0,u=i?1:0,d=(o<<17)+(a<<2)+(u<<1)+c;this._texturePool[d]||(this._texturePool[d]=[]);let l=this._texturePool[d].pop();return l||(l=this.createTexture(o,a,r,i)),l.source._resolution=s,l.source.width=o/s,l.source.height=a/s,l.source.pixelWidth=o,l.source.pixelHeight=a,l.frame.x=0,l.frame.y=0,l.frame.width=e,l.frame.height=n,l.updateUvs(),this._poolKeyHash[l.uid]=d,l}getSameSizeTexture(e,n=!1){const s=e.source;return this.getOptimalTexture(e.width,e.height,s._resolution,n)}returnTexture(e,n=!1){const s=this._poolKeyHash[e.uid];n&&(e.source.style=this.textureStyle),this._texturePool[s].push(e)}clear(e){if(e=e!==!1,e)for(const n in this._texturePool){const s=this._texturePool[n];if(s)for(let r=0;r<s.length;r++)s[r].destroy(!0)}this._texturePool={}}}const ra=new f1;li.register(ra);class p1{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Y,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Lu,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const n=e.children;for(let s=0;s<n.length;s++){const r=n[s];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(ra.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const n=this.childrenToUpdate[e];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const n=this.renderGroupChildren.indexOf(e);n>-1&&this.renderGroupChildren.splice(n,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const n=e.children;for(let s=0;s<n.length;s++)this.addChild(n[s])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const n=e.children;for(let s=0;s<n.length;s++)this.removeChild(n[s])}removeChildren(e){for(let n=0;n<e.length;n++)this.removeChild(e[n])}onChildUpdate(e){let n=this.childrenToUpdate[e.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const n=this.root.children;for(let s=0;s<n.length;s++)this._getChildren(n[s],e);return e}_getChildren(e,n=[]){if(n.push(e),e.renderGroup)return n;const s=e.children;for(let r=0;r<s.length;r++)this._getChildren(s[r],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return this._matrixDirty&1?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Y),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return this._matrixDirty&2?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Y),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(this._matrixDirty&4))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Y),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function m1(t,e,n={}){for(const s in e)!n[s]&&e[s]!==void 0&&(t[s]=e[s])}const Ha=new Ie(null),Fi=new Ie(null),Va=new Ie(null,1,1),Oi=new Ie(null),kd=1,g1=2,Xa=4;class Me extends Nt{constructor(e={}){var n,s;super(),this.uid=_e("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new Y,this.relativeGroupTransform=new Y,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Ie(this,0,0),this._scale=Va,this._pivot=Fi,this._origin=Oi,this._skew=Ha,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],m1(this,e,{children:!0,parent:!0,effects:!0}),(n=e.children)==null||n.forEach(r=>this.addChild(r)),(s=e.parent)==null||s.addChild(this)}static mixin(e){q("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Se.mixin(Me,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||q(ge,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const n=e[0],s=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),s&&(s.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,s&&s.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const n=e[0],s=this.children.indexOf(n);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,s),n.emit("removed",this)),n}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=Je.get(p1,this),this.groupTransform=Y.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),Je.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Y),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*Ex}set angle(e){this.rotation=e*Rx}get pivot(){return this._pivot===Fi&&(this._pivot=new Ie(this,0,0)),this._pivot}set pivot(e){this._pivot===Fi&&(this._pivot=new Ie(this,0,0),this._origin!==Oi&&$e("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===Ha&&(this._skew=new Ie(this,0,0)),this._skew}set skew(e){this._skew===Ha&&(this._skew=new Ie(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===Va&&(this._scale=new Ie(this,1,1)),this._scale}set scale(e){this._scale===Va&&(this._scale=new Ie(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Oi&&(this._origin=new Ie(this,0,0)),this._origin}set origin(e){this._origin===Oi&&(this._origin=new Ie(this,0,0),this._pivot!==Fi&&$e("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const n=this.getLocalBounds().width;this._setWidth(e,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const n=this.getLocalBounds().height;this._setHeight(e,n)}getSize(e){e||(e={});const n=this.getLocalBounds();return e.width=Math.abs(this.scale.x*n.width),e.height=Math.abs(this.scale.y*n.height),e}setSize(e,n){const s=this.getLocalBounds();typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,s.width),n!==void 0&&this._setHeight(n,s.height)}_updateSkew(){const e=this._rotation,n=this._skew;this._cx=Math.cos(e+n._y),this._sx=Math.sin(e+n._y),this._cy=-Math.sin(e-n._x),this._sy=Math.cos(e-n._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const n=this.localTransform,s=this._scale,r=this._pivot,i=this._origin,o=this._position,a=s._x,c=s._y,u=r._x,d=r._y,l=-i._x,h=-i._y;n.a=this._cx*a,n.b=this._sx*a,n.c=this._cy*c,n.d=this._sy*c,n.tx=o._x-(u*n.a+d*n.c)+(l*n.a+h*n.c)-l,n.ty=o._y-(u*n.b+d*n.d)+(l*n.b+h*n.d)-h}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=kd,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const s=Ce.shared.setValue(e??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=kd,this._onUpdate())}get tint(){return ao(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=g1,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const n=e?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Xa,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const n=e?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Xa,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const n=e?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Xa,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var r;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e==null?void 0:e.children)&&n)for(let i=0;i<n.length;++i)n[i].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}Se.mixin(Me,Zx,r1,h1,l1,a1,t1,n1,c1,Xx,Kx,i1,Jx);class Fu extends Me{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new vt(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const n=this.bounds,{x:s,y:r}=e;return s>=n.minX&&s<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,n,s){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);const o=r[this.renderPipeId];o!=null&&o.addRenderable&&o.addRenderable(this,e),this.didViewUpdate=!1;const a=this.children,c=a.length;for(let u=0;u<c;u++)a[u].collectRenderables(e,n,s);r.blendMode.popBlendMode(e)}}class tn extends Fu{constructor(e=ee.EMPTY){e instanceof ee&&(e={texture:e});const{texture:n=ee.EMPTY,anchor:s,roundPixels:r,width:i,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Ie({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,i!==void 0&&(this.width=i),o!==void 0&&(this.height=o)}static from(e,n=!1){return e instanceof ee?new tn(e):new tn(ee.from(e,n))}set texture(e){e||(e=ee.EMPTY);const n=this._texture;n!==e&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return hg(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return q("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,n=this._texture,s=this._bounds,{width:r,height:i}=n.orig;s.minX=-e._x*r,s.maxX=s.minX+r,s.minY=-e._y*i,s.maxY=s.minY+i}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const s=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const _1=new vt;function wg(t,e,n){const s=_1;t.measurable=!0,mg(t,n,s),e.addBoundsMask(s),t.measurable=!1}function Sg(t,e,n){const s=qt.get();t.measurable=!0;const r=ze.get().identity(),i=bg(t,n,r);yg(t,s,i),t.measurable=!1,e.addBoundsMask(s),ze.return(r),qt.return(s)}function bg(t,e,n){return t?(t!==e&&(bg(t.parent,e,n),t.updateLocalTransform(),n.append(t.localTransform)),n):($e("Mask bounds, renderable is not inside the root container"),n)}class kg{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof tn),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,n){this.inverse||wg(this.mask,e,n)}addLocalBounds(e,n){Sg(this.mask,e,n)}containsPoint(e,n){const s=this.mask;return n(s,e)}destroy(){this.reset()}static test(e){return e instanceof tn}}kg.extension=V.MaskEffect;class Tg{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}Tg.extension=V.MaskEffect;class Cg{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,n){wg(this.mask,e,n)}addLocalBounds(e,n){Sg(this.mask,e,n)}containsPoint(e,n){const s=this.mask;return n(s,e)}destroy(){this.reset()}static test(e){return e instanceof Me}}Cg.extension=V.MaskEffect;const y1={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,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")};let Td=y1;const at={get(){return Td},set(t){Td=t}};class Mg extends wt{constructor(e){e.resource||(e.resource=at.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,n=this.height,s=this._resolution){const r=super.resize(e,n,s);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Mg.extension=V.TextureSource;class Bo extends wt{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}Bo.extension=V.TextureSource;var Do=(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))(Do||{});class Ya{constructor(e,n=null,s=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=n,this.priority=s,this._once=r}match(e,n=null){return this._fn===e&&this._context===n}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}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 n=this.next;return this.next=e?null:n,this.previous=null,n}}const Pg=class nt{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 Ya(null,null,1/0),this.deltaMS=1/nt.targetFPMS,this.elapsedMS=1/nt.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,n,s=Do.NORMAL){return this._addListener(new Ya(e,n,s))}addOnce(e,n,s=Do.NORMAL){return this._addListener(new Ya(e,n,s,!0))}_addListener(e){let n=this._head.next,s=this._head;if(!n)e.connect(s);else{for(;n;){if(e.priority>n.priority){e.connect(s);break}s=n,n=n.next}e.previous||e.connect(s)}return this._startIfPossible(),this}remove(e,n){let s=this._head.next;for(;s;)s.match(e,n)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,n=this._head;for(;n=n.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 n;if(e>this.lastTime){if(n=this.elapsedMS=e-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*nt.targetFPMS;const s=this._head;let r=s.next;for(;r;)r=r.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const n=Math.min(Math.max(0,e)/1e3,nt.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!nt._shared){const e=nt._shared=new nt;e.autoStart=!0,e._protected=!0}return nt._shared}static get system(){if(!nt._system){const e=nt._system=new nt;e.autoStart=!0,e._protected=!0}return nt._system}};Pg.targetFPMS=.06;let ks=Pg,qa;async function x1(){return qa??(qa=(async()=>{var o;const e=at.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const n=await new Promise(a=>{const c=document.createElement("video");c.onloadeddata=()=>a(c),c.onerror=()=>a(null),c.autoplay=!1,c.crossOrigin="anonymous",c.preload="auto",c.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",c.load()});if(!n)return"premultiply-alpha-on-upload";const s=e.createTexture();e.bindTexture(e.TEXTURE_2D,s);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,s,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n);const i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(s),(o=e.getExtension("WEBGL_lose_context"))==null||o.loseContext(),i[0]<=i[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),qa}const ia=class Ag extends wt{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...Ag.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=ks.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,n=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await x1(),this._load=new Promise((s,r)=>{this.isValid?s(this):(this._resolve=s,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ks.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ks.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ks.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};ia.extension=V.TextureSource;ia.defaultOptions={...wt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};ia.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let v1=ia;const cs=(t,e,n=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(s=>typeof s=="string"||n?e(s):s):t);class w1{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 n=this._cache.get(e);return n||$e(`[Assets] Asset id ${e} was not found in the Cache`),n}set(e,n){const s=cs(e);let r;for(let c=0;c<this.parsers.length;c++){const u=this.parsers[c];if(u.test(n)){r=u.getCacheableAssets(s,n);break}}const i=new Map(Object.entries(r||{}));r||s.forEach(c=>{i.set(c,n)});const o=[...i.keys()],a={cacheKeys:o,keys:s};s.forEach(c=>{this._cacheMap.set(c,a)}),o.forEach(c=>{const u=r?r[c]:n;this._cache.has(c)&&this._cache.get(c)!==u&&$e("[Cache] already has key:",c),this._cache.set(c,i.get(c))})}remove(e){if(!this._cacheMap.has(e)){$e(`[Assets] Asset id ${e} was not found in the Cache`);return}const n=this._cacheMap.get(e);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const us=new w1,_c=[];Se.handleByList(V.TextureSource,_c);function Eg(t={}){const e=t&&t.resource,n=e?t.resource:t,s=e?t:{resource:t};for(let r=0;r<_c.length;r++){const i=_c[r];if(i.test(n))return new i(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function S1(t={},e=!1){const n=t&&t.resource,s=n?t.resource:t,r=n?t:{resource:t};if(!e&&us.has(s))return us.get(s);const i=new ee({source:Eg(r)});return i.on("destroy",()=>{us.has(s)&&us.remove(s)}),e||us.set(s,i),i}function b1(t,e=!1){return typeof t=="string"?us.get(t):t instanceof wt?new ee({source:t}):S1(t,e)}ee.from=b1;wt.from=Eg;Se.add(kg,Tg,Cg,v1,Bo,Mg,Ru);var Rg=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(Rg||{});function bt(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function rr(t){return t.split("?")[0].split("#")[0]}function k1(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T1(t,e,n){return t.replace(new RegExp(k1(e),"g"),n)}function C1(t,e){let n="",s=0,r=-1,i=0,o=-1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||i===1))if(r!==a-1&&i===2){if(n.length<2||s!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const c=n.lastIndexOf("/");if(c!==n.length-1){c===-1?(n="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),r=a,i=0;continue}}else if(n.length===2||n.length===1){n="",s=0,r=a,i=0;continue}}}else n.length>0?n+=`/${t.slice(r+1,a)}`:n=t.slice(r+1,a),s=a-r-1;r=a,i=0}else o===46&&i!==-1?++i:i=-1}return n}const Qr={toPosix(t){return T1(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){bt(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const n=/^[^/:]+:\/{0,2}/.exec(t);return n?n[0]:""},toAbsolute(t,e,n){if(bt(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const s=rr(this.toPosix(e??at.get().getBaseUrl())),r=rr(this.toPosix(n??this.rootname(s)));return t=this.toPosix(t),t.startsWith("/")?Qr.join(r,t.slice(1)):this.isAbsolute(t)?t:this.join(s,t)},normalize(t){if(bt(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const n=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const s=t.endsWith("/");return t=C1(t),t.length>0&&s&&(t+="/"),n?`/${t}`:e+t},isAbsolute(t){return bt(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let n=0;n<t.length;++n){const s=t[n];if(bt(s),s.length>0)if(e===void 0)e=s;else{const r=t[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${s}`:e+=`/${s}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(bt(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const n=e===47;let s=-1,r=!0;const i=this.getProtocol(t),o=t;t=t.slice(i.length);for(let a=t.length-1;a>=1;--a)if(e=t.charCodeAt(a),e===47){if(!r){s=a;break}}else r=!1;return s===-1?n?"/":this.isUrl(o)?i+t:i:n&&s===1?"//":i+t.slice(0,s)},rootname(t){bt(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const n=t.indexOf("/",e.length);n!==-1?e=t.slice(0,n):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){bt(t),e&&bt(e),t=rr(this.toPosix(t));let n=0,s=-1,r=!0,i;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(i=t.length-1;i>=0;--i){const c=t.charCodeAt(i);if(c===47){if(!r){n=i+1;break}}else a===-1&&(r=!1,a=i+1),o>=0&&(c===e.charCodeAt(o)?--o===-1&&(s=i):(o=-1,s=a))}return n===s?s=a:s===-1&&(s=t.length),t.slice(n,s)}for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===47){if(!r){n=i+1;break}}else s===-1&&(r=!1,s=i+1);return s===-1?"":t.slice(n,s)},extname(t){bt(t),t=rr(this.toPosix(t));let e=-1,n=0,s=-1,r=!0,i=0;for(let o=t.length-1;o>=0;--o){const a=t.charCodeAt(o);if(a===47){if(!r){n=o+1;break}continue}s===-1&&(r=!1,s=o+1),a===46?e===-1?e=o:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||s===-1||i===0||i===1&&e===s-1&&e===n+1?"":t.slice(e,s)},parse(t){bt(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=rr(this.toPosix(t));let n=t.charCodeAt(0);const s=this.isAbsolute(t);let r;e.root=this.rootname(t),s||this.hasProtocol(t)?r=1:r=0;let i=-1,o=0,a=-1,c=!0,u=t.length-1,d=0;for(;u>=r;--u){if(n=t.charCodeAt(u),n===47){if(!c){o=u+1;break}continue}a===-1&&(c=!1,a=u+1),n===46?i===-1?i=u:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||a===-1||d===0||d===1&&i===a-1&&i===o+1?a!==-1&&(o===0&&s?e.base=e.name=t.slice(1,a):e.base=e.name=t.slice(o,a)):(o===0&&s?(e.name=t.slice(1,i),e.base=t.slice(1,a)):(e.name=t.slice(o,i),e.base=t.slice(o,a)),e.ext=t.slice(i,a)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function Ig(t,e,n,s,r){const i=e[n];for(let o=0;o<i.length;o++){const a=i[o];n<e.length-1?Ig(t.replace(s[n],a),e,n+1,s,r):r.push(t.replace(s[n],a))}}function M1(t){const e=/\{(.*?)\}/g,n=t.match(e),s=[];if(n){const r=[];n.forEach(i=>{const o=i.substring(1,i.length-1).split(",");r.push(o)}),Ig(t,r,0,n,s)}else s.push(t);return s}const Cd=t=>!Array.isArray(t);class Lg{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,n)=>`${e}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(e,n)=>n.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(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.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 n=e;this._defaultSearchParams=Object.keys(n).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(n[s])}`).join("&")}}getAlias(e){const{alias:n,src:s}=e;return cs(n||s,i=>typeof i=="string"?i:Array.isArray(i)?i.map(o=>(o==null?void 0:o.src)??o):i!=null&&i.src?i.src:i,!0)}removeAlias(e,n){this._assetMap[e]&&(n&&n!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&$e("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(e,n){const s=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([i,o])=>typeof o=="string"||Array.isArray(o)?{alias:i,src:o}:{alias:i,...o})),r.forEach(i=>{const o=i.src,a=i.alias;let c;if(typeof a=="string"){const u=this._createBundleAssetId(e,a);s.push(u),c=[a,u]}else{const u=a.map(d=>this._createBundleAssetId(e,d));s.push(...u),c=[...a,...u]}this.add({...i,alias:c,src:o})}),this._bundles[e]=s}add(e){const n=[];Array.isArray(e)?n.push(...e):n.push(e);let s;s=i=>{this.hasKey(i)&&$e(`[Resolver] already has key: ${i} overwriting`)},cs(n).forEach(i=>{const{src:o}=i;let{data:a,format:c,loadParser:u,parser:d}=i;const l=cs(o).map(_=>typeof _=="string"?M1(_):Array.isArray(_)?_:[_]),h=this.getAlias(i);Array.isArray(h)?h.forEach(s):s(h);const f=[],p=_=>{const y=this._parsers.find(m=>m.test(_));return{src:_,...y==null?void 0:y.parse(_)}};l.forEach(_=>{_.forEach(y=>{let m={};if(typeof y!="object"?m=p(y):(a=y.data??a,c=y.format??c,(y.loadParser||y.parser)&&(u=y.loadParser??u,d=y.parser??d),m={...p(y.src),...y}),!h)throw new Error(`[Resolver] alias is undefined for this asset: ${m.src}`);m=this._buildResolvedAsset(m,{aliases:h,data:a,format:c,loadParser:u,parser:d,progressSize:i.progressSize}),f.push(m)})}),h.forEach(_=>{this._assetMap[_]=f})})}resolveBundle(e){const n=Cd(e);e=cs(e);const s={};return e.forEach(r=>{const i=this._bundles[r];if(i){const o=this.resolve(i),a={};for(const c in o){const u=o[c];a[this._extractAssetIdFromBundle(r,c)]=u}s[r]=a}}),n?s[e[0]]:s}resolveUrl(e){const n=this.resolve(e);if(typeof e!="string"){const s={};for(const r in n)s[r]=n[r].src;return s}return n.src}resolve(e){const n=Cd(e);e=cs(e);const s={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let i=this._assetMap[r];const o=this._getPreferredOrder(i);o==null||o.priority.forEach(a=>{o.params[a].forEach(c=>{const u=i.filter(d=>d[a]?d[a]===c:!1);u.length&&(i=u)})}),this._resolverHash[r]=i[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});s[r]=this._resolverHash[r]}),n?s[e[0]]:s}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let n=0;n<e.length;n++){const s=e[n],r=this._preferredOrder.find(i=>i.params.format.includes(s.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const n=/\?/.test(e)?"&":"?";return`${e}${n}${this._defaultSearchParams}`}_buildResolvedAsset(e,n){const{aliases:s,data:r,loadParser:i,parser:o,format:a,progressSize:c}=n;return(this._basePath||this._rootPath)&&(e.src=Qr.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=s??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=o??e.parser,e.format=a??e.format??P1(e.src),c!==void 0&&(e.progressSize=c),e}}Lg.RETINA_PREFIX=/@([0-9\.]+)x/;function P1(t){return t.split(".").pop().split("?").shift().split("#").shift()}const Md=(t,e)=>{const n=e.split("?")[1];return n&&(t+=`?${n}`),t},Fg=class _r{constructor(e,n){this.linkedSheets=[];let s=e;(e==null?void 0:e.source)instanceof wt&&(s={texture:e,data:n});const{texture:r,data:i,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=r instanceof ee?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;const a=parseFloat(i.meta.scale);a?(this.resolution=a,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=_r.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,n=!1){let s=e;const r=n?1/0:_r.BATCH_SIZE;for(;s-e<r&&s<this._frameKeys.length;){const i=this._frameKeys[s],o=this._frames[i],a=o.frame;if(a){let c=null,u=null;const d=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,l=new we(0,0,Math.floor(d.w)/this.resolution,Math.floor(d.h)/this.resolution);o.rotated?c=new we(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):c=new we(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(u=new we(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[i]=new ee({source:this.textureSource,frame:c,orig:l,trim:u,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:i.toString()})}s++}}_processAnimations(){const e=this.data.animations||{};for(const n in e){this.animations[n]=[];for(let s=0;s<e[n].length;s++){const r=e[n][s];this.animations[n].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*_r.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*_r.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var n;for(const s in this.textures)this.textures[s].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Fg.BATCH_SIZE=1e3;let Pd=Fg;const A1=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Og(t,e,n){const s={};if(t.forEach(r=>{s[r]=e}),Object.keys(e.textures).forEach(r=>{s[`${e.cachePrefix}${r}`]=e.textures[r]}),!n){const r=Qr.dirname(t[0]);e.linkedSheets.forEach((i,o)=>{const a=Og([`${r}/${e.data.meta.related_multi_packs[o]}`],i,!0);Object.assign(s,a)})}return s}const E1={extension:V.Asset,cache:{test:t=>t instanceof Pd,getCacheableAssets:(t,e)=>Og(t,e,!1)},resolver:{extension:{type:V.ResolveParser,name:"resolveSpritesheet"},test:t=>{const n=t.split("?")[0].split("."),s=n.pop(),r=n.pop();return s==="json"&&A1.includes(r)},parse:t=>{var n;const e=t.split(".");return{resolution:parseFloat(((n=Lg.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:V.LoadParser,priority:Rg.Normal,name:"spritesheetLoader"},async testParse(t,e){return Qr.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,n){var l,h;const{texture:s,imageFilename:r,textureOptions:i,cachePrefix:o}=(e==null?void 0:e.data)??{};let a=Qr.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let c;if(s instanceof ee)c=s;else{const f=Md(a+(r??t.meta.image),e.src);c=(await n.load([{src:f,data:i}]))[f]}const u=new Pd({texture:c.source,data:t,cachePrefix:o});await u.parse();const d=(l=t==null?void 0:t.meta)==null?void 0:l.related_multi_packs;if(Array.isArray(d)){const f=[];for(const _ of d){if(typeof _!="string")continue;let y=a+_;(h=e.data)!=null&&h.ignoreMultiPack||(y=Md(y,e.src),f.push(n.load({src:y,data:{textureOptions:i,ignoreMultiPack:!0}})))}const p=await Promise.all(f);u.linkedSheets=p,p.forEach(_=>{_.linkedSheets=[u].concat(u.linkedSheets.filter(y=>y!==_))})}return u},async unload(t,e,n){await n.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};Se.add(E1);const Ka=Object.create(null),Ad=Object.create(null);function Ou(t,e){let n=Ad[t];return n===void 0&&(Ka[e]===void 0&&(Ka[e]=1),Ad[t]=n=Ka[e]++),n}let is;function Bg(){return(!is||is!=null&&is.isContextLost())&&(is=at.get().createCanvas().getContext("webgl",{})),is}let Bi;function R1(){if(!Bi){Bi="mediump";const t=Bg();t&&t.getShaderPrecisionFormat&&(Bi=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return Bi}function I1(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
48
+
49
+ #ifdef GL_ES // This checks if it is WebGL1
50
+ #define in varying
51
+ #define finalColor gl_FragColor
52
+ #define texture texture2D
53
+ #endif
54
+ ${t}
55
+ `):`
56
+
57
+ #ifdef GL_ES // This checks if it is WebGL1
58
+ #define in attribute
59
+ #define out varying
60
+ #endif
61
+ ${t}
62
+ `}function L1(t,e,n){const s=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let r=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&s!=="highp"&&(r="mediump"),`precision ${r} float;
63
+ ${t}`}else if(s!=="highp"&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}function F1(t,e){return e?`#version 300 es
64
+ ${t}`:t}const O1={},B1={};function D1(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const s=n?O1:B1;return s[e]?(s[e]++,e+=`-${s[e]}`):s[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
65
+ ${t}`}function N1(t,e){return e?t.replace("#version 300 es",""):t}const Qa={stripVersion:N1,ensurePrecision:L1,addProgramDefines:I1,setProgramName:D1,insertVersion:F1},ir=Object.create(null),Dg=class yc{constructor(e){e={...yc.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:R1()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let r=e.fragment,i=e.vertex;Object.keys(Qa).forEach(o=>{const a=s[o];r=Qa[o](r,a,!0),i=Qa[o](i,a,!1)}),this.fragment=r,this.vertex=i,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Ou(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,ir[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return ir[n]||(ir[n]=new yc(e),ir[n]._cacheKey=n),ir[n]}};Dg.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Ng=Dg;const Ed={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function G1(t){return Ed[t]??Ed.float32}const j1={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},Rd=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Id(t,e){let n;for(;(n=Rd.exec(t))!==null;){const s=j1[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:s,stride:G1(s).stride,offset:0,instance:!1,start:0}}Rd.lastIndex=0}function z1(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function W1({source:t,entryPoint:e}){const n={},s=z1(t),r=s.indexOf(`fn ${e}(`);if(r===-1)return n;const i=s.indexOf("->",r);if(i===-1)return n;const o=s.substring(r,i);if(Id(o,n),Object.keys(n).length===0){const a=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const c=a[1],u=new RegExp(`struct\\s+${c}\\s*\\{([^}]+)\\}`,"s"),d=s.match(u);d&&Id(d[1],n)}}return n}function Za(t){var l,h;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,i=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,c=/struct\s+(\w+)/,u=(l=t.match(e))==null?void 0:l.map(f=>({group:parseInt(f.match(n)[1],10),binding:parseInt(f.match(s)[1],10),name:f.match(r)[2],isUniform:f.match(r)[1]==="<uniform>",type:f.match(i)[1]}));if(!u)return{groups:[],structs:[]};const d=((h=t.match(o))==null?void 0:h.map(f=>{const p=f.match(c)[1],_=f.match(a).reduce((y,m)=>{const[g,x]=m.split(":");return y[g.trim()]=x.trim(),y},{});return _?{name:p,members:_}:null}).filter(({name:f})=>u.some(p=>p.type===f||p.type.includes(`<${f}>`))))??[];return{groups:u,structs:d}}var zn=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(zn||{});function $1({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]=[]),s.isUniform?e[s.group].push({binding:s.binding,visibility:zn.VERTEX|zn.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?e[s.group].push({binding:s.binding,visibility:zn.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?e[s.group].push({binding:s.binding,visibility:zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?e[s.group].push({binding:s.binding,visibility:zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&e[s.group].push({binding:s.binding,visibility:zn.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function U1({groups:t}){const e=[];for(let n=0;n<t.length;n++){const s=t[n];e[s.group]||(e[s.group]={}),e[s.group][s.name]=s.binding}return e}function H1(t,e){const n=new Set,s=new Set,r=[...t.structs,...e.structs].filter(o=>n.has(o.name)?!1:(n.add(o.name),!0)),i=[...t.groups,...e.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:r,groups:i}}const or=Object.create(null);class oa{constructor(e){var a,c;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:s,layout:r,gpuLayout:i,name:o}=e;if(this.name=o,this.fragment=n,this.vertex=s,n.source===s.source){const u=Za(n.source);this.structsAndGroups=u}else{const u=Za(s.source),d=Za(n.source);this.structsAndGroups=H1(u,d)}this.layout=r??U1(this.structsAndGroups),this.gpuLayout=i??$1(this.structsAndGroups),this.autoAssignGlobalUniforms=((a=this.layout[0])==null?void 0:a.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((c=this.layout[1])==null?void 0:c.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,s=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=Ou(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=W1(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,or[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return or[n]||(or[n]=new oa(e),or[n]._cacheKey=n),or[n]}}const Gg=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],V1=Gg.reduce((t,e)=>(t[e]=!0,t),{});function X1(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const jg=class zg{constructor(e,n){this._touched=0,this.uid=_e("uniform"),this._resourceType="uniformGroup",this._resourceId=_e("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...zg.defaultOptions,...n},this.uniformStructures=e;const s={};for(const r in e){const i=e[r];if(i.name=r,i.size=i.size??1,!V1[i.type]){const o=i.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,a,c]=o;throw new Error(`Uniform type ${i.type} is not supported. Use type: '${a}', size: ${c} instead.`)}throw new Error(`Uniform type ${i.type} is not supported. Supported uniform types are: ${Gg.join(", ")}`)}i.value??(i.value=X1(i.type,i.size)),s[r]=i.value}this.uniforms=s,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Ou(Object.keys(s).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};jg.defaultOptions={ubo:!1,isStatic:!1};let Wg=jg;class lo{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const s in e){const r=e[s];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const s in this.resources)e[n++]=this.resources[s]._resourceId;this._key=e.join("|")}setResource(e,n){var r,i;const s=this.resources[n];e!==s&&((r=s==null?void 0:s.off)==null||r.call(s,"change",this.onResourceChange,this),(i=e.on)==null||i.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const s=this.resources;for(const r in s)s[r]._gcLastUsed=e,s[r]._touched=n}destroy(){var n;const e=this.resources;for(const s in e){const r=e[s];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var xc=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(xc||{});class Bu extends Nt{constructor(e){super(),this.uid=_e("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:s,groups:r,resources:i,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=n,this.glProgram=s,o===void 0&&(o=0,n&&(o|=xc.WEBGPU),s&&(o|=xc.WEBGL)),this.compatibleRenderers=o;const c={};if(!i&&!r&&(i={}),i&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&a)for(const u in a)for(const d in a[u]){const l=a[u][d];c[l]={group:u,binding:d,name:l}}else if(n&&r&&!a){const u=n.structsAndGroups.groups;a={},u.forEach(d=>{a[d.group]=a[d.group]||{},a[d.group][d.binding]=d.name,c[d.name]=d})}else if(i){r={},a={},n&&n.structsAndGroups.groups.forEach(l=>{a[l.group]=a[l.group]||{},a[l.group][l.binding]=l.name,c[l.name]=l});let u=0;for(const d in i)c[d]||(r[99]||(r[99]=new lo,this._ownedBindGroups.push(r[99])),c[d]={group:99,binding:u,name:d},a[99]=a[99]||{},a[99][u]=d,u++);for(const d in i){const l=d;let h=i[d];!h.source&&!h._resourceType&&(h=new Wg(h));const f=c[l];f&&(r[f.group]||(r[f.group]=new lo,this._ownedBindGroups.push(r[f.group])),r[f.group].setResource(h,f.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,c)}addResource(e,n,s){var r,i;(r=this._uniformBindMap)[n]||(r[n]={}),(i=this._uniformBindMap[n])[s]||(i[s]=e),this.groups[n]||(this.groups[n]=new lo,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const s={};for(const r in n){const i=n[r];Object.defineProperty(s,i.name,{get(){return e[i.group].getResource(i.binding)},set(o){e[i.group].setResource(o,i.binding)}})}return s}destroy(e=!1){var n,s;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(s=this.glProgram)==null||s.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:s,...r}=e;let i,o;return n&&(i=oa.from(n)),s&&(o=Ng.from(s)),new Bu({gpuProgram:i,glProgram:o,...r})}}const Y1={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Ja=0,el=1,tl=2,nl=3,sl=4,rl=5,vc=class $g{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Ja)}set blend(e){!!(this.data&1<<Ja)!==e&&(this.data^=1<<Ja)}get offsets(){return!!(this.data&1<<el)}set offsets(e){!!(this.data&1<<el)!==e&&(this.data^=1<<el)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<tl)}set culling(e){!!(this.data&1<<tl)!==e&&(this.data^=1<<tl)}get depthTest(){return!!(this.data&1<<nl)}set depthTest(e){!!(this.data&1<<nl)!==e&&(this.data^=1<<nl)}get depthMask(){return!!(this.data&1<<rl)}set depthMask(e){!!(this.data&1<<rl)!==e&&(this.data^=1<<rl)}get clockwiseFrontFace(){return!!(this.data&1<<sl)}set clockwiseFrontFace(e){!!(this.data&1<<sl)!==e&&(this.data^=1<<sl)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=Y1[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new $g;return e.depthTest=!1,e.blend=!0,e}};vc.default2d=vc.for2d();let Ug=vc;const wc=[];Se.handleByNamedList(V.Environment,wc);async function q1(t){if(!t)for(let e=0;e<wc.length;e++){const n=wc[e];if(n.value.test()){await n.value.load();return}}}let ar;function K1(){if(typeof ar=="boolean")return ar;try{ar=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{ar=!1}return ar}function Ld(t,e,n=2){const s=e&&e.length,r=s?e[0]*n:t.length;let i=Hg(t,0,r,n,!0);const o=[];if(!i||i.next===i.prev)return o;let a,c,u;if(s&&(i=tv(t,e,i,n)),t.length>80*n){a=t[0],c=t[1];let d=a,l=c;for(let h=n;h<r;h+=n){const f=t[h],p=t[h+1];f<a&&(a=f),p<c&&(c=p),f>d&&(d=f),p>l&&(l=p)}u=Math.max(d-a,l-c),u=u!==0?32767/u:0}return Zr(i,o,n,a,c,u,0),o}function Hg(t,e,n,s,r){let i;if(r===dv(t,e,n,s)>0)for(let o=e;o<n;o+=s)i=Fd(o/s|0,t[o],t[o+1],i);else for(let o=n-s;o>=e;o-=s)i=Fd(o/s|0,t[o],t[o+1],i);return i&&Ws(i,i.next)&&(ei(i),i=i.next),i}function ts(t,e){if(!t)return t;e||(e=t);let n=t,s;do if(s=!1,!n.steiner&&(Ws(n,n.next)||he(n.prev,n,n.next)===0)){if(ei(n),n=e=n.prev,n===n.next)break;s=!0}else n=n.next;while(s||n!==e);return e}function Zr(t,e,n,s,r,i,o){if(!t)return;!o&&i&&ov(t,s,r,i);let a=t;for(;t.prev!==t.next;){const c=t.prev,u=t.next;if(i?Z1(t,s,r,i):Q1(t)){e.push(c.i,t.i,u.i),ei(t),t=u.next,a=u.next;continue}if(t=u,t===a){o?o===1?(t=J1(ts(t),e),Zr(t,e,n,s,r,i,2)):o===2&&ev(t,e,n,s,r,i):Zr(ts(t),e,n,s,r,i,1);break}}}function Q1(t){const e=t.prev,n=t,s=t.next;if(he(e,n,s)>=0)return!1;const r=e.x,i=n.x,o=s.x,a=e.y,c=n.y,u=s.y,d=Math.min(r,i,o),l=Math.min(a,c,u),h=Math.max(r,i,o),f=Math.max(a,c,u);let p=s.next;for(;p!==e;){if(p.x>=d&&p.x<=h&&p.y>=l&&p.y<=f&&yr(r,a,i,c,o,u,p.x,p.y)&&he(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Z1(t,e,n,s){const r=t.prev,i=t,o=t.next;if(he(r,i,o)>=0)return!1;const a=r.x,c=i.x,u=o.x,d=r.y,l=i.y,h=o.y,f=Math.min(a,c,u),p=Math.min(d,l,h),_=Math.max(a,c,u),y=Math.max(d,l,h),m=Sc(f,p,e,n,s),g=Sc(_,y,e,n,s);let x=t.prevZ,v=t.nextZ;for(;x&&x.z>=m&&v&&v.z<=g;){if(x.x>=f&&x.x<=_&&x.y>=p&&x.y<=y&&x!==r&&x!==o&&yr(a,d,c,l,u,h,x.x,x.y)&&he(x.prev,x,x.next)>=0||(x=x.prevZ,v.x>=f&&v.x<=_&&v.y>=p&&v.y<=y&&v!==r&&v!==o&&yr(a,d,c,l,u,h,v.x,v.y)&&he(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;x&&x.z>=m;){if(x.x>=f&&x.x<=_&&x.y>=p&&x.y<=y&&x!==r&&x!==o&&yr(a,d,c,l,u,h,x.x,x.y)&&he(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=g;){if(v.x>=f&&v.x<=_&&v.y>=p&&v.y<=y&&v!==r&&v!==o&&yr(a,d,c,l,u,h,v.x,v.y)&&he(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function J1(t,e){let n=t;do{const s=n.prev,r=n.next.next;!Ws(s,r)&&Xg(s,n,n.next,r)&&Jr(s,r)&&Jr(r,s)&&(e.push(s.i,n.i,r.i),ei(n),ei(n.next),n=t=r),n=n.next}while(n!==t);return ts(n)}function ev(t,e,n,s,r,i){let o=t;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&cv(o,a)){let c=Yg(o,a);o=ts(o,o.next),c=ts(c,c.next),Zr(o,e,n,s,r,i,0),Zr(c,e,n,s,r,i,0);return}a=a.next}o=o.next}while(o!==t)}function tv(t,e,n,s){const r=[];for(let i=0,o=e.length;i<o;i++){const a=e[i]*s,c=i<o-1?e[i+1]*s:t.length,u=Hg(t,a,c,s,!1);u===u.next&&(u.steiner=!0),r.push(lv(u))}r.sort(nv);for(let i=0;i<r.length;i++)n=sv(r[i],n);return n}function nv(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const s=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=s-r}return n}function sv(t,e){const n=rv(t,e);if(!n)return e;const s=Yg(n,t);return ts(s,s.next),ts(n,n.next)}function rv(t,e){let n=e;const s=t.x,r=t.y;let i=-1/0,o;if(Ws(t,n))return n;do{if(Ws(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const l=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(l<=s&&l>i&&(i=l,o=n.x<n.next.x?n:n.next,l===s))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,c=o.x,u=o.y;let d=1/0;n=o;do{if(s>=n.x&&n.x>=c&&s!==n.x&&Vg(r<u?s:i,r,c,u,r<u?i:s,r,n.x,n.y)){const l=Math.abs(r-n.y)/(s-n.x);Jr(n,t)&&(l<d||l===d&&(n.x>o.x||n.x===o.x&&iv(o,n)))&&(o=n,d=l)}n=n.next}while(n!==a);return o}function iv(t,e){return he(t.prev,t,e.prev)<0&&he(e.next,t,t.next)<0}function ov(t,e,n,s){let r=t;do r.z===0&&(r.z=Sc(r.x,r.y,e,n,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,av(r)}function av(t){let e,n=1;do{let s=t,r;t=null;let i=null;for(e=0;s;){e++;let o=s,a=0;for(let u=0;u<n&&(a++,o=o.nextZ,!!o);u++);let c=n;for(;a>0||c>0&&o;)a!==0&&(c===0||!o||s.z<=o.z)?(r=s,s=s.nextZ,a--):(r=o,o=o.nextZ,c--),i?i.nextZ=r:t=r,r.prevZ=i,i=r;s=o}i.nextZ=null,n*=2}while(e>1);return t}function Sc(t,e,n,s,r){return t=(t-n)*r|0,e=(e-s)*r|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 lv(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function Vg(t,e,n,s,r,i,o,a){return(r-o)*(e-a)>=(t-o)*(i-a)&&(t-o)*(s-a)>=(n-o)*(e-a)&&(n-o)*(i-a)>=(r-o)*(s-a)}function yr(t,e,n,s,r,i,o,a){return!(t===o&&e===a)&&Vg(t,e,n,s,r,i,o,a)}function cv(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!uv(t,e)&&(Jr(t,e)&&Jr(e,t)&&hv(t,e)&&(he(t.prev,t,e.prev)||he(t,e.prev,e))||Ws(t,e)&&he(t.prev,t,t.next)>0&&he(e.prev,e,e.next)>0)}function he(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ws(t,e){return t.x===e.x&&t.y===e.y}function Xg(t,e,n,s){const r=Ni(he(t,e,n)),i=Ni(he(t,e,s)),o=Ni(he(n,s,t)),a=Ni(he(n,s,e));return!!(r!==i&&o!==a||r===0&&Di(t,n,e)||i===0&&Di(t,s,e)||o===0&&Di(n,t,s)||a===0&&Di(n,e,s))}function Di(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ni(t){return t>0?1:t<0?-1:0}function uv(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Xg(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Jr(t,e){return he(t.prev,t,t.next)<0?he(t,e,t.next)>=0&&he(t,t.prev,e)>=0:he(t,e,t.prev)<0||he(t,t.next,e)<0}function hv(t,e){let n=t,s=!1;const r=(t.x+e.x)/2,i=(t.y+e.y)/2;do n.y>i!=n.next.y>i&&n.next.y!==n.y&&r<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(s=!s),n=n.next;while(n!==t);return s}function Yg(t,e){const n=bc(t.i,t.x,t.y),s=bc(e.i,e.x,e.y),r=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,s.next=n,n.prev=s,i.next=s,s.prev=i,s}function Fd(t,e,n,s){const r=bc(t,e,n);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function ei(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 bc(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function dv(t,e,n,s){let r=0;for(let i=e,o=n-s;i<n;i+=s)r+=(t[o]-t[i])*(t[i+1]+t[o+1]),o=i;return r}const fv=Ld.default||Ld;var qg=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(qg||{});class pv{constructor(e){this.items=[],this._name=e}emit(e,n,s,r,i,o,a,c){const{name:u,items:d}=this;for(let l=0,h=d.length;l<h;l++)d[l][u](e,n,s,r,i,o,a,c);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const mv=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Kg=class Qg extends Nt{constructor(e){super(),this.tick=0,this.uid=_e("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...mv,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await q1(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)e={...this._systemsHash[s].constructor.defaultOptions,...e};e={...Qg.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(e);this._initOptions=e}render(e,n){this.tick++;let s=e;if(s instanceof Me&&(s={container:s},n&&(q(ge,"passing a second argument is deprecated, please use render options instead"),s.target=n.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const r=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=r?s.clearColor:Ce.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(e,n,s){const r=this.view.resolution;this.view.resize(e,n,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==r&&this.runners.resolutionChange.emit(s)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=qg.ALL);const{clear:s,clearColor:r,target:i,mipLevel:o,layer:a}=e;Ce.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(i,s,Ce.shared.toArray(),o??0,a??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new pv(n)})}_addSystems(e){let n;for(n in e){const s=e[n];this._addSystem(s.value,s.name)}}_addSystem(e,n){const s=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=s,this._systemsHash[n]=s;for(const r in this.runners)this.runners[r].add(s);return this}_addPipes(e,n){const s=n.reduce((r,i)=>(r[i.name]=i.value,r),{});e.forEach(r=>{const i=r.value,o=r.name,a=s[o];this.renderPipes[o]=new i(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&li.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!K1())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};Kg.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Zg=Kg,Gi;function gv(t){return Gi!==void 0||(Gi=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??Zg.defaultOptions.failIfMajorPerformanceCaveat};try{if(!at.get().getWebGLRenderingContext())return!1;let r=at.get().createCanvas().getContext("webgl",e);const i=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,i}catch{return!1}})()),Gi}let ji;async function _v(t={}){return ji!==void 0||(ji=await(async()=>{const e=at.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),ji}const Od=["webgl","webgpu","canvas"];async function yv(t){let e=[];t.preference?(e.push(t.preference),Od.forEach(i=>{i!==t.preference&&e.push(i)})):e=Od.slice();let n,s={};for(let i=0;i<e.length;i++){const o=e[i];if(o==="webgpu"&&await _v()){const{WebGPURenderer:a}=await Ar(async()=>{const{WebGPURenderer:c}=await import("./WebGPURenderer-B_Gw9-ml.js");return{WebGPURenderer:c}},__vite__mapDeps([3,4,5,2]));n=a,s={...t,...t.webgpu};break}else if(o==="webgl"&&gv(t.failIfMajorPerformanceCaveat??Zg.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Ar(async()=>{const{WebGLRenderer:c}=await import("./WebGLRenderer-Cgmusykq.js");return{WebGLRenderer:c}},__vite__mapDeps([6,4,5,2]));n=a,s={...t,...t.webgl};break}else if(o==="canvas"){const{CanvasRenderer:a}=await Ar(async()=>{const{CanvasRenderer:c}=await import("./CanvasRenderer-B7cP3KcG.js");return{CanvasRenderer:c}},__vite__mapDeps([7,5,2]));n=a,s={...t,...t.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(s),r}const Jg="8.17.1";class e0{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,Jg)}static destroy(){}}e0.extension=V.Application;class xv{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,Jg)}destroy(){this._renderer=null}}xv.extension={type:[V.WebGLSystem,V.WebGPUSystem],name:"initHook",priority:-10};class t0{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,s;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:i}=this._resizeTo;n=r,s=i}this.renderer.resize(n,s),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}}t0.extension=V.Application;class n0{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,Do.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?ks.shared:new ks,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}n0.extension=V.Application;Se.add(t0);Se.add(n0);const s0=class kc{constructor(...e){this.stage=new Me,e[0]!==void 0&&q(ge,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new Me),this.renderer=await yv(e),kc._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return q(ge,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const s=kc._plugins.slice(0);s.reverse(),s.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};s0._plugins=[];let r0=s0;Se.handleByList(V.Application,r0._plugins);Se.add(e0);var vv=Sv,il={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},wv=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function Sv(t){var e=[];return t.replace(wv,function(n,s,r){var i=s.toLowerCase();for(r=kv(r),i=="m"&&r.length>2&&(e.push([s].concat(r.splice(0,2))),i="l",s=s=="m"?"l":"L");;){if(r.length==il[i])return r.unshift(s),e.push(r);if(r.length<il[i])throw new Error("malformed path data");e.push([s].concat(r.splice(0,il[i])))}}),e}var bv=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function kv(t){var e=t.match(bv);return e?e.map(Number):[]}const Tv=Wf(vv);function Cv(t,e){const n=Tv(t),s=[];let r=null,i=0,o=0;for(let a=0;a<n.length;a++){const c=n[a],u=c[0],d=c;switch(u){case"M":i=d[1],o=d[2],e.moveTo(i,o);break;case"m":i+=d[1],o+=d[2],e.moveTo(i,o);break;case"H":i=d[1],e.lineTo(i,o);break;case"h":i+=d[1],e.lineTo(i,o);break;case"V":o=d[1],e.lineTo(i,o);break;case"v":o+=d[1],e.lineTo(i,o);break;case"L":i=d[1],o=d[2],e.lineTo(i,o);break;case"l":i+=d[1],o+=d[2],e.lineTo(i,o);break;case"C":i=d[5],o=d[6],e.bezierCurveTo(d[1],d[2],d[3],d[4],i,o);break;case"c":e.bezierCurveTo(i+d[1],o+d[2],i+d[3],o+d[4],i+d[5],o+d[6]),i+=d[5],o+=d[6];break;case"S":i=d[3],o=d[4],e.bezierCurveToShort(d[1],d[2],i,o);break;case"s":e.bezierCurveToShort(i+d[1],o+d[2],i+d[3],o+d[4]),i+=d[3],o+=d[4];break;case"Q":i=d[3],o=d[4],e.quadraticCurveTo(d[1],d[2],i,o);break;case"q":e.quadraticCurveTo(i+d[1],o+d[2],i+d[3],o+d[4]),i+=d[3],o+=d[4];break;case"T":i=d[1],o=d[2],e.quadraticCurveToShort(i,o);break;case"t":i+=d[1],o+=d[2],e.quadraticCurveToShort(i,o);break;case"A":i=d[6],o=d[7],e.arcToSvg(d[1],d[2],d[3],d[4],d[5],i,o);break;case"a":i+=d[6],o+=d[7],e.arcToSvg(d[1],d[2],d[3],d[4],d[5],i,o);break;case"Z":case"z":e.closePath(),s.length>0&&(r=s.pop(),r?(i=r.startX,o=r.startY):(i=0,o=0)),r=null;break;default:$e(`Unknown SVG path command: ${u}`)}u!=="Z"&&u!=="z"&&r===null&&(r={startX:i,startY:o},s.push(r))}return e}class Du{constructor(e=0,n=0,s=0){this.type="circle",this.x=e,this.y=n,this.radius=s}clone(){return new Du(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const s=this.radius*this.radius;let r=this.x-e,i=this.y-n;return r*=r,i*=i,r+i<=s}strokeContains(e,n,s,r=.5){if(this.radius===0)return!1;const i=this.x-e,o=this.y-n,a=this.radius,c=(1-r)*s,u=Math.sqrt(i*i+o*o);return u<=a+c&&u>a-(s-c)}getBounds(e){return e||(e=new we),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Nu{constructor(e=0,n=0,s=0,r=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=s,this.halfHeight=r}clone(){return new Nu(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(e-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return s*=s,r*=r,s+r<=1}strokeContains(e,n,s,r=.5){const{halfWidth:i,halfHeight:o}=this;if(i<=0||o<=0)return!1;const a=s*(1-r),c=s-a,u=i-c,d=o-c,l=i+a,h=o+a,f=e-this.x,p=n-this.y,_=f*f/(u*u)+p*p/(d*d),y=f*f/(l*l)+p*p/(h*h);return _>1&&y<=1}getBounds(e){return e||(e=new we),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function Mv(t,e,n,s,r,i){const o=t-n,a=e-s,c=r-n,u=i-s,d=o*c+a*u,l=c*c+u*u;let h=-1;l!==0&&(h=d/l);let f,p;h<0?(f=n,p=s):h>1?(f=r,p=i):(f=n+h*c,p=s+h*u);const _=t-f,y=e-p;return _*_+y*y}let Pv,Av;class Rr{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const s=[];for(let r=0,i=n.length;r<i;r++)s.push(n[r].x,n[r].y);n=s}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,s=n.length;for(let r=0;r<s;r+=2){const i=n[r],o=n[r+1],a=n[(r+2)%s],c=n[(r+3)%s];e+=(a-i)*(c+o)}return e<0}containsPolygon(e){const n=this.getBounds(Pv),s=e.getBounds(Av);if(!n.containsRect(s))return!1;const r=e.points;for(let i=0;i<r.length;i+=2){const o=r[i],a=r[i+1];if(!this.contains(o,a))return!1}return!0}clone(){const e=this.points.slice(),n=new Rr(e);return n.closePath=this.closePath,n}contains(e,n){let s=!1;const r=this.points.length/2;for(let i=0,o=r-1;i<r;o=i++){const a=this.points[i*2],c=this.points[i*2+1],u=this.points[o*2],d=this.points[o*2+1];c>n!=d>n&&e<(u-a)*((n-c)/(d-c))+a&&(s=!s)}return s}strokeContains(e,n,s,r=.5){const i=s*s,o=i*(1-r),a=i-o,{points:c}=this,u=c.length-(this.closePath?0:2);for(let d=0;d<u;d+=2){const l=c[d],h=c[d+1],f=c[(d+2)%c.length],p=c[(d+3)%c.length],_=Mv(e,n,l,h,f,p),y=Math.sign((f-l)*(n-h)-(p-h)*(e-l));if(_<=(y<0?a:o))return!0}return!1}getBounds(e){e||(e=new we);const n=this.points;let s=1/0,r=-1/0,i=1/0,o=-1/0;for(let a=0,c=n.length;a<c;a+=2){const u=n[a],d=n[a+1];s=u<s?u:s,r=u>r?u:r,i=d<i?d:i,o=d>o?d:o}return e.x=s,e.width=r-s,e.y=i,e.height=o-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return q("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return q("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const zi=(t,e,n,s,r,i,o)=>{const a=t-n,c=e-s,u=Math.sqrt(a*a+c*c);return u>=r-i&&u<=r+o};class Gu{constructor(e=0,n=0,s=0,r=0,i=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=s,this.height=r,this.radius=i}getBounds(e){return e||(e=new we),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new Gu(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+s&&n<=this.y+this.height-s||e>=this.x+s&&e<=this.x+this.width-s)return!0;let r=e-(this.x+s),i=n-(this.y+s);const o=s*s;if(r*r+i*i<=o||(r=e-(this.x+this.width-s),r*r+i*i<=o)||(i=n-(this.y+this.height-s),r*r+i*i<=o)||(r=e-(this.x+s),r*r+i*i<=o))return!0}return!1}strokeContains(e,n,s,r=.5){const{x:i,y:o,width:a,height:c,radius:u}=this,d=s*(1-r),l=s-d,h=i+u,f=o+u,p=a-u*2,_=c-u*2,y=i+a,m=o+c;return(e>=i-d&&e<=i+l||e>=y-l&&e<=y+d)&&n>=f&&n<=f+_||(n>=o-d&&n<=o+l||n>=m-l&&n<=m+d)&&e>=h&&e<=h+p?!0:e<h&&n<f&&zi(e,n,h,f,u,l,d)||e>y-u&&n<f&&zi(e,n,y-u,f,u,l,d)||e>y-u&&n>m-u&&zi(e,n,y-u,m-u,u,l,d)||e<h&&n>m-u&&zi(e,n,h,m-u,u,l,d)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const i0={};function Ev(t,e,n){let s=2166136261;for(let r=0;r<e;r++)s^=t[r].uid,s=Math.imul(s,16777619),s>>>=0;return i0[s]||Rv(t,e,s,n)}function Rv(t,e,n,s){const r={};let i=0;for(let a=0;a<s;a++){const c=a<e?t[a]:ee.EMPTY.source;r[i++]=c.source,r[i++]=c.style}const o=new lo(r);return i0[n]=o,o}class Bd{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function Dd(t,e,n,s){if(n??(n=0),s??(s=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(s&7)){const r=s/8;new Float64Array(e,0,r).set(new Float64Array(t,n,r))}else if(!(n&3)&&!(s&3)){const r=s/4;new Float32Array(e,0,r).set(new Float32Array(t,n,r))}else new Uint8Array(e).set(new Uint8Array(t,n,s))}const Iv={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var Lv=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(Lv||{});function Nd(t,e){return e.alphaMode==="no-premultiply-alpha"&&Iv[t]||t}const Fv=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
66
+ `);function Ov(t){let e="";for(let n=0;n<t;++n)n>0&&(e+=`
67
+ else `),n<t-1&&(e+=`if(test == ${n}.0){}`);return e}function Bv(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const s=Fv.replace(/%forloop%/gi,Ov(t));if(e.shaderSource(n,s),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))t=t/2|0;else break}}finally{e.deleteShader(n)}return t}let os=null;function Dv(){var e;if(os)return os;const t=Bg();return os=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),os=Bv(os,t),(e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext(),os}class Nv{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const n=this.textures[e];this.textures[e]=null,this.ids[n.uid]=null}this.count=0}}class Gv{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Nv,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const Ir=[];let No=0;li.register({clear:()=>{if(Ir.length>0)for(const t of Ir)t&&t.destroy();Ir.length=0,No=0}});function Gd(){return No>0?Ir[--No]:new Gv}function jd(t){t.elements=null,Ir[No++]=t}let lr=0;const o0=class a0{constructor(e){this.uid=_e("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...a0.defaultOptions,...e},e.maxTextures||(q("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Dv());const{maxTextures:n,attributesInitialSize:s,indicesInitialSize:r}=e;this.attributeBuffer=new Bd(s*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)jd(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,n){const s=e._batch.textures.ids[n._source.uid];return!s&&s!==0?!1:(e._textureId=s,e.texture=n,!0)}updateElement(e){this.dirty=!0;const n=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId)}break(e){const n=this._elements;if(!n[this.elementStart])return;let s=Gd(),r=s.textures;r.clear();const i=n[this.elementStart];let o=Nd(i.blendMode,i.texture._source),a=i.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const c=this.attributeBuffer.float32View,u=this.attributeBuffer.uint32View,d=this.indexBuffer;let l=this._batchIndexSize,h=this._batchIndexStart,f="startBatch",p=[];const _=this.maxTextures;for(let y=this.elementStart;y<this.elementSize;++y){const m=n[y];n[y]=null;const x=m.texture._source,v=Nd(m.blendMode,x),S=o!==v||a!==m.topology;if(x._batchTick===lr&&!S){m._textureId=x._textureBindLocation,l+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,c,u,m._attributeStart,m._textureId),this.packQuadIndex(d,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,c,u,m._attributeStart,m._textureId),this.packIndex(m,d,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=s,p.push(m);continue}x._batchTick=lr,(r.count>=_||S)&&(this._finishBatch(s,h,l-h,r,o,a,e,f,p),f="renderBatch",h=l,o=v,a=m.topology,s=Gd(),r=s.textures,r.clear(),p=[],++lr),m._textureId=x._textureBindLocation=r.count,r.ids[x.uid]=r.count,r.textures[r.count++]=x,m._batch=s,p.push(m),l+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,c,u,m._attributeStart,m._textureId),this.packQuadIndex(d,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,c,u,m._attributeStart,m._textureId),this.packIndex(m,d,m._indexStart,m._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(s,h,l-h,r,o,a,e,f,p),h=l,++lr),this.elementStart=this.elementSize,this._batchIndexStart=h,this._batchIndexSize=l}_finishBatch(e,n,s,r,i,o,a,c,u){e.gpuBindGroup=null,e.bindGroup=null,e.action=c,e.batcher=this,e.textures=r,e.blendMode=i,e.topology=o,e.start=n,e.size=s,e.elements=u,++lr,this.batches[this.batchIndex++]=e,a.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const n=Math.max(e,this.attributeBuffer.size*2),s=new Bd(n);Dd(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(e){const n=this.indexBuffer;let s=Math.max(e,n.length*1.5);s+=s%2;const r=s>65535?new Uint32Array(s):new Uint16Array(s);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let i=0;i<n.length;i++)r[i]=n[i];else Dd(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,n,s){e[n]=s+0,e[n+1]=s+1,e[n+2]=s+2,e[n+3]=s+0,e[n+4]=s+2,e[n+5]=s+3}packIndex(e,n,s,r){const i=e.indices,o=e.indexSize,a=e.indexOffset,c=e.attributeOffset;for(let u=0;u<o;u++)n[s++]=r+i[u+a]-c}destroy(e={}){var n;if(this.batches!==null){for(let s=0;s<this.batchIndex;s++)jd(this.batches[s]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,e.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let s=0;s<this._elements.length;s++)this._elements[s]&&(this._elements[s]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};o0.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let jv=o0;var Ye=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(Ye||{});class ti extends Nt{constructor(e){let{data:n,size:s}=e;const{usage:r,label:i,shrinkToFit:o}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=_e("buffer"),this._resourceType="buffer",this._resourceId=_e("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,s??(s=n==null?void 0:n.byteLength);const a=!!n;this.descriptor={size:s,usage:r,mappedAtCreation:a,label:i},this.shrinkToFit=o??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Ye.STATIC)}set static(e){e?this.descriptor.usage|=Ye.STATIC:this.descriptor.usage&=~Ye.STATIC}setDataWithSize(e,n,s){if(this._updateID++,this._updateSize=n*e.BYTES_PER_ELEMENT,this._data===e){s&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?s&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=_e("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function l0(t,e){if(!(t instanceof ti)){let n=e?Ye.INDEX:Ye.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),n=Ye.INDEX|Ye.COPY_DST):(t=new Float32Array(t),n=Ye.VERTEX|Ye.COPY_DST)),t=new ti({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return t}function zv(t,e,n){const s=t.getAttribute(e);if(!s)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=s.buffer.data;let i=1/0,o=1/0,a=-1/0,c=-1/0;const u=r.BYTES_PER_ELEMENT,d=(s.offset||0)/u,l=(s.stride||2*4)/u;for(let h=d;h<r.length;h+=l){const f=r[h],p=r[h+1];f>a&&(a=f),p>c&&(c=p),f<i&&(i=f),p<o&&(o=p)}return n.minX=i,n.minY=o,n.maxX=a,n.maxY=c,n}function Wv(t){return(t instanceof ti||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=l0(t.buffer,!1),t}class $v extends Nt{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=_e("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new vt,this._boundsDirty=!0;const{attributes:n,indexBuffer:s,topology:r}=e;if(this.buffers=[],this.attributes={},n)for(const i in n)this.addAttribute(i,n[i]);this.instanceCount=e.instanceCount??1,s&&this.addIndex(s),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const n=this.attributes[e];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(e,n){const s=Wv(n);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=s}addIndex(e){this.indexBuffer=l0(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,zv(this,"aPosition",this._bounds)):this._bounds}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){var n;this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(s=>s.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const Uv=new Float32Array(1),Hv=new Uint32Array(1);class Vv extends $v{constructor(){const n=new ti({data:Uv,label:"attribute-batch-buffer",usage:Ye.VERTEX|Ye.COPY_DST,shrinkToFit:!1}),s=new ti({data:Hv,label:"index-batch-buffer",usage:Ye.INDEX|Ye.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:4*4},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:5*4}},indexBuffer:s})}}function zd(t,e,n){if(t)for(const s in t){const r=s.toLocaleLowerCase(),i=e[r];if(i){let o=t[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&i.push(`//----${n}----//`),i.push(o)}else $e(`${s} placement hook does not exist in shader`)}}const Xv=/\{\{(.*?)\}\}/g;function Wd(t){var s;const e={};return(((s=t.match(Xv))==null?void 0:s.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function $d(t,e){let n;const s=/@in\s+([^;]+);/g;for(;(n=s.exec(t))!==null;)e.push(n[1])}function Ud(t,e,n=!1){const s=[];$d(e,s),t.forEach(a=>{a.header&&$d(a.header,s)});const r=s;n&&r.sort();const i=r.map((a,c)=>` @location(${c}) ${a},`).join(`
68
+ `);let o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
69
+ ${i}
70
+ `),o}function Hd(t,e){let n;const s=/@out\s+([^;]+);/g;for(;(n=s.exec(t))!==null;)e.push(n[1])}function Yv(t){const n=/\b(\w+)\s*:/g.exec(t);return n?n[1]:""}function qv(t){const e=/@.*?\s+/g;return t.replace(e,"")}function Kv(t,e){const n=[];Hd(e,n),t.forEach(c=>{c.header&&Hd(c.header,n)});let s=0;const r=n.sort().map(c=>c.indexOf("builtin")>-1?c:`@location(${s++}) ${c}`).join(`,
71
+ `),i=n.sort().map(c=>` var ${qv(c)};`).join(`
72
+ `),o=`return VSOutput(
73
+ ${n.sort().map(c=>` ${Yv(c)}`).join(`,
74
+ `)});`;let a=e.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`
75
+ ${r}
76
+ `),a=a.replace("{{start}}",`
77
+ ${i}
78
+ `),a=a.replace("{{return}}",`
79
+ ${o}
80
+ `),a}function Vd(t,e){let n=t;for(const s in e){const r=e[s];r.join(`
81
+ `).length?n=n.replace(`{{${s}}}`,`//-----${s} START-----//
82
+ ${r.join(`
83
+ `)}
84
+ //----${s} FINISH----//`):n=n.replace(`{{${s}}}`,"")}return n}const pn=Object.create(null),ol=new Map;let Qv=0;function Zv({template:t,bits:e}){const n=c0(t,e);if(pn[n])return pn[n];const{vertex:s,fragment:r}=ew(t,e);return pn[n]=u0(s,r,e),pn[n]}function Jv({template:t,bits:e}){const n=c0(t,e);return pn[n]||(pn[n]=u0(t.vertex,t.fragment,e)),pn[n]}function ew(t,e){const n=e.map(o=>o.vertex).filter(o=>!!o),s=e.map(o=>o.fragment).filter(o=>!!o);let r=Ud(n,t.vertex,!0);r=Kv(n,r);const i=Ud(s,t.fragment,!0);return{vertex:r,fragment:i}}function c0(t,e){return e.map(n=>(ol.has(n)||ol.set(n,Qv++),ol.get(n))).sort((n,s)=>n-s).join("-")+t.vertex+t.fragment}function u0(t,e,n){const s=Wd(t),r=Wd(e);return n.forEach(i=>{zd(i.vertex,s,i.name),zd(i.fragment,r,i.name)}),{vertex:Vd(t,s),fragment:Vd(e,r)}}const tw=`
85
+ @in aPosition: vec2<f32>;
86
+ @in aUV: vec2<f32>;
87
+
88
+ @out @builtin(position) vPosition: vec4<f32>;
89
+ @out vUV : vec2<f32>;
90
+ @out vColor : vec4<f32>;
91
+
92
+ {{header}}
93
+
94
+ struct VSOutput {
95
+ {{struct}}
96
+ };
97
+
98
+ @vertex
99
+ fn main( {{in}} ) -> VSOutput {
100
+
101
+ var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
102
+ var modelMatrix = mat3x3<f32>(
103
+ 1.0, 0.0, 0.0,
104
+ 0.0, 1.0, 0.0,
105
+ 0.0, 0.0, 1.0
106
+ );
107
+ var position = aPosition;
108
+ var uv = aUV;
109
+
110
+ {{start}}
111
+
112
+ vColor = vec4<f32>(1., 1., 1., 1.);
113
+
114
+ {{main}}
115
+
116
+ vUV = uv;
117
+
118
+ var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
119
+
120
+ vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
121
+
122
+ vColor *= globalUniforms.uWorldColorAlpha;
123
+
124
+ {{end}}
125
+
126
+ {{return}}
127
+ };
128
+ `,nw=`
129
+ @in vUV : vec2<f32>;
130
+ @in vColor : vec4<f32>;
131
+
132
+ {{header}}
133
+
134
+ @fragment
135
+ fn main(
136
+ {{in}}
137
+ ) -> @location(0) vec4<f32> {
138
+
139
+ {{start}}
140
+
141
+ var outColor:vec4<f32>;
142
+
143
+ {{main}}
144
+
145
+ var finalColor:vec4<f32> = outColor * vColor;
146
+
147
+ {{end}}
148
+
149
+ return finalColor;
150
+ };
151
+ `,sw=`
152
+ in vec2 aPosition;
153
+ in vec2 aUV;
154
+
155
+ out vec4 vColor;
156
+ out vec2 vUV;
157
+
158
+ {{header}}
159
+
160
+ void main(void){
161
+
162
+ mat3 worldTransformMatrix = uWorldTransformMatrix;
163
+ mat3 modelMatrix = mat3(
164
+ 1.0, 0.0, 0.0,
165
+ 0.0, 1.0, 0.0,
166
+ 0.0, 0.0, 1.0
167
+ );
168
+ vec2 position = aPosition;
169
+ vec2 uv = aUV;
170
+
171
+ {{start}}
172
+
173
+ vColor = vec4(1.);
174
+
175
+ {{main}}
176
+
177
+ vUV = uv;
178
+
179
+ mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
180
+
181
+ gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
182
+
183
+ vColor *= uWorldColorAlpha;
184
+
185
+ {{end}}
186
+ }
187
+ `,rw=`
188
+
189
+ in vec4 vColor;
190
+ in vec2 vUV;
191
+
192
+ out vec4 finalColor;
193
+
194
+ {{header}}
195
+
196
+ void main(void) {
197
+
198
+ {{start}}
199
+
200
+ vec4 outColor;
201
+
202
+ {{main}}
203
+
204
+ finalColor = outColor * vColor;
205
+
206
+ {{end}}
207
+ }
208
+ `,iw={name:"global-uniforms-bit",vertex:{header:`
209
+ struct GlobalUniforms {
210
+ uProjectionMatrix:mat3x3<f32>,
211
+ uWorldTransformMatrix:mat3x3<f32>,
212
+ uWorldColorAlpha: vec4<f32>,
213
+ uResolution: vec2<f32>,
214
+ }
215
+
216
+ @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
217
+ `}},ow={name:"global-uniforms-bit",vertex:{header:`
218
+ uniform mat3 uProjectionMatrix;
219
+ uniform mat3 uWorldTransformMatrix;
220
+ uniform vec4 uWorldColorAlpha;
221
+ uniform vec2 uResolution;
222
+ `}};function aw({bits:t,name:e}){const n=Zv({template:{fragment:nw,vertex:tw},bits:[iw,...t]});return oa.from({name:e,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function lw({bits:t,name:e}){return new Ng({name:e,...Jv({template:{vertex:sw,fragment:rw},bits:[ow,...t]})})}const cw={name:"color-bit",vertex:{header:`
223
+ @in aColor: vec4<f32>;
224
+ `,main:`
225
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
226
+ `}},uw={name:"color-bit",vertex:{header:`
227
+ in vec4 aColor;
228
+ `,main:`
229
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
230
+ `}},al={};function hw(t){const e=[];if(t===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let s=0;s<t;s++)e.push(`@group(1) @binding(${n++}) var textureSource${s+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${n++}) var textureSampler${s+1}: sampler;`)}return e.join(`
231
+ `)}function dw(t){const e=[];if(t===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let n=0;n<t;n++)n===t-1?e.push(" default:{"):e.push(` case ${n}:{`),e.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join(`
232
+ `)}function fw(t){return al[t]||(al[t]={name:"texture-batch-bit",vertex:{header:`
233
+ @in aTextureIdAndRound: vec2<u32>;
234
+ @out @interpolate(flat) vTextureId : u32;
235
+ `,main:`
236
+ vTextureId = aTextureIdAndRound.y;
237
+ `,end:`
238
+ if(aTextureIdAndRound.x == 1)
239
+ {
240
+ vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
241
+ }
242
+ `},fragment:{header:`
243
+ @in @interpolate(flat) vTextureId: u32;
244
+
245
+ ${hw(t)}
246
+ `,main:`
247
+ var uvDx = dpdx(vUV);
248
+ var uvDy = dpdy(vUV);
249
+
250
+ ${dw(t)}
251
+ `}}),al[t]}const ll={};function pw(t){const e=[];for(let n=0;n<t;n++)n>0&&e.push("else"),n<t-1&&e.push(`if(vTextureId < ${n}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${n}], vUV);`),e.push("}");return e.join(`
252
+ `)}function mw(t){return ll[t]||(ll[t]={name:"texture-batch-bit",vertex:{header:`
253
+ in vec2 aTextureIdAndRound;
254
+ out float vTextureId;
255
+
256
+ `,main:`
257
+ vTextureId = aTextureIdAndRound.y;
258
+ `,end:`
259
+ if(aTextureIdAndRound.x == 1.)
260
+ {
261
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
262
+ }
263
+ `},fragment:{header:`
264
+ in float vTextureId;
265
+
266
+ uniform sampler2D uTextures[${t}];
267
+
268
+ `,main:`
269
+
270
+ ${pw(t)}
271
+ `}}),ll[t]}const gw={name:"round-pixels-bit",vertex:{header:`
272
+ fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
273
+ {
274
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
275
+ }
276
+ `}},_w={name:"round-pixels-bit",vertex:{header:`
277
+ vec2 roundPixels(vec2 position, vec2 targetSize)
278
+ {
279
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
280
+ }
281
+ `}},Xd={};function yw(t){let e=Xd[t];if(e)return e;const n=new Int32Array(t);for(let s=0;s<t;s++)n[s]=s;return e=Xd[t]=new Wg({uTextures:{value:n,type:"i32",size:t}},{isStatic:!0}),e}class Yd extends Bu{constructor(e){const n=lw({name:"batch",bits:[uw,mw(e),_w]}),s=aw({name:"batch",bits:[cw,fw(e),gw]});super({glProgram:n,gpuProgram:s,resources:{batchSamplers:yw(e)}}),this.maxTextures=e}}let cr=null;const h0=class d0 extends jv{constructor(e){super(e),this.geometry=new Vv,this.name=d0.extension.name,this.vertexSize=6,cr??(cr=new Yd(e.maxTextures)),this.shader=cr}packAttributes(e,n,s,r,i){const o=i<<16|e.roundPixels&65535,a=e.transform,c=a.a,u=a.b,d=a.c,l=a.d,h=a.tx,f=a.ty,{positions:p,uvs:_}=e,y=e.color,m=e.attributeOffset,g=m+e.attributeSize;for(let x=m;x<g;x++){const v=x*2,S=p[v],w=p[v+1];n[r++]=c*S+d*w+h,n[r++]=l*w+u*S+f,n[r++]=_[v],n[r++]=_[v+1],s[r++]=y,s[r++]=o}}packQuadAttributes(e,n,s,r,i){const o=e.texture,a=e.transform,c=a.a,u=a.b,d=a.c,l=a.d,h=a.tx,f=a.ty,p=e.bounds,_=p.maxX,y=p.minX,m=p.maxY,g=p.minY,x=o.uvs,v=e.color,S=i<<16|e.roundPixels&65535;n[r+0]=c*y+d*g+h,n[r+1]=l*g+u*y+f,n[r+2]=x.x0,n[r+3]=x.y0,s[r+4]=v,s[r+5]=S,n[r+6]=c*_+d*g+h,n[r+7]=l*g+u*_+f,n[r+8]=x.x1,n[r+9]=x.y1,s[r+10]=v,s[r+11]=S,n[r+12]=c*_+d*m+h,n[r+13]=l*m+u*_+f,n[r+14]=x.x2,n[r+15]=x.y2,s[r+16]=v,s[r+17]=S,n[r+18]=c*y+d*m+h,n[r+19]=l*m+u*y+f,n[r+20]=x.x3,n[r+21]=x.y3,s[r+22]=v,s[r+23]=S}_updateMaxTextures(e){this.shader.maxTextures!==e&&(cr=new Yd(e),this.shader=cr)}destroy(){this.shader=null,super.destroy()}};h0.extension={type:[V.Batcher],name:"default"};let xw=h0;class ci{constructor(e){this.items=Object.create(null);const{renderer:n,type:s,onUnload:r,priority:i,name:o}=e;this._renderer=n,n.gc.addResourceHash(this,"items",s,i??0),this._onUnload=r,this.name=o}add(e){return this.items[e.uid]?!1:(this.items[e.uid]=e,e.once("unload",this.remove,this),e._gcLastUsed=this._renderer.gc.now,!0)}remove(e,...n){var r;if(!this.items[e.uid])return;const s=e._gpuData[this._renderer.uid];s&&((r=this._onUnload)==null||r.call(this,e,...n),s.destroy(),e._gpuData[this._renderer.uid]=null,this.items[e.uid]=null)}removeAll(...e){Object.values(this.items).forEach(n=>n&&this.remove(n,...e))}destroy(...e){this.removeAll(...e),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function vw(t,e,n,s,r,i,o,a=null){let c=0;n*=e,r*=i;const u=a.a,d=a.b,l=a.c,h=a.d,f=a.tx,p=a.ty;for(;c<o;){const _=t[n],y=t[n+1];s[r]=u*_+l*y+f,s[r+1]=d*_+h*y+p,r+=i,n+=e,c++}}function ww(t,e,n,s){let r=0;for(e*=n;r<s;)t[e]=0,t[e+1]=0,e+=n,r++}function f0(t,e,n,s,r){const i=e.a,o=e.b,a=e.c,c=e.d,u=e.tx,d=e.ty;n||(n=0),s||(s=2),r||(r=t.length/s-n);let l=n*s;for(let h=0;h<r;h++){const f=t[l],p=t[l+1];t[l]=i*f+a*p+u,t[l+1]=o*f+c*p+d,l+=s}}const Sw=new Y;class ju{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const e=this.baseColor,n=e>>16|e&65280|(e&255)<<16,s=this.renderable;return s?_g(n,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var e;return((e=this.renderable)==null?void 0:e.groupTransform)||Sw}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const ni={extension:{type:V.ShapeBuilder,name:"circle"},build(t,e){let n,s,r,i,o,a;if(t.type==="circle"){const v=t;if(o=a=v.radius,o<=0)return!1;n=v.x,s=v.y,r=i=0}else if(t.type==="ellipse"){const v=t;if(o=v.halfWidth,a=v.halfHeight,o<=0||a<=0)return!1;n=v.x,s=v.y,r=i=0}else{const v=t,S=v.width/2,w=v.height/2;n=v.x+S,s=v.y+w,o=a=Math.max(0,Math.min(v.radius,Math.min(S,w))),r=S-o,i=w-a}if(r<0||i<0)return!1;const c=Math.ceil(2.3*Math.sqrt(o+a)),u=c*8+(r?4:0)+(i?4:0);if(u===0)return!1;if(c===0)return e[0]=e[6]=n+r,e[1]=e[3]=s+i,e[2]=e[4]=n-r,e[5]=e[7]=s-i,!0;let d=0,l=c*4+(r?2:0)+2,h=l,f=u,p=r+o,_=i,y=n+p,m=n-p,g=s+_;if(e[d++]=y,e[d++]=g,e[--l]=g,e[--l]=m,i){const v=s-_;e[h++]=m,e[h++]=v,e[--f]=v,e[--f]=y}for(let v=1;v<c;v++){const S=Math.PI/2*(v/c),w=r+Math.cos(S)*o,b=i+Math.sin(S)*a,k=n+w,T=n-w,C=s+b,P=s-b;e[d++]=k,e[d++]=C,e[--l]=C,e[--l]=T,e[h++]=T,e[h++]=P,e[--f]=P,e[--f]=k}p=r,_=i+a,y=n+p,m=n-p,g=s+_;const x=s-_;return e[d++]=y,e[d++]=g,e[--f]=x,e[--f]=y,r&&(e[d++]=m,e[d++]=g,e[--f]=x,e[--f]=m),!0},triangulate(t,e,n,s,r,i){if(t.length===0)return;let o=0,a=0;for(let d=0;d<t.length;d+=2)o+=t[d],a+=t[d+1];o/=t.length/2,a/=t.length/2;let c=s;e[c*n]=o,e[c*n+1]=a;const u=c++;for(let d=0;d<t.length;d+=2)e[c*n]=t[d],e[c*n+1]=t[d+1],d>0&&(r[i++]=c,r[i++]=u,r[i++]=c-1),c++;r[i++]=u+1,r[i++]=u,r[i++]=c-1}},bw={...ni,extension:{...ni.extension,name:"ellipse"}},kw={...ni,extension:{...ni.extension,name:"roundedRectangle"}},p0=1e-4,qd=1e-4;function Tw(t){const e=t.length;if(e<6)return 1;let n=0;for(let s=0,r=t[e-2],i=t[e-1];s<e;s+=2){const o=t[s],a=t[s+1];n+=(o-r)*(a+i),r=o,i=a}return n<0?-1:1}function Kd(t,e,n,s,r,i,o,a){const c=t-n*r,u=e-s*r,d=t+n*i,l=e+s*i;let h,f;o?(h=s,f=-n):(h=-s,f=n);const p=c+h,_=u+f,y=d+h,m=l+f;return a.push(p,_),a.push(y,m),2}function In(t,e,n,s,r,i,o,a){const c=n-t,u=s-e;let d=Math.atan2(c,u),l=Math.atan2(r-t,i-e);a&&d<l?d+=Math.PI*2:!a&&d>l&&(l+=Math.PI*2);let h=d;const f=l-d,p=Math.abs(f),_=Math.sqrt(c*c+u*u),y=(15*p*Math.sqrt(_)/Math.PI>>0)+1,m=f/y;if(h+=m,a){o.push(t,e),o.push(n,s);for(let g=1,x=h;g<y;g++,x+=m)o.push(t,e),o.push(t+Math.sin(x)*_,e+Math.cos(x)*_);o.push(t,e),o.push(r,i)}else{o.push(n,s),o.push(t,e);for(let g=1,x=h;g<y;g++,x+=m)o.push(t+Math.sin(x)*_,e+Math.cos(x)*_),o.push(t,e);o.push(r,i),o.push(t,e)}return y*2}function Cw(t,e,n,s,r,i){const o=p0;if(t.length===0)return;const a=e;let c=a.alignment;if(e.alignment!==.5){let A=Tw(t);c=(c-.5)*A+.5}const u=new Ne(t[0],t[1]),d=new Ne(t[t.length-2],t[t.length-1]),l=s,h=Math.abs(u.x-d.x)<o&&Math.abs(u.y-d.y)<o;if(l){t=t.slice(),h&&(t.pop(),t.pop(),d.set(t[t.length-2],t[t.length-1]));const A=(u.x+d.x)*.5,D=(d.y+u.y)*.5;t.unshift(A,D),t.push(A,D)}const f=r,p=t.length/2;let _=t.length;const y=f.length/2,m=a.width/2,g=m*m,x=a.miterLimit*a.miterLimit;let v=t[0],S=t[1],w=t[2],b=t[3],k=0,T=0,C=-(S-b),P=v-w,R=0,F=0,L=Math.sqrt(C*C+P*P);C/=L,P/=L,C*=m,P*=m;const J=c,O=(1-J)*2,B=J*2;l||(a.cap==="round"?_+=In(v-C*(O-B)*.5,S-P*(O-B)*.5,v-C*O,S-P*O,v+C*B,S+P*B,f,!0)+2:a.cap==="square"&&(_+=Kd(v,S,C,P,O,B,!0,f))),f.push(v-C*O,S-P*O),f.push(v+C*B,S+P*B);for(let A=1;A<p-1;++A){v=t[(A-1)*2],S=t[(A-1)*2+1],w=t[A*2],b=t[A*2+1],k=t[(A+1)*2],T=t[(A+1)*2+1],C=-(S-b),P=v-w,L=Math.sqrt(C*C+P*P),C/=L,P/=L,C*=m,P*=m,R=-(b-T),F=w-k,L=Math.sqrt(R*R+F*F),R/=L,F/=L,R*=m,F*=m;const D=w-v,$=S-b,z=w-k,G=T-b,W=D*z+$*G,j=$*z-G*D,ne=j<0;if(Math.abs(j)<.001*Math.abs(W)){f.push(w-C*O,b-P*O),f.push(w+C*B,b+P*B),W>=0&&(a.join==="round"?_+=In(w,b,w-C*O,b-P*O,w-R*O,b-F*O,f,!1)+4:_+=2,f.push(w-R*B,b-F*B),f.push(w+R*O,b+F*O));continue}const Q=(-C+v)*(-P+b)-(-C+w)*(-P+S),ye=(-R+k)*(-F+b)-(-R+w)*(-F+T),Z=(D*ye-z*Q)/j,xe=(G*Q-$*ye)/j,ht=(Z-w)*(Z-w)+(xe-b)*(xe-b),Ve=w+(Z-w)*O,An=b+(xe-b)*O,En=w-(Z-w)*B,Rn=b-(xe-b)*B,D0=Math.min(D*D+$*$,z*z+G*G),Xu=ne?O:B,N0=D0+Xu*Xu*g;ht<=N0?a.join==="bevel"||ht/g>x?(ne?(f.push(Ve,An),f.push(w+C*B,b+P*B),f.push(Ve,An),f.push(w+R*B,b+F*B)):(f.push(w-C*O,b-P*O),f.push(En,Rn),f.push(w-R*O,b-F*O),f.push(En,Rn)),_+=2):a.join==="round"?ne?(f.push(Ve,An),f.push(w+C*B,b+P*B),_+=In(w,b,w+C*B,b+P*B,w+R*B,b+F*B,f,!0)+4,f.push(Ve,An),f.push(w+R*B,b+F*B)):(f.push(w-C*O,b-P*O),f.push(En,Rn),_+=In(w,b,w-C*O,b-P*O,w-R*O,b-F*O,f,!1)+4,f.push(w-R*O,b-F*O),f.push(En,Rn)):(f.push(Ve,An),f.push(En,Rn)):(f.push(w-C*O,b-P*O),f.push(w+C*B,b+P*B),a.join==="round"?ne?_+=In(w,b,w+C*B,b+P*B,w+R*B,b+F*B,f,!0)+2:_+=In(w,b,w-C*O,b-P*O,w-R*O,b-F*O,f,!1)+2:a.join==="miter"&&ht/g<=x&&(ne?(f.push(En,Rn),f.push(En,Rn)):(f.push(Ve,An),f.push(Ve,An)),_+=2),f.push(w-R*O,b-F*O),f.push(w+R*B,b+F*B),_+=2)}v=t[(p-2)*2],S=t[(p-2)*2+1],w=t[(p-1)*2],b=t[(p-1)*2+1],C=-(S-b),P=v-w,L=Math.sqrt(C*C+P*P),C/=L,P/=L,C*=m,P*=m,f.push(w-C*O,b-P*O),f.push(w+C*B,b+P*B),l||(a.cap==="round"?_+=In(w-C*(O-B)*.5,b-P*(O-B)*.5,w-C*O,b-P*O,w+C*B,b+P*B,f,!1)+2:a.cap==="square"&&(_+=Kd(w,b,C,P,O,B,!1,f)));const E=qd*qd;for(let A=y;A<_+y-2;++A)v=f[A*2],S=f[A*2+1],w=f[(A+1)*2],b=f[(A+1)*2+1],k=f[(A+2)*2],T=f[(A+2)*2+1],!(Math.abs(v*(b-T)+w*(T-S)+k*(S-b))<E)&&i.push(A,A+1,A+2)}function Mw(t,e,n,s){const r=p0;if(t.length===0)return;const i=t[0],o=t[1],a=t[t.length-2],c=t[t.length-1],u=e||Math.abs(i-a)<r&&Math.abs(o-c)<r,d=n,l=t.length/2,h=d.length/2;for(let f=0;f<l;f++)d.push(t[f*2]),d.push(t[f*2+1]);for(let f=0;f<l-1;f++)s.push(h+f,h+f+1);u&&s.push(h+l-1,h)}function m0(t,e,n,s,r,i,o){const a=fv(t,e,2);if(!a)return;for(let u=0;u<a.length;u+=3)i[o++]=a[u]+r,i[o++]=a[u+1]+r,i[o++]=a[u+2]+r;let c=r*s;for(let u=0;u<t.length;u+=2)n[c]=t[u],n[c+1]=t[u+1],c+=s}const Pw=[],Aw={extension:{type:V.ShapeBuilder,name:"polygon"},build(t,e){for(let n=0;n<t.points.length;n++)e[n]=t.points[n];return!0},triangulate(t,e,n,s,r,i){m0(t,Pw,e,n,s,r,i)}},Ew={extension:{type:V.ShapeBuilder,name:"rectangle"},build(t,e){const n=t,s=n.x,r=n.y,i=n.width,o=n.height;return i>0&&o>0?(e[0]=s,e[1]=r,e[2]=s+i,e[3]=r,e[4]=s+i,e[5]=r+o,e[6]=s,e[7]=r+o,!0):!1},triangulate(t,e,n,s,r,i){let o=0;s*=n,e[s+o]=t[0],e[s+o+1]=t[1],o+=n,e[s+o]=t[2],e[s+o+1]=t[3],o+=n,e[s+o]=t[6],e[s+o+1]=t[7],o+=n,e[s+o]=t[4],e[s+o+1]=t[5],o+=n;const a=s/n;r[i++]=a,r[i++]=a+1,r[i++]=a+2,r[i++]=a+1,r[i++]=a+3,r[i++]=a+2}},Rw={extension:{type:V.ShapeBuilder,name:"triangle"},build(t,e){return e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0},triangulate(t,e,n,s,r,i){let o=0;s*=n,e[s+o]=t[0],e[s+o+1]=t[1],o+=n,e[s+o]=t[2],e[s+o+1]=t[3],o+=n,e[s+o]=t[4],e[s+o+1]=t[5];const a=s/n;r[i++]=a,r[i++]=a+1,r[i++]=a+2}},Qd=[{offset:0,color:"white"},{offset:1,color:"black"}],zu=class Tc{constructor(...e){this.uid=_e("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=Iw(e);n={...n.type==="radial"?Tc.defaultRadialOptions:Tc.defaultLinearOptions,...og(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(e,n){return this.colorStops.push({offset:e,color:Ce.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:n}=this.start,{x:s,y:r}=this.end,i=s-e,o=r-n;const a=i<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(i<0){const y=e;e=s,s=y,i*=-1}if(o<0){const y=n;n=r,r=y,o*=-1}}const c=this.colorStops.length?this.colorStops:Qd,u=this._textureSize,{canvas:d,context:l}=Jd(u,1),h=a?l.createLinearGradient(this._textureSize,0,0,0):l.createLinearGradient(0,0,this._textureSize,0);Zd(h,c),l.fillStyle=h,l.fillRect(0,0,u,1),this.texture=new ee({source:new Bo({resource:d,addressMode:this._wrapMode})});const f=Math.sqrt(i*i+o*o),p=Math.atan2(o,i),_=new Y;_.scale(f/u,1),_.rotate(p),_.translate(e,n),this.textureSpace==="local"&&_.scale(u,u),this.transform=_}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const e=this.colorStops.length?this.colorStops:Qd,n=this._textureSize,{canvas:s,context:r}=Jd(n,n),{x:i,y:o}=this.center,{x:a,y:c}=this.outerCenter,u=this.innerRadius,d=this.outerRadius,l=a-d,h=c-d,f=n/(d*2),p=(i-l)*f,_=(o-h)*f,y=r.createRadialGradient(p,_,u*f,(a-l)*f,(c-h)*f,d*f);Zd(y,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,n,n),r.fillStyle=y,r.translate(p,_),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-p,-_),r.fillRect(0,0,n,n),this.texture=new ee({source:new Bo({resource:s,addressMode:this._wrapMode})});const m=new Y;m.scale(1/f,1/f),m.translate(l,h),this.textureSpace==="local"&&m.scale(n,n),this.transform=m}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};zu.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};zu.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let nn=zu;function Zd(t,e){for(let n=0;n<e.length;n++){const s=e[n];t.addColorStop(s.offset,s.color)}}function Jd(t,e){const n=at.get().createCanvas(t,e),s=n.getContext("2d");return{canvas:n,context:s}}function Iw(t){let e=t[0]??{};return(typeof e=="number"||t[1])&&(q("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??nn.defaultLinearOptions.textureSize}),e}const Lw=new Y,Fw=new we;function Ow(t,e,n,s){const r=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if(e.textureSpace==="local"){const o=n.getBounds(Fw);e.width&&o.pad(e.width);const{x:a,y:c}=o,u=1/o.width,d=1/o.height,l=-a*u,h=-c*d,f=r.a,p=r.b,_=r.c,y=r.d;r.a*=u,r.b*=u,r.c*=d,r.d*=d,r.tx=l*f+h*_+r.tx,r.ty=l*p+h*y+r.ty}else r.translate(e.texture.frame.x,e.texture.frame.y),r.scale(1/e.texture.source.width,1/e.texture.source.height);const i=e.texture.source.style;return!(e.fill instanceof nn)&&i.addressMode==="clamp-to-edge"&&(i.addressMode="repeat",i.update()),s&&r.append(Lw.copyFrom(s).invert()),r}const aa={};Se.handleByMap(V.ShapeBuilder,aa);Se.add(Ew,Aw,Rw,ni,bw,kw);const Bw=new we,Dw=new Y;function Nw(t,e){const{geometryData:n,batches:s}=e;s.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let r=0;r<t.instructions.length;r++){const i=t.instructions[r];if(i.action==="texture")Gw(i.data,s,n);else if(i.action==="fill"||i.action==="stroke"){const o=i.action==="stroke",a=i.data.path.shapePath,c=i.data.style,u=i.data.hole;o&&u&&ef(u.shapePath,c,!0,s,n),u&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=u.shapePath.shapePrimitives),ef(a,c,o,s,n)}}}function Gw(t,e,n){const s=[],r=aa.rectangle,i=Bw;i.x=t.dx,i.y=t.dy,i.width=t.dw,i.height=t.dh;const o=t.transform;if(!r.build(i,s))return;const{vertices:a,uvs:c,indices:u}=n,d=u.length,l=a.length/2;o&&f0(s,o),r.triangulate(s,a,2,l,u,d);const h=t.image,f=h.uvs;c.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);const p=Je.get(ju);p.indexOffset=d,p.indexSize=u.length-d,p.attributeOffset=l,p.attributeSize=a.length/2-l,p.baseColor=t.style,p.alpha=t.alpha,p.texture=h,p.geometryData=n,e.push(p)}function ef(t,e,n,s,r){const{vertices:i,uvs:o,indices:a}=r;t.shapePrimitives.forEach(({shape:c,transform:u,holes:d})=>{const l=[],h=aa[c.type];if(!h.build(c,l))return;const f=a.length,p=i.length/2;let _="triangle-list";if(u&&f0(l,u),n){const x=c.closePath??!0,v=e;v.pixelLine?(Mw(l,x,i,a),_="line-list"):Cw(l,v,!1,x,i,a)}else if(d){const x=[],v=l.slice();jw(d).forEach(w=>{x.push(v.length/2),v.push(...w)}),m0(v,x,i,2,p,a,f)}else h.triangulate(l,i,2,p,a,f);const y=o.length/2,m=e.texture;if(m!==ee.WHITE){const x=Ow(Dw,e,c,u);vw(i,2,p,o,y,2,i.length/2-p,x)}else ww(o,y,2,i.length/2-p);const g=Je.get(ju);g.indexOffset=f,g.indexSize=a.length-f,g.attributeOffset=p,g.attributeSize=i.length/2-p,g.baseColor=e.color,g.alpha=e.alpha,g.texture=m,g.geometryData=r,g.topology=_,s.push(g)})}function jw(t){const e=[];for(let n=0;n<t.length;n++){const s=t[n].shape,r=[];aa[s.type].build(s,r)&&e.push(r)}return e}class zw{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{Je.return(e)}),this.graphicsData&&Je.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class Ww{constructor(){this.instructions=new Lu}init(e){const n=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new xw({maxTextures:n}),this.instructions.reset()}get geometry(){return q(Ox,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const Wu=class Cc{constructor(e){this._renderer=e,this._managedContexts=new ci({renderer:e,type:"resource",name:"graphicsContext"})}init(e){Cc.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Cc.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=!!e._gpuData[this._renderer.uid],s=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!n){n&&s.reset(),Nw(e,s);const r=e.batchMode;e.customShader||r==="no-batch"?s.isBatchable=!1:r==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,e.dirty=!1}return s}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=Je.get(Ww,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=s;s.graphicsData=n;const o=i.vertices.length,a=i.indices.length;for(let l=0;l<r.length;l++)r[l].applyTransform=!1;const c=n.batcher;c.ensureAttributeBuffer(o),c.ensureIndexBuffer(a),c.begin();for(let l=0;l<r.length;l++){const h=r[l];c.add(h)}c.finish(n.instructions);const u=c.geometry;u.indexBuffer.setDataWithSize(c.indexBuffer,c.indexSize,!0),u.buffers[0].setDataWithSize(c.attributeBuffer.float32View,c.attributeSize,!0);const d=c.batches;for(let l=0;l<d.length;l++){const h=d[l];h.bindGroup=Ev(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(e){const n=new zw;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Wu.extension={type:[V.WebGLSystem,V.WebGPUSystem],name:"graphicsContext"};Wu.defaultOptions={bezierSmoothness:.5};let $u=Wu;const $w=8,Wi=11920929e-14,Uw=1;function g0(t,e,n,s,r,i,o,a,c,u){const l=Math.min(.99,Math.max(0,u??$u.defaultOptions.bezierSmoothness));let h=(Uw-l)/1;return h*=h,Hw(e,n,s,r,i,o,a,c,t,h),t}function Hw(t,e,n,s,r,i,o,a,c,u){Mc(t,e,n,s,r,i,o,a,c,u,0),c.push(o,a)}function Mc(t,e,n,s,r,i,o,a,c,u,d){if(d>$w)return;const l=(t+n)/2,h=(e+s)/2,f=(n+r)/2,p=(s+i)/2,_=(r+o)/2,y=(i+a)/2,m=(l+f)/2,g=(h+p)/2,x=(f+_)/2,v=(p+y)/2,S=(m+x)/2,w=(g+v)/2;if(d>0){let b=o-t,k=a-e;const T=Math.abs((n-o)*k-(s-a)*b),C=Math.abs((r-o)*k-(i-a)*b);if(T>Wi&&C>Wi){if((T+C)*(T+C)<=u*(b*b+k*k)){c.push(S,w);return}}else if(T>Wi){if(T*T<=u*(b*b+k*k)){c.push(S,w);return}}else if(C>Wi){if(C*C<=u*(b*b+k*k)){c.push(S,w);return}}else if(b=S-(t+o)/2,k=w-(e+a)/2,b*b+k*k<=u){c.push(S,w);return}}Mc(t,e,l,h,m,g,S,w,c,u,d+1),Mc(S,w,x,v,_,y,o,a,c,u,d+1)}const Vw=8,Xw=11920929e-14,Yw=1;function qw(t,e,n,s,r,i,o,a){const u=Math.min(.99,Math.max(0,a??$u.defaultOptions.bezierSmoothness));let d=(Yw-u)/1;return d*=d,Kw(e,n,s,r,i,o,t,d),t}function Kw(t,e,n,s,r,i,o,a){Pc(o,t,e,n,s,r,i,a,0),o.push(r,i)}function Pc(t,e,n,s,r,i,o,a,c){if(c>Vw)return;const u=(e+s)/2,d=(n+r)/2,l=(s+i)/2,h=(r+o)/2,f=(u+l)/2,p=(d+h)/2;let _=i-e,y=o-n;const m=Math.abs((s-i)*y-(r-o)*_);if(m>Xw){if(m*m<=a*(_*_+y*y)){t.push(f,p);return}}else if(_=f-(e+i)/2,y=p-(n+o)/2,_*_+y*y<=a){t.push(f,p);return}Pc(t,e,n,u,d,f,p,a,c+1),Pc(t,f,p,l,h,i,o,a,c+1)}function _0(t,e,n,s,r,i,o,a){let c=Math.abs(r-i);(!o&&r>i||o&&i>r)&&(c=2*Math.PI-c),a||(a=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(c/Math.PI)))),a=Math.max(a,3);let u=c/a,d=r;u*=o?-1:1;for(let l=0;l<a+1;l++){const h=Math.cos(d),f=Math.sin(d),p=e+h*s,_=n+f*s;t.push(p,_),d+=u}}function Qw(t,e,n,s,r,i){const o=t[t.length-2],c=t[t.length-1]-n,u=o-e,d=r-n,l=s-e,h=Math.abs(c*l-u*d);if(h<1e-8||i===0){(t[t.length-2]!==e||t[t.length-1]!==n)&&t.push(e,n);return}const f=c*c+u*u,p=d*d+l*l,_=c*d+u*l,y=i*Math.sqrt(f)/h,m=i*Math.sqrt(p)/h,g=y*_/f,x=m*_/p,v=y*l+m*u,S=y*d+m*c,w=u*(m+g),b=c*(m+g),k=l*(y+x),T=d*(y+x),C=Math.atan2(b-S,w-v),P=Math.atan2(T-S,k-v);_0(t,v+e,S+n,i,C,P,u*d>l*c)}const Lr=Math.PI*2,cl={centerX:0,centerY:0,ang1:0,ang2:0},ul=({x:t,y:e},n,s,r,i,o,a,c)=>{t*=n,e*=s;const u=r*t-i*e,d=i*t+r*e;return c.x=u+o,c.y=d+a,c};function Zw(t,e){const n=e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),s=e===1.5707963267948966?.551915024494:n,r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*s,y:i+r*s},{x:o+a*s,y:a-o*s},{x:o,y:a}]}const tf=(t,e,n,s)=>{const r=t*s-e*n<0?-1:1;let i=t*n+e*s;return i>1&&(i=1),i<-1&&(i=-1),r*Math.acos(i)},Jw=(t,e,n,s,r,i,o,a,c,u,d,l,h)=>{const f=Math.pow(r,2),p=Math.pow(i,2),_=Math.pow(d,2),y=Math.pow(l,2);let m=f*p-f*y-p*_;m<0&&(m=0),m/=f*y+p*_,m=Math.sqrt(m)*(o===a?-1:1);const g=m*r/i*l,x=m*-i/r*d,v=u*g-c*x+(t+n)/2,S=c*g+u*x+(e+s)/2,w=(d-g)/r,b=(l-x)/i,k=(-d-g)/r,T=(-l-x)/i,C=tf(1,0,w,b);let P=tf(w,b,k,T);a===0&&P>0&&(P-=Lr),a===1&&P<0&&(P+=Lr),h.centerX=v,h.centerY=S,h.ang1=C,h.ang2=P};function eS(t,e,n,s,r,i,o,a=0,c=0,u=0){if(i===0||o===0)return;const d=Math.sin(a*Lr/360),l=Math.cos(a*Lr/360),h=l*(e-s)/2+d*(n-r)/2,f=-d*(e-s)/2+l*(n-r)/2;if(h===0&&f===0)return;i=Math.abs(i),o=Math.abs(o);const p=Math.pow(h,2)/Math.pow(i,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(i*=Math.sqrt(p),o*=Math.sqrt(p)),Jw(e,n,s,r,i,o,c,u,d,l,h,f,cl);let{ang1:_,ang2:y}=cl;const{centerX:m,centerY:g}=cl;let x=Math.abs(y)/(Lr/4);Math.abs(1-x)<1e-7&&(x=1);const v=Math.max(Math.ceil(x),1);y/=v;let S=t[t.length-2],w=t[t.length-1];const b={x:0,y:0};for(let k=0;k<v;k++){const T=Zw(_,y),{x:C,y:P}=ul(T[0],i,o,l,d,m,g,b),{x:R,y:F}=ul(T[1],i,o,l,d,m,g,b),{x:L,y:J}=ul(T[2],i,o,l,d,m,g,b);g0(t,S,w,C,P,R,F,L,J),S=L,w=J,_+=y}}function tS(t,e,n){const s=(o,a)=>{const c=a.x-o.x,u=a.y-o.y,d=Math.sqrt(c*c+u*u),l=c/d,h=u/d;return{len:d,nx:l,ny:h}},r=(o,a)=>{o===0?t.moveTo(a.x,a.y):t.lineTo(a.x,a.y)};let i=e[e.length-1];for(let o=0;o<e.length;o++){const a=e[o%e.length],c=a.radius??n;if(c<=0){r(o,a),i=a;continue}const u=e[(o+1)%e.length],d=s(a,i),l=s(a,u);if(d.len<1e-4||l.len<1e-4){r(o,a),i=a;continue}let h=Math.asin(d.nx*l.ny-d.ny*l.nx),f=1,p=!1;d.nx*l.nx-d.ny*-l.ny<0?h<0?h=Math.PI+h:(h=Math.PI-h,f=-1,p=!0):h>0&&(f=-1,p=!0);const _=h/2;let y,m=Math.abs(Math.cos(_)*c/Math.sin(_));m>Math.min(d.len/2,l.len/2)?(m=Math.min(d.len/2,l.len/2),y=Math.abs(m*Math.sin(_)/Math.cos(_))):y=c;const g=a.x+l.nx*m+-l.ny*y*f,x=a.y+l.ny*m+l.nx*y*f,v=Math.atan2(d.ny,d.nx)+Math.PI/2*f,S=Math.atan2(l.ny,l.nx)-Math.PI/2*f;o===0&&t.moveTo(g+Math.cos(v)*y,x+Math.sin(v)*y),t.arc(g,x,y,v,S,p),i=a}}function nS(t,e,n,s){const r=(a,c)=>Math.sqrt((a.x-c.x)**2+(a.y-c.y)**2),i=(a,c,u)=>({x:a.x+(c.x-a.x)*u,y:a.y+(c.y-a.y)*u}),o=e.length;for(let a=0;a<o;a++){const c=e[(a+1)%o],u=c.radius??n;if(u<=0){a===0?t.moveTo(c.x,c.y):t.lineTo(c.x,c.y);continue}const d=e[a],l=e[(a+2)%o],h=r(d,c);let f;if(h<1e-4)f=c;else{const y=Math.min(h/2,u);f=i(c,d,y/h)}const p=r(l,c);let _;if(p<1e-4)_=c;else{const y=Math.min(p/2,u);_=i(c,l,y/p)}a===0?t.moveTo(f.x,f.y):t.lineTo(f.x,f.y),t.quadraticCurveTo(c.x,c.y,_.x,_.y,s)}}const sS=new we;class rS{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new vt,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,n){return this.startPoly(e,n),this}lineTo(e,n){this._ensurePoly();const s=this._currentPoly.points,r=s[s.length-2],i=s[s.length-1];return(r!==e||i!==n)&&s.push(e,n),this}arc(e,n,s,r,i,o){this._ensurePoly(!1);const a=this._currentPoly.points;return _0(a,e,n,s,r,i,o),this}arcTo(e,n,s,r,i){this._ensurePoly();const o=this._currentPoly.points;return Qw(o,e,n,s,r,i),this}arcToSvg(e,n,s,r,i,o,a){const c=this._currentPoly.points;return eS(c,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,n,s,r,i),this}bezierCurveTo(e,n,s,r,i,o,a){this._ensurePoly();const c=this._currentPoly;return g0(this._currentPoly.points,c.lastX,c.lastY,e,n,s,r,i,o,a),this}quadraticCurveTo(e,n,s,r,i){this._ensurePoly();const o=this._currentPoly;return qw(this._currentPoly.points,o.lastX,o.lastY,e,n,s,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,n){this.endPoly(),n&&!n.isIdentity()&&(e=e.clone(!0),e.transform(n));const s=this.shapePrimitives,r=s.length;for(let i=0;i<e.instructions.length;i++){const o=e.instructions[i];this[o.action](...o.data)}if(e.checkForHoles&&s.length-r>1){let i=null;for(let o=r;o<s.length;o++){const a=s[o];if(a.shape.type==="polygon"){const c=a.shape,u=i==null?void 0:i.shape;u&&u.containsPolygon(c)?(i.holes||(i.holes=[]),i.holes.push(a),s.copyWithin(o,o+1),s.length--,o--):i=a}}}return this}finish(e=!1){this.endPoly(e)}rect(e,n,s,r,i){return this.drawShape(new we(e,n,s,r),i),this}circle(e,n,s,r){return this.drawShape(new Du(e,n,s),r),this}poly(e,n,s){const r=new Rr(e);return r.closePath=n,this.drawShape(r,s),this}regularPoly(e,n,s,r,i=0,o){r=Math.max(r|0,3);const a=-1*Math.PI/2+i,c=Math.PI*2/r,u=[];for(let d=0;d<r;d++){const l=a-d*c;u.push(e+s*Math.cos(l),n+s*Math.sin(l))}return this.poly(u,!0,o),this}roundPoly(e,n,s,r,i,o=0,a){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,n,s,r,o);const c=s*Math.sin(Math.PI/r)-.001;i=Math.min(i,c);const u=-1*Math.PI/2+o,d=Math.PI*2/r,l=(r-2)*Math.PI/r/2;for(let h=0;h<r;h++){const f=h*d+u,p=e+s*Math.cos(f),_=n+s*Math.sin(f),y=f+Math.PI+l,m=f-Math.PI-l,g=p+i*Math.cos(y),x=_+i*Math.sin(y),v=p+i*Math.cos(m),S=_+i*Math.sin(m);h===0?this.moveTo(g,x):this.lineTo(g,x),this.quadraticCurveTo(p,_,v,S,a)}return this.closePath()}roundShape(e,n,s=!1,r){return e.length<3?this:(s?nS(this,e,n,r):tS(this,e,n),this.closePath())}filletRect(e,n,s,r,i){if(i===0)return this.rect(e,n,s,r);const o=Math.min(s,r)/2,a=Math.min(o,Math.max(-o,i)),c=e+s,u=n+r,d=a<0?-a:0,l=Math.abs(a);return this.moveTo(e,n+l).arcTo(e+d,n+d,e+l,n,l).lineTo(c-l,n).arcTo(c-d,n+d,c,n+l,l).lineTo(c,u-l).arcTo(c-d,u-d,e+s-l,u,l).lineTo(e+l,u).arcTo(e+d,u-d,e,u-l,l).closePath()}chamferRect(e,n,s,r,i,o){if(i<=0)return this.rect(e,n,s,r);const a=Math.min(i,Math.min(s,r)/2),c=e+s,u=n+r,d=[e+a,n,c-a,n,c,n+a,c,u-a,c-a,u,e+a,u,e,u-a,e,n+a];for(let l=d.length-1;l>=2;l-=2)d[l]===d[l-2]&&d[l-1]===d[l-3]&&d.splice(l-1,2);return this.poly(d,!0,o)}ellipse(e,n,s,r,i){return this.drawShape(new Nu(e,n,s,r),i),this}roundRect(e,n,s,r,i,o){return this.drawShape(new Gu(e,n,s,r,i),o),this}drawShape(e,n){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:n}),this}startPoly(e,n){let s=this._currentPoly;return s&&this.endPoly(),s=new Rr,s.points.push(e,n),this._currentPoly=s,this}endPoly(e=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=e,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new Rr,e)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let s=n.shape.x,r=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const i=n.transform,o=s;s=i.a*s+i.c*r+i.tx,r=i.b*o+i.d*r+i.ty}this._currentPoly.points.push(s,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<e.instructions.length;n++){const s=e.instructions[n];this[s.action](...s.data)}this.finish()}get bounds(){const e=this._bounds;e.clear();const n=this.shapePrimitives;for(let s=0;s<n.length;s++){const r=n[s],i=r.shape.getBounds(sS);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}}class Kt{constructor(e,n=!1){this.instructions=[],this.uid=_e("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof e=="string"?Cv(e,this):this.instructions=(e==null?void 0:e.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new rS(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,n){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,n]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,n,s,r,i){const o=this.instructions[this.instructions.length-1],a=this.getLastPoint(Ne.shared);let c=0,u=0;if(!o||o.action!=="bezierCurveTo")c=a.x,u=a.y;else{c=o.data[2],u=o.data[3];const d=a.x,l=a.y;c=d+(d-c),u=l+(l-u)}return this.instructions.push({action:"bezierCurveTo",data:[c,u,e,n,s,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,n,s){const r=this.instructions[this.instructions.length-1],i=this.getLastPoint(Ne.shared);let o=0,a=0;if(!r||r.action!=="quadraticCurveTo")o=i.x,a=i.y;else{o=r.data[0],a=r.data[1];const c=i.x,u=i.y;o=c+(c-o),a=u+(u-a)}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,n,s]}),this._dirty=!0,this}rect(e,n,s,r,i){return this.instructions.push({action:"rect",data:[e,n,s,r,i]}),this._dirty=!0,this}circle(e,n,s,r){return this.instructions.push({action:"circle",data:[e,n,s,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,n,s,r,i,o,a){i||(i=r/2);const c=-1*Math.PI/2+o,u=s*2,d=Math.PI*2/u,l=[];for(let h=0;h<u;h++){const f=h%2?i:r,p=h*d+c;l.push(e+f*Math.cos(p),n+f*Math.sin(p))}return this.poly(l,!0,a),this}clone(e=!1){const n=new Kt;if(n.checkForHoles=this.checkForHoles,!e)n.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){const r=this.instructions[s];n.instructions.push({action:r.action,data:r.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;const n=e.a,s=e.b,r=e.c,i=e.d,o=e.tx,a=e.ty;let c=0,u=0,d=0,l=0,h=0,f=0,p=0,_=0;for(let y=0;y<this.instructions.length;y++){const m=this.instructions[y],g=m.data;switch(m.action){case"moveTo":case"lineTo":c=g[0],u=g[1],g[0]=n*c+r*u+o,g[1]=s*c+i*u+a;break;case"bezierCurveTo":d=g[0],l=g[1],h=g[2],f=g[3],c=g[4],u=g[5],g[0]=n*d+r*l+o,g[1]=s*d+i*l+a,g[2]=n*h+r*f+o,g[3]=s*h+i*f+a,g[4]=n*c+r*u+o,g[5]=s*c+i*u+a;break;case"quadraticCurveTo":d=g[0],l=g[1],c=g[2],u=g[3],g[0]=n*d+r*l+o,g[1]=s*d+i*l+a,g[2]=n*c+r*u+o,g[3]=s*c+i*u+a;break;case"arcToSvg":c=g[5],u=g[6],p=g[0],_=g[1],g[0]=n*p+r*_,g[1]=s*p+i*_,g[5]=n*c+r*u+o,g[6]=s*c+i*u+a;break;case"circle":g[4]=ur(g[3],e);break;case"rect":g[4]=ur(g[4],e);break;case"ellipse":g[8]=ur(g[8],e);break;case"roundRect":g[5]=ur(g[5],e);break;case"addPath":g[0].transform(e);break;case"poly":g[2]=ur(g[2],e);break;default:$e("unknown transform action",m.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let n=this.instructions.length-1,s=this.instructions[n];if(!s)return e.x=0,e.y=0,e;for(;s.action==="closePath";){if(n--,n<0)return e.x=0,e.y=0,e;s=this.instructions[n]}switch(s.action){case"moveTo":case"lineTo":e.x=s.data[0],e.y=s.data[1];break;case"quadraticCurveTo":e.x=s.data[2],e.y=s.data[3];break;case"bezierCurveTo":e.x=s.data[4],e.y=s.data[5];break;case"arc":case"arcToSvg":e.x=s.data[5],e.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(e);break}return e}}function ur(t,e){return t?t.prepend(e):e.clone()}function pe(t,e,n){const s=t.getAttribute(e);return s?Number(s):n}function iS(t,e){const n=t.querySelectorAll("defs");for(let s=0;s<n.length;s++){const r=n[s];for(let i=0;i<r.children.length;i++){const o=r.children[i];switch(o.nodeName.toLowerCase()){case"lineargradient":e.defs[o.id]=oS(o);break;case"radialgradient":e.defs[o.id]=aS();break}}}}function oS(t){const e=pe(t,"x1",0),n=pe(t,"y1",0),s=pe(t,"x2",1),r=pe(t,"y2",0),i=t.getAttribute("gradientUnits")||"objectBoundingBox",o=new nn(e,n,s,r,i==="objectBoundingBox"?"local":"global");for(let a=0;a<t.children.length;a++){const c=t.children[a],u=pe(c,"offset",0),d=Ce.shared.setValue(c.getAttribute("stop-color")).toNumber();o.addColorStop(u,d)}return o}function aS(t){return $e("[SVG Parser] Radial gradients are not yet supported"),new nn(0,0,1,0)}function nf(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const sf={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function y0(t,e){const n=t.getAttribute("style"),s={},r={},i={strokeStyle:s,fillStyle:r,useFill:!1,useStroke:!1};for(const o in sf){const a=t.getAttribute(o);a&&rf(e,i,o,a.trim())}if(n){const o=n.split(";");for(let a=0;a<o.length;a++){const c=o[a].trim(),[u,d]=c.split(":");sf[u]&&rf(e,i,u,d.trim())}}return{strokeStyle:i.useStroke?s:null,fillStyle:i.useFill?r:null,useFill:i.useFill,useStroke:i.useStroke}}function rf(t,e,n,s){switch(n){case"stroke":if(s!=="none"){if(s.startsWith("url(")){const r=nf(s);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=Ce.shared.setValue(s).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){const r=nf(s);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=Ce.shared.setValue(s).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(s);break;case"stroke-opacity":e.strokeStyle.alpha=Number(s);break;case"opacity":e.fillStyle.alpha=Number(s),e.strokeStyle.alpha=Number(s);break}}function lS(t){if(t.length<=2)return!0;const e=t.map(a=>a.area).sort((a,c)=>c-a),[n,s]=e,r=e[e.length-1],i=n/s,o=s/r;return!(i>3&&o<2)}function cS(t){return t.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function uS(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const n=e.map(Number),s=[],r=[];for(let d=0;d<n.length;d+=2)d+1<n.length&&(s.push(n[d]),r.push(n[d+1]));if(s.length===0||r.length===0)return 0;const i=Math.min(...s),o=Math.max(...s),a=Math.min(...r),c=Math.max(...r);return(o-i)*(c-a)}function of(t,e){const n=new Kt(t,!1);for(const s of n.instructions)e.instructions.push(s)}function hS(t,e){if(typeof t=="string"){const o=document.createElement("div");o.innerHTML=t.trim(),t=o.querySelector("svg")}const n={context:e,defs:{},path:new Kt};iS(t,n);const s=t.children,{fillStyle:r,strokeStyle:i}=y0(t,n);for(let o=0;o<s.length;o++){const a=s[o];a.nodeName.toLowerCase()!=="defs"&&x0(a,n,r,i)}return e}function x0(t,e,n,s){const r=t.children,{fillStyle:i,strokeStyle:o}=y0(t,e);i&&n?n={...n,...i}:i&&(n=i),o&&s?s={...s,...o}:o&&(s=o);const a=!n&&!s;a&&(n={color:0});let c,u,d,l,h,f,p,_,y,m,g,x,v,S,w,b,k;switch(t.nodeName.toLowerCase()){case"path":{S=t.getAttribute("d");const T=t.getAttribute("fill-rule"),C=cS(S),P=T==="evenodd",R=C.length>1;if(P&&R){const L=C.map(O=>({path:O,area:uS(O)}));if(L.sort((O,B)=>B.area-O.area),C.length>3||!lS(L))for(let O=0;O<L.length;O++){const B=L[O],E=O===0;e.context.beginPath();const A=new Kt(void 0,!0);of(B.path,A),e.context.path(A),E?(n&&e.context.fill(n),s&&e.context.stroke(s)):e.context.cut()}else for(let O=0;O<L.length;O++){const B=L[O],E=O%2===1;e.context.beginPath();const A=new Kt(void 0,!0);of(B.path,A),e.context.path(A),E?e.context.cut():(n&&e.context.fill(n),s&&e.context.stroke(s))}}else{const L=T?T==="evenodd":!0;w=new Kt(S,L),e.context.path(w),n&&e.context.fill(n),s&&e.context.stroke(s)}break}case"circle":p=pe(t,"cx",0),_=pe(t,"cy",0),y=pe(t,"r",0),e.context.ellipse(p,_,y,y),n&&e.context.fill(n),s&&e.context.stroke(s);break;case"rect":c=pe(t,"x",0),u=pe(t,"y",0),b=pe(t,"width",0),k=pe(t,"height",0),m=pe(t,"rx",0),g=pe(t,"ry",0),m||g?e.context.roundRect(c,u,b,k,m||g):e.context.rect(c,u,b,k),n&&e.context.fill(n),s&&e.context.stroke(s);break;case"ellipse":p=pe(t,"cx",0),_=pe(t,"cy",0),m=pe(t,"rx",0),g=pe(t,"ry",0),e.context.beginPath(),e.context.ellipse(p,_,m,g),n&&e.context.fill(n),s&&e.context.stroke(s);break;case"line":d=pe(t,"x1",0),l=pe(t,"y1",0),h=pe(t,"x2",0),f=pe(t,"y2",0),e.context.beginPath(),e.context.moveTo(d,l),e.context.lineTo(h,f),s&&e.context.stroke(s);break;case"polygon":v=t.getAttribute("points"),x=v.match(/-?\d+/g).map(T=>parseInt(T,10)),e.context.poly(x,!0),n&&e.context.fill(n),s&&e.context.stroke(s);break;case"polyline":v=t.getAttribute("points"),x=v.match(/-?\d+/g).map(T=>parseInt(T,10)),e.context.poly(x,!1),s&&e.context.stroke(s);break;case"g":case"svg":break;default:{$e(`[SVG parser] <${t.nodeName}> elements unsupported`);break}}a&&(n=null);for(let T=0;T<r.length;T++)x0(r[T],e,n,s)}const af={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class la{constructor(e,n){this.uid=_e("fillPattern"),this._tick=0,this.transform=new Y,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),n&&(e.source.style.addressModeU=af[n].addressModeU,e.source.style.addressModeV=af[n].addressModeV)}setTransform(e){const n=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function dS(t){return Ce.isColorLike(t)}function lf(t){return t instanceof la}function cf(t){return t instanceof nn}function fS(t){return t instanceof ee}function pS(t,e,n){const s=Ce.shared.setValue(e??0);return t.color=s.toNumber(),t.alpha=s.alpha===1?n.alpha:s.alpha,t.texture=ee.WHITE,{...n,...t}}function mS(t,e,n){return t.texture=e,{...n,...t}}function uf(t,e,n){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...n,...t}}function hf(t,e,n){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...n,...t}}function gS(t,e){const n={...e,...t},s=Ce.shared.setValue(n.color);return n.alpha*=s.alpha,n.color=s.toNumber(),n}function Xn(t,e){if(t==null)return null;const n={},s=t;return dS(t)?pS(n,t,e):fS(t)?mS(n,t,e):lf(t)?uf(n,t,e):cf(t)?hf(n,t,e):s.fill&&lf(s.fill)?uf(s,s.fill,e):s.fill&&cf(s.fill)?hf(s,s.fill,e):gS(s,e)}function Go(t,e){const{width:n,alignment:s,miterLimit:r,cap:i,join:o,pixelLine:a,...c}=e,u=Xn(t,c);return u?{width:n,alignment:s,miterLimit:r,cap:i,join:o,pixelLine:a,...u}:null}function _S(t,e){let n=1;const s=t.shapePath.shapePrimitives;for(let r=0;r<s.length;r++){const i=s[r].shape;if(i.type!=="polygon")continue;const o=i.points,a=o.length;if(a<6)continue;const c=i.closePath;for(let u=0;u<a;u+=2){if(!c&&(u===0||u===a-2))continue;const d=(u-2+a)%a,l=(u+2)%a,h=o[d],f=o[d+1],p=o[u],_=o[u+1],y=o[l],m=o[l+1],g=h-p,x=f-_,v=y-p,S=m-_,w=g*g+x*x,b=v*v+S*S;if(w<1e-12||b<1e-12)continue;let C=(g*v+x*S)/Math.sqrt(w*b);C<-1?C=-1:C>1&&(C=1);const P=Math.sqrt((1-C)*.5);if(P<1e-6)continue;const R=Math.min(1/P,e);R>n&&(n=R)}}return n}const yS=new Ne,df=new Y,Uu=class Lt extends Nt{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=_e("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new Kt,this._transform=new Y,this._fillStyle={...Lt.defaultFillStyle},this._strokeStyle={...Lt.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new vt,this._boundsDirty=!0}clone(){const e=new Lt;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=Xn(e,Lt.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=Go(e,Lt.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=Xn(e,Lt.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=Xn(e,Lt.defaultStrokeStyle),this}texture(e,n,s,r,i,o){return this.instructions.push({action:"texture",data:{image:e,dx:s||0,dy:r||0,dw:i||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?Ce.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Kt,this}fill(e,n){let s;const r=this.instructions[this.instructions.length-1];return this._tick===0&&(r==null?void 0:r.action)==="stroke"?s=r.data.path:s=this._activePath.clone(),s?(e!=null&&(n!==void 0&&typeof e=="number"&&(q(ge,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:n}),this._fillStyle=Xn(e,Lt.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:n}=this._activePath.getLastPoint(Ne.shared);this._activePath.clear(),this._activePath.moveTo(e,n)}stroke(e){let n;const s=this.instructions[this.instructions.length-1];return this._tick===0&&(s==null?void 0:s.action)==="fill"?n=s.data.path:n=this._activePath.clone(),n?(e!=null&&(this._strokeStyle=Go(e,Lt.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const n=this.instructions[this.instructions.length-1-e],s=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(s);else{n.data.hole=s;break}}return this._initNextPathLocation(),this}arc(e,n,s,r,i,o){this._tick++;const a=this._transform;return this._activePath.arc(a.a*e+a.c*n+a.tx,a.b*e+a.d*n+a.ty,s,r,i,o),this}arcTo(e,n,s,r,i){this._tick++;const o=this._transform;return this._activePath.arcTo(o.a*e+o.c*n+o.tx,o.b*e+o.d*n+o.ty,o.a*s+o.c*r+o.tx,o.b*s+o.d*r+o.ty,i),this}arcToSvg(e,n,s,r,i,o,a){this._tick++;const c=this._transform;return this._activePath.arcToSvg(e,n,s,r,i,c.a*o+c.c*a+c.tx,c.b*o+c.d*a+c.ty),this}bezierCurveTo(e,n,s,r,i,o,a){this._tick++;const c=this._transform;return this._activePath.bezierCurveTo(c.a*e+c.c*n+c.tx,c.b*e+c.d*n+c.ty,c.a*s+c.c*r+c.tx,c.b*s+c.d*r+c.ty,c.a*i+c.c*o+c.tx,c.b*i+c.d*o+c.ty,a),this}closePath(){var e;return this._tick++,(e=this._activePath)==null||e.closePath(),this}ellipse(e,n,s,r){return this._tick++,this._activePath.ellipse(e,n,s,r,this._transform.clone()),this}circle(e,n,s){return this._tick++,this._activePath.circle(e,n,s,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,n){this._tick++;const s=this._transform;return this._activePath.lineTo(s.a*e+s.c*n+s.tx,s.b*e+s.d*n+s.ty),this}moveTo(e,n){this._tick++;const s=this._transform,r=this._activePath.instructions,i=s.a*e+s.c*n+s.tx,o=s.b*e+s.d*n+s.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=i,r[0].data[1]=o,this):(this._activePath.moveTo(i,o),this)}quadraticCurveTo(e,n,s,r,i){this._tick++;const o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*n+o.tx,o.b*e+o.d*n+o.ty,o.a*s+o.c*r+o.tx,o.b*s+o.d*r+o.ty,i),this}rect(e,n,s,r){return this._tick++,this._activePath.rect(e,n,s,r,this._transform.clone()),this}roundRect(e,n,s,r,i){return this._tick++,this._activePath.roundRect(e,n,s,r,i,this._transform.clone()),this}poly(e,n){return this._tick++,this._activePath.poly(e,n,this._transform.clone()),this}regularPoly(e,n,s,r,i=0,o){return this._tick++,this._activePath.regularPoly(e,n,s,r,i,o),this}roundPoly(e,n,s,r,i,o){return this._tick++,this._activePath.roundPoly(e,n,s,r,i,o),this}roundShape(e,n,s,r){return this._tick++,this._activePath.roundShape(e,n,s,r),this}filletRect(e,n,s,r,i){return this._tick++,this._activePath.filletRect(e,n,s,r,i),this}chamferRect(e,n,s,r,i,o){return this._tick++,this._activePath.chamferRect(e,n,s,r,i,o),this}star(e,n,s,r,i=0,o=0){return this._tick++,this._activePath.star(e,n,s,r,i,o,this._transform.clone()),this}svg(e){return this._tick++,hS(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,n=e){return this._transform.scale(e,n),this}setTransform(e,n,s,r,i,o){return e instanceof Y?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,n,s,r,i,o),this)}transform(e,n,s,r,i,o){return e instanceof Y?(this._transform.append(e),this):(df.set(e,n,s,r,i,o),this._transform.append(df),this)}translate(e,n=e){return this._transform.translate(e,n),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const e=this._bounds;e.clear();for(let n=0;n<this.instructions.length;n++){const s=this.instructions[n],r=s.action;if(r==="fill"){const i=s.data;e.addBounds(i.path.bounds)}else if(r==="texture"){const i=s.data;e.addFrame(i.dx,i.dy,i.dx+i.dw,i.dy+i.dh,i.transform)}if(r==="stroke"){const i=s.data,o=i.style.alignment;let a=i.style.width*(1-o);i.style.join==="miter"&&(a*=_S(i.path,i.style.miterLimit));const c=i.path.bounds;e.addFrame(c.minX-a,c.minY-a,c.maxX+a,c.maxY+a)}}return e.isValid||e.set(0,0,0,0),e}containsPoint(e){var r;if(!this.bounds.containsPoint(e.x,e.y))return!1;const n=this.instructions;let s=!1;for(let i=0;i<n.length;i++){const o=n[i],a=o.data,c=a.path;if(!o.action||!c)continue;const u=a.style,d=c.shapePath.shapePrimitives;for(let l=0;l<d.length;l++){const h=d[l].shape;if(!u||!h)continue;const f=d[l].transform,p=f?f.applyInverse(e,yS):e;if(o.action==="fill")s=h.contains(p.x,p.y);else{const y=u;s=h.strokeContains(p.x,p.y,y.width,y.alignment)}const _=a.hole;if(_){const y=(r=_.shapePath)==null?void 0:r.shapePrimitives;if(y)for(let m=0;m<y.length;m++)y[m].shape.contains(p.x,p.y)&&(s=!1)}if(s)return!0}}return s}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const s=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(s)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(s))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Uu.defaultFillStyle={color:16777215,alpha:1,texture:ee.WHITE,matrix:null,fill:null,textureSpace:"local"};Uu.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:ee.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Mt=Uu;class xS{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class vS{constructor(){this.instructions=new Lu}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const Hu=class Ac{constructor(e){this._renderer=e,this._managedContexts=new ci({renderer:e,type:"resource",name:"graphicsContext"})}init(e){Ac.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Ac.defaultOptions.bezierSmoothness}getContextRenderData(e){return this.getGpuContext(e).graphicsData||this._initContextRenderData(e)}updateGpuContext(e){const n=e._gpuData,s=!!n[this._renderer.uid],r=n[this._renderer.uid]||this._initContext(e);return(e.dirty||!s)&&(s&&r.reset(),r.isBatchable=!1,e.dirty=!1),r}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){const n=new vS,s=this.getGpuContext(e);return s.graphicsData=n,n.init(),n}_initContext(e){const n=new xS;return n.context=e,e._gpuData[this._renderer.uid]=n,this._managedContexts.add(e),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Hu.extension={type:[V.CanvasSystem],name:"graphicsContext"};Hu.defaultOptions={bezierSmoothness:.5};let wS=Hu;class v0{constructor(e,n){this.state=Ug.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ci({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){return!1}addRenderable(e,n){this._managedGraphics.add(e),this.renderer.renderPipes.batch.break(n),n.add(e)}updateRenderable(e){}execute(e){e.isRenderable&&this._adaptor.execute(this,e)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}v0.extension={type:[V.CanvasPipes],name:"graphics"};function SS(t,e,n){const s=(t>>24&255)/255;e[n++]=(t&255)/255*s,e[n++]=(t>>8&255)/255*s,e[n++]=(t>>16&255)/255*s,e[n++]=s}class bS{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{Je.return(e)}),this.batches.length=0}}class w0{constructor(e,n){this.state=Ug.for2d(),this.renderer=e,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ci({renderer:e,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const n=e.context,s=!!e._gpuData,i=this.renderer.graphicsContext.updateGpuContext(n);return!!(i.isBatchable||s!==i.isBatchable)}addRenderable(e,n){const r=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),r.isBatchable?this._addToBatcher(e,n):(this.renderer.renderPipes.batch.break(n),n.add(e))}updateRenderable(e){const s=this._getGpuDataForRenderable(e).batches;for(let r=0;r<s.length;r++){const i=s[r];i._batcher.updateElement(i)}}execute(e){if(!e.isRenderable)return;const n=this.renderer,s=e.context;if(!n.graphicsContext.getGpuContext(s).batches.length)return;const i=s.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const o=i.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=n._roundPixels|e._roundPixels,SS(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const n=this._getGpuDataForRenderable(e),r=this.renderer.graphicsContext.updateGpuContext(e.context);n.destroy(),r.isBatchable&&this._updateBatchesForRenderable(e,n)}_addToBatcher(e,n){const s=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(e).batches;for(let i=0;i<r.length;i++){const o=r[i];s.addToBatch(o,n)}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){const n=new bS;return e._gpuData[this.renderer.uid]=n,this._managedGraphics.add(e),n}_updateBatchesForRenderable(e,n){const s=e.context,i=this.renderer.graphicsContext.getGpuContext(s),o=this.renderer._roundPixels|e._roundPixels;n.batches=i.batches.map(a=>{const c=Je.get(ju);return a.copyTo(c),c.renderable=e,c.roundPixels=o,c})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}w0.extension={type:[V.WebGLPipes,V.WebGPUPipes],name:"graphics"};Se.add(v0);Se.add(w0);Se.add(wS);Se.add($u);class se extends Fu{constructor(e){e instanceof Mt&&(e={context:e});const{context:n,roundPixels:s,...r}=e||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new Mt,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=s??!1}set context(e){e!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=e,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===!0||(e==null?void 0:e.context)===!0)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_onTouch(e){this._gcLastUsed=e,this._context._gcLastUsed=e}_callContextMethod(e,n){return this.context[e](...n),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){return e?new se(this._context.clone()):(this._ownedContext=null,new se(this._context))}lineStyle(e,n,s){q(ge,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return e&&(r.width=e),n&&(r.color=n),s&&(r.alpha=s),this.context.strokeStyle=r,this}beginFill(e,n){q(ge,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const s={};return e!==void 0&&(s.color=e),n!==void 0&&(s.alpha=n),this.context.fillStyle=s,this}endFill(){q(ge,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return(e.width!==Mt.defaultStrokeStyle.width||e.color!==Mt.defaultStrokeStyle.color||e.alpha!==Mt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return q(ge,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return q(ge,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return q(ge,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return q(ge,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return q(ge,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return q(ge,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}class kS extends Fu{constructor(e,n){const{text:s,resolution:r,style:i,anchor:o,width:a,height:c,roundPixels:u,...d}=e;super({...d}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=s??"",this.style=i,this.resolution=r??null,this.allowChildren=!1,this._anchor=new Ie({_onUpdate:()=>{this.onViewUpdate()}}),o&&(this.anchor=o),this.roundPixels=u??!1,a!==void 0&&(this.width=a),c!==void 0&&(this.height=c)}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate())}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(e){var n;e||(e={}),(n=this._style)==null||n.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height)}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(e){const n=this.bounds.width,s=this.bounds.height,r=-n*this.anchor.x;let i=0;return e.x>=r&&e.x<=r+n&&(i=-s*this.anchor.y,e.y>=i&&e.y<=i+s)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(e=!1){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e!=null&&e.style)&&this._style.destroy(e),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function TS(t,e){let n=t[0]??{};return(typeof n=="string"||t[1])&&(q(ge,`use new ${e}({ text: "hi!", style }) instead`),n={text:n,style:t[1]}),n}class CS{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=!1}_createCanvasAndContext(e,n){const s=at.get().createCanvas();s.width=e,s.height=n;const r=s.getContext("2d");return{canvas:s,context:r}}getOptimalCanvasAndContext(e,n,s=1){e=Math.ceil(e*s-1e-6),n=Math.ceil(n*s-1e-6),e=Gs(e),n=Gs(n);const r=(e<<17)+(n<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let i=this._canvasPool[r].pop();return i||(i=this._createCanvasAndContext(e,n)),i}returnCanvasAndContext(e){const n=e.canvas,{width:s,height:r}=n,i=(s<<17)+(r<<1);e.context.resetTransform(),e.context.clearRect(0,0,s,r),this._canvasPool[i].push(e)}clear(){this._canvasPool={}}}const Ec=new CS;li.register(Ec);let Ln=null,Ht=null;function MS(t,e){Ln||(Ln=at.get().createCanvas(256,128),Ht=Ln.getContext("2d",{willReadFrequently:!0}),Ht.globalCompositeOperation="copy",Ht.globalAlpha=1),(Ln.width<t||Ln.height<e)&&(Ln.width=Gs(t),Ln.height=Gs(e))}function ff(t,e,n){for(let s=0,r=4*n*e;s<e;++s,r+=4)if(t[r+3]!==0)return!1;return!0}function pf(t,e,n,s,r){const i=4*e;for(let o=s,a=s*i+4*n;o<=r;++o,a+=i)if(t[a+3]!==0)return!1;return!0}function PS(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:n}=e,s=Math.min(e.resolution??1,1),r=e.width??n.width,i=e.height??n.height;let o=e.output;if(MS(r,i),!Ht)throw new TypeError("Failed to get canvas 2D context");Ht.drawImage(n,0,0,r,i,0,0,r*s,i*s);const c=Ht.getImageData(0,0,r,i).data;let u=0,d=0,l=r-1,h=i-1;for(;d<i&&ff(c,r,d);)++d;if(d===i)return we.EMPTY;for(;ff(c,r,h);)--h;for(;pf(c,r,u,d,h);)++u;for(;pf(c,r,l,d,h);)--l;return++l,++h,Ht.globalCompositeOperation="source-over",Ht.strokeRect(u,d,l-u,h-d),Ht.globalCompositeOperation="copy",o??(o=new we),o.set(u/s,d/s,(l-u)/s,(h-d)/s),o}/**
282
+ * tiny-lru
283
+ *
284
+ * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
285
+ * @license BSD-3-Clause
286
+ * @version 11.4.7
287
+ */class AS{constructor(e=0,n=0,s=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=s,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){const n=this.items[e];delete this.items[e],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(e=this.keys()){const n=new Array(e.length);for(let s=0;s<e.length;s++){const r=e[s];n[s]=[r,this.get(r)]}return n}evict(e=!1){if(e||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(e){let n;return this.has(e)&&(n=this.items[e].expiry),n}get(e){const n=this.items[e];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(n),n.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e))}keys(){const e=new Array(this.size);let n=this.first,s=0;for(;n!==null;)e[s++]=n.key,n=n.next;return e}setWithEvicted(e,n,s=this.resetTtl){let r=null;if(this.has(e))this.set(e,n,!0,s);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let i=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n};++this.size===1?this.first=i:this.last.next=i,this.last=i}return r}set(e,n,s=!1,r=this.resetTtl){let i=this.items[e];return s||i!==void 0?(i.value=n,s===!1&&r&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:n},++this.size===1?this.first=i:this.last.next=i,this.last=i),this}values(e=this.keys()){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=this.get(e[s]);return n}}function ES(t=1e3,e=0,n=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new AS(t,e,n)}function S0(t){return!!t.tagStyles&&Object.keys(t.tagStyles).length>0}function b0(t){return t.includes("<")}function RS(t,e){return t.clone().assign(e)}function IS(t,e){const n=[],s=e.tagStyles;if(!S0(e)||!b0(t))return n.push({text:t,style:e}),n;const r=[e],i=[];let o="",a=0;for(;a<t.length;){const c=t[a];if(c==="<"){const u=t.indexOf(">",a);if(u===-1){o+=c,a++;continue}const d=t.slice(a+1,u);if(d.startsWith("/")){const l=d.slice(1).trim();if(i.length>0&&i[i.length-1]===l){o.length>0&&(n.push({text:o,style:r[r.length-1]}),o=""),r.pop(),i.pop(),a=u+1;continue}else{o+=t.slice(a,u+1),a=u+1;continue}}else{const l=d.trim();if(s[l]){o.length>0&&(n.push({text:o,style:r[r.length-1]}),o="");const h=r[r.length-1],f=RS(h,s[l]);r.push(f),i.push(l),a=u+1;continue}else{o+=t.slice(a,u+1),a=u+1;continue}}}else o+=c,a++}return o.length>0&&n.push({text:o,style:r[r.length-1]}),n}const LS=[10,13],FS=new Set(LS),OS=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],BS=new Set(OS),DS=[9,32];new Set(DS);const NS=[45,8208,8211,8212,173],GS=new Set(NS),jS=/(\r\n|\r|\n)/,zS=/(?:\r\n|\r|\n)/;function jo(t){return typeof t!="string"?!1:FS.has(t.charCodeAt(0))}function gt(t,e){return typeof t!="string"?!1:BS.has(t.charCodeAt(0))}function WS(t){return typeof t!="string"?!1:GS.has(t.charCodeAt(0))}function k0(t){return t==="normal"||t==="pre-line"}function T0(t){return t==="normal"}function $t(t){if(typeof t!="string")return"";let e=t.length-1;for(;e>=0&&gt(t[e]);)e--;return e<t.length-1?t.slice(0,e+1):t}function C0(t){const e=[],n=[];if(typeof t!="string")return e;for(let s=0;s<t.length;s++){const r=t[s],i=t[s+1];if(gt(r)||jo(r)){n.length>0&&(e.push(n.join("")),n.length=0),r==="\r"&&i===`
288
+ `?(e.push(`\r
289
+ `),s++):e.push(r);continue}n.push(r),WS(r)&&i&&!gt(i)&&!jo(i)&&(e.push(n.join("")),n.length=0)}return n.length>0&&e.push(n.join("")),e}function M0(t,e,n,s){const r=n(t),i=[];for(let o=0;o<r.length;o++){let a=r[o],c=a,u=1;for(;r[o+u];){const d=r[o+u];if(!s(c,d,t,o,e))a+=d,c=d,u++;else break}o+=u-1,i.push(a)}return i}const $S=/\r\n|\r|\n/g;function US(t,e,n,s,r,i,o,a){var J,O;const c=IS(t,e);if(T0(e.whiteSpace))for(let B=0;B<c.length;B++){const E=c[B];c[B]={text:E.text.replace($S," "),style:E.style}}const d=[];let l=[];for(const B of c){const E=B.text.split(jS);for(let A=0;A<E.length;A++){const D=E[A];D===`\r
290
+ `||D==="\r"||D===`
291
+ `?(d.push(l),l=[]):D.length>0&&l.push({text:D,style:B.style})}}(l.length>0||d.length===0)&&d.push(l);const h=n?HS(d,e,s,r,o,a):d,f=[],p=[],_=[],y=[],m=[];let g=0;const x=e._fontString,v=i(x);v.fontSize===0&&(v.fontSize=e.fontSize,v.ascent=e.fontSize);let S="",w=!!e.dropShadow,b=((J=e._stroke)==null?void 0:J.width)||0;for(const B of h){let E=0,A=v.ascent,D=v.descent,$="";for(const G of B){const W=G.style._fontString,j=i(W);W!==S&&(s.font=W,S=W);const ne=r(G.text,G.style.letterSpacing,s);E+=ne,A=Math.max(A,j.ascent),D=Math.max(D,j.descent),$+=G.text;const Q=((O=G.style._stroke)==null?void 0:O.width)||0;Q>b&&(b=Q),!w&&G.style.dropShadow&&(w=!0)}B.length===0&&(A=v.ascent,D=v.descent),f.push(E),p.push(A),_.push(D),m.push($);const z=e.lineHeight||A+D;y.push(z+e.leading),g=Math.max(g,E)}const k=b,P=(n&&e.align!=="left"?Math.max(g,e.wordWrapWidth):g)+k+(e.dropShadow?e.dropShadow.distance:0);let R=0;for(let B=0;B<y.length;B++)R+=y[B];R=Math.max(R,y[0]+k);const F=R+(e.dropShadow?e.dropShadow.distance:0),L=e.lineHeight||v.fontSize;return{width:P,height:F,lines:m,lineWidths:f,lineHeight:L+e.leading,maxLineWidth:g,fontProperties:v,runsByLine:h,lineAscents:p,lineDescents:_,lineHeights:y,hasDropShadow:w}}function HS(t,e,n,s,r,i){var y;const{letterSpacing:o,whiteSpace:a,wordWrapWidth:c,breakWords:u}=e,d=k0(a),l=c+o,h={};let f="";const p=(m,g)=>{const x=`${m}|${g.styleKey}`;let v=h[x];if(v===void 0){const S=g._fontString;S!==f&&(n.font=S,f=S),v=s(m,g.letterSpacing,n)+g.letterSpacing,h[x]=v}return v},_=[];for(const m of t){const g=VS(m),x=_.length,v=R=>{let F=0,L=R;do{const{token:J,style:O}=g[L];F+=p(J,O),L++}while(L<g.length&&g[L].continuesFromPrevious);return F},S=R=>{const F=[];let L=R;do F.push({token:g[L].token,style:g[L].style}),L++;while(L<g.length&&g[L].continuesFromPrevious);return F};let w=[],b=0,k=!d,T=null;const C=()=>{T&&T.text.length>0&&w.push(T),T=null},P=()=>{if(C(),w.length>0){const R=w[w.length-1];R.text=$t(R.text),R.text.length===0&&w.pop()}_.push(w),w=[],b=0,k=!1};for(let R=0;R<g.length;R++){const{token:F,style:L,continuesFromPrevious:J}=g[R],O=p(F,L);if(d){const A=gt(F),D=(T==null?void 0:T.text[T.text.length-1])??((y=w[w.length-1])==null?void 0:y.text.slice(-1))??"",$=D?gt(D):!1;if(A&&$)continue}const B=!J,E=B?v(R):O;if(E>l&&B)if(b>0&&P(),u){const A=S(R);for(let D=0;D<A.length;D++){const $=A[D].token,z=A[D].style,G=M0($,u,i,r);for(const W of G){const j=p(W,z);j+b>l&&P(),!T||T.style!==z?(C(),T={text:W,style:z}):T.text+=W,b+=j}}R+=A.length-1}else{const A=S(R);C(),_.push(A.map(D=>({text:D.token,style:D.style}))),k=!1,R+=A.length-1}else if(E+b>l&&B){if(gt(F)){k=!1;continue}P(),T={text:F,style:L},b=O}else if(J&&!u)!T||T.style!==L?(C(),T={text:F,style:L}):T.text+=F,b+=O;else{const A=gt(F);if(b===0&&A&&!k)continue;!T||T.style!==L?(C(),T={text:F,style:L}):T.text+=F,b+=O}}if(C(),w.length>0){const R=w[w.length-1];R.text=$t(R.text),R.text.length===0&&w.pop()}(w.length>0||_.length===x)&&_.push(w)}return _}function VS(t){const e=[];let n=!1;for(const s of t){const r=C0(s.text);let i=!0;for(const o of r){const a=gt(o)||jo(o),c=i&&n&&!a;e.push({token:o,style:s.style,continuesFromPrevious:c}),n=!a,i=!1}}return e}const XS={willReadFrequently:!0};function mf(t,e,n,s,r){let i=n[t];return typeof i!="number"&&(i=r(t,e,s)+e,n[t]=i),i}function YS(t,e,n,s,r,i,o){const a=n.getContext("2d",XS);a.font=e._fontString;let c=0,u="";const d=[],l=Object.create(null),{letterSpacing:h,whiteSpace:f}=e,p=k0(f),_=T0(f);let y=!p;const m=e.wordWrapWidth+h,g=C0(t);for(let v=0;v<g.length;v++){let S=g[v];if(jo(S)){if(!_){d.push($t(u)),y=!p,u="",c=0;continue}S=" "}if(p){const b=gt(S),k=gt(u[u.length-1]);if(b&&k)continue}const w=mf(S,h,l,a,s);if(w>m)if(u!==""&&(d.push($t(u)),u="",c=0),r(S,e.breakWords)){const b=M0(S,e.breakWords,o,i);for(const k of b){const T=mf(k,h,l,a,s);T+c>m&&(d.push($t(u)),y=!1,u="",c=0),u+=k,c+=T}}else u.length>0&&(d.push($t(u)),u="",c=0),d.push($t(S)),y=!1,u="",c=0;else w+c>m&&(y=!1,d.push($t(u)),u="",c=0),(u.length>0||!gt(S)||y)&&(u+=S,c+=w)}const x=$t(u);return x.length>0&&d.push(x),d.join(`
292
+ `)}const gf={willReadFrequently:!0},rn=class U{static get experimentalLetterSpacingSupported(){let e=U._experimentalLetterSpacingSupported;if(e===void 0){const n=at.get().getCanvasRenderingContext2D().prototype;e=U._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return e}constructor(e,n,s,r,i,o,a,c,u,d){this.text=e,this.style=n,this.width=s,this.height=r,this.lines=i,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=c,this.fontProperties=u,d&&(this.runsByLine=d.runsByLine,this.lineAscents=d.lineAscents,this.lineDescents=d.lineDescents,this.lineHeights=d.lineHeights,this.hasDropShadow=d.hasDropShadow)}static measureText(e=" ",n,s=U._canvas,r=n.wordWrap){var S;const i=`${e}-${n.styleKey}-wordWrap-${r}`;if(U._measurementCache.has(i))return U._measurementCache.get(i);if(S0(n)&&b0(e)){const w=US(e,n,r,U._context,U._measureText,U.measureFont,U.canBreakChars,U.wordWrapSplit),b=new U(e,n,w.width,w.height,w.lines,w.lineWidths,w.lineHeight,w.maxLineWidth,w.fontProperties,{runsByLine:w.runsByLine,lineAscents:w.lineAscents,lineDescents:w.lineDescents,lineHeights:w.lineHeights,hasDropShadow:w.hasDropShadow});return U._measurementCache.set(i,b),b}const a=n._fontString,c=U.measureFont(a);c.fontSize===0&&(c.fontSize=n.fontSize,c.ascent=n.fontSize,c.descent=0);const u=U._context;u.font=a;const l=(r?U._wordWrap(e,n,s):e).split(zS),h=new Array(l.length);let f=0;for(let w=0;w<l.length;w++){const b=U._measureText(l[w],n.letterSpacing,u);h[w]=b,f=Math.max(f,b)}const p=((S=n._stroke)==null?void 0:S.width)??0,_=n.lineHeight||c.fontSize,y=U._getAlignWidth(f,n,r),m=U._adjustWidthForStyle(y,n),g=Math.max(_,c.fontSize+p)+(l.length-1)*(_+n.leading),x=U._adjustHeightForStyle(g,n),v=new U(e,n,m,x,l,h,_+n.leading,f,c);return U._measurementCache.set(i,v),v}static _adjustWidthForStyle(e,n){var i;const s=((i=n._stroke)==null?void 0:i.width)||0;let r=e+s;return n.dropShadow&&(r+=n.dropShadow.distance),r}static _adjustHeightForStyle(e,n){let s=e;return n.dropShadow&&(s+=n.dropShadow.distance),s}static _getAlignWidth(e,n,s){return s&&n.align!=="left"?Math.max(e,n.wordWrapWidth):e}static _measureText(e,n,s){let r=!1;U.experimentalLetterSpacingSupported&&(U.experimentalLetterSpacing?(s.letterSpacing=`${n}px`,s.textLetterSpacing=`${n}px`,r=!0):(s.letterSpacing="0px",s.textLetterSpacing="0px"));const i=s.measureText(e);let o=i.width;const a=-(i.actualBoundingBoxLeft??0);let u=(i.actualBoundingBoxRight??0)-a;if(o>0)if(r)o-=n,u-=n;else{const d=(U.graphemeSegmenter(e).length-1)*n;o+=d,u+=d}return Math.max(o,u)}static _wordWrap(e,n,s=U._canvas){return YS(e,n,s,U._measureText,U.canBreakWords,U.canBreakChars,U.wordWrapSplit)}static isBreakingSpace(e,n){return gt(e)}static canBreakWords(e,n){return n}static canBreakChars(e,n,s,r,i){return!0}static wordWrapSplit(e){return U.graphemeSegmenter(e)}static measureFont(e){if(U._fonts[e])return U._fonts[e];const n=U._context;n.font=e;const s=n.measureText(U.METRICS_STRING+U.BASELINE_SYMBOL),r=s.actualBoundingBoxAscent??0,i=s.actualBoundingBoxDescent??0,o={ascent:r,descent:i,fontSize:r+i};return U._fonts[e]=o,o}static clearMetrics(e=""){e?delete U._fonts[e]:U._fonts={}}static get _canvas(){if(!U.__canvas){let e;try{const n=new OffscreenCanvas(0,0),s=n.getContext("2d",gf);if(s!=null&&s.measureText)return U.__canvas=n,n;e=at.get().createCanvas()}catch{e=at.get().createCanvas()}e.width=e.height=10,U.__canvas=e}return U.__canvas}static get _context(){return U.__context||(U.__context=U._canvas.getContext("2d",gf)),U.__context}};rn.METRICS_STRING="|ÉqÅ";rn.BASELINE_SYMBOL="M";rn.BASELINE_MULTIPLIER=1.4;rn.HEIGHT_MULTIPLIER=2;rn.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const t=new Intl.Segmenter;return e=>{const n=t.segment(e),s=[];let r=0;for(const i of n)s[r++]=i.segment;return s}}return t=>[...t]})();rn.experimentalLetterSpacing=!1;rn._fonts={};rn._measurementCache=ES(1e3);let an=rn;const qS=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Rc(t){const e=typeof t.fontSize=="number"?`${t.fontSize}px`:t.fontSize;let n=t.fontFamily;Array.isArray(t.fontFamily)||(n=t.fontFamily.split(","));for(let s=n.length-1;s>=0;s--){let r=n[s].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!qS.includes(r)&&(r=`"${r}"`),n[s]=r}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${n.join(",")}`}const _f=1e5;function $i(t,e,n,s=0,r=0,i=0){if(t.texture===ee.WHITE&&!t.fill)return Ce.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(t.fill){if(t.fill instanceof la){const o=t.fill,a=e.createPattern(o.texture.source.resource,"repeat"),c=o.transform.copyTo(Y.shared);return c.scale(o.texture.source.pixelWidth,o.texture.source.pixelHeight),a.setTransform(c),a}else if(t.fill instanceof nn){const o=t.fill,a=o.type==="linear",c=o.textureSpace==="local";let u=1,d=1;c&&n&&(u=n.width+s,d=n.height+s);let l,h=!1;if(a){const{start:f,end:p}=o;l=e.createLinearGradient(f.x*u+r,f.y*d+i,p.x*u+r,p.y*d+i),h=Math.abs(p.x-f.x)<Math.abs((p.y-f.y)*.1)}else{const{center:f,innerRadius:p,outerCenter:_,outerRadius:y}=o;l=e.createRadialGradient(f.x*u+r,f.y*d+i,p*u,_.x*u+r,_.y*d+i,y*u)}if(h&&c&&n){const f=n.lineHeight/d;for(let p=0;p<n.lines.length;p++){const _=(p*n.lineHeight+s/2)/d;o.colorStops.forEach(y=>{let m=_+y.offset*f;m=Math.max(0,Math.min(1,m)),l.addColorStop(Math.floor(m*_f)/_f,Ce.shared.setValue(y.color).toHex())})}}else o.colorStops.forEach(f=>{l.addColorStop(f.offset,Ce.shared.setValue(f.color).toHex())});return l}}else{const o=e.createPattern(t.texture.source.resource,"repeat"),a=t.matrix.copyTo(Y.shared);return a.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),o.setTransform(a),o}return $e("FillStyle not recognised",t),"red"}const yf=new we;function as(t){let e=0;for(let n=0;n<t.length;n++)t.charCodeAt(n)===32&&e++;return e}class KS{getCanvasAndContext(e){const{text:n,style:s,resolution:r=1}=e,i=s._getFinalPadding(),o=an.measureText(n||" ",s),a=Math.ceil(Math.ceil(Math.max(1,o.width)+i*2)*r),c=Math.ceil(Math.ceil(Math.max(1,o.height)+i*2)*r),u=Ec.getOptimalCanvasAndContext(a,c);this._renderTextToCanvas(s,i,r,u,o);const d=s.trim?PS({canvas:u.canvas,width:a,height:c,resolution:1,output:yf}):yf.set(0,0,a,c);return{canvasAndContext:u,frame:d}}returnCanvasAndContext(e){Ec.returnCanvasAndContext(e)}_renderTextToCanvas(e,n,s,r,i){var w,b,k;if(i.runsByLine&&i.runsByLine.length>0){this._renderTaggedTextToCanvas(i,e,n,s,r);return}const{canvas:o,context:a}=r,c=Rc(e),u=i.lines,d=i.lineHeight,l=i.lineWidths,h=i.maxLineWidth,f=i.fontProperties,p=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=e.textBaseline,(w=e._stroke)!=null&&w.width){const T=e._stroke;a.lineWidth=T.width,a.miterLimit=T.miterLimit,a.lineJoin=T.join,a.lineCap=T.cap}a.font=c;let _,y;const m=e.dropShadow?2:1,g=e.wordWrap?Math.max(e.wordWrapWidth,h):h,v=(((b=e._stroke)==null?void 0:b.width)??0)/2;let S=(d-f.fontSize)/2;d-f.fontSize<0&&(S=0);for(let T=0;T<m;++T){const C=e.dropShadow&&T===0,P=C?Math.ceil(Math.max(1,p)+n*2):0,R=P*s;if(C)this._setupDropShadow(a,e,s,R);else{const F=e._gradientBounds,L=e._gradientOffset;if(F){const J={width:F.width,height:F.height,lineHeight:F.height,lines:i.lines};this._setFillAndStrokeStyles(a,e,J,n,v,(L==null?void 0:L.x)??0,(L==null?void 0:L.y)??0)}else L?this._setFillAndStrokeStyles(a,e,i,n,v,L.x,L.y):this._setFillAndStrokeStyles(a,e,i,n,v);a.shadowColor="rgba(0,0,0,0)"}for(let F=0;F<u.length;F++){_=v,y=v+F*d+f.ascent+S,_+=this._getAlignmentOffset(l[F],g,e.align);let L=0;if(e.align==="justify"&&e.wordWrap&&F<u.length-1){const J=as(u[F]);J>0&&(L=(g-l[F])/J)}(k=e._stroke)!=null&&k.width&&this._drawLetterSpacing(u[F],e,r,_+n,y+n-P,!0,L),e._fill!==void 0&&this._drawLetterSpacing(u[F],e,r,_+n,y+n-P,!1,L)}}}_renderTaggedTextToCanvas(e,n,s,r,i){var v,S,w;const{canvas:o,context:a}=i,{runsByLine:c,lineWidths:u,maxLineWidth:d,lineAscents:l,lineHeights:h,hasDropShadow:f}=e,p=o.height;a.resetTransform(),a.scale(r,r),a.textBaseline=n.textBaseline;const _=f?2:1,y=n.wordWrap?Math.max(n.wordWrapWidth,d):d;let m=((v=n._stroke)==null?void 0:v.width)??0;for(const b of c)for(const k of b){const T=((S=k.style._stroke)==null?void 0:S.width)??0;T>m&&(m=T)}const g=m/2,x=[];for(let b=0;b<c.length;b++){const k=c[b],T=[];for(const C of k){const P=Rc(C.style);a.font=P,T.push({width:an._measureText(C.text,C.style.letterSpacing,a),font:P})}x.push(T)}for(let b=0;b<_;++b){const k=f&&b===0,T=k?Math.ceil(Math.max(1,p)+s*2):0,C=T*r;k||(a.shadowColor="rgba(0,0,0,0)");let P=g;for(let R=0;R<c.length;R++){const F=c[R],L=u[R],J=l[R],O=h[R],B=x[R];let E=g;E+=this._getAlignmentOffset(L,y,n.align);let A=0;if(n.align==="justify"&&n.wordWrap&&R<c.length-1){let z=0;for(const G of F)z+=as(G.text);z>0&&(A=(y-L)/z)}const D=P+J;let $=E+s;for(let z=0;z<F.length;z++){const G=F[z],{width:W,font:j}=B[z];if(a.font=j,a.textBaseline=G.style.textBaseline,(w=G.style._stroke)!=null&&w.width){const Q=G.style._stroke;if(a.lineWidth=Q.width,a.miterLimit=Q.miterLimit,a.lineJoin=Q.join,a.lineCap=Q.cap,k)if(G.style.dropShadow)this._setupDropShadow(a,G.style,r,C);else{const ye=as(G.text);$+=W+ye*A;continue}else{const ye=an.measureFont(j),Z=G.style.lineHeight||ye.fontSize,xe={width:W,height:Z,lineHeight:Z,lines:[G.text]};a.strokeStyle=$i(Q,a,xe,s*2,$-s,P)}this._drawLetterSpacing(G.text,G.style,i,$,D+s-T,!0,A)}const ne=as(G.text);$+=W+ne*A}$=E+s;for(let z=0;z<F.length;z++){const G=F[z],{width:W,font:j}=B[z];if(a.font=j,a.textBaseline=G.style.textBaseline,G.style._fill!==void 0){if(k)if(G.style.dropShadow)this._setupDropShadow(a,G.style,r,C);else{const Q=as(G.text);$+=W+Q*A;continue}else{const Q=an.measureFont(j),ye=G.style.lineHeight||Q.fontSize,Z={width:W,height:ye,lineHeight:ye,lines:[G.text]};a.fillStyle=$i(G.style._fill,a,Z,s*2,$-s,P)}this._drawLetterSpacing(G.text,G.style,i,$,D+s-T,!1,A)}const ne=as(G.text);$+=W+ne*A}P+=O}}}_setFillAndStrokeStyles(e,n,s,r,i,o=0,a=0){var c;if(e.fillStyle=n._fill?$i(n._fill,e,s,r*2,o,a):null,(c=n._stroke)!=null&&c.width){const u=i+r*2;e.strokeStyle=$i(n._stroke,e,s,u,o,a)}}_setupDropShadow(e,n,s,r){e.fillStyle="black",e.strokeStyle="black";const i=n.dropShadow,o=i.color,a=i.alpha;e.shadowColor=Ce.shared.setValue(o).setAlpha(a).toRgbaString();const c=i.blur*s,u=i.distance*s;e.shadowBlur=c,e.shadowOffsetX=Math.cos(i.angle)*u,e.shadowOffsetY=Math.sin(i.angle)*u+r}_getAlignmentOffset(e,n,s){return s==="right"?n-e:s==="center"?(n-e)/2:0}_drawLetterSpacing(e,n,s,r,i,o=!1,a=0){const{context:c}=s,u=n.letterSpacing;let d=!1;if(an.experimentalLetterSpacingSupported&&(an.experimentalLetterSpacing?(c.letterSpacing=`${u}px`,c.textLetterSpacing=`${u}px`,d=!0):(c.letterSpacing="0px",c.textLetterSpacing="0px")),(u===0||d)&&a===0){o?c.strokeText(e,r,i):c.fillText(e,r,i);return}if(a!==0&&(u===0||d)){const _=e.split(" ");let y=r;const m=c.measureText(" ").width;for(let g=0;g<_.length;g++)o?c.strokeText(_[g],y,i):c.fillText(_[g],y,i),y+=c.measureText(_[g]).width+m+a;return}let l=r;const h=an.graphemeSegmenter(e);let f=c.measureText(e).width,p=0;for(let _=0;_<h.length;++_){const y=h[_];o?c.strokeText(y,l,i):c.fillText(y,l,i);let m="";for(let g=_+1;g<h.length;++g)m+=h[g];p=c.measureText(m).width,l+=f-p+u,y===" "&&(l+=a),f=p}}}const Ts=new KS,Vu=class Wn extends Nt{constructor(e={}){super(),this.uid=_e("textStyle"),this._tick=0,this._cachedFontString=null,QS(e),e instanceof Wn&&(e=e._toObject());const r={...Wn.defaultTextStyle,...e};for(const i in r){const o=i;this[o]=r[i]}this._tagStyles=e.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Wn.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Wn.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Mt.defaultFillStyle,...e},()=>{this._fill=Xn({...this._originalFill},Mt.defaultFillStyle)})),this._fill=Xn(e===0?"black":e,Mt.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Mt.defaultStrokeStyle,...e},()=>{this._stroke=Go({...this._originalStroke},Mt.defaultStrokeStyle)})),this._stroke=Go(e,Mt.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(e){this._tagStyles!==e&&(this._tagStyles=e??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const e=Wn.defaultTextStyle;for(const n in e)this[n]=e[n]}assign(e){for(const n in e){const s=n;this[s]=e[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=Rc(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new Wn(this._toObject())}_getFinalPadding(){let e=0;if(this._filters)for(let n=0;n<this._filters.length;n++)e+=this._filters[n].padding;return Math.max(this._padding,e)}destroy(e=!1){var s,r,i,o;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const a=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(s=this._fill)!=null&&s.texture&&this._fill.texture.destroy(a),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(a),(i=this._stroke)!=null&&i.texture&&this._stroke.texture.destroy(a),(o=this._originalStroke)!=null&&o.texture&&this._originalStroke.texture.destroy(a)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,n){return new Proxy(e,{set:(s,r,i)=>(s[r]===i||(s[r]=i,n==null||n(r,i),this.update()),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Ce.isColorLike(e)||e instanceof nn||e instanceof la)}};Vu.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Vu.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let $s=Vu;function QS(t){const e=t;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const n=$s.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??n.alpha,angle:e.dropShadowAngle??n.angle,blur:e.dropShadowBlur??n.blur,color:e.dropShadowColor??n.color,distance:e.dropShadowDistance??n.distance}}if(e.strokeThickness!==void 0){q(ge,"strokeThickness is now a part of stroke");const n=e.stroke;let s={};if(Ce.isColorLike(n))s.color=n;else if(n instanceof nn||n instanceof la)s.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))s=n;else throw new Error("Invalid stroke value.");t.stroke={...s,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if(q(ge,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&$e("The number of fill colors must match the number of fill gradient stops.");const n=new nn({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),s=e.fillGradientStops.slice(),r=e.fill.map(i=>Ce.shared.setValue(i).toNumber());s.forEach((i,o)=>{n.addColorStop(i,r[o])}),t.fill={fill:n}}}function ZS(t,e){const{texture:n,bounds:s}=t,r=e._style._getFinalPadding();hg(s,e._anchor,n);const i=e._anchor._x*r*2,o=e._anchor._y*r*2;s.minX-=r-i,s.minY-=r-o,s.maxX-=r-i,s.maxY-=r-o}class JS{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class eb extends JS{}class P0{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new ci({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const e in this._managedTexts.items){const n=this._managedTexts.items[e];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(e){const n=this._getGpuText(e),s=e.styleKey;return n.currentKey!==s?!0:e._didTextUpdate}addRenderable(e,n){const s=this._getGpuText(e);if(e._didTextUpdate){const r=e._autoResolution?this._renderer.resolution:e.resolution;(s.currentKey!==e.styleKey||e._resolution!==r)&&this._updateGpuText(e),e._didTextUpdate=!1,ZS(s,e)}this._renderer.renderPipes.batch.addToBatch(s,n)}updateRenderable(e){const n=this._getGpuText(e);n._batcher.updateElement(n)}_updateGpuText(e){const n=this._getGpuText(e);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,n.texture=this._renderer.canvasText.getManagedTexture(e),n.currentKey=e.styleKey}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const n=new eb;return n.currentKey="--",n.renderable=e,n.transform=e.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=n,this._managedTexts.add(e),n}onTextUnload(e){const n=e._gpuData[this._renderer.uid];if(!n)return;const{canvasText:s}=this._renderer;s.getReferenceCount(n.currentKey)>0?s.decreaseReferenceCount(n.currentKey):n.texture&&s.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}P0.extension={type:[V.WebGLPipes,V.WebGPUPipes,V.CanvasPipes],name:"text"};const tb=new vt;function nb(t,e,n,s,r=!1){const i=tb;i.minX=0,i.minY=0,i.maxX=t.width/s|0,i.maxY=t.height/s|0;const o=ra.getOptimalTexture(i.width,i.height,s,!1,r);return o.source.uploadMethodId="image",o.source.resource=t,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=e/s,o.frame.height=n/s,o.source.emit("update",o.source),o.updateUvs(),o}class A0{constructor(e,n){this._activeTextures={},this._renderer=e,this._retainCanvasContext=n}getTexture(e,n,s,r){typeof e=="string"&&(q("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:s,resolution:n}),e.style instanceof $s||(e.style=new $s(e.style)),e.textureStyle instanceof js||(e.textureStyle=new js(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:i,style:o,textureStyle:a,autoGenerateMipmaps:c}=e,u=e.resolution??this._renderer.resolution,{frame:d,canvasAndContext:l}=Ts.getCanvasAndContext({text:i,style:o,resolution:u}),h=nb(l.canvas,d.width,d.height,u,c);if(a&&(h.source.style=a),o.trim&&(d.pad(o.padding),h.frame.copyFrom(d),h.frame.scale(1/u),h.updateUvs()),o.filters){const f=this._applyFilters(h,o.filters);return this.returnTexture(h),Ts.returnCanvasAndContext(l),f}return this._renderer.texture.initSource(h._source),this._retainCanvasContext||Ts.returnCanvasAndContext(l),h}returnTexture(e){const n=e.source,s=n.resource;if(this._retainCanvasContext&&(s!=null&&s.getContext)){const r=s.getContext("2d");r&&Ts.returnCanvasAndContext({canvas:s,context:r})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",ra.returnTexture(e,!0)}renderTextToCanvas(){q("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const n=e.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const s=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle,autoGenerateMipmaps:e.autoGenerateMipmaps});return this._activeTextures[n]={texture:s,usageCount:1},s}decreaseReferenceCount(e){const n=this._activeTextures[e];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[e]=null))}getReferenceCount(e){var n;return((n=this._activeTextures[e])==null?void 0:n.usageCount)??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++}_applyFilters(e,n){const s=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:e,filters:n});return this._renderer.renderTarget.bind(s,!1),r}destroy(){this._renderer=null;for(const e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null}}class E0 extends A0{constructor(e){super(e,!0)}}E0.extension={type:[V.CanvasSystem],name:"canvasText"};class R0 extends A0{constructor(e){super(e,!1)}}R0.extension={type:[V.WebGLSystem,V.WebGPUSystem],name:"canvasText"};Se.add(E0);Se.add(R0);Se.add(P0);class Us extends kS{constructor(...e){const n=TS(e,"Text");super(n,$s),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof js?n.textureStyle:new js(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??wt.defaultOptions.autoGenerateMipmaps}updateBounds(){const e=this._bounds,n=this._anchor;let s=0,r=0;if(this._style.trim){const{frame:i,canvasAndContext:o}=Ts.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Ts.returnCanvasAndContext(o),s=i.width,r=i.height}else{const i=an.measureText(this._text,this._style);s=i.width,r=i.height}e.minX=-n._x*s,e.maxX=e.minX+s,e.minY=-n._y*r,e.maxY=e.minY+r}}Se.add(Cx,Mx);class sb{constructor(e){this.starfield=null,this.starfieldGraphics=null,this.nebula=null,this.vignette=null,this.app=e,this.container=new Me,this.renderNebula(),this.renderStarfield(),this.renderVignette()}renderStarfield(){const e=this.app.renderer.width,n=this.app.renderer.height,s=400;let r=0;const i=()=>(r=(r*9301+49297)%233280,r/233280),o=new se;for(let c=0;c<s;c++){const u=i()*e,d=i()*n,l=i()*1.5,h=.3+i()*.7;o.circle(u,d,l).fill({color:16777215,alpha:h*.6})}const a=this.app.renderer.generateTexture(o);o.destroy(),this.starfield=new tn(a),this.container.addChild(this.starfield)}renderNebula(){const e=new se,n=this.app.renderer.width,s=this.app.renderer.height;e.rect(0,0,n,s).fill({color:657946,alpha:.4});const r=[{x:n*.25,y:s*.3,radius:350,color:1706542,alpha:.04},{x:n*.7,y:s*.6,radius:280,color:662062,alpha:.03},{x:n*.5,y:s*.8,radius:320,color:1706542,alpha:.05},{x:n*.15,y:s*.7,radius:220,color:662062,alpha:.02}];for(const i of r)e.circle(i.x,i.y,i.radius).fill({color:i.color,alpha:i.alpha});this.nebula=e,this.container.addChild(this.nebula)}renderVignette(){const e=new se,n=this.app.renderer.width,s=this.app.renderer.height,r=394002,i=.45,o=12;for(let a=0;a<o;a++){const c=a/o,u=i*(1-c)*(1-c),d=c*Math.min(n,s)*.4;e.rect(0,d-d/o,n,d/o+2).fill({color:r,alpha:u}),e.rect(0,s-d,n,d/o+2).fill({color:r,alpha:u}),e.rect(d-d/o,d,d/o+2,s-2*d).fill({color:r,alpha:u}),e.rect(n-d,d,d/o+2,s-2*d).fill({color:r,alpha:u})}this.vignette=e,this.container.addChild(this.vignette)}tick(e){}}class I0{constructor(e=64){this.size=e,this.canvas=new OffscreenCanvas(e,e),this.ctx=this.canvas.getContext("2d"),this.imgData=this.ctx.createImageData(e,e),this.texture=ee.from(this.canvas)}hash(e,n){return Math.abs(Math.sin(e*127.1+n*311.7)*43758.5453)%1}noise(e,n){const s=Math.floor(e),r=Math.floor(n),i=e-s,o=n-r,a=i*i*(3-2*i),c=o*o*(3-2*o),u=this.hash(s,r),d=this.hash(s+1,r),l=this.hash(s,r+1),h=this.hash(s+1,r+1);return u+(d-u)*a+(l-u)*c+(u-d-l+h)*a*c}fbm(e,n,s=5){let r=0,i=.5;for(let o=0;o<s;o++)r+=i*this.noise(e,n),e=e*2.07+.1,n=n*2.07-.2,i*=.47;return r}update(e,n,s,r,i){const o=this.size,a=o/2,c=this.imgData.data,u=e,d=s*17.3,l=n;for(let h=0;h<o;h++)for(let f=0;f<o;f++){const p=(f-a)/a,_=(h-a)/a,y=Math.sqrt(p*p+_*_),m=(h*o+f)*4;if(y>1){c[m]=c[m+1]=c[m+2]=c[m+3]=0;continue}const g=Math.atan2(_,p),x=g/(Math.PI*2)+.5,v=y,S=this.fbm(x*3+u*.12+d,v*4+u*.08,4),w=this.fbm(x*5-u*.15+d*.7,v*3+u*.1,4),b=S*.6+w*.4,k=.1+l*.3,T=this.fbm(p*3+u*k+d,_*3+u*k*.8,3),C=Math.exp(-y*y*5),P=Math.exp(-y*y*2),R=l*(Math.sin(y*12-u*6)*.5+.5)*Math.exp(-y*2)*.5,F=Math.max(0,1-Math.abs(y-.55-Math.sin(u*.5)*.03)/.025),L=Math.max(0,1-Math.abs(y-.75+Math.cos(u*.7)*.02)/.02),J=Math.max(0,1-Math.abs(y-.9)/.015),O=(F*.25+L*.18+J*.12)*(1+l*2);let B=0;for(let Z=0;Z<4;Z++){const xe=g+u*.3+d+Z*Math.PI/2,ht=Math.pow(Math.max(0,Math.cos(xe*3+T*4)),12),Ve=Math.min(1,Math.max(0,(y-.2)/.3))*Math.min(1,Math.max(0,(1-y)/.4));B+=ht*Ve*.15}B*=1+l*3;const E=1,A=.98,D=.93,$=C*.6;let z=r[0]*.7+(E-r[0]*.7)*$,G=r[1]*.7+(A-r[1]*.7)*$,W=r[2]*.7+(D-r[2]*.7)*$;z+=i[0]*(O*.8+B*.7+R*.4),G+=i[1]*(O*.8+B*.7+R*.4),W+=i[2]*(O*.8+B*.7+R*.4);const j=b*P*.5;z=z*(1-j)+i[0]*j,G=G*(1-j)+i[1]*j,W=W*(1-j)+i[2]*j;const ne=1-T*.2;z*=ne,G*=ne,W*=ne,z+=l*i[0]*.15,G+=l*i[1]*.15,W+=l*i[2]*.15;const Q=Math.pow(Math.min(1,Math.max(0,(y-.35)/.6)),2);z+=i[0]*Q*(.12+l*.15),G+=i[1]*Q*(.12+l*.15),W+=i[2]*Q*(.12+l*.15);const ye=Math.min(1,Math.max(0,(1-y)/.15));c[m]=Math.min(255,z*ye*255)|0,c[m+1]=Math.min(255,G*ye*255)|0,c[m+2]=Math.min(255,W*ye*255)|0,c[m+3]=ye*255|0}this.ctx.putImageData(this.imgData,0,0),this.texture.source.update()}destroy(){this.texture.destroy()}}let Ic=null;const hl=new Map,dl=new Map,fl=new Map,pl=new Map,ml=new Map;let gl=null;const L0=32,rb=32,ib=48,ob=64,ab=64;function lb(t){Ic=t}function Ys(){if(!Ic)throw new Error("NodeTextures not initialized — call initNodeTextures(renderer) first");return Ic}function xf(t){if(hl.has(t))return hl.get(t);const e=Ys(),n=L0,s=new se;s.circle(n,n,n).fill({color:t,alpha:.12}),s.circle(n,n,n*.7).fill({color:t,alpha:.08}),s.circle(n,n,n*.4).fill({color:t,alpha:.05});const r=e.generateTexture(s);return s.destroy(),hl.set(t,r),r}function cb(t){if(dl.has(t))return dl.get(t);const e=Ys(),n=L0/2,s=new se;s.circle(n,n,n).fill({color:t,alpha:.9});const r=e.generateTexture(s);return s.destroy(),dl.set(t,r),r}function ub(t){if(fl.has(t))return fl.get(t);const e=Ys(),n=rb/2,s=new se;s.poly([n,0,n*2,n,n,n*2,0,n]).fill({color:t,alpha:.9});const r=e.generateTexture(s);return s.destroy(),fl.set(t,r),r}function hb(t){if(pl.has(t))return pl.get(t);const e=Ys(),n=ib/2,s=n*.75,r=new se,i=6;for(let a=0;a<i;a++){const c=a/i*Math.PI*2,u=(a+.38)/i*Math.PI*2;if(r.arc(n,n,s,c,u).stroke({width:1,color:t,alpha:.8}),a<i-1){const d=(a+1)/i*Math.PI*2;r.moveTo(n+Math.cos(d)*s,n+Math.sin(d)*s)}}r.circle(n,n,s*1.1).fill({color:t,alpha:.2});const o=e.generateTexture(r);return r.destroy(),pl.set(t,o),o}function db(t,e){const n=`${t}-${e}`;if(ml.has(n))return ml.get(n);const s=Ys(),r=ob/2,i=new se;i.circle(r,r,r).fill({color:t,alpha:.03}),i.circle(r,r,r*.7).fill({color:t,alpha:.05}),i.circle(r,r,r*.45).fill({color:t,alpha:.08});const o=s.generateTexture(i);return i.destroy(),ml.set(n,o),o}function fb(){if(gl)return gl;const t=Ys(),e=ab/2,n=e*.8,s=16498468,r=new se,i=10;for(let a=0;a<i;a++){const c=a/i*Math.PI*2,u=(a+.4)/i*Math.PI*2;if(r.arc(e,e,n,c,u).stroke({width:1.5,color:s,alpha:.8}),a<i-1){const d=(a+1)/i*Math.PI*2;r.moveTo(e+Math.cos(d)*n,e+Math.sin(d)*n)}}const o=t.generateTexture(r);return r.destroy(),gl=o,o}function $n(t){const e=new tn(t);return e.anchor.set(.5),e}class pb{constructor(e){this.coreLabel=null,this.modelLabel=null,this.orbitRingGraphics=[],this.nodeObjects=new Map,this.permissionActive=!1,this.permSprite=null,this.time=0,this.coreAct=0,this.seed=0,this.coreGlowSprite=null,this.plasmaCore=null,this.plasmaSprite=null,this.modelFamily="unknown",this.data=e,this.container=new Me,this.container.position.set(e.centerX,e.centerY);let n=0;for(let o=0;o<e.sessionId.length;o++)n=Math.imul(n^e.sessionId.charCodeAt(o),16777619);this.seed=(n>>>0)%1e4/1e4,this.modelFamily=Mi(e.model||"");try{this.plasmaCore=new I0(48),this.plasmaSprite=new tn(this.plasmaCore.texture),this.plasmaSprite.anchor.set(.5);const o=e.isChild?22:32;this.plasmaSprite.width=o,this.plasmaSprite.height=o,this.container.addChild(this.plasmaSprite)}catch{this.plasmaCore=null,this.plasmaSprite=null}this.initCoreGlow();const s=fb();this.permSprite=$n(s);const i=e.isChild?4.5:7;this.permSprite.scale.set(i*2.5*2/64),this.permSprite.visible=!1,this.container.addChild(this.permSprite),this.createCoreLabel(),this.createModelLabel()}get cluster(){return this.data}initCoreGlow(){const e=tt[this.modelFamily]||tt.unknown,n=db(e.glow,e.brightHex);this.coreGlowSprite=$n(n);const r=this.data.isChild?4.5:7;this.coreGlowSprite.scale.set(r*4*2/64),this.container.addChildAt(this.coreGlowSprite,0)}createCoreLabel(){const e=this.data.isChild,n=e?"agent":"session",s=tt[this.modelFamily]||tt.unknown;this.coreLabel=new Us({text:`${n}:${this.data.label}`,style:{fontSize:11,fontFamily:"monospace",fill:s.brightHex,align:"center"}});const r=e?4.5:7;this.coreLabel.anchor.set(.5,0),this.coreLabel.position.set(0,r+6),this.coreLabel.alpha=e?.65:.7,this.container.addChild(this.coreLabel)}createModelLabel(){const e=this.data.model;if(!e)return;const n=Mi(e),s=e.match(/(\d+)[-.](\d+)/),r=s?`${s[1]}.${s[2]}`:"",i=r?`${n} ${r}`:n,o=tt[n]||tt.unknown;this.modelLabel=new Us({text:i,style:{fontSize:7,fontFamily:"monospace",fill:o.brightHex,align:"center"}});const c=this.data.isChild?4.5:7;this.modelLabel.anchor.set(.5,0),this.modelLabel.position.set(0,c+20),this.modelLabel.alpha=.5,this.container.addChild(this.modelLabel)}setPermission(e){this.permissionActive=e,this.permSprite&&(this.permSprite.visible=e)}updateOrbitRings(){for(const e of this.orbitRingGraphics)this.container.removeChild(e),e.destroy();this.orbitRingGraphics=[];for(let e=0;e<this.data.ringCounts.length;e++)if(this.data.ringCounts[e]>0){const n=new se,s=ot[e]||ot[ot.length-1];n.circle(0,0,s).stroke({width:.6,color:16777215,alpha:.045}),this.container.addChildAt(n,0),this.orbitRingGraphics.push(n)}}triggerActivity(){this.coreAct=1}tick(e){if(this.container.position.set(this.data.centerX,this.data.centerY),this.time+=e,this.coreAct>0&&(this.coreAct=Math.max(0,this.coreAct-.02)),this.data.model){const c=Mi(this.data.model);if(c!==this.modelFamily&&(this.modelFamily=c,this.coreLabel)){const u=tt[c]||tt.unknown;this.coreLabel.style.fill=u.brightHex}}const n=this.data.isChild,s=n?4.5:7,r=this.data.compacting??0,i=this.data.compacted??0;let o=1+Math.sin(this.time*.8+this.seed*6)*.03+this.coreAct*.12;if(r>.1?o*=1-r*.4:i>.1&&(o*=1+i*.5),this.coreGlowSprite){const c=s*4*2/64;this.coreGlowSprite.scale.set(c*o),this.coreGlowSprite.alpha=.8+this.coreAct*.2}if(this.plasmaCore&&this.plasmaSprite){const c=tt[this.modelFamily]||tt.unknown;let u=c.base,d=c.bright;r>.1?(u=[.19,.25,.5],d=[.31,.38,.75]):i>.1&&(u=[1,.82,.38],d=[1,.94,.75]),Math.floor(this.time*60)%3===0&&this.plasmaCore.update(this.time,this.coreAct,this.seed,u,d);const l=(n?22:32)*o;this.plasmaSprite.width=l,this.plasmaSprite.height=l}this.permSprite&&this.permissionActive&&(this.permSprite.rotation=this.time*1.2,this.permSprite.alpha=.7+Math.sin(this.time*3)*.2);for(const c of this.orbitRingGraphics)r>.1?(c.scale.set(1-r*.3),c.alpha=1-r*.6):i>.1?(c.scale.set(1+i*.15),c.alpha=1):(c.scale.set(1),c.alpha=1);const a=this.data.model;if(a){const c=Mi(a);this.modelLabel?c!==this.modelFamily&&(this.container.removeChild(this.modelLabel),this.modelLabel.destroy(),this.modelLabel=null,this.createModelLabel()):this.createModelLabel()}}drawRingsIntoBatch(e,n,s){const i=this.data.isChild?4.5:7,o=this.time,a=this.coreAct,c=this.seed,u=this.data.compacting??0,d=this.data.compacted??0,l=tt[this.modelFamily]||tt.unknown;let h=l.glow,f=l.brightHex;u>.1?(h=3162240,f=8425664):d>.1&&(h=16765024,f=16777215);let p=1+Math.sin(o*.8+c*6)*.03+a*.12;u>.1?p*=1-u*.4:d>.1&&(p*=1+d*.5);const _=i*p,y=n,m=s,g=_*(2+Math.sin(o*.5+c)*.08),x=_*(2.8+Math.sin(o*.35+c+2)*.06),v=.06+a*.08;e.circle(y,m,g).stroke({width:.5,color:h,alpha:v}),e.circle(y,m,x).stroke({width:.4,color:h,alpha:v*.7});const S=[{r:1.5,speed:.6,len:.5,width:1},{r:1.9,speed:-.4,len:.35,width:.8},{r:2.3,speed:.3,len:.6,width:.7},{r:1.3,speed:-.8,len:.25,width:.6},{r:2.6,speed:.2,len:.4,width:.5}];for(let w=0;w<S.length;w++){const b=S[w],k=_*b.r,T=o*b.speed+c*(w+1)*1.3+w*1.25,C=b.len+Math.sin(o*1.2+w*.9)*.1,P=(.15+a*.2)*(1-w*.12);e.arc(y,m,k,T,T+C).stroke({width:b.width,color:h,alpha:P});const R=S[w+1];if(R){const F=o*R.speed+c*(w+2)*1.3+(w+1)*1.25,L=_*R.r;e.moveTo(y+Math.cos(F)*L,m+Math.sin(F)*L)}}for(let w=0;w<3;w++){const b=_*(1.6+w*.5),k=.7+w*.3+c*.2,T=o*k+w*2.09+c*4,C=y+Math.cos(T)*b,P=m+Math.sin(T)*b,R=.4+a*.4+Math.sin(o*2+w)*.15;e.circle(C,P,2.5).fill({color:h,alpha:R*.3}),e.circle(C,P,1).fill({color:f,alpha:R})}if(a>.1)for(let w=0;w<5;w++){const b=_*(1.2+a*1.5+w*.2),k=o*(1.5+w*.4)+w*1.26+c*3,T=y+Math.cos(k)*b,C=m+Math.sin(k)*b,P=a*.5*(1-w/5);e.circle(T,C,.8).fill({color:f,alpha:P})}}destroy(){var e;for(const n of this.orbitRingGraphics)n.destroy();this.orbitRingGraphics=[],(e=this.plasmaCore)==null||e.destroy(),this.plasmaCore=null,this.container.destroy({children:!0})}}class vf{constructor(e){this.nodeLabel=null,this.impactGraphics=null,this.actionLabel=null,this.actionFade=0,this.glowSprite=null,this.bodySprite=null,this.agentRingSprite=null,this.orbitRadii=ot,this.time=0,this.isHovered=!1,this.isSelected=!1,this.life=1,this.isRemoved=!1,this.impactTime=0,this.compacting=0,this.compacted=0,this.agentPlasma=null,this.agentPlasmaSprite=null,this.impactType=null,this.impactProgress=0,this.IMPACT_SPEED=1/.4,this.data=e,this.container=new Me,this.baseRadius=Math.max(2,e.baseRadius),this.life=e.life??1,this.impactTime=e.impactTime??0,e.nodeType==="agent"?this.initAgentVisuals(e):e.nodeType==="file"?this.initFileVisuals(e):this.initEphemeralVisuals(e),this.createNodeLabel(),this.updatePosition(),this.container.eventMode="static",this.container.cursor="pointer"}initFileVisuals(e){const n=xf(e.color);this.glowSprite=$n(n);const s=this.baseRadius*2.5/16;this.glowSprite.scale.set(s),this.container.addChild(this.glowSprite);const r=cb(e.color);this.bodySprite=$n(r);const i=this.baseRadius/8;this.bodySprite.scale.set(i),this.container.addChild(this.bodySprite)}initEphemeralVisuals(e){const n=ub(e.color);this.bodySprite=$n(n);const s=this.baseRadius/8;this.bodySprite.scale.set(s),this.container.addChild(this.bodySprite)}initAgentVisuals(e){try{this.agentPlasma=new I0(32),this.agentPlasmaSprite=new tn(this.agentPlasma.texture),this.agentPlasmaSprite.anchor.set(.5),this.agentPlasmaSprite.width=12,this.agentPlasmaSprite.height=12,this.container.addChild(this.agentPlasmaSprite)}catch{}const n=hb(e.color);this.agentRingSprite=$n(n);const s=18/24;this.agentRingSprite.scale.set(s),this.container.addChild(this.agentRingSprite);const r=xf(e.color);this.glowSprite=$n(r),this.glowSprite.scale.set(.6),this.container.addChildAt(this.glowSprite,0)}createNodeLabel(){this.nodeLabel=new Us({text:this.data.label,style:{fontSize:7,fontFamily:"monospace",fill:this.data.color,align:"center"}}),this.nodeLabel.anchor.set(.5,0),this.nodeLabel.position.set(0,this.baseRadius+3),this.nodeLabel.alpha=1,this.container.addChild(this.nodeLabel)}playImpact(e){this.impactTime=1,this.impactGraphics||(this.impactGraphics=new se,this.container.addChild(this.impactGraphics)),this.impactType=e,this.impactProgress=1}tickImpact(e){if(!this.impactGraphics||this.impactType===null)return;if(this.impactProgress-=e*this.IMPACT_SPEED,this.impactProgress<=0){this.container.removeChild(this.impactGraphics),this.impactGraphics.destroy({children:!0}),this.impactGraphics=null,this.impactType=null;return}const n=this.impactProgress,s=this.data.baseRadius;switch(this.impactGraphics.clear(),this.impactType){case"scan":this.impactGraphics.circle(0,0,s+n*15).stroke({width:1.5,color:4906624,alpha:n*.8});break;case"spark":for(let r=0;r<6;r++){const i=r/6*Math.PI*2,o=(1-n)*20;this.impactGraphics.circle(Math.cos(i)*o,Math.sin(i)*o,2).fill({color:16739125,alpha:n*.8})}break;case"ping":this.impactGraphics.circle(0,0,s+(1-n)*12).stroke({width:1,color:4906624,alpha:n*.6}),this.impactGraphics.circle(0,0,s+(1-n)*22).stroke({width:1,color:4906624,alpha:n*.3});break;case"fade":this.impactGraphics.circle(0,0,s+(1-n)*8).fill({color:16777215,alpha:n*.5});break;case"fail":{const r=8+n*4;this.impactGraphics.moveTo(-r,-r).lineTo(r,r).stroke({width:2,color:16711680,alpha:n*.8}),this.impactGraphics.moveTo(r,-r).lineTo(-r,r).stroke({width:2,color:16711680,alpha:n*.8});break}case"morph":this.impactGraphics.circle(0,0,s+(1-n)*8).stroke({width:1,color:10309341,alpha:n*.7}),this.impactGraphics.circle(0,0,s+(1-n)*16).stroke({width:1,color:10309341,alpha:n*.4});break}}tick(e){if(this.time+=e,this.tickImpact(e),this.impactTime>0&&(this.impactTime-=.022,this.impactTime<0&&(this.impactTime=0)),this.data.life<1&&(this.life=Math.max(0,this.data.life),this.life<=0&&(this.isRemoved=!0)),this.updatePosition(),this.agentPlasma&&this.agentPlasmaSprite){if(Math.floor(this.time*60)%4===0){const r=tt.unknown;this.agentPlasma.update(this.time,this.impactTime,.5,r.base,r.bright)}this.agentPlasmaSprite.alpha=this.life}if(this.agentRingSprite&&(this.agentRingSprite.rotation=this.time*2.5),this.glowSprite){const r=.12*this.life+(this.impactTime>0?this.impactTime*.3:0);this.glowSprite.alpha=r}if(this.bodySprite&&this.data.nodeType==="file"){const r=this.data.impactType==="morph"?this.data.impactTime*1.8:0,i=(this.baseRadius+r)/8;this.bodySprite.scale.set(i)}this.actionLabel&&this.actionFade>0&&(this.actionFade-=e*.25,this.actionLabel.alpha=Math.max(0,this.actionFade*.9),this.actionLabel.position.y-=e*3,this.actionFade<=0&&(this.container.removeChild(this.actionLabel),this.actionLabel.destroy(),this.actionLabel=null,this.actionFade=0));let n=this.life;this.compacting>.1?n*=1-this.compacting*.6:this.compacted>.1&&(n=Math.min(1,n*(1+this.compacted*.3))),this.container.alpha=n;let s=this.life;this.compacting>.1?s*=1-this.compacting*.3:this.compacted>.2&&(s*=1+this.compacted*.15),this.isSelected?s*=1.3:this.isHovered&&(s*=1.15),this.container.scale.set(s)}setHovered(e){this.isHovered=e}setSelected(e){this.isSelected=e}showAction(e,n){this.actionLabel&&(this.container.removeChild(this.actionLabel),this.actionLabel.destroy()),this.actionLabel=new Us({text:e,style:{fontSize:7,fontFamily:"monospace",fill:n,align:"center"}}),this.actionLabel.anchor.set(.5,1),this.actionLabel.position.set(0,-(this.baseRadius+8)),this.actionLabel.alpha=.9,this.actionFade=1,this.container.addChild(this.actionLabel)}updatePosition(){if(this.data.nodeType!=="file"){const r=this.data.orbitAngle;let i=this.data.orbitRadius;this.compacting>.1?i*=1-this.compacting*.4:this.compacted>.1&&(i*=1+this.compacted*.2),this.container.position.set(Math.cos(r)*i,Math.sin(r)*i);return}const e=Math.max(0,Math.min(this.data.orbitRing,this.orbitRadii.length-1));let n=this.orbitRadii[e];this.compacting>.1?n*=1-this.compacting*.4:this.compacted>.1&&(n*=1+this.compacted*.2);const s=this.data.orbitAngle;this.container.position.set(Math.cos(s)*n,Math.sin(s)*n)}destroy(){var e;this.actionLabel&&(this.actionLabel.destroy(),this.actionLabel=null),this.impactGraphics&&(this.impactGraphics.destroy({children:!0}),this.impactGraphics=null),(e=this.agentPlasma)==null||e.destroy(),this.agentPlasma=null,this.container.destroy({children:!0})}}class mb{constructor(e,n){this.currentScale=1,this.targetScale=1,this.currentCx=0,this.currentCy=0,this.targetCx=0,this.targetCy=0,this.lerpAlpha=.15,this.autofitEnabled=!0,this.manualPanX=0,this.manualPanY=0,this.manualZoom=1,this.idleTimer=0,this.idleThreshold=2,this.dragging=!1,this.dragLastX=0,this.dragLastY=0,this.shakeIntensity=0,this.shakeDecay=.92,this.pinnedPoints=[],this.app=e,this.worldLayer=n,this.canvas=e.canvas,this.onWheel=this.handleWheel.bind(this),this.onPointerDown=this.handlePointerDown.bind(this),this.onPointerMove=this.handlePointerMove.bind(this),this.onPointerUp=this.handlePointerUp.bind(this),this.setupControls()}setupControls(){this.canvas.addEventListener("wheel",this.onWheel,{passive:!0}),this.canvas.addEventListener("pointerdown",this.onPointerDown),this.canvas.addEventListener("pointermove",this.onPointerMove),this.canvas.addEventListener("pointerup",this.onPointerUp),this.canvas.addEventListener("pointerleave",this.onPointerUp)}handleWheel(e){const n=e.deltaY<0?1.1:.9090909090909091;this.manualZoom*=n,this.autofitEnabled=!1,this.idleTimer=0}handlePointerDown(e){this.dragging=!0,this.dragLastX=e.clientX,this.dragLastY=e.clientY}handlePointerMove(e){if(!this.dragging)return;const n=e.clientX-this.dragLastX,s=e.clientY-this.dragLastY;this.dragLastX=e.clientX,this.dragLastY=e.clientY;const r=this.currentScale||1;this.manualPanX-=n/r,this.manualPanY-=s/r,this.autofitEnabled=!1,this.idleTimer=0}handlePointerUp(e){this.dragging=!1}pinPoint(e,n,s){this.pinnedPoints.push({x:e,y:n,ttl:s})}calculateBounds(e){let n=1/0,s=-1/0,r=1/0,i=-1/0;for(const a of e.values()){let c=ot[0]+sd;for(let u=Math.min(a.ringCounts.length,ot.length)-1;u>=0;u--)if(a.ringCounts[u]>0){c=ot[u]+sd;break}n=Math.min(n,a.centerX-c),s=Math.max(s,a.centerX+c),r=Math.min(r,a.centerY-c),i=Math.max(i,a.centerY+c)}for(const a of this.pinnedPoints)n=Math.min(n,a.x),s=Math.max(s,a.x),r=Math.min(r,a.y),i=Math.max(i,a.y);const o=60;return{minX:n-o,maxX:s+o,minY:r-o,maxY:i+o}}calculateTarget(e){const n=e.maxX-e.minX,s=e.maxY-e.minY,r=n/s,i=this.app.renderer.width/this.app.renderer.height;let o;r>i?o=this.app.renderer.width/n:o=this.app.renderer.height/s,o=Math.max(.3,Math.min(3,o*.92));const a=(e.minX+e.maxX)/2,c=(e.minY+e.maxY)/2;return{targetScale:o,centerX:a,centerY:c}}tick(e,n,s=!0){for(let c=this.pinnedPoints.length-1;c>=0;c--)this.pinnedPoints[c].ttl-=e,this.pinnedPoints[c].ttl<=0&&this.pinnedPoints.splice(c,1);if(!s||n.size===0)return;this.idleTimer+=e,this.idleTimer>this.idleThreshold&&!this.autofitEnabled&&(this.autofitEnabled=!0);const r=this.calculateBounds(n),i=this.calculateTarget(r);this.autofitEnabled?(this.manualZoom+=(1-this.manualZoom)*this.lerpAlpha,this.manualPanX+=(0-this.manualPanX)*this.lerpAlpha,this.manualPanY+=(0-this.manualPanY)*this.lerpAlpha,this.targetScale=i.targetScale*this.manualZoom,this.targetCx=i.centerX+this.manualPanX,this.targetCy=i.centerY+this.manualPanY):(this.targetScale=i.targetScale*this.manualZoom,this.targetCx=i.centerX+this.manualPanX,this.targetCy=i.centerY+this.manualPanY),this.currentScale+=(this.targetScale-this.currentScale)*this.lerpAlpha,this.currentCx+=(this.targetCx-this.currentCx)*this.lerpAlpha,this.currentCy+=(this.targetCy-this.currentCy)*this.lerpAlpha;let o=0,a=0;this.shakeIntensity>.5&&(o=(Math.random()-.5)*this.shakeIntensity,a=(Math.random()-.5)*this.shakeIntensity,this.shakeIntensity*=this.shakeDecay,this.shakeIntensity<.5&&(this.shakeIntensity=0)),this.worldLayer.pivot.set(this.currentCx,this.currentCy),this.worldLayer.position.set(this.app.renderer.width/2+o,this.app.renderer.height/2+a),this.worldLayer.scale.set(this.currentScale)}shake(e){this.shakeIntensity=Math.max(this.shakeIntensity,e)}destroy(){this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointerleave",this.onPointerUp)}}class gb{constructor(){this.time=0,this.graphics=new se}redraw(e,n=1/60){this.graphics.clear(),this.time+=n;for(const s of e.values()){const r=s.data;if(r.parentSessionId){const i=Array.from(e.values()).find(o=>o.data.sessionId===r.parentSessionId);i&&this.drawEnergyTether(i.data.centerX,i.data.centerY,r.centerX,r.centerY,r.isChild)}for(const i of r.edges){const o=r.nodes.get(i.fromKey),a=r.nodes.get(i.toKey);o&&a&&this.graphics.moveTo(o.x,o.y).lineTo(a.x,a.y).stroke({width:.4,color:16777215,alpha:.08})}}}drawEnergyTether(e,n,s,r,i){const o=s-e,a=r-n,c=Math.sqrt(o*o+a*a);if(c<1)return;const u=o/c,l=-(a/c),h=u,f=this.time,p=i?14466680:10532060,_=Math.max(8,Math.floor(c/6));for(let m=0;m<_;m++){const g=m/_,x=(m+1)/_,v=Math.sin(g*Math.PI*3+f*1.5)*3,S=Math.sin(x*Math.PI*3+f*1.5)*3,w=Math.sin(g*Math.PI),b=Math.sin(x*Math.PI),k=e+o*g+l*v*w,T=n+a*g+h*v*w,C=e+o*x+l*S*b,P=n+a*x+h*S*b;this.graphics.moveTo(k,T).lineTo(C,P).stroke({width:.6,color:p,alpha:.1})}const y=3;for(let m=0;m<y;m++){const g=(f*.4+m/y)%1,x=Math.sin(g*Math.PI*3+f*1.5)*3,v=Math.sin(g*Math.PI),S=e+o*g+l*x*v,w=n+a*g+h*x*v,b=Math.sin(g*Math.PI)*.5;b>.02&&(this.graphics.circle(S,w,1.5).fill({color:p,alpha:b*.6}),this.graphics.circle(S,w,3).fill({color:p,alpha:b*.15}))}}}const _b=5,yb=12;function xb(t){for(const e of t.values()){e.compacting=Math.max(0,e.compacting-.005),e.compacted=Math.max(0,e.compacted-.007);for(const n of e.nodes.values()){if(n.targetOrbitAngle!==void 0){const s=n.targetOrbitAngle-n.orbitAngle,r=Math.atan2(Math.sin(s),Math.cos(s));n.orbitAngle+=r*.05,Math.abs(r)>.01&&(n.marks=[]),Math.abs(r)<.01&&(n.orbitAngle=n.targetOrbitAngle,delete n.targetOrbitAngle)}else n.orbitAngle+=n.orbitSpeed;if(n.x=e.centerX+Math.cos(n.orbitAngle)*n.orbitRadius,n.y=e.centerY+Math.sin(n.orbitAngle)*n.orbitRadius,n.nodeType==="agent"){const s=n.key.replace("agent:","");e.agentPositionMap.set(s,{x:n.x,y:n.y})}if(n.orbitRing>=0){const s=_b/n.orbitRadius,r=n.marks.length>0?n.marks[n.marks.length-1]:null;(r===null||Math.abs(n.orbitAngle-r)>=s)&&(n.marks.push(n.orbitAngle),n.marks.length>yb&&n.marks.shift())}n.impactTime=Math.max(0,n.impactTime-.022),n.actionFade=Math.max(0,n.actionFade-.003),n.entry=Math.min(1,n.entry+.01)}e.promptSnakes||(e.promptSnakes=[]);for(const n of e.promptSnakes)n.progress=Math.min(1,n.progress+.003);e.promptSnakes=e.promptSnakes.filter(n=>n.progress<1)}}const vb=3;class wb{constructor(e,n,s){this.clusterObjects=new Map,this.previousRingCounts=new Map,this.app=e,this.clustersRef=n,this.autofitRef=s,this.container=new Me,lb(e.renderer),this.container.position.set(e.renderer.width/2,e.renderer.height/2),this.cameraController=new mb(e,this.container),this.edgeLayer=new gb,this.container.addChild(this.edgeLayer.graphics),this.batchGfx=new se,this.container.addChild(this.batchGfx);for(const r of n.current.values())this.createCluster(r)}get clusters(){return this.clustersRef.current}createCluster(e){const n=new pb(e);n.updateOrbitRings(),this.container.addChild(n.container),this.clusterObjects.set(e.sessionId,n);for(const s of e.nodes.values()){const r=new vf(s);n.container.addChild(r.container),n.nodeObjects.set(s.key,r)}}getNodeObject(e,n){const s=this.clusterObjects.get(e);return s?s.nodeObjects.get(n)??null:null}tickClusterPhysics(e){const n=Array.from(e.values()),s=n.length;if(s===0)return;const r=i=>{const o=[55,90,125,160,195];for(let a=i.ringCounts.length-1;a>=0;a--)if(i.ringCounts[a]>0)return o[a]??195;return o[0]};if(s===1){const i=n[0];i.centerX+=(0-i.centerX)*.1,i.centerY+=(0-i.centerY)*.1}else{for(let i=0;i<s;i++){const o=n[i],a=r(o);for(let c=i+1;c<s;c++){const u=n[c],d=r(u),l=a+d+120,h=u.centerX-o.centerX,f=u.centerY-o.centerY,p=Math.sqrt(h*h+f*f)||.01;if(p<l){const _=(l-p)/p*.5;o.centerX-=h*_,o.centerY-=f*_,u.centerX+=h*_,u.centerY+=f*_}}}for(const i of n)i.centerX+=(0-i.centerX)*.003,i.centerY+=(0-i.centerY)*.003}}drawTrailsIntoBatch(e,n){const s=n.centerX,r=n.centerY,i=n.compacting??0;if(!(i>.8))for(const o of n.nodes.values()){if(o.orbitRing<0||o.marks.length===0)continue;const a=o.nodeType==="file"?.5:(o.life??1)*.4*Math.min(1,o.entry??1);if(a<=.01)continue;const c=i>.5?a*(1-i):a,u=Math.max(0,Math.min(o.orbitRing,ot.length-1)),d=ot[u],l=vb/d,h=o.marks.length;for(let f=0;f<h;f++){const p=(f+1)/h,_=c*p;if(_<=.01)continue;const y=o.marks[f];if(e.arc(s,r,d,y-l/2,y+l/2).stroke({width:1.2,color:16777215,alpha:_}),f<h-1){const m=o.marks[f+1];e.moveTo(s+Math.cos(m-l/2)*d,r+Math.sin(m-l/2)*d)}}}}tick(e){const n=this.clustersRef.current;this.tickClusterPhysics(n),xb(n),this.cameraController.tick(e,n,this.autofitRef.current),this.batchGfx.clear();for(const[s,r]of n){let i=this.clusterObjects.get(s);i||(this.createCluster(r),i=this.clusterObjects.get(s)),(this.previousRingCounts.get(s)??-1)!==r.ringCounts.length&&(i.updateOrbitRings(),this.previousRingCounts.set(s,r.ringCounts.length)),i.tick(e),i.drawRingsIntoBatch(this.batchGfx,r.centerX,r.centerY),this.drawTrailsIntoBatch(this.batchGfx,r);for(const a of r.nodes.values()){let c=i.nodeObjects.get(a.key);c||(c=new vf(a),i.container.addChild(c.container),i.nodeObjects.set(a.key,c)),c.compacting=r.compacting,c.compacted=r.compacted,c.tick(e)}for(const[a,c]of i.nodeObjects)r.nodes.has(a)||(i.container.removeChild(c.container),i.nodeObjects.delete(a),c.destroy())}for(const[s,r]of this.clusterObjects)n.has(s)||(this.container.removeChild(r.container),this.clusterObjects.delete(s),this.previousRingCounts.delete(s),r.destroy());this.edgeLayer.redraw(this.clusterObjects,e)}hitTest(e,n){const s=(e-this.container.position.x)/this.container.scale.x+this.container.pivot.x,r=(n-this.container.position.y)/this.container.scale.y+this.container.pivot.y,i=15/this.container.scale.x;let o=null;for(const[a,c]of this.clusterObjects){const u=c.data;for(const[d,l]of c.nodeObjects){const h=u.centerX+l.container.position.x,f=u.centerY+l.container.position.y,p=s-h,_=r-f,y=Math.sqrt(p*p+_*_);if(y<=i&&(o===null||y<o.dist)){const m=u.nodes.get(d);m&&(o={node:m,cluster:u,dist:y})}}}return o?{node:o.node,cluster:o.cluster}:null}setNodeHovered(e,n){const s=this.clusterObjects.get(e);if(s)for(const[r,i]of s.nodeObjects)i.setHovered(r===n)}setNodeSelected(e,n){const s=this.clusterObjects.get(e);if(s)for(const[r,i]of s.nodeObjects)i.setSelected(r===n)}}function wf(t,e,n){return{controlPoints:[t,e,n]}}function Lc(t,e){const[n,s,r]=t.controlPoints,i=1-e,o=i*i,a=e*e,c=o,u=2*i*e,d=a;return{x:c*n.x+u*s.x+d*r.x,y:c*n.y+u*s.y+d*r.y}}function Sb(t,e){const[n,s,r]=t.controlPoints,i=1-e,o=2*i*(s.x-n.x)+2*e*(r.x-s.x),a=2*i*(s.y-n.y)+2*e*(r.y-s.y),c=Math.sqrt(o*o+a*a);return c<1e-4?{x:0,y:0}:{x:o/c,y:a/c}}function bb(t,e=20){let n=0,s=Lc(t,0);for(let r=1;r<=e;r++){const i=r/e,o=Lc(t,i),a=o.x-s.x,c=o.y-s.y;n+=Math.sqrt(a*a+c*c),s=o}return n}class kb{constructor(e,n,s,r=!1,i){this.progress=0,this.onComplete=null,this.duration=4,this.letterTexts=[],this.letterOffsets=[],this.snakeSpan=0,this.container=new Me,this.splinePath=e,this.words=n,this.isResponse=r,this.onComplete=i||null;const o=r?6:7,a=4,c=3,u=[],d=[];let l=0;for(let p=0;p<n.length;p++){p>0&&(l+=c);for(let _=0;_<n[p].length;_++)u.push(n[p][_]),d.push(l+a*.5),l+=a}const h=bb(e),f=l;this.snakeSpan=Math.min(.85,f/h);for(let p=0;p<d.length;p++)this.letterOffsets.push(d[p]/f*this.snakeSpan);for(const p of u){const _=new Us({text:p,style:{fontSize:o,fontFamily:"monospace",fontWeight:"700",fill:s,align:"center",dropShadow:{alpha:.3,angle:Math.PI/4,blur:0,distance:1,color:0}}});_.anchor.set(.5,.5),_.visible=!1,this.letterTexts.push(_),this.container.addChild(_)}}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=this.progress*(1+this.snakeSpan);for(let s=0;s<this.letterTexts.length;s++){const r=n-(this.snakeSpan-this.letterOffsets[s]);if(r<0||r>1){this.letterTexts[s].visible=!1;continue}const i=Lc(this.splinePath,r),o=Sb(this.splinePath,r),a=Math.atan2(o.y,o.x),c=Math.min(1,r*5),u=Math.min(1,(1-r)*5),d=c*u;if(d<=.01){this.letterTexts[s].visible=!1;continue}const l=this.letterTexts[s];l.visible=!0,l.position.set(i.x,i.y),l.rotation=a,l.alpha=d}this.progress>=1&&this.onComplete&&this.onComplete()}isDone(){return this.progress>=1}destroy(){this.container.destroy({children:!0})}}class Tb{constructor(e,n){this.progress=0,this.maxRadius=250,this.time=0,this.seeds=[],this.spiralSeeds=[],this.phase=e,this.coreRadius=n,this.duration=e==="implosion"?3.5:2.5,this.container=new Me,this.gfx=new se,this.container.addChild(this.gfx);for(let s=0;s<64;s++)this.seeds.push(Math.random());for(let s=0;s<6;s++)this.spiralSeeds.push(Math.random())}tick(e){this.progress=Math.min(1,this.progress+e/this.duration),this.time+=e,this.gfx.clear(),this.phase==="implosion"?this.drawImplosion():this.drawRebirth()}drawImplosion(){const e=this.progress,n=this.time;e<.65&&this.drawGravityWell(e/.65,n),e>.5&&e<.85&&this.drawSingularity((e-.5)/.35,n),e>.8&&this.drawCollapseFlash((e-.8)/.2)}drawGravityWell(e,n){const s=Mb(e),r=this.coreRadius*(1+s*8),i=s*.55;this.gfx.circle(0,0,r*1.3).fill({color:132104,alpha:i*.3}),this.gfx.circle(0,0,r).fill({color:264208,alpha:i*.6}),this.gfx.circle(0,0,r*.5).fill({color:516,alpha:i*.9});const o=6,a=7377104;for(let u=0;u<o;u++){const d=u/o*Math.PI*2+this.spiralSeeds[u]*.5,l=n*(1.2+s*3),h=(.15+s*.35)*(1-u*.04),f=40;let p=0,_=0,y=!1;for(let m=0;m<f;m++){const g=m/f,x=this.maxRadius*(1-s*.7)*(1-g*.85);if(x<3)break;const v=d+l+g*(3+s*5),S=Math.cos(v)*x,w=Math.sin(v)*x,b=h*(1-g*.6);y&&b>.01&&this.gfx.moveTo(p,_).lineTo(S,w).stroke({width:1.5*(1-g*.5),color:a,alpha:b}),p=S,_=w,y=!0}}const c=32;for(let u=0;u<c;u++){const d=this.seeds[u],l=d*Math.PI*2+n*(.8+d*2+s*4),f=this.maxRadius*(.3+d*.7)*(1-s*(.6+d*.35));if(f<2)continue;const p=Math.cos(l)*f,_=Math.sin(l)*f,y=(.2+s*.5)*(1-u/c*.4),m=1+d*1.5;if(this.gfx.circle(p,_,m*2).fill({color:a,alpha:y*.2}),this.gfx.circle(p,_,m).fill({color:13688319,alpha:y}),y>.08){const g=l+Math.PI,x=p+Math.cos(g)*m*6,v=_+Math.sin(g)*m*6;this.gfx.moveTo(p,_).lineTo(x,v).stroke({width:.6,color:9087696,alpha:y*.5})}}for(let u=0;u<7;u++){const d=u*.08,l=Math.max(0,Math.min(1,(e-d)/(1-d))),f=this.maxRadius*(.3+u*.1)*(1-Cb(l)),p=(1-l)*(.25+s*.15);p>.01&&f>2&&this.gfx.circle(0,0,f).stroke({width:.8+s*.5,color:10533088,alpha:p})}if(s>.3){const u=(s-.3)/.7,d=this.coreRadius*(2+u*3),l=u*.4;this.gfx.circle(0,0,d).stroke({width:2+u*2,color:8433919,alpha:l}),this.gfx.circle(0,0,d*.85).stroke({width:1,color:12638463,alpha:l*.6})}}drawSingularity(e,n){const s=Pb(e),r=this.coreRadius*(6-s*5.5),i=.5+s*.4;this.gfx.circle(0,0,r).stroke({width:3-s*2,color:14741247,alpha:i});const o=[16736352,6356832,6316287];for(let u=0;u<3;u++){const d=(u-1)*(2+s*4),l=r+d;l>1&&this.gfx.circle(0,0,l).stroke({width:1,color:o[u],alpha:i*.15})}const a=16;for(let u=0;u<a;u++){const d=u/a*Math.PI*2+n*5,l=r*1.5,h=r*.2*(1-s),f=i*.4;if(f>.01&&l>h){const p=Math.cos(d)*l,_=Math.sin(d)*l,y=Math.cos(d)*h,m=Math.sin(d)*h;this.gfx.moveTo(p,_).lineTo(y,m).stroke({width:1.5*(1-s*.5),color:13689087,alpha:f})}}const c=s*.9;this.gfx.circle(0,0,this.coreRadius*.5).fill({color:16777215,alpha:c}),this.gfx.circle(0,0,this.coreRadius*1.5).fill({color:14741759,alpha:c*.3})}drawCollapseFlash(e){const n=hr(e),s=this.maxRadius*(.3+n*.8),r=(1-n)*.6;this.gfx.circle(0,0,s).fill({color:0,alpha:r});const i=(1-n)*1;i>.05&&(this.gfx.circle(0,0,2).fill({color:16777215,alpha:i}),this.gfx.circle(0,0,8).fill({color:12638463,alpha:i*.2}))}drawRebirth(){const e=this.progress,n=this.time;e<.2&&this.drawIgnition(e/.2),e>.1&&e<.6&&this.drawDetonation((e-.1)/.5,n),e>.2&&this.drawShockwave((e-.2)/.8,n),e>.5&&this.drawAfterglow((e-.5)/.5)}drawIgnition(e){const n=Ab(e),s=[{r:3,color:16777215,alpha:1},{r:12,color:16777200,alpha:.9},{r:25,color:16775392,alpha:.6},{r:50,color:16771248,alpha:.3},{r:80,color:16765056,alpha:.12}];for(const r of s){const i=r.r*n,o=r.alpha*(1-e*.3);o>.01&&i>.5&&this.gfx.circle(0,0,i).fill({color:r.color,alpha:o})}}drawDetonation(e,n){const s=Sf(e),r=16;for(let a=0;a<r;a++){const c=this.seeds[a+32],u=a/r*Math.PI*2+c*.3,d=s*this.maxRadius*(1.2+c*.5),l=(1-e)*(.5+c*.2),h=(3+c*2)*(1-e*.6);if(l>.01&&d>2){const f=Math.cos(u)*d,p=Math.sin(u)*d;this.gfx.moveTo(0,0).lineTo(f,p).stroke({width:h*.3,color:16777215,alpha:l*.6}),this.gfx.moveTo(0,0).lineTo(f,p).stroke({width:h,color:16765024,alpha:l*.4})}}for(let a=0;a<3;a++){const c=a*.15,u=Math.max(0,Math.min(1,(e-c)/(1-c))),d=hr(u)*this.maxRadius*(1+a*.15),l=(1-u)*(.6-a*.12),h=(4-a)*(1-u*.5),f=a===0?16769152:a===1?16756800:16744480;l>.01&&d>1&&this.gfx.circle(0,0,d).stroke({width:h,color:f,alpha:l})}const i=this.coreRadius*(2+s*5),o=(1-e)*.5;o>.01&&(this.gfx.circle(0,0,i).fill({color:16775392,alpha:o*.3}),this.gfx.circle(0,0,i*.4).fill({color:16777215,alpha:o*.6}))}drawShockwave(e,n){const r=hr(e)*this.maxRadius*1.8,i=(1-e)*.65;if(i>.01&&r>1){const a=5*(1-e*.7);this.gfx.circle(0,0,r).stroke({width:a,color:16769184,alpha:i}),this.gfx.circle(0,0,r*.98).stroke({width:1,color:16777215,alpha:i*.4})}if(e>.15){const a=(e-.15)/.85,c=hr(a)*this.maxRadius*1.5,u=(1-a)*.3;u>.01&&c>1&&this.gfx.circle(0,0,c).stroke({width:2*(1-a*.5),color:13672544,alpha:u})}const o=48;for(let a=0;a<o;a++){const c=this.seeds[a],u=a/o*Math.PI*2+c*.5,d=.6+c*.8,l=Sf(Math.min(1,e*d))*this.maxRadius*(1.2+c*.6),h=(1-e)*(.4+c*.3),f=.8+c*1.5;if(h>.02&&l>2){const p=Math.cos(u)*l,_=Math.sin(u)*l,y=[16769184,16765040,16760896,16777168,16777215],m=y[a%y.length];if(this.gfx.circle(p,_,f*3).fill({color:m,alpha:h*.15}),this.gfx.circle(p,_,f).fill({color:16777215,alpha:h*.7}),h>.08){const g=f*8*(1-e*.5),x=p-Math.cos(u)*g,v=_-Math.sin(u)*g;this.gfx.moveTo(p,_).lineTo(x,v).stroke({width:.5,color:m,alpha:h*.4})}}}if(e<.7)for(let c=0;c<8;c++){const u=this.spiralSeeds[c%6],d=c/8*Math.PI*2,l=(1-e/.7)*.3;if(l>.01){let f=0,p=0;for(let _=1;_<=20;_++){const y=_/20,m=hr(e)*this.maxRadius*y*1.1,g=Math.sin(y*6+n*3+u*10)*15*y,x=d+g/m,v=Math.cos(x)*m,S=Math.sin(x)*m;_>1&&m>2&&this.gfx.moveTo(f,p).lineTo(v,S).stroke({width:1*(1-y*.5),color:16765056,alpha:l*(1-y*.5)}),f=v,p=S}}}}drawAfterglow(e){const n=(1-e)*(1-e),s=this.maxRadius*.4;if(n>.01&&(this.gfx.circle(0,0,s*1.5).fill({color:16765024,alpha:n*.06}),this.gfx.circle(0,0,s).fill({color:16771216,alpha:n*.1}),this.gfx.circle(0,0,s*.4).fill({color:16775376,alpha:n*.15}),this.gfx.circle(0,0,this.coreRadius*2).fill({color:16777215,alpha:n*.2})),n>.03){const r=this.coreRadius*(4+Math.sin(this.time*4)*.5);this.gfx.circle(0,0,r).stroke({width:1,color:16769184,alpha:n*.25})}}isDone(){return this.progress>=1}destroy(){this.gfx.destroy(),this.container.destroy({children:!0})}}function Cb(t){return t*t}function hr(t){return 1-(1-t)*(1-t)}function Mb(t){return t*t*t}function Sf(t){return 1-(1-t)**3}function Pb(t){return t<.5?2*t*t:1-(-2*t+2)**2/2}function Ab(t){return 1-(1-t)**4}class Eb{constructor(){this.progress=0,this.duration=.8,this.container=new Me,this.gfx=new se,this.container.addChild(this.gfx)}tick(e){this.progress+=e/this.duration,this.gfx.clear();const n=Math.min(1,this.progress),s=12616956,r=5+n*25,i=(1-n)*.6;i>.01&&this.gfx.circle(0,0,r).stroke({width:1.5*(1-n),color:s,alpha:i});const o=(1-n)*.8;o>.01&&(this.gfx.circle(0,0,4*(1-n*.5)).fill({color:16777215,alpha:o}),this.gfx.circle(0,0,8*(1-n*.3)).fill({color:s,alpha:o*.3}));const a=4;for(let c=0;c<a;c++){const u=c/a*Math.PI*2+.3,d=n*20,l=Math.cos(u)*d,h=Math.sin(u)*d,f=(1-n)*.7;f>.01&&this.gfx.circle(l,h,1.2*(1-n)).fill({color:s,alpha:f})}}isDone(){return this.progress>=1}destroy(){this.gfx.destroy(),this.container.destroy({children:!0})}}class Rb{constructor(e){this.progress=0,this.duration=1.2,this.container=new Me,this.isChild=e,this.gfx=new se,this.container.addChild(this.gfx)}tick(e){this.progress+=e/this.duration,this.gfx.clear();const n=Math.min(1,this.progress),s=this.isChild?14466680:13161968,r=this.isChild?16773320:16777215;if(n<.4){const i=n/.4,o=(1-i)*.7;this.gfx.circle(0,0,10+i*15).fill({color:r,alpha:o}),this.gfx.circle(0,0,5+i*8).fill({color:16777215,alpha:o*.8})}if(n>.1&&n<.8){const i=(n-.1)/.7,o=10+i*60,a=(1-i)*.5;this.gfx.circle(0,0,o).stroke({width:2*(1-i),color:s,alpha:a})}if(n>.2){const i=(n-.2)/.8,o=5+i*80,a=(1-i)*.25;a>.01&&this.gfx.circle(0,0,o).stroke({width:1*(1-i),color:s,alpha:a})}if(n<.6){const i=n/.6;for(let o=0;o<6;o++){const a=o/6*Math.PI*2,c=i*15,u=i*40,d=(1-i)*.4;if(d>.01){const l=Math.cos(a)*c,h=Math.sin(a)*c,f=Math.cos(a)*u,p=Math.sin(a)*u;this.gfx.moveTo(l,h).lineTo(f,p).stroke({width:1,color:r,alpha:d})}}}}isDone(){return this.progress>=1}destroy(){this.gfx.destroy(),this.container.destroy({children:!0})}}class Ib{constructor(){this.progress=0,this.time=0,this.duration=2.2,this.seeds=[],this.container=new Me,this.gfx=new se,this.container.addChild(this.gfx);for(let e=0;e<48;e++)this.seeds.push(Math.random())}tick(e){this.progress=Math.min(1,this.progress+e/this.duration),this.time+=e,this.gfx.clear();const n=this.progress;n<.35&&this.drawImplosion(n/.35),n>.3&&n<.55&&this.drawFlash((n-.3)/.25),n>.5&&this.drawStarburst((n-.5)/.5)}drawImplosion(e){const n=Lb(e),s=this.time,r=80*(1-n),i=(1-n*.6)*.85;r>1&&(this.gfx.circle(0,0,r).stroke({width:2.5*(1-n*.4),color:11060464,alpha:i}),this.gfx.circle(0,0,r*.85).stroke({width:1,color:13690111,alpha:i*.5}));const o=8;for(let u=0;u<o;u++){const d=this.seeds[u],h=u/o*Math.PI*2+d*.6+s*(1.5+n*4),f=r*(.5+d*.5),p=.4+d*.3,_=(1-n)*(.3+d*.2);_>.01&&f>2&&this.gfx.arc(0,0,f,h,h+p).stroke({width:1.2,color:7377104,alpha:_})}const a=12*(1-n*.8)+n*3,c=n*.9;c>.01&&(this.gfx.circle(0,0,a*3).fill({color:6324416,alpha:c*.12}),this.gfx.circle(0,0,a).fill({color:13689087,alpha:c*.5}),this.gfx.circle(0,0,a*.4).fill({color:16777215,alpha:c}));for(let u=0;u<12;u++){const d=this.seeds[u+8],l=u/12*Math.PI*2+d*.4,h=r*(.3+d*.7)*(1-n*.9);if(h<2)continue;const f=Math.cos(l)*h,p=Math.sin(l)*h,_=(1-n)*(.3+d*.3);this.gfx.circle(f,p,1.5).fill({color:10535144,alpha:_})}}drawFlash(e){const n=kf(e),s=e<.3?e/.3:1-(e-.3)/.7,r=s*s;r>.01&&(this.gfx.circle(0,0,5+n*20).fill({color:16777215,alpha:r}),this.gfx.circle(0,0,15+n*40).fill({color:13691135,alpha:r*.4}),this.gfx.circle(0,0,30+n*70).fill({color:9087704,alpha:r*.12}));const i=16,o=s*.7;if(o>.01)for(let a=0;a<i;a++){const c=this.seeds[a+20],u=a/i*Math.PI*2+c*.25,d=n*(60+c*80),l=(2+c*2)*(1-e*.6),h=o*(.6+c*.4);if(d>2&&h>.01){const f=Math.cos(u)*d,p=Math.sin(u)*d;this.gfx.moveTo(0,0).lineTo(f,p).stroke({width:l*.3,color:16777215,alpha:h*.8}),this.gfx.moveTo(0,0).lineTo(f,p).stroke({width:l,color:9484543,alpha:h*.35})}}}drawStarburst(e){const s=bf(e)*160,r=(1-e)*.6;if(r>.01&&s>1&&(this.gfx.circle(0,0,s).stroke({width:3*(1-e*.7),color:10535167,alpha:r}),this.gfx.circle(0,0,s*.97).stroke({width:1,color:16777215,alpha:r*.3})),e>.2){const a=(e-.2)/.8,c=bf(a)*130,u=(1-a)*.25;u>.01&&c>1&&this.gfx.circle(0,0,c).stroke({width:1.5*(1-a*.5),color:7377096,alpha:u})}const i=32;for(let a=0;a<i;a++){const c=this.seeds[a%this.seeds.length],u=this.seeds[(a+16)%this.seeds.length],d=a/i*Math.PI*2+c*.5,l=.5+c*.9,h=kf(Math.min(1,e*l))*(90+u*80),f=(1-e)*(.5+c*.3),p=.8+c*1.8;if(f>.02&&h>2){const _=Math.cos(d)*h,y=Math.sin(d)*h,m=[12638463,9483504,14215423,16777215,7377112],g=m[a%m.length];if(this.gfx.circle(_,y,p*2.5).fill({color:g,alpha:f*.12}),this.gfx.circle(_,y,p).fill({color:16777215,alpha:f*.7}),f>.1){const x=p*10*(1-e*.4),v=_-Math.cos(d)*x,S=y-Math.sin(d)*x;this.gfx.moveTo(_,y).lineTo(v,S).stroke({width:.6,color:g,alpha:f*.4})}}}const o=(1-e)*(1-e)*.4;o>.01&&(this.gfx.circle(0,0,50).fill({color:6324416,alpha:o*.2}),this.gfx.circle(0,0,20).fill({color:10535167,alpha:o*.5}),this.gfx.circle(0,0,6).fill({color:16777215,alpha:o}))}isDone(){return this.progress>=1}destroy(){this.gfx.destroy(),this.container.destroy({children:!0})}}function Lb(t){return t*t*t}function bf(t){return 1-(1-t)*(1-t)}function kf(t){return 1-(1-t)**3}class Pn{constructor(e,n,s=1){this.progress=0,this.duration=1,this.trackTarget=null,this.trackIsStart=!1,this.trackLookup=null,this.container=new Me,this.startPos=e,this.endPos=n,this.duration=s}syncTarget(){if(!this.trackTarget&&this.trackLookup){const e=this.trackLookup.resolve();e&&(this.trackTarget=e,this.trackLookup=null)}if(this.trackTarget){const e={x:this.trackTarget.position.x,y:this.trackTarget.position.y};this.trackIsStart?this.startPos=e:this.endPos=e}}isDone(){return this.progress>=1}destroy(){this.container.destroy({children:!0})}}function Fb(t){return t<.5?2*t*t:-1+(4-2*t)*t}class Ob extends Pn{constructor(e,n,s,r=!1,i=1){super(e,n,i),this.color=s,this.inbound=r,this.graphics=new se,this.container.position.set(e.x,e.y),this.container.addChild(this.graphics)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=this.graphics;n.clear();const s=this.color,r=this.startPos,i=this.endPos;if(this.progress<.45){const o=this.progress/.45,a=Math.min(1,o*4);this.container.position.set(r.x,r.y);const c=14,u=18,d=u-o*u*2,l=5,h=[[-1,-1],[1,-1],[-1,1],[1,1]];for(const[m,g]of h)n.moveTo(m*c,g*u),n.lineTo(m*c,g*u-g*l),n.stroke({width:.5,color:s,alpha:a*.18}),n.moveTo(m*c,g*u),n.lineTo(m*c-m*l,g*u),n.stroke({width:.5,color:s,alpha:a*.18});n.moveTo(-c,d),n.lineTo(c,d),n.stroke({width:1.2,color:s,alpha:a*.85}),n.moveTo(-c,d),n.lineTo(c,d),n.stroke({width:8,color:s,alpha:a*.12});const f=d,p=u-d;p>0&&(n.rect(-c,f,c*2,p),n.fill({color:s,alpha:a*.035}));const _=3.5,y=Math.floor(u*2/_);for(let m=0;m<y;m++){const g=-u+m*_+2;if(g<d)continue;const x=g-d;if(x>14)continue;const v=a*.22*(1-x/14),S=4+m*7%5*2.5,w=-8+m*3%5*1.5;n.moveTo(w-S*.5,g),n.lineTo(w+S*.5,g),n.stroke({width:.5,color:s,alpha:v})}if(o>.88){const m=(o-.88)/.12;n.circle(0,0,m*16),n.stroke({width:.7,color:s,alpha:(1-m)*.4})}}else{const o=(this.progress-.45)/.55,a=Fb(o),c=r.x+(i.x-r.x)*a,u=r.y+(i.y-r.y)*a;this.container.position.set(c,u);const d=Math.max(0,a-.35),l=r.x+(i.x-r.x)*d,h=r.y+(i.y-r.y)*d,f=l-c,p=h-u;n.moveTo(f,p),n.lineTo(0,0),n.stroke({width:1.2,color:s,alpha:.5}),n.moveTo(f,p),n.lineTo(f*.3,p*.3),n.stroke({width:1.2,color:s,alpha:.1});const _=5;for(let y=0;y<_;y++){const m=y/_*.3,g=Math.min(1,Math.max(0,a-m));if(g<=0)continue;const x=r.x+(i.x-r.x)*g,v=r.y+(i.y-r.y)*g,S=x-c,w=v-u,b=g<.1?g/.1:g>.85?(1-g)/.15:1;n.circle(S,w,2.5-y*.3),n.fill({color:s,alpha:b*.8})}if(n.circle(0,0,2),n.fill({color:16777215,alpha:.9}),o>.85){const y=(o-.85)/.15,m=i.x-c,g=i.y-u;n.circle(m,g,y*16),n.stroke({width:.8,color:s,alpha:(1-y)*.6})}}}}function Bb(t){return t<.5?2*t*t:-1+(4-2*t)*t}function Ui(t){const e=Math.sin(t*127.1+311.7)*43758.5453;return e-Math.floor(e)}class Db extends Pn{constructor(e,n,s,r=!1,i=.8){super(e,n,i),this.color=s,this.graphics=new se,this.container.position.set(e.x,e.y),this.container.addChild(this.graphics),this.mainAngle=Math.atan2(n.y-e.y,n.x-e.x),this.fullDist=Math.hypot(n.x-e.x,n.y-e.y)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=this.graphics;n.clear();const s=this.color,r=Bb(Math.min(this.progress,1)),i=16,o=.65;if(r<.18){const a=1-r/.18;n.circle(0,0,36),n.fill({color:s,alpha:a*.45}),n.circle(0,0,12),n.fill({color:s,alpha:a*.7})}for(let a=0;a<i;a++){const c=a/(i-1)*2-1,u=this.mainAngle+c*o+(Ui(a*2.3+1)-.5)*.2,d=.65+Ui(a*3.7+2)*.45,l=Ui(a*1.3+.5)*.06,h=Math.min(1,Math.max(0,(r-l)/(1-l))*d);if(h<=0)continue;const f=h*this.fullDist,p=Math.cos(u)*f,_=Math.sin(u)*f,y=(1-h*.8)*(.9-Math.abs(c)*.25),m=(1-h*.55)*(1.6+Ui(a*5.1+3)*1.4),g=Math.max(0,f-this.fullDist*.09),x=Math.cos(u)*g,v=Math.sin(u)*g;n.moveTo(x,v),n.lineTo(p,_),n.stroke({width:m*.5,color:s,alpha:y*.5}),n.circle(p,_,m),n.fill({color:s,alpha:y})}}}function Nb(t){return t<.5?2*t*t:-1+(4-2*t)*t}function _l(t){const e=Math.sin(t*127.1+311.7)*43758.5453;return e-Math.floor(e)}class Gb extends Pn{constructor(e,n,s,r=!1,i=.8){super(e,n,i),this.color=s,this.graphics=new se,this.container.position.set(0,0),this.container.addChild(this.graphics),this.dx=n.x-e.x,this.dy=n.y-e.y;const o=Math.hypot(this.dx,this.dy)||1;this.nx=-this.dy/o,this.ny=this.dx/o}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=this.graphics;n.clear(),this.dx=this.endPos.x-this.startPos.x,this.dy=this.endPos.y-this.startPos.y;const s=Math.hypot(this.dx,this.dy)||1;this.nx=-this.dy/s,this.ny=this.dx/s;const r=this.color,i=Nb(Math.min(this.progress,1)),o=this.startPos.x,a=this.startPos.y,c=12;for(let l=0;l<c;l++){const h=(_l(l*2.1+.3)-.5)*2*70,f=_l(l*1.7+.9)*.07,p=Math.min(1,Math.max(0,(i-f)/(1-f)));if(p<=0)continue;const _=h*Math.sin(p*Math.PI),y=o+this.dx*p+this.nx*_,m=a+this.dy*p+this.ny*_,g=Math.min(1,p*4)*(1-p*.75),x=1.2+_l(l*3.3+1)*1.8,v=o+this.dx*p,S=a+this.dy*p;n.moveTo(v,S),n.lineTo(y,m),n.stroke({width:.5,color:r,alpha:g*.2}),n.circle(y,m,x),n.fill({color:r,alpha:g*.9})}const u=o+(this.endPos.x-o)*i,d=a+(this.endPos.y-a)*i;if(n.circle(u,d,2.5),n.fill({color:r,alpha:.95}),this.progress>.82){const l=(this.progress-.82)/.18;n.circle(this.endPos.x,this.endPos.y,l*22),n.stroke({width:.8,color:r,alpha:(1-l)*.5})}}}function jb(t){return t<.5?2*t*t:-1+(4-2*t)*t}class zb extends Pn{constructor(e,n,s,r=!1,i=.8){super(e,n,i),this.time=0,this.color=s,this.graphics=new se,this.container.addChild(this.graphics)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration),this.time+=e;const n=jb(Math.min(this.progress,1)),s=this.startPos.x+(this.endPos.x-this.startPos.x)*n,r=this.startPos.y+(this.endPos.y-this.startPos.y)*n;this.graphics.clear(),this.graphics.moveTo(this.startPos.x,this.startPos.y).lineTo(s,r).stroke({width:8,color:this.color,alpha:.07});const i=s-this.startPos.x,o=r-this.startPos.y,a=[{t0:0,t1:.35,alpha:.5},{t0:.35,t1:.7,alpha:.35},{t0:.7,t1:1,alpha:.75}];for(const c of a){const u=this.startPos.x+i*c.t0,d=this.startPos.y+o*c.t0,l=this.startPos.x+i*c.t1,h=this.startPos.y+o*c.t1;this.graphics.moveTo(u,d).lineTo(l,h).stroke({width:2,color:this.color,alpha:c.alpha})}for(let c=3;c>=0;c--){const u=(4-c)*2.5+1,d=(.08-c*.015)*(1+Math.sin(this.time*12+c)*.3),l=Math.cos(this.time*5+c*1.4)*c*1.5,h=Math.sin(this.time*4+c*2.1)*c*1.5;this.graphics.circle(s+l,r+h,u).fill({color:this.color,alpha:Math.max(0,d)})}this.graphics.circle(s,r,2).fill({color:this.color,alpha:.95}),this.graphics.circle(s,r,.7).fill({color:16777215,alpha:.9})}}function Tf(t){return t<.5?2*t*t:-1+(4-2*t)*t}class Wb extends Pn{constructor(e,n,s,r=!1,i=.8){super(e,n,i),this.time=0,this.color=s,this.graphics=new se,this.container.addChild(this.graphics)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration),this.time+=e;const n=Tf(Math.min(this.progress,1));this.graphics.clear(),this.graphics.moveTo(this.startPos.x,this.startPos.y).lineTo(this.endPos.x,this.endPos.y).stroke({width:14,color:this.color,alpha:.07}),this.graphics.moveTo(this.startPos.x,this.startPos.y).lineTo(this.endPos.x,this.endPos.y).stroke({width:3,color:this.color,alpha:.18});const s=this.endPos.x-this.startPos.x,r=this.endPos.y-this.startPos.y;for(let i=0;i<5;i++){const o=((n*1.6-i*.2)%1+1)%1;if(o>.98)continue;const a=Tf(o),c=this.startPos.x+s*a,u=this.startPos.y+r*a,d=o>.85?(1-o)/.15:1,l=.7+.3*Math.sin(this.time*22+i*1.4);this.graphics.circle(c,u,3.8).fill({color:this.color,alpha:d*.75}),this.graphics.circle(c,u,1.3).fill({color:16777215,alpha:d*l*.95})}if(this.progress>.8){const i=(this.progress-.8)/.2,o=i*14;this.graphics.circle(this.endPos.x,this.endPos.y,o).stroke({width:1,color:this.color,alpha:(1-i)*.5})}}}const yl=["> npm run build","compiled 0 errs","> git status","M src/app.ts","> grep -r TODO","src/utils:42","> cat config.json",'{"port": 3000}',"> ls -la","drwxr-xr-x 4","> echo $PATH","/usr/local/bin","> node -v","v20.11.0","> pwd","/home/user/app"],Cf=4,Hi=42,Vi=30,Xi=6,xl=5;class $b extends Pn{constructor(e,n,s,r=!1,i=2.5){super(e,n,i),this.color=s,this.graphics=new se,this.container.addChild(this.graphics),this.monoStyle=new $s({fontFamily:"monospace",fontSize:4,fill:s}),this.outputStyle=new $s({fontFamily:"monospace",fontSize:4,fill:8947848}),this.lineTexts=[];for(let o=0;o<Cf;o++){const a=new Us({text:"",style:this.monoStyle});a.position.set(0,0),this.lineTexts.push(a),this.container.addChild(a)}}tick(e){this.progress=Math.min(1,this.progress+e/this.duration),this.container.position.set(this.endPos.x,this.endPos.y);const n=Math.min(1,this.progress*10),s=this.progress>.85?(1-this.progress)/.15:1,r=n*s;this.graphics.clear();const i=-Hi/2,o=-Vi/2;this.graphics.roundRect(i,o,Hi,Vi,3).fill({color:1710638,alpha:r*.92}),this.graphics.rect(i,o,Hi,Xi).fill({color:2763326,alpha:r*.95});const a=o+Xi/2,c=1,u=i+4;this.graphics.circle(u,a,c).fill({color:16736086,alpha:r}),this.graphics.circle(u+4,a,c).fill({color:16760110,alpha:r}),this.graphics.circle(u+8,a,c).fill({color:2607423,alpha:r});for(let _=o+Xi;_<o+Vi;_+=2)this.graphics.rect(i,_,Hi,1).fill({color:16777215,alpha:.03*r});const d=this.progress*yl.length*.8,l=Math.floor(d),h=d-l,f=i+3,p=o+Xi+2;for(let _=0;_<Cf;_++){const y=(l+_)%yl.length,m=yl[y],g=this.lineTexts[_];g.text=m;const x=m.startsWith(">");g.style=x?this.monoStyle:this.outputStyle,g.position.set(f,p+_*xl-h*xl),g.alpha=r;const v=g.position.y;(v<p-1||v>o+Vi-xl)&&(g.alpha=0)}}destroy(){for(const e of this.lineTexts)e.destroy();this.graphics.destroy(),super.destroy()}}const Mf=50,Ub=[{width:8,alpha:.04},{width:3,alpha:.1},{width:1.5,alpha:.7}];class Hb extends Pn{constructor(e,n,s,r=!1,i=.6){super(e,n,i),this.color=s,this.graphics=new se,this.container.addChild(this.graphics)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=this.progress>.8?(1-this.progress)/.2:1;this.graphics.clear();const s=this.endPos.x-this.startPos.x,r=this.endPos.y-this.startPos.y,i=Math.sqrt(s*s+r*r);if(i<.001)return;const o=s/i,c=-(r/i),u=o;for(const y of Ub){const m=y.alpha*n;this.graphics.moveTo(this.startPos.x,this.startPos.y);for(let g=1;g<=Mf;g++){const x=g/Mf,v=this.startPos.x+s*x,S=this.startPos.y+r*x,w=Math.sin(x*5*Math.PI+this.progress*10)*8,b=v+c*w,k=S+u*w;this.graphics.lineTo(b,k)}this.graphics.stroke({width:y.width,color:this.color,alpha:m})}const d=this.progress,l=this.startPos.x+s*d,h=this.startPos.y+r*d,f=Math.sin(d*5*Math.PI+this.progress*10)*8,p=l+c*f,_=h+u*f;this.graphics.circle(p,_,3).fill({color:16777215,alpha:n*.9}),this.graphics.circle(p,_,5).fill({color:this.color,alpha:n*.2})}destroy(){this.graphics.destroy(),super.destroy()}}function Vb(t){return t<.5?2*t*t:-1+(4-2*t)*t}class Xb extends Pn{constructor(e,n,s,r=!1,i=.6){super(e,n,i),this.color=s,this.graphics=new se,this.container.addChild(this.graphics)}tick(e){this.progress=Math.min(1,this.progress+e/this.duration);const n=Vb(Math.min(this.progress,1)),s=this.startPos.x+(this.endPos.x-this.startPos.x)*n,r=this.startPos.y+(this.endPos.y-this.startPos.y)*n,i=Math.max(0,n-.25),o=this.startPos.x+(this.endPos.x-this.startPos.x)*i,a=this.startPos.y+(this.endPos.y-this.startPos.y)*i;this.graphics.clear();const c=4;for(let u=0;u<c;u++){const d=u/c,l=(u+1)/c,h=l*.8,f=o+(s-o)*d,p=a+(r-a)*d,_=o+(s-o)*l,y=a+(r-a)*l;this.graphics.moveTo(f,p).lineTo(_,y).stroke({width:1.2,color:this.color,alpha:h})}this.graphics.circle(s,r,2).fill({color:this.color,alpha:.9})}}const Yb={Read:"scan",Grep:"scan",Glob:"scan",Edit:"morph",Write:"morph",Bash:"spark",Notification:"ping",Stop:"fade"},zo=class zo{constructor(e,n){this.projectiles=[],this.snakes=[],this.compactions=[],this.miscEffects=[],this.impactTimers=[],this.permissionTimers=new Map,this.lastResponseSnakeTime=new Map,this.projectileMap={Read:Ob,Grep:Db,Glob:Gb,Edit:zb,Write:Wb,Bash:$b,WebFetch:Hb},this.app=e,this.worldLayer=n,this.setupListeners()}setupListeners(){ie.on("tool:used",e=>{this.spawnProjectile(e)}),ie.on("prompt:submitted",e=>{this.spawnSnake(e)}),ie.on("response:received",e=>{const n=Date.now(),s=this.lastResponseSnakeTime.get(e.sessionId)??0;n-s<2e3||(this.lastResponseSnakeTime.set(e.sessionId,n),this.spawnSnake({...e,isResponse:!0}))}),ie.on("compact:pre",e=>{this.spawnCompaction(e.sessionId,"implosion")}),ie.on("compact:post",e=>{this.spawnCompaction(e.sessionId,"rebirth")}),ie.on("permission:request",e=>{const n=this.worldLayer.clusterObjects.get(e.sessionId);if(n){n.setPermission(!0);const s=this.permissionTimers.get(e.sessionId);s&&clearTimeout(s);const r=setTimeout(()=>{n.setPermission(!1),this.permissionTimers.delete(e.sessionId)},5e3);this.permissionTimers.set(e.sessionId,r)}}),ie.on("cluster:created",e=>{this.spawnClusterEntrance(e.cluster.sessionId)}),ie.on("cluster:removed",e=>{this.lastResponseSnakeTime.delete(e.sessionId);const n=this.permissionTimers.get(e.sessionId);n&&(clearTimeout(n),this.permissionTimers.delete(e.sessionId))}),ie.on("subagent:start",e=>{this.spawnSubagentEffect(e.sessionId,e.agentId)}),ie.on("subagent:stop",e=>{const n=this.worldLayer.clusterObjects.get(e.sessionId);n&&n.triggerActivity()}),ie.on("session:end",e=>{this.spawnSessionEnd(e.sessionId)}),ie.on("notification",e=>{const n=this.worldLayer.getNodeObject(e.sessionId,e.nodeKey);n&&(n.playImpact("ping"),n.showAction(e.title||"notification",3462041));const s=this.worldLayer.clusterObjects.get(e.sessionId);s&&s.triggerActivity()})}spawnProjectile(e){var v;const n=(v=this.worldLayer.clusters)==null?void 0:v.get(e.sessionId);if(!n)return;const s=n.nodes.get(e.nodeKey);if(!s)return;const r=this.worldLayer.clusterObjects.get(e.sessionId);if(!r)return;const i=r.nodeObjects.get(e.nodeKey),o=i?i.container.position.x:Math.cos(s.orbitAngle)*s.orbitRadius,a=i?i.container.position.y:Math.sin(s.orbitAngle)*s.orbitRadius,c={x:0,y:0},u={x:o,y:a},l=["Read","Grep","Glob"].includes(e.tool),h=l?u:c,f=l?c:u,p=parseInt(e.colorHex.replace("#",""),16)??16777215,_=this.projectileMap[e.tool]??Xb,y=new _(h,f,p,l);if(y.trackIsStart=l,i)y.trackTarget=i.container;else{const S=e.sessionId,w=e.nodeKey,b=this.worldLayer;y.trackLookup={sessionId:S,nodeKey:w,resolve:()=>{const k=b.clusterObjects.get(S),T=k==null?void 0:k.nodeObjects.get(w);return T?T.container:null}}}r.container.addChild(y.container),this.projectiles.push(y);const m=y.duration,g=Yb[e.tool]??"ping",x=setTimeout(()=>{const S=this.worldLayer.getNodeObject(e.sessionId,e.nodeKey);if(S){S.playImpact(g);const w=S.data.actionLabel;S.showAction(w||e.tool,p)}},m*1e3);this.impactTimers.push(x)}spawnCompaction(e,n){const s=this.worldLayer.clusterObjects.get(e);if(!s)return;const r=s.data.isChild,i=r?4.5:7,o=new Tb(n,i);s.container.addChild(o.container),this.compactions.push(o),s.triggerActivity(),n==="implosion"?this.worldLayer.cameraController.shake(r?3:6):this.worldLayer.cameraController.shake(r?8:15)}spawnSnake(e,n=3){var v;if(!((v=this.worldLayer.clusters)==null?void 0:v.get(e.sessionId))){n>0&&requestAnimationFrame(()=>this.spawnSnake(e,n-1));return}if(this.snakes.length>=zo.MAX_SNAKES)return;const r=e.words.slice(0,8);if(r.length===0)return;const i=this.worldLayer.clusterObjects.get(e.sessionId);if(!i){n>0&&requestAnimationFrame(()=>this.spawnSnake(e,n-1));return}const o=this.app.renderer.width,a=this.app.renderer.height,c=this.worldLayer.container.scale.x||1,u=Math.sqrt(o*o+a*a)/2/c+100;let d;const l=Math.random()*Math.PI*2,h=Math.cos(l)*u,f=Math.sin(l)*u,p=l+Math.PI/2,y=(Math.random()>.5?1:-1)*(120+Math.random()*100),m=h/2+Math.cos(p)*y,g=f/2+Math.sin(p)*y;e.isResponse?d=wf({x:0,y:0},{x:m,y:g},{x:h,y:f}):d=wf({x:h,y:f},{x:m,y:g},{x:0,y:0});const x=new kb(d,r,e.color,e.isResponse??!1);i.container.addChild(x.container),this.snakes.push(x)}spawnClusterEntrance(e){const n=this.worldLayer.clusterObjects.get(e);if(!n)return;const s=n.data.isChild,r=new Rb(s);n.container.addChild(r.container),this.miscEffects.push(r)}spawnSubagentEffect(e,n){const s=this.worldLayer.clusterObjects.get(e);if(!s)return;const r=`agent:${n}`,i=s.nodeObjects.get(r);if(!i)return;const o=new Eb;i.container.addChild(o.container),this.miscEffects.push(o),s.triggerActivity()}spawnSessionEnd(e){const n=this.worldLayer.clusterObjects.get(e);if(!n)return;const s=n.container.position.x,r=n.container.position.y,i=new Ib;i.container.position.set(s,r),this.worldLayer.container.addChild(i.container),this.miscEffects.push(i),this.worldLayer.cameraController.pinPoint(s,r,2.5)}tick(e){var n,s,r,i;for(let o=this.projectiles.length-1;o>=0;o--){const a=this.projectiles[o];a.syncTarget(),a.tick(e),a.isDone()&&((n=a.container.parent)==null||n.removeChild(a.container),a.destroy(),this.projectiles.splice(o,1))}for(let o=this.snakes.length-1;o>=0;o--){const a=this.snakes[o];a.tick(e),a.isDone()&&((s=a.container.parent)==null||s.removeChild(a.container),a.destroy(),this.snakes.splice(o,1))}for(let o=this.compactions.length-1;o>=0;o--){const a=this.compactions[o];a.tick(e),a.isDone()&&((r=a.container.parent)==null||r.removeChild(a.container),a.destroy(),this.compactions.splice(o,1))}for(let o=this.miscEffects.length-1;o>=0;o--){const a=this.miscEffects[o];a.tick(e),a.isDone()&&((i=a.container.parent)==null||i.removeChild(a.container),a.destroy(),this.miscEffects.splice(o,1))}}destroy(){var e,n,s,r;ie.clear();for(const i of this.impactTimers)clearTimeout(i);this.impactTimers=[];for(const i of this.permissionTimers.values())clearTimeout(i);this.permissionTimers.clear();for(const i of this.projectiles)(e=i.container.parent)==null||e.removeChild(i.container),i.destroy();for(const i of this.snakes)(n=i.container.parent)==null||n.removeChild(i.container),i.destroy();for(const i of this.compactions)(s=i.container.parent)==null||s.removeChild(i.container),i.destroy();for(const i of this.miscEffects)(r=i.container.parent)==null||r.removeChild(i.container),i.destroy();this.projectiles=[],this.snakes=[],this.compactions=[],this.miscEffects=[]}};zo.MAX_SNAKES=6;let Fc=zo;class qb{constructor(e,n,s){this.intervalId=null,this.samples=[],this.maxSamples=60,this.latest=null,this.app=e,this.worldLayer=n,this.animationManager=s}start(e=5){this.intervalId||(this.intervalId=setInterval(()=>this.sample(),e*1e3),this.sample())}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}sample(){var f,p,_,y,m;const e=performance.memory?Math.round(performance.memory.usedJSHeapSize/1024/1024):-1,n=Object.keys(((p=(f=globalThis.PIXI)==null?void 0:f.utils)==null?void 0:p.TextureCache)??{}).length,s=this.worldLayer.clusterObjects.size;let r=0;for(const g of this.worldLayer.clusterObjects.values())r+=g.nodeObjects.size;const i=this.animationManager,o=((_=i==null?void 0:i.projectiles)==null?void 0:_.length)??0,a=((y=i==null?void 0:i.snakes)==null?void 0:y.length)??0,c=((m=i==null?void 0:i.miscEffects)==null?void 0:m.length)??0,u={t:Date.now(),heapMB:e,textures:n,clusters:s,nodes:r,projectiles:o,snakes:a,miscEffects:c};this.latest=u,this.samples.push(u),this.samples.length>this.maxSamples&&this.samples.shift();const d=this.samples.length>=6?this.samples[this.samples.length-6]:null,l=d?u.heapMB-d.heapMB:0,h=[`heap=${u.heapMB}MB`,l!==0?`(${l>0?"+":""}${l}MB/30s)`:"",`tex=${u.textures}`,`clusters=${u.clusters}`,`nodes=${u.nodes}`,`proj=${u.projectiles}`,`snakes=${u.snakes}`,`misc=${u.miscEffects}`].filter(Boolean).join(" ");fetch("/hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hook_event_name:"Diagnostic",session_id:"memory-monitor",message:h,heap_mb:u.heapMB,heap_growth_mb:l,texture_count:u.textures,cluster_count:u.clusters,node_count:u.nodes})}).catch(()=>{}),console.info("[mem]",h)}report(e=10){return this.samples.slice(-e).map(s=>`${Math.round((Date.now()-s.t)/1e3)}s ago heap=${s.heapMB}MB tex=${s.textures} clusters=${s.clusters} nodes=${s.nodes} proj=${s.projectiles} snakes=${s.snakes}`).join(`
293
+ `)}}class Kb{constructor(e,n,s){this.animationManager=null,this.memoryMonitor=null,this.rafId=0,this._resizeHandler=()=>this.onResize(),this.canvas=e,this.clustersRef=n,this.autofitRef=s}async init(){this.app=new r0,await this.app.init({canvas:this.canvas,width:window.innerWidth,height:window.innerHeight,antialias:!0,resolution:(window.devicePixelRatio||1)*dx,autoDensity:!0,backgroundColor:526344,autoStart:!1}),this.backgroundLayer=new sb(this.app),this.app.stage.addChild(this.backgroundLayer.container),this.worldLayer=new wb(this.app,this.clustersRef,this.autofitRef),this.app.stage.addChild(this.worldLayer.container);try{this.animationManager=new Fc(this.app,this.worldLayer)}catch(e){console.error("Failed to create AnimationManager:",e)}this.uiLayer=new Me,this.app.stage.addChild(this.uiLayer),this.memoryMonitor=new qb(this.app,this.worldLayer,this.animationManager),this.memoryMonitor.start(5),window.addEventListener("resize",this._resizeHandler)}tick(e){var n;this.app&&(this.backgroundLayer.tick(e),this.worldLayer.tick(e),(n=this.animationManager)==null||n.tick(e),this.app.render())}onResize(){if(!this.app)return;const e=window.innerWidth,n=window.innerHeight;this.app.renderer.resize(e,n)}destroy(){var e,n;window.removeEventListener("resize",this._resizeHandler),(e=this.memoryMonitor)==null||e.stop(),(n=this.animationManager)==null||n.destroy();try{this.app.destroy()}catch{}try{const s=this.canvas.getContext("webgl2")||this.canvas.getContext("webgl");if(s){const r=s.getExtension("WEBGL_lose_context");r&&r.loseContext()}}catch{}}}function Qb({clusters:t,onHover:e,onSelect:n,autofitEnabled:s}){const r=H.useRef(null),i=H.useRef(null),o=H.useRef(t);o.current=t;const a=H.useRef(s);a.current=s;const c=H.useRef(e);c.current=e;const u=H.useRef(n);u.current=n;const d=H.useRef(null),l=H.useRef(y=>{const m=i.current;if(!m)return;const g=m.worldLayer.hitTest(y.clientX,y.clientY),x=g?`${g.cluster.sessionId}:${g.node.key}`:null;x!==d.current&&(d.current=x,c.current((g==null?void 0:g.node)??null,(g==null?void 0:g.cluster)??null))}).current,h=H.useRef(y=>{const m=i.current;if(!m)return;const g=m.worldLayer.hitTest(y.clientX,y.clientY);u.current((g==null?void 0:g.node)??null,(g==null?void 0:g.cluster)??null)}).current;H.useEffect(()=>{let y=null;return(async()=>{const g=r.current;if(!g){console.error("Canvas ref not available");return}try{const x=new Kb(g,o,a);await x.init(),i.current=x;const v=()=>{try{x.tick(1/120)}catch(S){console.error("Error in tick:",S)}y=requestAnimationFrame(v)};y=requestAnimationFrame(v)}catch(x){console.error("Failed to initialize PixiApp:",x)}})(),()=>{y!==null&&cancelAnimationFrame(y),i.current&&(i.current.destroy(),i.current=null)}},[]);const f=t.size===0,[p,_]=H.useState(!0);return H.useEffect(()=>{if(!f){const y=setTimeout(()=>_(!1),800);return()=>clearTimeout(y)}_(!0)},[f]),M.jsxs("div",{onMouseMove:l,onClick:h,style:{position:"relative"},children:[M.jsx("canvas",{ref:r,style:{display:"block",width:"100vw",height:"100vh",background:"#080808"}}),p&&M.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",opacity:f?1:0,transition:"opacity 0.8s ease-out"},children:[M.jsx("div",{style:{fontSize:13,fontFamily:"monospace",color:"#444",letterSpacing:"0.15em",textTransform:"uppercase",marginBottom:12},children:"claude-live"}),M.jsxs("div",{style:{fontSize:11,fontFamily:"monospace",color:"#333",textAlign:"center",lineHeight:1.7},children:["waiting for sessions",M.jsx("span",{style:{animation:"blink 1.5s step-end infinite"},children:"_"})]}),M.jsx("style",{children:"@keyframes blink { 50% { opacity: 0 } }"})]})]})}const Pf=["/src/App.tsx","/src/store.ts","/src/types.ts","/src/canvas/renderer.ts","/src/canvas/graph.ts","/server/index.js","/package.json","/client/vite.config.ts","/src/main.tsx","/src/index.css","/src/DebugPanel.tsx","/tests/store.test.ts","/bin/claude-live.js"],Af=["npm run build","git status","ls -la src/","npx tsc --noEmit","npm test","git diff --stat"];function Ef(){return"debug-"+Math.random().toString(36).slice(2,8)}async function et(t){await fetch("/hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}function Zb({sessionIds:t,isOpen:e,onClose:n}){const[s,r]=H.useState(Ef),i=H.useRef(0),o=H.useRef(0),a=H.useRef("agent-"+Math.random().toString(36).slice(2,7));function c(){return Pf[i.current++%Pf.length]}function u(){return Af[o.current++%Af.length]}function d(p,_){return et({session_id:s,hook_event_name:"PreToolUse",tool_name:p,tool_input:_})}function l(p,_,y){et({session_id:s,hook_event_name:"PreToolUse",tool_name:p,tool_input:_}),setTimeout(()=>{et({session_id:s,hook_event_name:"PostToolUse",tool_name:p,tool_input:_,tool_response:y})},100)}const h=[{label:"Read",color:"#4ade80",fn:()=>l("Read",{file_path:c()},{type:"text",file:{filePath:c(),content:"Response data from file read operation with individual letters streaming outward"}})},{label:"Edit",color:"#60a5fa",fn:()=>d("Edit",{file_path:c()})},{label:"Write",color:"#60a5fa",fn:()=>l("Write",{file_path:c(),content:"Writing content to file with response snake animation showing letters outward"},{})},{label:"Grep",color:"#a78bfa",fn:()=>d("Grep",{pattern:"useState",path:"."})},{label:"Glob",color:"#a78bfa",fn:()=>d("Glob",{pattern:"**/*.tsx",path:c()})},{label:"Bash",color:"#f59e0b",fn:()=>l("Bash",{command:u()},{stdout:"bash command output with response letters flowing outward in straight animation paths",stderr:"",interrupted:!1})},{label:"WebFetch",color:"#f472b6",fn:()=>d("WebFetch",{url:"https://api.github.com/repos"})},{label:"Notification",color:"#34d399",fn:()=>et({session_id:s,hook_event_name:"Notification",tool_input:{message:"Task complete! All files updated."}})},{label:"Permission",color:"#fbbf24",fn:()=>et({session_id:s,hook_event_name:"PermissionRequest",tool_input:{message:"Allow bash command execution?"}})},{label:"Stop",color:"#888888",fn:()=>et({session_id:s,hook_event_name:"Stop"})},{label:"SubStart",color:"#c084fc",fn:()=>et({session_id:s,hook_event_name:"SubagentStart",agent_id:a.current,agent_type:"general-purpose"})},{label:"SubStop",color:"#7c3aed",fn:()=>et({session_id:s,hook_event_name:"SubagentStop",agent_id:a.current})},{label:"SessEnd",color:"#ef4444",fn:()=>et({session_id:s,hook_event_name:"SessionEnd"})},{label:"Fail",color:"#f87171",fn:()=>et({session_id:s,hook_event_name:"PostToolUseFailure",tool_name:"Read",tool_input:{file_path:c()},error:"File not found"})},{label:"Compact↓",color:"#94a3b8",fn:()=>et({session_id:s,hook_event_name:"PreCompact",trigger:"manual"})},{label:"Compact↑",color:"#38bdf8",fn:()=>et({session_id:s,hook_event_name:"PostCompact"})},{label:"Prompt",color:"#38bdf8",fn:()=>et({session_id:s,hook_event_name:"UserPromptSubmit",prompt:"Fix the login bug on the dashboard page"})},{label:"RespRead",color:"#4ade80",fn:()=>l("Read",{file_path:c()},{type:"text",file:{filePath:c(),content:"const response data flowing outward through the canvas with individual letters"}})},{label:"RespWrite",color:"#60a5fa",fn:()=>l("Write",{file_path:c(),content:"Writing response snake letters streaming outward in straight paths with subtle glow effects"},{})},{label:"RespBash",color:"#f59e0b",fn:()=>l("Bash",{command:u()},{stdout:"command output letters flowing smoothly outward from cluster center with proper spacing",stderr:"",interrupted:!1})}];if(!e)return null;const f=t.includes(s)?t:[...t,s];return M.jsxs("div",{className:"panel-overlay",children:[M.jsxs("div",{className:"debug-panel-header",children:[M.jsx("span",{className:"debug-panel-title",children:"debug"}),M.jsx("button",{className:"debug-close",onClick:n,children:"×"})]}),M.jsxs("div",{className:"debug-section",children:[M.jsx("div",{className:"debug-section-label",children:"session"}),M.jsxs("div",{className:"debug-session-row",children:[M.jsx("select",{className:"debug-select",value:s,onChange:p=>r(p.target.value),children:f.map(p=>M.jsx("option",{value:p,children:p.slice(0,18)},p))}),M.jsx("button",{className:"debug-new-btn",onClick:()=>r(Ef()),children:"+ new"})]})]}),M.jsxs("div",{className:"debug-section",children:[M.jsx("div",{className:"debug-section-label",children:"fire event"}),M.jsx("div",{className:"debug-tool-grid",children:h.map(({label:p,color:_,fn:y})=>M.jsx("button",{className:"debug-tool-btn",style:{"--tool-color":_},onClick:y,children:p},p))})]})]})}const Jb=[{badge:"#",name:"Read",description:"file operations",color:"#22c55e"},{badge:"E",name:"Edit / Write",description:"editing tools",color:"#3b82f6"},{badge:"B",name:"Bash",description:"shell commands",color:"#f97316"},{badge:"G",name:"Grep / Glob",description:"search tools",color:"#a855f7"},{badge:"↗",name:"WebFetch",description:"HTTP requests",color:"#ec4899"},{badge:"!",name:"Notification",description:"notifications",color:"#06b6d4"},{badge:"✓",name:"Stop",description:"tool completion",color:"#666666"},{badge:"⬡",name:"Subagent",description:"subagent execution",color:"#a855f7"}],e2=[{name:"Slide-in bounce",description:"New event arrives at top of log"},{name:"Dot pop",description:"Emphasis animation on new entry (scale/rotate)"},{name:"Scan shimmer",description:"Left-to-right scan effect (processing effect)"},{name:"Fade with time",description:"Entry visibility decreases after 5 seconds"}];function t2({isOpen:t,onClose:e}){return t?M.jsxs("div",{className:"panel-overlay operations-panel",children:[M.jsx("button",{className:"panel-close-btn",onClick:e,children:"×"}),M.jsxs("div",{className:"panel-section",children:[M.jsx("h3",{children:"Node Types"}),M.jsx("div",{className:"node-types-grid",children:Jb.map(n=>M.jsxs("div",{className:"node-type-item",children:[M.jsx("div",{className:"node-type-badge",style:{background:n.color},children:n.badge}),M.jsxs("div",{className:"node-type-info",children:[M.jsx("div",{className:"node-type-name",children:n.name}),M.jsx("div",{className:"node-type-description",children:n.description})]})]},n.name))})]}),M.jsxs("div",{className:"panel-section",children:[M.jsx("h3",{children:"Animation Styles"}),M.jsx("div",{className:"animations-list",children:e2.map(n=>M.jsxs("div",{className:"animation-item",children:[M.jsx("div",{className:"animation-name",children:n.name}),M.jsx("div",{className:"animation-description",children:n.description})]},n.name))})]})]}):null}var F0={};/*!
294
+ * howler.js v2.2.4
295
+ * howlerjs.com
296
+ *
297
+ * (c) 2013-2020, James Simpson of GoldFire Studios
298
+ * goldfirestudios.com
299
+ *
300
+ * MIT License
301
+ */(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var l=this||n;return l._counter=1e3,l._html5AudioPool=[],l.html5PoolSize=10,l._codecs={},l._howls=[],l._muted=!1,l._volume=1,l._canPlayEvent="canplaythrough",l._navigator=typeof window<"u"&&window.navigator?window.navigator:null,l.masterGain=null,l.noAudio=!1,l.usingWebAudio=!0,l.autoSuspend=!0,l.ctx=null,l.autoUnlock=!0,l._setup(),l},volume:function(l){var h=this||n;if(l=parseFloat(l),h.ctx||d(),typeof l<"u"&&l>=0&&l<=1){if(h._volume=l,h._muted)return h;h.usingWebAudio&&h.masterGain.gain.setValueAtTime(l,n.ctx.currentTime);for(var f=0;f<h._howls.length;f++)if(!h._howls[f]._webAudio)for(var p=h._howls[f]._getSoundIds(),_=0;_<p.length;_++){var y=h._howls[f]._soundById(p[_]);y&&y._node&&(y._node.volume=y._volume*l)}return h}return h._volume},mute:function(l){var h=this||n;h.ctx||d(),h._muted=l,h.usingWebAudio&&h.masterGain.gain.setValueAtTime(l?0:h._volume,n.ctx.currentTime);for(var f=0;f<h._howls.length;f++)if(!h._howls[f]._webAudio)for(var p=h._howls[f]._getSoundIds(),_=0;_<p.length;_++){var y=h._howls[f]._soundById(p[_]);y&&y._node&&(y._node.muted=l?!0:y._muted)}return h},stop:function(){for(var l=this||n,h=0;h<l._howls.length;h++)l._howls[h].stop();return l},unload:function(){for(var l=this||n,h=l._howls.length-1;h>=0;h--)l._howls[h].unload();return l.usingWebAudio&&l.ctx&&typeof l.ctx.close<"u"&&(l.ctx.close(),l.ctx=null,d()),l},codecs:function(l){return(this||n)._codecs[l.replace(/^x-/,"")]},_setup:function(){var l=this||n;if(l.state=l.ctx&&l.ctx.state||"suspended",l._autoSuspend(),!l.usingWebAudio)if(typeof Audio<"u")try{var h=new Audio;typeof h.oncanplaythrough>"u"&&(l._canPlayEvent="canplay")}catch{l.noAudio=!0}else l.noAudio=!0;try{var h=new Audio;h.muted&&(l.noAudio=!0)}catch{}return l.noAudio||l._setupCodecs(),l},_setupCodecs:function(){var l=this||n,h=null;try{h=typeof Audio<"u"?new Audio:null}catch{return l}if(!h||typeof h.canPlayType!="function")return l;var f=h.canPlayType("audio/mpeg;").replace(/^no$/,""),p=l._navigator?l._navigator.userAgent:"",_=p.match(/OPR\/(\d+)/g),y=_&&parseInt(_[0].split("/")[1],10)<33,m=p.indexOf("Safari")!==-1&&p.indexOf("Chrome")===-1,g=p.match(/Version\/(.*?) /),x=m&&g&&parseInt(g[1],10)<15;return l._codecs={mp3:!!(!y&&(f||h.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!f,opus:!!h.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!h.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(h.canPlayType('audio/wav; codecs="1"')||h.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!h.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!h.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(h.canPlayType("audio/x-m4a;")||h.canPlayType("audio/m4a;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(h.canPlayType("audio/x-m4b;")||h.canPlayType("audio/m4b;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(h.canPlayType("audio/x-mp4;")||h.canPlayType("audio/mp4;")||h.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!x&&h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!x&&h.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!h.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(h.canPlayType("audio/x-flac;")||h.canPlayType("audio/flac;")).replace(/^no$/,"")},l},_unlockAudio:function(){var l=this||n;if(!(l._audioUnlocked||!l.ctx)){l._audioUnlocked=!1,l.autoUnlock=!1,!l._mobileUnloaded&&l.ctx.sampleRate!==44100&&(l._mobileUnloaded=!0,l.unload()),l._scratchBuffer=l.ctx.createBuffer(1,1,22050);var h=function(f){for(;l._html5AudioPool.length<l.html5PoolSize;)try{var p=new Audio;p._unlocked=!0,l._releaseHtml5Audio(p)}catch{l.noAudio=!0;break}for(var _=0;_<l._howls.length;_++)if(!l._howls[_]._webAudio)for(var y=l._howls[_]._getSoundIds(),m=0;m<y.length;m++){var g=l._howls[_]._soundById(y[m]);g&&g._node&&!g._node._unlocked&&(g._node._unlocked=!0,g._node.load())}l._autoResume();var x=l.ctx.createBufferSource();x.buffer=l._scratchBuffer,x.connect(l.ctx.destination),typeof x.start>"u"?x.noteOn(0):x.start(0),typeof l.ctx.resume=="function"&&l.ctx.resume(),x.onended=function(){x.disconnect(0),l._audioUnlocked=!0,document.removeEventListener("touchstart",h,!0),document.removeEventListener("touchend",h,!0),document.removeEventListener("click",h,!0),document.removeEventListener("keydown",h,!0);for(var v=0;v<l._howls.length;v++)l._howls[v]._emit("unlock")}};return document.addEventListener("touchstart",h,!0),document.addEventListener("touchend",h,!0),document.addEventListener("click",h,!0),document.addEventListener("keydown",h,!0),l}},_obtainHtml5Audio:function(){var l=this||n;if(l._html5AudioPool.length)return l._html5AudioPool.pop();var h=new Audio().play();return h&&typeof Promise<"u"&&(h instanceof Promise||typeof h.then=="function")&&h.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(l){var h=this||n;return l._unlocked&&h._html5AudioPool.push(l),h},_autoSuspend:function(){var l=this;if(!(!l.autoSuspend||!l.ctx||typeof l.ctx.suspend>"u"||!n.usingWebAudio)){for(var h=0;h<l._howls.length;h++)if(l._howls[h]._webAudio){for(var f=0;f<l._howls[h]._sounds.length;f++)if(!l._howls[h]._sounds[f]._paused)return l}return l._suspendTimer&&clearTimeout(l._suspendTimer),l._suspendTimer=setTimeout(function(){if(l.autoSuspend){l._suspendTimer=null,l.state="suspending";var p=function(){l.state="suspended",l._resumeAfterSuspend&&(delete l._resumeAfterSuspend,l._autoResume())};l.ctx.suspend().then(p,p)}},3e4),l}},_autoResume:function(){var l=this;if(!(!l.ctx||typeof l.ctx.resume>"u"||!n.usingWebAudio))return l.state==="running"&&l.ctx.state!=="interrupted"&&l._suspendTimer?(clearTimeout(l._suspendTimer),l._suspendTimer=null):l.state==="suspended"||l.state==="running"&&l.ctx.state==="interrupted"?(l.ctx.resume().then(function(){l.state="running";for(var h=0;h<l._howls.length;h++)l._howls[h]._emit("resume")}),l._suspendTimer&&(clearTimeout(l._suspendTimer),l._suspendTimer=null)):l.state==="suspending"&&(l._resumeAfterSuspend=!0),l}};var n=new e,s=function(l){var h=this;if(!l.src||l.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}h.init(l)};s.prototype={init:function(l){var h=this;return n.ctx||d(),h._autoplay=l.autoplay||!1,h._format=typeof l.format!="string"?l.format:[l.format],h._html5=l.html5||!1,h._muted=l.mute||!1,h._loop=l.loop||!1,h._pool=l.pool||5,h._preload=typeof l.preload=="boolean"||l.preload==="metadata"?l.preload:!0,h._rate=l.rate||1,h._sprite=l.sprite||{},h._src=typeof l.src!="string"?l.src:[l.src],h._volume=l.volume!==void 0?l.volume:1,h._xhr={method:l.xhr&&l.xhr.method?l.xhr.method:"GET",headers:l.xhr&&l.xhr.headers?l.xhr.headers:null,withCredentials:l.xhr&&l.xhr.withCredentials?l.xhr.withCredentials:!1},h._duration=0,h._state="unloaded",h._sounds=[],h._endTimers={},h._queue=[],h._playLock=!1,h._onend=l.onend?[{fn:l.onend}]:[],h._onfade=l.onfade?[{fn:l.onfade}]:[],h._onload=l.onload?[{fn:l.onload}]:[],h._onloaderror=l.onloaderror?[{fn:l.onloaderror}]:[],h._onplayerror=l.onplayerror?[{fn:l.onplayerror}]:[],h._onpause=l.onpause?[{fn:l.onpause}]:[],h._onplay=l.onplay?[{fn:l.onplay}]:[],h._onstop=l.onstop?[{fn:l.onstop}]:[],h._onmute=l.onmute?[{fn:l.onmute}]:[],h._onvolume=l.onvolume?[{fn:l.onvolume}]:[],h._onrate=l.onrate?[{fn:l.onrate}]:[],h._onseek=l.onseek?[{fn:l.onseek}]:[],h._onunlock=l.onunlock?[{fn:l.onunlock}]:[],h._onresume=[],h._webAudio=n.usingWebAudio&&!h._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(h),h._autoplay&&h._queue.push({event:"play",action:function(){h.play()}}),h._preload&&h._preload!=="none"&&h.load(),h},load:function(){var l=this,h=null;if(n.noAudio){l._emit("loaderror",null,"No audio support.");return}typeof l._src=="string"&&(l._src=[l._src]);for(var f=0;f<l._src.length;f++){var p,_;if(l._format&&l._format[f])p=l._format[f];else{if(_=l._src[f],typeof _!="string"){l._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}p=/^data:audio\/([^;,]+);/i.exec(_),p||(p=/\.([^.]+)$/.exec(_.split("?",1)[0])),p&&(p=p[1].toLowerCase())}if(p||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),p&&n.codecs(p)){h=l._src[f];break}}if(!h){l._emit("loaderror",null,"No codec support for selected audio sources.");return}return l._src=h,l._state="loading",window.location.protocol==="https:"&&h.slice(0,5)==="http:"&&(l._html5=!0,l._webAudio=!1),new r(l),l._webAudio&&o(l),l},play:function(l,h){var f=this,p=null;if(typeof l=="number")p=l,l=null;else{if(typeof l=="string"&&f._state==="loaded"&&!f._sprite[l])return null;if(typeof l>"u"&&(l="__default",!f._playLock)){for(var _=0,y=0;y<f._sounds.length;y++)f._sounds[y]._paused&&!f._sounds[y]._ended&&(_++,p=f._sounds[y]._id);_===1?l=null:p=null}}var m=p?f._soundById(p):f._inactiveSound();if(!m)return null;if(p&&!l&&(l=m._sprite||"__default"),f._state!=="loaded"){m._sprite=l,m._ended=!1;var g=m._id;return f._queue.push({event:"play",action:function(){f.play(g)}}),g}if(p&&!m._paused)return h||f._loadQueue("play"),m._id;f._webAudio&&n._autoResume();var x=Math.max(0,m._seek>0?m._seek:f._sprite[l][0]/1e3),v=Math.max(0,(f._sprite[l][0]+f._sprite[l][1])/1e3-x),S=v*1e3/Math.abs(m._rate),w=f._sprite[l][0]/1e3,b=(f._sprite[l][0]+f._sprite[l][1])/1e3;m._sprite=l,m._ended=!1;var k=function(){m._paused=!1,m._seek=x,m._start=w,m._stop=b,m._loop=!!(m._loop||f._sprite[l][2])};if(x>=b){f._ended(m);return}var T=m._node;if(f._webAudio){var C=function(){f._playLock=!1,k(),f._refreshBuffer(m);var L=m._muted||f._muted?0:m._volume;T.gain.setValueAtTime(L,n.ctx.currentTime),m._playStart=n.ctx.currentTime,typeof T.bufferSource.start>"u"?m._loop?T.bufferSource.noteGrainOn(0,x,86400):T.bufferSource.noteGrainOn(0,x,v):m._loop?T.bufferSource.start(0,x,86400):T.bufferSource.start(0,x,v),S!==1/0&&(f._endTimers[m._id]=setTimeout(f._ended.bind(f,m),S)),h||setTimeout(function(){f._emit("play",m._id),f._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?C():(f._playLock=!0,f.once("resume",C),f._clearTimer(m._id))}else{var P=function(){T.currentTime=x,T.muted=m._muted||f._muted||n._muted||T.muted,T.volume=m._volume*n.volume(),T.playbackRate=m._rate;try{var L=T.play();if(L&&typeof Promise<"u"&&(L instanceof Promise||typeof L.then=="function")?(f._playLock=!0,k(),L.then(function(){f._playLock=!1,T._unlocked=!0,h?f._loadQueue():f._emit("play",m._id)}).catch(function(){f._playLock=!1,f._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),m._ended=!0,m._paused=!0})):h||(f._playLock=!1,k(),f._emit("play",m._id)),T.playbackRate=m._rate,T.paused){f._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}l!=="__default"||m._loop?f._endTimers[m._id]=setTimeout(f._ended.bind(f,m),S):(f._endTimers[m._id]=function(){f._ended(m),T.removeEventListener("ended",f._endTimers[m._id],!1)},T.addEventListener("ended",f._endTimers[m._id],!1))}catch(J){f._emit("playerror",m._id,J)}};T.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(T.src=f._src,T.load());var R=window&&window.ejecta||!T.readyState&&n._navigator.isCocoonJS;if(T.readyState>=3||R)P();else{f._playLock=!0,f._state="loading";var F=function(){f._state="loaded",P(),T.removeEventListener(n._canPlayEvent,F,!1)};T.addEventListener(n._canPlayEvent,F,!1),f._clearTimer(m._id)}}return m._id},pause:function(l){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"pause",action:function(){h.pause(l)}}),h;for(var f=h._getSoundIds(l),p=0;p<f.length;p++){h._clearTimer(f[p]);var _=h._soundById(f[p]);if(_&&!_._paused&&(_._seek=h.seek(f[p]),_._rateSeek=0,_._paused=!0,h._stopFade(f[p]),_._node))if(h._webAudio){if(!_._node.bufferSource)continue;typeof _._node.bufferSource.stop>"u"?_._node.bufferSource.noteOff(0):_._node.bufferSource.stop(0),h._cleanBuffer(_._node)}else(!isNaN(_._node.duration)||_._node.duration===1/0)&&_._node.pause();arguments[1]||h._emit("pause",_?_._id:null)}return h},stop:function(l,h){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"stop",action:function(){f.stop(l)}}),f;for(var p=f._getSoundIds(l),_=0;_<p.length;_++){f._clearTimer(p[_]);var y=f._soundById(p[_]);y&&(y._seek=y._start||0,y._rateSeek=0,y._paused=!0,y._ended=!0,f._stopFade(p[_]),y._node&&(f._webAudio?y._node.bufferSource&&(typeof y._node.bufferSource.stop>"u"?y._node.bufferSource.noteOff(0):y._node.bufferSource.stop(0),f._cleanBuffer(y._node)):(!isNaN(y._node.duration)||y._node.duration===1/0)&&(y._node.currentTime=y._start||0,y._node.pause(),y._node.duration===1/0&&f._clearSound(y._node))),h||f._emit("stop",y._id))}return f},mute:function(l,h){var f=this;if(f._state!=="loaded"||f._playLock)return f._queue.push({event:"mute",action:function(){f.mute(l,h)}}),f;if(typeof h>"u")if(typeof l=="boolean")f._muted=l;else return f._muted;for(var p=f._getSoundIds(h),_=0;_<p.length;_++){var y=f._soundById(p[_]);y&&(y._muted=l,y._interval&&f._stopFade(y._id),f._webAudio&&y._node?y._node.gain.setValueAtTime(l?0:y._volume,n.ctx.currentTime):y._node&&(y._node.muted=n._muted?!0:l),f._emit("mute",y._id))}return f},volume:function(){var l=this,h=arguments,f,p;if(h.length===0)return l._volume;if(h.length===1||h.length===2&&typeof h[1]>"u"){var _=l._getSoundIds(),y=_.indexOf(h[0]);y>=0?p=parseInt(h[0],10):f=parseFloat(h[0])}else h.length>=2&&(f=parseFloat(h[0]),p=parseInt(h[1],10));var m;if(typeof f<"u"&&f>=0&&f<=1){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"volume",action:function(){l.volume.apply(l,h)}}),l;typeof p>"u"&&(l._volume=f),p=l._getSoundIds(p);for(var g=0;g<p.length;g++)m=l._soundById(p[g]),m&&(m._volume=f,h[2]||l._stopFade(p[g]),l._webAudio&&m._node&&!m._muted?m._node.gain.setValueAtTime(f,n.ctx.currentTime):m._node&&!m._muted&&(m._node.volume=f*n.volume()),l._emit("volume",m._id))}else return m=p?l._soundById(p):l._sounds[0],m?m._volume:0;return l},fade:function(l,h,f,p){var _=this;if(_._state!=="loaded"||_._playLock)return _._queue.push({event:"fade",action:function(){_.fade(l,h,f,p)}}),_;l=Math.min(Math.max(0,parseFloat(l)),1),h=Math.min(Math.max(0,parseFloat(h)),1),f=parseFloat(f),_.volume(l,p);for(var y=_._getSoundIds(p),m=0;m<y.length;m++){var g=_._soundById(y[m]);if(g){if(p||_._stopFade(y[m]),_._webAudio&&!g._muted){var x=n.ctx.currentTime,v=x+f/1e3;g._volume=l,g._node.gain.setValueAtTime(l,x),g._node.gain.linearRampToValueAtTime(h,v)}_._startFadeInterval(g,l,h,f,y[m],typeof p>"u")}}return _},_startFadeInterval:function(l,h,f,p,_,y){var m=this,g=h,x=f-h,v=Math.abs(x/.01),S=Math.max(4,v>0?p/v:p),w=Date.now();l._fadeTo=f,l._interval=setInterval(function(){var b=(Date.now()-w)/p;w=Date.now(),g+=x*b,g=Math.round(g*100)/100,x<0?g=Math.max(f,g):g=Math.min(f,g),m._webAudio?l._volume=g:m.volume(g,l._id,!0),y&&(m._volume=g),(f<h&&g<=f||f>h&&g>=f)&&(clearInterval(l._interval),l._interval=null,l._fadeTo=null,m.volume(f,l._id),m._emit("fade",l._id))},S)},_stopFade:function(l){var h=this,f=h._soundById(l);return f&&f._interval&&(h._webAudio&&f._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(f._interval),f._interval=null,h.volume(f._fadeTo,l),f._fadeTo=null,h._emit("fade",l)),h},loop:function(){var l=this,h=arguments,f,p,_;if(h.length===0)return l._loop;if(h.length===1)if(typeof h[0]=="boolean")f=h[0],l._loop=f;else return _=l._soundById(parseInt(h[0],10)),_?_._loop:!1;else h.length===2&&(f=h[0],p=parseInt(h[1],10));for(var y=l._getSoundIds(p),m=0;m<y.length;m++)_=l._soundById(y[m]),_&&(_._loop=f,l._webAudio&&_._node&&_._node.bufferSource&&(_._node.bufferSource.loop=f,f&&(_._node.bufferSource.loopStart=_._start||0,_._node.bufferSource.loopEnd=_._stop,l.playing(y[m])&&(l.pause(y[m],!0),l.play(y[m],!0)))));return l},rate:function(){var l=this,h=arguments,f,p;if(h.length===0)p=l._sounds[0]._id;else if(h.length===1){var _=l._getSoundIds(),y=_.indexOf(h[0]);y>=0?p=parseInt(h[0],10):f=parseFloat(h[0])}else h.length===2&&(f=parseFloat(h[0]),p=parseInt(h[1],10));var m;if(typeof f=="number"){if(l._state!=="loaded"||l._playLock)return l._queue.push({event:"rate",action:function(){l.rate.apply(l,h)}}),l;typeof p>"u"&&(l._rate=f),p=l._getSoundIds(p);for(var g=0;g<p.length;g++)if(m=l._soundById(p[g]),m){l.playing(p[g])&&(m._rateSeek=l.seek(p[g]),m._playStart=l._webAudio?n.ctx.currentTime:m._playStart),m._rate=f,l._webAudio&&m._node&&m._node.bufferSource?m._node.bufferSource.playbackRate.setValueAtTime(f,n.ctx.currentTime):m._node&&(m._node.playbackRate=f);var x=l.seek(p[g]),v=(l._sprite[m._sprite][0]+l._sprite[m._sprite][1])/1e3-x,S=v*1e3/Math.abs(m._rate);(l._endTimers[p[g]]||!m._paused)&&(l._clearTimer(p[g]),l._endTimers[p[g]]=setTimeout(l._ended.bind(l,m),S)),l._emit("rate",m._id)}}else return m=l._soundById(p),m?m._rate:l._rate;return l},seek:function(){var l=this,h=arguments,f,p;if(h.length===0)l._sounds.length&&(p=l._sounds[0]._id);else if(h.length===1){var _=l._getSoundIds(),y=_.indexOf(h[0]);y>=0?p=parseInt(h[0],10):l._sounds.length&&(p=l._sounds[0]._id,f=parseFloat(h[0]))}else h.length===2&&(f=parseFloat(h[0]),p=parseInt(h[1],10));if(typeof p>"u")return 0;if(typeof f=="number"&&(l._state!=="loaded"||l._playLock))return l._queue.push({event:"seek",action:function(){l.seek.apply(l,h)}}),l;var m=l._soundById(p);if(m)if(typeof f=="number"&&f>=0){var g=l.playing(p);g&&l.pause(p,!0),m._seek=f,m._ended=!1,l._clearTimer(p),!l._webAudio&&m._node&&!isNaN(m._node.duration)&&(m._node.currentTime=f);var x=function(){g&&l.play(p,!0),l._emit("seek",p)};if(g&&!l._webAudio){var v=function(){l._playLock?setTimeout(v,0):x()};setTimeout(v,0)}else x()}else if(l._webAudio){var S=l.playing(p)?n.ctx.currentTime-m._playStart:0,w=m._rateSeek?m._rateSeek-m._seek:0;return m._seek+(w+S*Math.abs(m._rate))}else return m._node.currentTime;return l},playing:function(l){var h=this;if(typeof l=="number"){var f=h._soundById(l);return f?!f._paused:!1}for(var p=0;p<h._sounds.length;p++)if(!h._sounds[p]._paused)return!0;return!1},duration:function(l){var h=this,f=h._duration,p=h._soundById(l);return p&&(f=h._sprite[p._sprite][1]/1e3),f},state:function(){return this._state},unload:function(){for(var l=this,h=l._sounds,f=0;f<h.length;f++)h[f]._paused||l.stop(h[f]._id),l._webAudio||(l._clearSound(h[f]._node),h[f]._node.removeEventListener("error",h[f]._errorFn,!1),h[f]._node.removeEventListener(n._canPlayEvent,h[f]._loadFn,!1),h[f]._node.removeEventListener("ended",h[f]._endFn,!1),n._releaseHtml5Audio(h[f]._node)),delete h[f]._node,l._clearTimer(h[f]._id);var p=n._howls.indexOf(l);p>=0&&n._howls.splice(p,1);var _=!0;for(f=0;f<n._howls.length;f++)if(n._howls[f]._src===l._src||l._src.indexOf(n._howls[f]._src)>=0){_=!1;break}return i&&_&&delete i[l._src],n.noAudio=!1,l._state="unloaded",l._sounds=[],l=null,null},on:function(l,h,f,p){var _=this,y=_["_on"+l];return typeof h=="function"&&y.push(p?{id:f,fn:h,once:p}:{id:f,fn:h}),_},off:function(l,h,f){var p=this,_=p["_on"+l],y=0;if(typeof h=="number"&&(f=h,h=null),h||f)for(y=0;y<_.length;y++){var m=f===_[y].id;if(h===_[y].fn&&m||!h&&m){_.splice(y,1);break}}else if(l)p["_on"+l]=[];else{var g=Object.keys(p);for(y=0;y<g.length;y++)g[y].indexOf("_on")===0&&Array.isArray(p[g[y]])&&(p[g[y]]=[])}return p},once:function(l,h,f){var p=this;return p.on(l,h,f,1),p},_emit:function(l,h,f){for(var p=this,_=p["_on"+l],y=_.length-1;y>=0;y--)(!_[y].id||_[y].id===h||l==="load")&&(setTimeout((function(m){m.call(this,h,f)}).bind(p,_[y].fn),0),_[y].once&&p.off(l,_[y].fn,_[y].id));return p._loadQueue(l),p},_loadQueue:function(l){var h=this;if(h._queue.length>0){var f=h._queue[0];f.event===l&&(h._queue.shift(),h._loadQueue()),l||f.action()}return h},_ended:function(l){var h=this,f=l._sprite;if(!h._webAudio&&l._node&&!l._node.paused&&!l._node.ended&&l._node.currentTime<l._stop)return setTimeout(h._ended.bind(h,l),100),h;var p=!!(l._loop||h._sprite[f][2]);if(h._emit("end",l._id),!h._webAudio&&p&&h.stop(l._id,!0).play(l._id),h._webAudio&&p){h._emit("play",l._id),l._seek=l._start||0,l._rateSeek=0,l._playStart=n.ctx.currentTime;var _=(l._stop-l._start)*1e3/Math.abs(l._rate);h._endTimers[l._id]=setTimeout(h._ended.bind(h,l),_)}return h._webAudio&&!p&&(l._paused=!0,l._ended=!0,l._seek=l._start||0,l._rateSeek=0,h._clearTimer(l._id),h._cleanBuffer(l._node),n._autoSuspend()),!h._webAudio&&!p&&h.stop(l._id,!0),h},_clearTimer:function(l){var h=this;if(h._endTimers[l]){if(typeof h._endTimers[l]!="function")clearTimeout(h._endTimers[l]);else{var f=h._soundById(l);f&&f._node&&f._node.removeEventListener("ended",h._endTimers[l],!1)}delete h._endTimers[l]}return h},_soundById:function(l){for(var h=this,f=0;f<h._sounds.length;f++)if(l===h._sounds[f]._id)return h._sounds[f];return null},_inactiveSound:function(){var l=this;l._drain();for(var h=0;h<l._sounds.length;h++)if(l._sounds[h]._ended)return l._sounds[h].reset();return new r(l)},_drain:function(){var l=this,h=l._pool,f=0,p=0;if(!(l._sounds.length<h)){for(p=0;p<l._sounds.length;p++)l._sounds[p]._ended&&f++;for(p=l._sounds.length-1;p>=0;p--){if(f<=h)return;l._sounds[p]._ended&&(l._webAudio&&l._sounds[p]._node&&l._sounds[p]._node.disconnect(0),l._sounds.splice(p,1),f--)}}},_getSoundIds:function(l){var h=this;if(typeof l>"u"){for(var f=[],p=0;p<h._sounds.length;p++)f.push(h._sounds[p]._id);return f}else return[l]},_refreshBuffer:function(l){var h=this;return l._node.bufferSource=n.ctx.createBufferSource(),l._node.bufferSource.buffer=i[h._src],l._panner?l._node.bufferSource.connect(l._panner):l._node.bufferSource.connect(l._node),l._node.bufferSource.loop=l._loop,l._loop&&(l._node.bufferSource.loopStart=l._start||0,l._node.bufferSource.loopEnd=l._stop||0),l._node.bufferSource.playbackRate.setValueAtTime(l._rate,n.ctx.currentTime),h},_cleanBuffer:function(l){var h=this,f=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!l.bufferSource)return h;if(n._scratchBuffer&&l.bufferSource&&(l.bufferSource.onended=null,l.bufferSource.disconnect(0),f))try{l.bufferSource.buffer=n._scratchBuffer}catch{}return l.bufferSource=null,h},_clearSound:function(l){var h=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);h||(l.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var r=function(l){this._parent=l,this.init()};r.prototype={init:function(){var l=this,h=l._parent;return l._muted=h._muted,l._loop=h._loop,l._volume=h._volume,l._rate=h._rate,l._seek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++n._counter,h._sounds.push(l),l.create(),l},create:function(){var l=this,h=l._parent,f=n._muted||l._muted||l._parent._muted?0:l._volume;return h._webAudio?(l._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),l._node.gain.setValueAtTime(f,n.ctx.currentTime),l._node.paused=!0,l._node.connect(n.masterGain)):n.noAudio||(l._node=n._obtainHtml5Audio(),l._errorFn=l._errorListener.bind(l),l._node.addEventListener("error",l._errorFn,!1),l._loadFn=l._loadListener.bind(l),l._node.addEventListener(n._canPlayEvent,l._loadFn,!1),l._endFn=l._endListener.bind(l),l._node.addEventListener("ended",l._endFn,!1),l._node.src=h._src,l._node.preload=h._preload===!0?"auto":h._preload,l._node.volume=f*n.volume(),l._node.load()),l},reset:function(){var l=this,h=l._parent;return l._muted=h._muted,l._loop=h._loop,l._volume=h._volume,l._rate=h._rate,l._seek=0,l._rateSeek=0,l._paused=!0,l._ended=!0,l._sprite="__default",l._id=++n._counter,l},_errorListener:function(){var l=this;l._parent._emit("loaderror",l._id,l._node.error?l._node.error.code:0),l._node.removeEventListener("error",l._errorFn,!1)},_loadListener:function(){var l=this,h=l._parent;h._duration=Math.ceil(l._node.duration*10)/10,Object.keys(h._sprite).length===0&&(h._sprite={__default:[0,h._duration*1e3]}),h._state!=="loaded"&&(h._state="loaded",h._emit("load"),h._loadQueue()),l._node.removeEventListener(n._canPlayEvent,l._loadFn,!1)},_endListener:function(){var l=this,h=l._parent;h._duration===1/0&&(h._duration=Math.ceil(l._node.duration*10)/10,h._sprite.__default[1]===1/0&&(h._sprite.__default[1]=h._duration*1e3),h._ended(l)),l._node.removeEventListener("ended",l._endFn,!1)}};var i={},o=function(l){var h=l._src;if(i[h]){l._duration=i[h].duration,u(l);return}if(/^data:[^;]+;base64,/.test(h)){for(var f=atob(h.split(",")[1]),p=new Uint8Array(f.length),_=0;_<f.length;++_)p[_]=f.charCodeAt(_);c(p.buffer,l)}else{var y=new XMLHttpRequest;y.open(l._xhr.method,h,!0),y.withCredentials=l._xhr.withCredentials,y.responseType="arraybuffer",l._xhr.headers&&Object.keys(l._xhr.headers).forEach(function(m){y.setRequestHeader(m,l._xhr.headers[m])}),y.onload=function(){var m=(y.status+"")[0];if(m!=="0"&&m!=="2"&&m!=="3"){l._emit("loaderror",null,"Failed loading audio file with status: "+y.status+".");return}c(y.response,l)},y.onerror=function(){l._webAudio&&(l._html5=!0,l._webAudio=!1,l._sounds=[],delete i[h],l.load())},a(y)}},a=function(l){try{l.send()}catch{l.onerror()}},c=function(l,h){var f=function(){h._emit("loaderror",null,"Decoding audio data failed.")},p=function(_){_&&h._sounds.length>0?(i[h._src]=_,u(h,_)):f()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(l).then(p).catch(f):n.ctx.decodeAudioData(l,p,f)},u=function(l,h){h&&!l._duration&&(l._duration=h.duration),Object.keys(l._sprite).length===0&&(l._sprite={__default:[0,l._duration*1e3]}),l._state!=="loaded"&&(l._state="loaded",l._emit("load"),l._loadQueue())},d=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var l=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),h=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),f=h?parseInt(h[1],10):null;if(l&&f&&f<9){var p=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!p&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};t.Howler=n,t.Howl=s,typeof qs<"u"?(qs.HowlerGlobal=e,qs.Howler=n,qs.Howl=s,qs.Sound=r):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=s,window.Sound=r)})();/*!
302
+ * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
303
+ *
304
+ * howler.js v2.2.4
305
+ * howlerjs.com
306
+ *
307
+ * (c) 2013-2020, James Simpson of GoldFire Studios
308
+ * goldfirestudios.com
309
+ *
310
+ * MIT License
311
+ */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var r=s._howls.length-1;r>=0;r--)s._howls[r].stereo(n);return s},HowlerGlobal.prototype.pos=function(n,s,r){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(s=typeof s!="number"?i._pos[1]:s,r=typeof r!="number"?i._pos[2]:r,typeof n=="number")i._pos=[n,s,r],typeof i.ctx.listener.positionX<"u"?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]);else return i._pos;return i},HowlerGlobal.prototype.orientation=function(n,s,r,i,o,a){var c=this;if(!c.ctx||!c.ctx.listener)return c;var u=c._orientation;if(s=typeof s!="number"?u[1]:s,r=typeof r!="number"?u[2]:r,i=typeof i!="number"?u[3]:i,o=typeof o!="number"?u[4]:o,a=typeof a!="number"?u[5]:a,typeof n=="number")c._orientation=[n,s,r,i,o,a],typeof c.ctx.listener.forwardX<"u"?(c.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),c.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),c.ctx.listener.forwardZ.setTargetAtTime(r,Howler.ctx.currentTime,.1),c.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),c.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),c.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):c.ctx.listener.setOrientation(n,s,r,i,o,a);else return u;return c},Howl.prototype.init=function(n){return function(s){var r=this;return r._orientation=s.orientation||[1,0,0],r._stereo=s.stereo||null,r._pos=s.pos||null,r._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},r._onstereo=s.onstereo?[{fn:s.onstereo}]:[],r._onpos=s.onpos?[{fn:s.onpos}]:[],r._onorientation=s.onorientation?[{fn:s.onorientation}]:[],n.call(this,s)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,s){var r=this;if(!r._webAudio)return r;if(r._state!=="loaded")return r._queue.push({event:"stereo",action:function(){r.stereo(n,s)}}),r;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof n=="number")r._stereo=n,r._pos=[n,0,0];else return r._stereo;for(var o=r._getSoundIds(s),a=0;a<o.length;a++){var c=r._soundById(o[a]);if(c)if(typeof n=="number")c._stereo=n,c._pos=[n,0,0],c._node&&(c._pannerAttr.panningModel="equalpower",(!c._panner||!c._panner.pan)&&e(c,i),i==="spatial"?typeof c._panner.positionX<"u"?(c._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),c._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),c._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):c._panner.setPosition(n,0,0):c._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),r._emit("stereo",c._id);else return c._stereo}return r},Howl.prototype.pos=function(n,s,r,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(n,s,r,i)}}),o;if(s=typeof s!="number"?0:s,r=typeof r!="number"?-.5:r,typeof i>"u")if(typeof n=="number")o._pos=[n,s,r];else return o._pos;for(var a=o._getSoundIds(i),c=0;c<a.length;c++){var u=o._soundById(a[c]);if(u)if(typeof n=="number")u._pos=[n,s,r],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(s,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setPosition(n,s,r)),o._emit("pos",u._id);else return u._pos}return o},Howl.prototype.orientation=function(n,s,r,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(n,s,r,i)}}),o;if(s=typeof s!="number"?o._orientation[1]:s,r=typeof r!="number"?o._orientation[2]:r,typeof i>"u")if(typeof n=="number")o._orientation=[n,s,r];else return o._orientation;for(var a=o._getSoundIds(i),c=0;c<a.length;c++){var u=o._soundById(a[c]);if(u)if(typeof n=="number")u._orientation=[n,s,r],u._node&&(u._panner||(u._pos||(u._pos=o._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(s,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(r,Howler.ctx.currentTime)):u._panner.setOrientation(n,s,r)),o._emit("orientation",u._id);else return u._orientation}return o},Howl.prototype.pannerAttr=function(){var n=this,s=arguments,r,i,o;if(!n._webAudio)return n;if(s.length===0)return n._pannerAttr;if(s.length===1)if(typeof s[0]=="object")r=s[0],typeof i>"u"&&(r.pannerAttr||(r.pannerAttr={coneInnerAngle:r.coneInnerAngle,coneOuterAngle:r.coneOuterAngle,coneOuterGain:r.coneOuterGain,distanceModel:r.distanceModel,maxDistance:r.maxDistance,refDistance:r.refDistance,rolloffFactor:r.rolloffFactor,panningModel:r.panningModel}),n._pannerAttr={coneInnerAngle:typeof r.pannerAttr.coneInnerAngle<"u"?r.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof r.pannerAttr.coneOuterAngle<"u"?r.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof r.pannerAttr.coneOuterGain<"u"?r.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof r.pannerAttr.distanceModel<"u"?r.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof r.pannerAttr.maxDistance<"u"?r.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof r.pannerAttr.refDistance<"u"?r.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof r.pannerAttr.rolloffFactor<"u"?r.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof r.pannerAttr.panningModel<"u"?r.pannerAttr.panningModel:n._panningModel});else return o=n._soundById(parseInt(s[0],10)),o?o._pannerAttr:n._pannerAttr;else s.length===2&&(r=s[0],i=parseInt(s[1],10));for(var a=n._getSoundIds(i),c=0;c<a.length;c++)if(o=n._soundById(a[c]),o){var u=o._pannerAttr;u={coneInnerAngle:typeof r.coneInnerAngle<"u"?r.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof r.coneOuterAngle<"u"?r.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof r.coneOuterGain<"u"?r.coneOuterGain:u.coneOuterGain,distanceModel:typeof r.distanceModel<"u"?r.distanceModel:u.distanceModel,maxDistance:typeof r.maxDistance<"u"?r.maxDistance:u.maxDistance,refDistance:typeof r.refDistance<"u"?r.refDistance:u.refDistance,rolloffFactor:typeof r.rolloffFactor<"u"?r.rolloffFactor:u.rolloffFactor,panningModel:typeof r.panningModel<"u"?r.panningModel:u.panningModel};var d=o._panner;d||(o._pos||(o._pos=n._pos||[0,0,-.5]),e(o,"spatial"),d=o._panner),d.coneInnerAngle=u.coneInnerAngle,d.coneOuterAngle=u.coneOuterAngle,d.coneOuterGain=u.coneOuterGain,d.distanceModel=u.distanceModel,d.maxDistance=u.maxDistance,d.refDistance=u.refDistance,d.rolloffFactor=u.rolloffFactor,d.panningModel=u.panningModel}return n},Sound.prototype.init=function(n){return function(){var s=this,r=s._parent;s._orientation=r._orientation,s._stereo=r._stereo,s._pos=r._pos,s._pannerAttr=r._pannerAttr,n.call(this),s._stereo?r.stereo(s._stereo):s._pos&&r.pos(s._pos[0],s._pos[1],s._pos[2],s._id)}}(Sound.prototype.init),Sound.prototype.reset=function(n){return function(){var s=this,r=s._parent;return s._orientation=r._orientation,s._stereo=r._stereo,s._pos=r._pos,s._pannerAttr=r._pannerAttr,s._stereo?r.stereo(s._stereo):s._pos?r.pos(s._pos[0],s._pos[1],s._pos[2],s._id):s._panner&&(s._panner.disconnect(0),s._panner=void 0,r._refreshBuffer(s)),n.call(this)}}(Sound.prototype.reset);var e=function(n,s){s=s||"spatial",s==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()})(F0);const Oc=["/chords/chord_01.ogg","/chords/chord_02.ogg","/chords/chord_03.ogg","/chords/chord_04.ogg","/chords/chord_05.ogg","/chords/chord_06.ogg","/chords/chord_07.ogg","/chords/chord_08.ogg","/chords/chord_09.ogg","/chords/chord_10.ogg","/chords/chord_11.ogg","/chords/chord_12.ogg","/chords/chord_13.ogg","/chords/chord_14.ogg","/chords/chord_15.ogg","/chords/chord_16.ogg"];let ca=!1,co=[],Rf=!1;const If=new Map;let O0=document.hidden,B0=document.hidden?0:Date.now();const n2=500,s2=[];function r2(){if(Rf)return;Rf=!0;const t=localStorage.getItem("claude-live-audio-enabled");t!==null&&(ca=t==="true");let e=0;co=Oc.map(n=>new F0.Howl({src:[n],volume:.2,preload:!0,onload:()=>{e++,s2.forEach(s=>s(e,Oc.length))}})),document.addEventListener("visibilitychange",()=>{O0=document.hidden,document.hidden||(B0=Date.now())})}function i2(t,e){return t==="Read"?0:t==="Edit"||t==="Write"?1:t==="Bash"?2:t==="Grep"||t==="Glob"?3:t==="WebFetch"?4:e==="Notification"||e==="PermissionRequest"?5:e==="SubagentStart"?6:e==="SubagentStop"?7:e==="UserPromptSubmit"?8:e==="SessionStart"?9:e==="SessionEnd"?10:Math.floor(Math.random()*Oc.length)}function Lf(t,e){if(!ca||co.length===0||O0||Date.now()-B0<n2)return;const n=t||e||"unknown",s=Date.now();if(s-(If.get(n)||0)<150)return;If.set(n,s);const r=i2(t,e),i=co[r%co.length];i.state()==="loaded"&&i.play()}function o2(t){ca=t,localStorage.setItem("claude-live-audio-enabled",t?"true":"false")}function a2(){return ca}function l2({enabled:t}){return t?M.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[M.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),M.jsx("path",{d:"M15.54 8.46a7 7 0 0 1 0 9.9M19.07 4.93a11 11 0 0 1 0 15.66"})]}):M.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[M.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),M.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),M.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})}function c2({enabled:t}){const e=t?"#38bdf8":"#666666",n=t?1:.6;return M.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:M.jsxs("g",{opacity:n,stroke:e,strokeWidth:t?2:1.5,fill:"none",children:[M.jsx("path",{d:"M 3 3 L 3 7 M 3 3 L 7 3"}),M.jsx("path",{d:"M 17 3 L 17 7 M 17 3 L 13 3"}),M.jsx("path",{d:"M 3 17 L 3 13 M 3 17 L 7 17"}),M.jsx("path",{d:"M 17 17 L 17 13 M 17 17 L 13 17"})]})})}const Ff=5e3,Of=4e3,u2=1e3,h2=100;function d2({entries:t}){const[e,n]=H.useState(Date.now()),[s,r]=H.useState(!1);H.useEffect(()=>{let c,u=Date.now();const d=()=>{const l=Date.now();l-u>=h2&&(n(l),u=l),c=requestAnimationFrame(d)};return c=requestAnimationFrame(d),()=>cancelAnimationFrame(c)},[]);const i=c=>{const u=e-c.createdAt;return u>=Ff?0:u<Of?1:1-(u-Of)/u2},o=H.useMemo(()=>t.filter(c=>e-c.createdAt<Ff).slice(-5),[t,e]),a=H.useMemo(()=>[...t].reverse(),[t]);return M.jsxs("div",{className:"event-log-container",children:[o.length>0&&M.jsx("div",{className:"event-log",children:o.map(c=>{const u=i(c);return M.jsxs("div",{className:"event-log-entry",style:{opacity:u,"--entry-color":c.colorHex},children:[M.jsx("div",{className:"event-log-dot",style:{background:c.colorHex}}),M.jsx("span",{className:"event-log-tool",style:{color:c.colorHex},children:c.tool}),c.file&&M.jsx("span",{className:"event-log-file",children:c.file}),M.jsx("span",{className:"event-log-session",children:c.sessionLabel})]},`live-${c.id}`)})}),M.jsx("button",{className:"event-log-history-btn",onClick:()=>r(!0),children:o.length>0?`history (${t.length})`:"history"}),s&&M.jsxs("div",{className:"event-log-history","aria-modal":"true",children:[M.jsx("button",{className:"event-log-history-back",onClick:()=>r(!1),children:"← live"}),a.map(c=>M.jsxs("div",{className:"event-log-entry event-log-entry--static",style:{opacity:.7,"--entry-color":c.colorHex},children:[M.jsx("div",{className:"event-log-dot",style:{background:c.colorHex}}),M.jsx("span",{className:"event-log-tool",style:{color:c.colorHex},children:c.tool}),c.file&&M.jsx("span",{className:"event-log-file",children:c.file}),M.jsx("span",{className:"event-log-session",children:c.sessionLabel})]},`history-${c.id}`))]})]})}const f2=["Read","Edit","Write","Bash","Grep","Glob","WebFetch"],Yi=["server/index.js","bin/hook.js","bin/cli.js","bin/hook-wrapper.sh","client/src/App.tsx","client/src/store.ts","client/src/types.ts","client/src/canvas-pixi/PixiApp.ts","client/src/canvas-pixi/PixiScene.tsx","client/src/canvas-pixi/layers/WorldLayer.ts","client/src/events/EventBus.ts","package.json","README.md","CLAUDE.md","client/vite.config.ts"],p2=["npm test","npm run build","npm run dev","git status","npx tsc --noEmit","grep -r TODO client/src/","ls -la node_modules/","cat .gitignore"],m2=["https://nodejs.org/api/http.html","https://api.github.com/repos","https://www.npmjs.com/package/claude-live"],g2=["refactor the auth module to use JWT tokens","add error handling to the SSE endpoint","fix the failing typecheck in App.tsx","implement the event filtering feature","write tests for the hook handler"];let Bf=0,Df=0;function _2(){return"xxxxxxxx-xxxx-4xxx".replace(/x/g,()=>Math.floor(Math.random()*16).toString(16))}function zt(t){return t[Math.floor(Math.random()*t.length)]}function y2(){return _2()}function Fn(t,e,n,s,r){return{id:`demo-${Bf++}`,session_id:t,hook_event_name:e,tool_name:n,tool_input:s,tool_response:r??null,timestamp:Date.now(),cwd:"/home/user/claude-live",tool_use_id:`tu-${Bf}`}}function x2(t){const e=[];let n=0;function s(){const d=y2();Df++;const l=`demo-session-${Df}`;return e.push({id:d,label:l,active:!0,eventsSent:0}),t({type:"event",data:Fn(d,"SessionStart",null,null)}),d}function r(d){const l=zt(f2);let h={},f={};switch(l){case"Read":h={file_path:zt(Yi)},f={content:`file contents...
312
+ `.repeat(20)};break;case"Edit":h={file_path:zt(Yi),old_string:"old code",new_string:`new code
313
+ with changes`};break;case"Write":h={file_path:zt(Yi),content:`// new file
314
+ `.repeat(10)};break;case"Bash":h={command:zt(p2)},f={exitCode:Math.random()>.9?1:0,output:"command output"};break;case"Grep":h={pattern:zt(["TODO","FIXME","async fn","impl "]),path:"src/"},f={numMatches:Math.floor(Math.random()*20)};break;case"Glob":h={pattern:zt(["**/*.js","**/*.ts","**/*.tsx"]),path:"."},f={files:Yi.slice(0,Math.floor(Math.random()*10))};break;case"WebFetch":h={url:zt(m2)},f={status:200};break}t({type:"event",data:Fn(d.id,"PreToolUse",l,h)}),setTimeout(()=>{const p=Math.random()>.92;t({type:"event",data:Fn(d.id,p?"PostToolUseFailure":"PostToolUse",l,h,f)}),d.eventsSent++},200+Math.random()*800)}function i(d){const l=zt(g2);t({type:"event",data:{...Fn(d.id,"UserPromptSubmit",null,null),prompt:l}})}function o(d){t({type:"event",data:{...Fn(d.id,"Stop",null,null),stop_reason:"end_turn"}})}function a(d){t({type:"event",data:Fn(d.id,"PreCompact",null,{trigger:"auto"})}),setTimeout(()=>{t({type:"event",data:Fn(d.id,"PostCompact",null,{summary:"Context compacted"})})},3500)}const c=s();setTimeout(()=>{const d=e.find(l=>l.id===c);d&&i(d)},500);const u=setInterval(()=>{if(n++,n===30&&e.length<2){const d=s();setTimeout(()=>{const l=e.find(h=>h.id===d);l&&i(l)},500)}for(const d of e){if(!d.active)continue;const l=Math.random();l<.6?r(d):l<.7?i(d):l<.75?o(d):l<.76&&d.eventsSent>40&&a(d)}},1200);return()=>clearInterval(u)}function v2(){const t=window.location.hostname;return!!(t.includes("github.io")||t.includes("pages.dev")||new URLSearchParams(window.location.search).has("demo"))}const ls=bx(),uo={Read:"#4ade80",Edit:"#60a5fa",Write:"#60a5fa",Bash:"#f59e0b",Grep:"#a78bfa",Glob:"#a78bfa",WebFetch:"#f472b6",Stop:"#888888",Notification:"#34d399",SubagentStart:"#c084fc",SubagentStop:"#7c3aed",PostToolUseFailure:"#f87171",SessionEnd:"#ef4444",UserPromptSubmit:"#38bdf8",PreCompact:"#94a3b8",PostCompact:"#94a3b8",SessionStart:"#22d3ee",InstructionsLoaded:"#a3a3a3",WorktreeCreate:"#86efac",WorktreeRemove:"#fca5a5"};function Bc(t){var s;const e=t.tool_input,n=t.tool_name;if(n==="Edit"){const r=(e==null?void 0:e.file_path)||"",i=((e==null?void 0:e.new_string)||"").split(`
315
+ `).length,o=((e==null?void 0:e.old_string)||"").split(`
316
+ `).length,a=r.split("/").pop()||"";return i!==o?`${a} +${i}−${o}`:`${a} ${i}L`}if(n==="Write"){const r=(e==null?void 0:e.file_path)||"",i=((e==null?void 0:e.content)||"").split(`
317
+ `).length;return`${r.split("/").pop()||""} ${i}L`}if(n==="Read"){const r=(e==null?void 0:e.file_path)||"",i=e==null?void 0:e.limit,o=e==null?void 0:e.offset,a=r.split("/").pop()||"";return o?`${a} @${o}`:i?`${a} ${i}L`:a}if(["Grep","Glob"].includes(n||""))return(e==null?void 0:e.pattern)||((s=e==null?void 0:e.file_path)==null?void 0:s.split("/").pop())||"";if(n==="Bash")return((e==null?void 0:e.command)||"").slice(0,22);if(n==="WebFetch")try{return new URL((e==null?void 0:e.url)||"").hostname}catch{return""}return t.hook_event_name==="UserPromptSubmit"?(t.prompt||"").slice(0,30):t.hook_event_name==="PreCompact"?t.trigger||"compacting...":t.hook_event_name==="PostCompact"?"context compacted":t.hook_event_name==="SessionStart"?t.model||t.source||"started":t.hook_event_name==="InstructionsLoaded"?t.memory_type||"instructions":""}function Nf(t){var r,i;const e=t.tool_name,n=t.tool_input,s=t.tool_response;if(e==="Read"&&s){const a=((n==null?void 0:n.file_path)||"").split("/").pop()||"",c=s.content??s.text??s.output;if(typeof c=="string"){const u=c.split(`
318
+ `).length;return`${a} ${u}L`}return a}if(e==="Grep"&&s){const o=s.count??s.numMatches??s.total;return o!==void 0?`${(n==null?void 0:n.pattern)||""} ${o} hits`:(n==null?void 0:n.pattern)||""}if(e==="Glob"&&s){const o=Array.isArray(s)?s.length:((r=s.files)==null?void 0:r.length)??s.count;return o!==void 0?`${(n==null?void 0:n.pattern)||""} ${o} files`:(n==null?void 0:n.pattern)||""}if(e==="Bash"&&s){const o=s.exitCode??s.exit_code??s.code;return o!==void 0?`$ ${((i=((n==null?void 0:n.command)||"").split(/\s+/)[0])==null?void 0:i.split("/").pop())||""} ${o===0?"✓":`✗ ${o}`}`:((n==null?void 0:n.command)||"").slice(0,22)}return Bc(t)}const Gf=100;function w2(t){return!t||!t.lastTool?"#888":uo[t.lastTool]??"#888"}function jf(t){if(!t)return"—";const e=Math.floor((Date.now()-t)/1e3);return e<3?"just now":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`}function zf(t){if(!t)return"";const e=t.split("/").filter(Boolean);return e[e.length-1]??""}function S2(){const[t,e]=H.useState(ls.getSessions()),[n,s]=H.useState(null),[r,i]=H.useState(0),[o,a]=H.useState(null),[c,u]=H.useState(null),[d,l]=H.useState(null),[h,f]=H.useState(0),[p,_]=H.useState(0),[y,m]=H.useState(new Map),[g,x]=H.useState([]),[v,S]=H.useState(!1),[w,b]=H.useState(!1),[k,T]=H.useState("connecting"),[C,P]=H.useState(()=>localStorage.getItem("claude-live-audio-enabled")==="true"),[R,F]=H.useState(()=>localStorage.getItem("claude-live-autofit-enabled")==="true");H.useEffect(()=>{r2(),P(a2())},[]),H.useEffect(()=>{localStorage.setItem("claude-live-autofit-enabled",R?"true":"false")},[R]),H.useEffect(()=>{const E=A=>{f(A.clientX),_(A.clientY)};return window.addEventListener("mousemove",E),()=>window.removeEventListener("mousemove",E)},[]),H.useEffect(()=>{if(v2()){const z=x2(G=>{if(G.type==="event"){const W=G.data;ls.addEvent(W),e(new Map(ls.getSessions())),s(W.tool_name??W.hook_event_name??null),i(Q=>Q+1),Lf(W.tool_name??void 0,W.hook_event_name??void 0);const j=["Read","Edit","Write","Grep","Glob","Bash"].includes(W.tool_name||"");if(!(W.hook_event_name==="PostToolUse"&&!j)){const Q=ls.getSessions().get(W.session_id);let ye=W.tool_name||W.hook_event_name||"?";if(ye.startsWith("mcp_")){const Z=ye.split("__");ye=Z[Z.length-1].replace(/_/g," ")}x(Z=>{const xe={id:W.id,tool:ye,file:W.hook_event_name==="PostToolUse"?Nf(W):Bc(W),sessionLabel:(Q==null?void 0:Q.label)??W.session_id.slice(0,8),project:zf(W.cwd),colorHex:uo[ye]??"#888",createdAt:Date.now()};return[...Z,xe].slice(-Gf)})}}});return()=>z()}const E="/events";let A=null,D=!1;function $(){D||(A=new EventSource(E),A.onopen=()=>{console.log("[claude-live] SSE connected"),T("connected")},A.onmessage=z=>{var G;try{const W=JSON.parse(z.data);if(W.type==="event"){const j=W.data;if(j.hook_event_name==="Diagnostic")return;ls.addEvent(j);const ne=ls.getSessions();e(new Map(ne)),s(j.tool_name??j.hook_event_name??null),i(Z=>Z+1),Lf(j.tool_name??void 0,j.hook_event_name??void 0);const Q=["Read","Edit","Write","Grep","Glob","Bash"].includes(j.tool_name||"");if(!(j.hook_event_name==="PostToolUse"&&!Q)){const Z=ne.get(j.session_id);let xe=j.tool_name||j.hook_event_name||"?";if(xe.startsWith("mcp_")){const ht=xe.split("__");xe=ht[ht.length-1].replace(/_/g," ")}x(ht=>{const Ve={id:j.id,tool:xe,file:j.hook_event_name==="PostToolUse"?Nf(j):Bc(j),sessionLabel:(Z==null?void 0:Z.label)??j.session_id.slice(0,8),project:zf(j.cwd),colorHex:uo[xe]??"#888",createdAt:Date.now()};return[...ht,Ve].slice(-Gf)})}if(j.hook_event_name==="Notification"||j.hook_event_name==="PermissionRequest"){const Z=ne.get(j.session_id),xe=((G=j.tool_input)==null?void 0:G.message)??"awaiting input";m(ht=>{const Ve=new Map(ht);return Ve.set(j.session_id,{sessionId:j.session_id,sessionLabel:(Z==null?void 0:Z.label)??j.session_id.slice(0,8),message:xe,timestamp:j.timestamp}),Ve})}(j.tool_name||j.hook_event_name==="UserPromptSubmit")&&m(Z=>{if(!Z.has(j.session_id))return Z;const xe=new Map(Z);return xe.delete(j.session_id),xe})}}catch{}},A.onerror=()=>{console.warn("[claude-live] SSE error, reconnecting..."),T("disconnected")})}return $(),()=>{D=!0,A==null||A.close()}},[]);const L=(E,A)=>a(E),J=(E,A)=>{u(E),l(A)},O=()=>{const E=!C;P(E),o2(E)},B=()=>{const E=!R;F(E),localStorage.setItem("claude-live-autofit-enabled",E?"true":"false")};return M.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[M.jsx(Qb,{clusters:t,onHover:L,onSelect:J,autofitEnabled:R}),M.jsxs("div",{className:"hud",children:[M.jsxs("div",{className:"hud-title",children:["claude",M.jsx("span",{children:"live"})]}),M.jsxs("div",{className:"hud-stat",children:[M.jsx("span",{className:"hud-label",children:"sse"}),M.jsx("span",{className:"hud-value",style:{color:k==="connected"?"#4ade80":k==="error"?"#f87171":"#fbbf24"},children:k})]}),M.jsxs("div",{className:"hud-stat",children:[M.jsx("span",{className:"hud-label",children:"events"}),M.jsx("span",{className:"hud-value",children:r})]}),M.jsxs("div",{className:"hud-stat",children:[M.jsx("span",{className:"hud-label",children:"sessions"}),M.jsx("span",{className:"hud-value",children:t.size})]}),M.jsxs("div",{className:"hud-stat",children:[M.jsx("span",{className:"hud-label",children:"last"}),M.jsx("span",{className:"hud-value hud-tool",style:{color:uo[n??""]??"#888"},children:n??"—"})]})]}),M.jsxs("div",{className:"top-right-buttons",children:[M.jsx("button",{className:"audio-toggle",onClick:O,title:C?"Mute audio":"Unmute audio","aria-label":C?"Mute audio":"Unmute audio",children:M.jsx(l2,{enabled:C})}),M.jsx("button",{className:"autofit-toggle",onClick:B,title:R?"Disable autofit":"Enable autofit","aria-label":R?"Disable autofit":"Enable autofit",children:M.jsx(c2,{enabled:R})}),M.jsx("button",{className:"hud-button",onClick:()=>S(!0),title:"Show operations legend","aria-label":"Operations",children:"?"}),M.jsx("button",{className:"hud-button",onClick:()=>b(!0),title:"Show debug panel","aria-label":"Debug",children:"⚙"})]}),y.size>0&&M.jsxs("div",{className:"perm-notifications",children:[M.jsx("div",{className:"perm-notifications-title",children:"awaiting input"}),[...y.values()].map(E=>M.jsxs("div",{className:"perm-notification-item",children:[M.jsx("div",{className:"perm-notification-dot"}),M.jsxs("div",{className:"perm-notification-body",children:[M.jsxs("div",{className:"perm-notification-session",children:["session:",E.sessionLabel]}),M.jsx("div",{className:"perm-notification-msg",children:E.message.slice(0,60)})]})]},E.sessionId))]}),M.jsx("div",{className:"bottom-left-panel",children:M.jsx(d2,{entries:g})}),M.jsxs("div",{className:"tooltip",style:{left:h+14,top:p-10,opacity:o?1:0},children:[M.jsx("div",{className:"tooltip-label",children:(o==null?void 0:o.label)??""}),M.jsx("div",{className:"tooltip-type",children:(o==null?void 0:o.nodeType)??""}),M.jsxs("div",{className:"tooltip-meta",children:[(o==null?void 0:o.lastTool)??"—"," · ",jf(o==null?void 0:o.lastTimestamp)]}),M.jsxs("div",{className:"tooltip-count",children:[(o==null?void 0:o.eventCount)??0," events"]}),(o==null?void 0:o.awaitingPermission)&&M.jsxs("div",{className:"perm-badge",children:[M.jsx("div",{className:"perm-dot"}),"waiting for permission"]})]}),M.jsx(Zb,{sessionIds:[...t.keys()],isOpen:w,onClose:()=>b(!1)}),M.jsx(t2,{isOpen:v,onClose:()=>S(!1)}),M.jsxs("div",{className:`sidebar ${c?"sidebar--open":""}`,children:[M.jsxs("div",{className:"sidebar-header",children:[M.jsx("div",{className:"sidebar-close",onClick:()=>{u(null),l(null)},children:"×"}),M.jsx("div",{className:"sidebar-title",children:(c==null?void 0:c.label)??""}),M.jsx("div",{className:"sidebar-type",children:(c==null?void 0:c.nodeType)??""}),(c==null?void 0:c.awaitingPermission)&&M.jsxs("div",{className:"perm-badge",style:{marginTop:8},children:[M.jsx("div",{className:"perm-dot"}),"awaiting permission"]})]}),M.jsxs("div",{className:"sidebar-section",children:[M.jsx("div",{className:"sidebar-section-label",children:"Last action"}),M.jsx("div",{className:"sidebar-action",style:{color:w2(c)},children:(c==null?void 0:c.lastTool)??"—"}),M.jsx("div",{className:"sidebar-time",children:jf(c==null?void 0:c.lastTimestamp)})]}),M.jsxs("div",{className:"sidebar-section",children:[M.jsx("div",{className:"sidebar-section-label",children:"Total interactions"}),M.jsx("div",{className:"sidebar-count",children:(c==null?void 0:c.eventCount)??0})]}),M.jsxs("div",{className:"sidebar-section",children:[M.jsx("div",{className:"sidebar-section-label",children:"Session"}),M.jsx("div",{className:"sidebar-session",children:(d==null?void 0:d.label)??"—"})]})]})]})}tg(document.getElementById("root")).render(M.jsx(H.StrictMode,{children:M.jsx(S2,{})}));export{ra as $,Zg as A,ti as B,Ce as C,at as D,Nt as E,nn as F,oa as G,Ou as H,qg as I,wt as J,Wg as K,Ec as L,Y as M,aw as N,cw as O,Ne as P,gw as Q,xc as R,Bu as S,ee as T,Do as U,fw as V,Dx as W,xw as X,Je as Y,mg as Z,vt as _,Ug as a,wd as a0,tn as a1,JS as a2,p1 as a3,bd as a4,Xa as a5,kd as a6,g1 as a7,js as a8,we as a9,yg as aa,SS as ab,Jg as ac,q as ad,li as ae,ge as af,xv as ag,pv as ah,$v as ai,Bv as aj,lw as ak,uw as al,_w as am,mw as an,yw as ao,Ng as b,Lv as c,Ye as d,_e as e,re as f,G1 as g,ao as h,V as i,se as j,Ow as k,Cw as l,_g as m,la as n,Mg as o,Se as p,ks as q,Qx as r,aa as s,Me as t,K1 as u,Ev as v,$e as w,ci as x,Dd as y,lo as z};