claude-session-viewer 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,70 @@
1
+ var Iy=Object.defineProperty;var Gd=t=>{throw TypeError(t)};var Ay=(t,e,n)=>e in t?Iy(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var J=(t,e,n)=>Ay(t,typeof e!="symbol"?e+"":e,n),Sl=(t,e,n)=>e.has(t)||Gd("Cannot "+n);var _=(t,e,n)=>(Sl(t,e,"read from private field"),n?n.call(t):e.get(t)),H=(t,e,n)=>e.has(t)?Gd("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),F=(t,e,n,s)=>(Sl(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),X=(t,e,n)=>(Sl(t,e,"access private method"),n);var ko=(t,e,n,s)=>({set _(r){F(t,e,r,n)},get _(){return _(t,e,s)}});(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)}})();function zy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var eg={exports:{}},tl={},tg={exports:{}},Q={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var lo=Symbol.for("react.element"),By=Symbol.for("react.portal"),Wy=Symbol.for("react.fragment"),$y=Symbol.for("react.strict_mode"),Hy=Symbol.for("react.profiler"),Uy=Symbol.for("react.provider"),Vy=Symbol.for("react.context"),Qy=Symbol.for("react.forward_ref"),Yy=Symbol.for("react.suspense"),Ky=Symbol.for("react.memo"),Xy=Symbol.for("react.lazy"),Jd=Symbol.iterator;function qy(t){return t===null||typeof t!="object"?null:(t=Jd&&t[Jd]||t["@@iterator"],typeof t=="function"?t:null)}var ng={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sg=Object.assign,rg={};function Ar(t,e,n){this.props=t,this.context=e,this.refs=rg,this.updater=n||ng}Ar.prototype.isReactComponent={};Ar.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")};Ar.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function ig(){}ig.prototype=Ar.prototype;function Tc(t,e,n){this.props=t,this.context=e,this.refs=rg,this.updater=n||ng}var Rc=Tc.prototype=new ig;Rc.constructor=Tc;sg(Rc,Ar.prototype);Rc.isPureReactComponent=!0;var Zd=Array.isArray,og=Object.prototype.hasOwnProperty,Oc={current:null},ag={key:!0,ref:!0,__self:!0,__source:!0};function lg(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)og.call(e,s)&&!ag.hasOwnProperty(s)&&(r[s]=e[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(t&&t.defaultProps)for(s in a=t.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return{$$typeof:lo,type:t,key:i,ref:o,props:r,_owner:Oc.current}}function Gy(t,e){return{$$typeof:lo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Dc(t){return typeof t=="object"&&t!==null&&t.$$typeof===lo}function Jy(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var eh=/\/+/g;function Cl(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Jy(""+t.key):e.toString(36)}function ea(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 lo:case By:o=!0}}if(o)return o=t,r=r(o),t=s===""?"."+Cl(o,0):s,Zd(r)?(n="",t!=null&&(n=t.replace(eh,"$&/")+"/"),ea(r,e,n,"",function(u){return u})):r!=null&&(Dc(r)&&(r=Gy(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(eh,"$&/")+"/")+t)),e.push(r)),1;if(o=0,s=s===""?".":s+":",Zd(t))for(var a=0;a<t.length;a++){i=t[a];var l=s+Cl(i,a);o+=ea(i,e,n,l,r)}else if(l=qy(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=s+Cl(i,a++),o+=ea(i,e,n,l,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 _o(t,e,n){if(t==null)return t;var s=[],r=0;return ea(t,s,"","",function(i){return e.call(n,i,r++)}),s}function Zy(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 Je={current:null},ta={transition:null},ex={ReactCurrentDispatcher:Je,ReactCurrentBatchConfig:ta,ReactCurrentOwner:Oc};function ug(){throw Error("act(...) is not supported in production builds of React.")}Q.Children={map:_o,forEach:function(t,e,n){_o(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return _o(t,function(){e++}),e},toArray:function(t){return _o(t,function(e){return e})||[]},only:function(t){if(!Dc(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Q.Component=Ar;Q.Fragment=Wy;Q.Profiler=Hy;Q.PureComponent=Tc;Q.StrictMode=$y;Q.Suspense=Yy;Q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ex;Q.act=ug;Q.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=sg({},t.props),r=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Oc.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)og.call(e,l)&&!ag.hasOwnProperty(l)&&(s[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];s.children=a}return{$$typeof:lo,type:t.type,key:r,ref:i,props:s,_owner:o}};Q.createContext=function(t){return t={$$typeof:Vy,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Uy,_context:t},t.Consumer=t};Q.createElement=lg;Q.createFactory=function(t){var e=lg.bind(null,t);return e.type=t,e};Q.createRef=function(){return{current:null}};Q.forwardRef=function(t){return{$$typeof:Qy,render:t}};Q.isValidElement=Dc;Q.lazy=function(t){return{$$typeof:Xy,_payload:{_status:-1,_result:t},_init:Zy}};Q.memo=function(t,e){return{$$typeof:Ky,type:t,compare:e===void 0?null:e}};Q.startTransition=function(t){var e=ta.transition;ta.transition={};try{t()}finally{ta.transition=e}};Q.unstable_act=ug;Q.useCallback=function(t,e){return Je.current.useCallback(t,e)};Q.useContext=function(t){return Je.current.useContext(t)};Q.useDebugValue=function(){};Q.useDeferredValue=function(t){return Je.current.useDeferredValue(t)};Q.useEffect=function(t,e){return Je.current.useEffect(t,e)};Q.useId=function(){return Je.current.useId()};Q.useImperativeHandle=function(t,e,n){return Je.current.useImperativeHandle(t,e,n)};Q.useInsertionEffect=function(t,e){return Je.current.useInsertionEffect(t,e)};Q.useLayoutEffect=function(t,e){return Je.current.useLayoutEffect(t,e)};Q.useMemo=function(t,e){return Je.current.useMemo(t,e)};Q.useReducer=function(t,e,n){return Je.current.useReducer(t,e,n)};Q.useRef=function(t){return Je.current.useRef(t)};Q.useState=function(t){return Je.current.useState(t)};Q.useSyncExternalStore=function(t,e,n){return Je.current.useSyncExternalStore(t,e,n)};Q.useTransition=function(){return Je.current.useTransition()};Q.version="18.3.1";tg.exports=Q;var S=tg.exports;const tx=zy(S);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var nx=S,sx=Symbol.for("react.element"),rx=Symbol.for("react.fragment"),ix=Object.prototype.hasOwnProperty,ox=nx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ax={key:!0,ref:!0,__self:!0,__source:!0};function cg(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)ix.call(e,s)&&!ax.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:sx,type:t,key:i,ref:o,props:r,_owner:ox.current}}tl.Fragment=rx;tl.jsx=cg;tl.jsxs=cg;eg.exports=tl;var c=eg.exports,pu={},dg={exports:{}},gt={},hg={exports:{}},fg={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(t){function e(T,A){var B=T.length;T.push(A);e:for(;0<B;){var D=B-1>>>1,$=T[D];if(0<r($,A))T[D]=A,T[B]=$,B=D;else break e}}function n(T){return T.length===0?null:T[0]}function s(T){if(T.length===0)return null;var A=T[0],B=T.pop();if(B!==A){T[0]=B;e:for(var D=0,$=T.length,K=$>>>1;D<K;){var V=2*(D+1)-1,U=T[V],G=V+1,et=T[G];if(0>r(U,B))G<$&&0>r(et,U)?(T[D]=et,T[G]=B,D=G):(T[D]=U,T[V]=B,D=V);else if(G<$&&0>r(et,B))T[D]=et,T[G]=B,D=G;else break e}}return A}function r(T,A){var B=T.sortIndex-A.sortIndex;return B!==0?B:T.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 l=[],u=[],d=1,h=null,f=3,p=!1,x=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(T){for(var A=n(u);A!==null;){if(A.callback===null)s(u);else if(A.startTime<=T)s(u),A.sortIndex=A.expirationTime,e(l,A);else break;A=n(u)}}function w(T){if(y=!1,v(T),!x)if(n(l)!==null)x=!0,W(j);else{var A=n(u);A!==null&&O(w,A.startTime-T)}}function j(T,A){x=!1,y&&(y=!1,g(N),N=-1),p=!0;var B=f;try{for(v(A),h=n(l);h!==null&&(!(h.expirationTime>A)||T&&!P());){var D=h.callback;if(typeof D=="function"){h.callback=null,f=h.priorityLevel;var $=D(h.expirationTime<=A);A=t.unstable_now(),typeof $=="function"?h.callback=$:h===n(l)&&s(l),v(A)}else s(l);h=n(l)}if(h!==null)var K=!0;else{var V=n(u);V!==null&&O(w,V.startTime-A),K=!1}return K}finally{h=null,f=B,p=!1}}var E=!1,k=null,N=-1,R=5,C=-1;function P(){return!(t.unstable_now()-C<R)}function z(){if(k!==null){var T=t.unstable_now();C=T;var A=!0;try{A=k(!0,T)}finally{A?Y():(E=!1,k=null)}}else E=!1}var Y;if(typeof m=="function")Y=function(){m(z)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,se=we.port2;we.port1.onmessage=z,Y=function(){se.postMessage(null)}}else Y=function(){b(z,0)};function W(T){k=T,E||(E=!0,Y())}function O(T,A){N=b(function(){T(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(T){T.callback=null},t.unstable_continueExecution=function(){x||p||(x=!0,W(j))},t.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<T?Math.floor(1e3/T):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(T){switch(f){case 1:case 2:case 3:var A=3;break;default:A=f}var B=f;f=A;try{return T()}finally{f=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(T,A){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var B=f;f=T;try{return A()}finally{f=B}},t.unstable_scheduleCallback=function(T,A,B){var D=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?D+B:D):B=D,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=B+$,T={id:d++,callback:A,priorityLevel:T,startTime:B,expirationTime:$,sortIndex:-1},B>D?(T.sortIndex=B,e(u,T),n(l)===null&&T===n(u)&&(y?(g(N),N=-1):y=!0,O(w,B-D))):(T.sortIndex=$,e(l,T),x||p||(x=!0,W(j))),T},t.unstable_shouldYield=P,t.unstable_wrapCallback=function(T){var A=f;return function(){var B=f;f=A;try{return T.apply(this,arguments)}finally{f=B}}}})(fg);hg.exports=fg;var lx=hg.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var ux=S,pt=lx;function M(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 pg=new Set,Ti={};function Us(t,e){Pr(t,e),Pr(t+"Capture",e)}function Pr(t,e){for(Ti[t]=e,t=0;t<e.length;t++)pg.add(e[t])}var yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gu=Object.prototype.hasOwnProperty,cx=/^[: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]*$/,th={},nh={};function dx(t){return gu.call(nh,t)?!0:gu.call(th,t)?!1:cx.test(t)?nh[t]=!0:(th[t]=!0,!1)}function hx(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 fx(t,e,n,s){if(e===null||typeof e>"u"||hx(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 Ze(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 Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ie[t]=new Ze(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ie[e]=new Ze(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ie[t]=new Ze(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ie[t]=new Ze(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){Ie[t]=new Ze(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ie[t]=new Ze(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ie[t]=new Ze(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ie[t]=new Ze(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ie[t]=new Ze(t,5,!1,t.toLowerCase(),null,!1,!1)});var Lc=/[\-:]([a-z])/g;function Fc(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(Lc,Fc);Ie[e]=new Ze(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(Lc,Fc);Ie[e]=new Ze(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(Lc,Fc);Ie[e]=new Ze(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ie[t]=new Ze(t,1,!1,t.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ie[t]=new Ze(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ic(t,e,n,s){var r=Ie.hasOwnProperty(e)?Ie[e]:null;(r!==null?r.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(fx(e,n,r,s)&&(n=null),s||r===null?dx(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 kn=ux.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,So=Symbol.for("react.element"),Xs=Symbol.for("react.portal"),qs=Symbol.for("react.fragment"),Ac=Symbol.for("react.strict_mode"),mu=Symbol.for("react.profiler"),gg=Symbol.for("react.provider"),mg=Symbol.for("react.context"),zc=Symbol.for("react.forward_ref"),yu=Symbol.for("react.suspense"),xu=Symbol.for("react.suspense_list"),Bc=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),yg=Symbol.for("react.offscreen"),sh=Symbol.iterator;function Qr(t){return t===null||typeof t!="object"?null:(t=sh&&t[sh]||t["@@iterator"],typeof t=="function"?t:null)}var xe=Object.assign,jl;function li(t){if(jl===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);jl=e&&e[1]||""}return`
34
+ `+jl+t}var Nl=!1;function El(t,e){if(!t||Nl)return"";Nl=!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(`
35
+ `),i=s.stack.split(`
36
+ `),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 l=`
37
+ `+r[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Nl=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?li(t):""}function px(t){switch(t.tag){case 5:return li(t.type);case 16:return li("Lazy");case 13:return li("Suspense");case 19:return li("SuspenseList");case 0:case 2:case 15:return t=El(t.type,!1),t;case 11:return t=El(t.type.render,!1),t;case 1:return t=El(t.type,!0),t;default:return""}}function vu(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 qs:return"Fragment";case Xs:return"Portal";case mu:return"Profiler";case Ac:return"StrictMode";case yu:return"Suspense";case xu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mg:return(t.displayName||"Context")+".Consumer";case gg:return(t._context.displayName||"Context")+".Provider";case zc:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Bc:return e=t.displayName||null,e!==null?e:vu(t.type)||"Memo";case En:e=t._payload,t=t._init;try{return vu(t(e))}catch{}}return null}function gx(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 vu(e);case 8:return e===Ac?"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 ss(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function mx(t){var e=xg(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 Co(t){t._valueTracker||(t._valueTracker=mx(t))}function vg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),s="";return t&&(s=xg(t)?t.checked?"true":"false":t.value),t=s,t!==n?(e.setValue(t),!0):!1}function xa(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 bu(t,e){var n=e.checked;return xe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function rh(t,e){var n=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;n=ss(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 bg(t,e){e=e.checked,e!=null&&Ic(t,"checked",e,!1)}function wu(t,e){bg(t,e);var n=ss(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")?ku(t,e.type,n):e.hasOwnProperty("defaultValue")&&ku(t,e.type,ss(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ih(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 ku(t,e,n){(e!=="number"||xa(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ui=Array.isArray;function lr(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=""+ss(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 _u(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(M(91));return xe({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function oh(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(M(92));if(ui(n)){if(1<n.length)throw Error(M(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:ss(n)}}function wg(t,e){var n=ss(e.value),s=ss(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 ah(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function kg(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 Su(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?kg(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var jo,_g=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(jo=jo||document.createElement("div"),jo.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=jo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ri(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var yi={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},yx=["Webkit","ms","Moz","O"];Object.keys(yi).forEach(function(t){yx.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),yi[e]=yi[t]})});function Sg(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||yi.hasOwnProperty(t)&&yi[t]?(""+e).trim():e+"px"}function Cg(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Sg(n,e[n],s);n==="float"&&(n="cssFloat"),s?t.setProperty(n,r):t[n]=r}}var xx=xe({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 Cu(t,e){if(e){if(xx[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(M(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(M(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(M(61))}if(e.style!=null&&typeof e.style!="object")throw Error(M(62))}}function ju(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 Nu=null;function Wc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Eu=null,ur=null,cr=null;function lh(t){if(t=ho(t)){if(typeof Eu!="function")throw Error(M(280));var e=t.stateNode;e&&(e=ol(e),Eu(t.stateNode,t.type,e))}}function jg(t){ur?cr?cr.push(t):cr=[t]:ur=t}function Ng(){if(ur){var t=ur,e=cr;if(cr=ur=null,lh(t),e)for(t=0;t<e.length;t++)lh(e[t])}}function Eg(t,e){return t(e)}function Pg(){}var Pl=!1;function Mg(t,e,n){if(Pl)return t(e,n);Pl=!0;try{return Eg(t,e,n)}finally{Pl=!1,(ur!==null||cr!==null)&&(Pg(),Ng())}}function Oi(t,e){var n=t.stateNode;if(n===null)return null;var s=ol(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(M(231,e,typeof n));return n}var Pu=!1;if(yn)try{var Yr={};Object.defineProperty(Yr,"passive",{get:function(){Pu=!0}}),window.addEventListener("test",Yr,Yr),window.removeEventListener("test",Yr,Yr)}catch{Pu=!1}function vx(t,e,n,s,r,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(d){this.onError(d)}}var xi=!1,va=null,ba=!1,Mu=null,bx={onError:function(t){xi=!0,va=t}};function wx(t,e,n,s,r,i,o,a,l){xi=!1,va=null,vx.apply(bx,arguments)}function kx(t,e,n,s,r,i,o,a,l){if(wx.apply(this,arguments),xi){if(xi){var u=va;xi=!1,va=null}else throw Error(M(198));ba||(ba=!0,Mu=u)}}function Vs(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 Tg(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 uh(t){if(Vs(t)!==t)throw Error(M(188))}function _x(t){var e=t.alternate;if(!e){if(e=Vs(t),e===null)throw Error(M(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 uh(r),t;if(i===s)return uh(r),e;i=i.sibling}throw Error(M(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(M(189))}}if(n.alternate!==s)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?t:e}function Rg(t){return t=_x(t),t!==null?Og(t):null}function Og(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Og(t);if(e!==null)return e;t=t.sibling}return null}var Dg=pt.unstable_scheduleCallback,ch=pt.unstable_cancelCallback,Sx=pt.unstable_shouldYield,Cx=pt.unstable_requestPaint,ke=pt.unstable_now,jx=pt.unstable_getCurrentPriorityLevel,$c=pt.unstable_ImmediatePriority,Lg=pt.unstable_UserBlockingPriority,wa=pt.unstable_NormalPriority,Nx=pt.unstable_LowPriority,Fg=pt.unstable_IdlePriority,nl=null,tn=null;function Ex(t){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(nl,t,void 0,(t.current.flags&128)===128)}catch{}}var Bt=Math.clz32?Math.clz32:Tx,Px=Math.log,Mx=Math.LN2;function Tx(t){return t>>>=0,t===0?32:31-(Px(t)/Mx|0)|0}var No=64,Eo=4194304;function ci(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 ka(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=ci(a):(i&=o,i!==0&&(s=ci(i)))}else o=n&~r,o!==0?s=ci(o):i!==0&&(s=ci(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-Bt(e),r=1<<n,s|=t[n],e&=~r;return s}function Rx(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 Ox(t,e){for(var n=t.suspendedLanes,s=t.pingedLanes,r=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Bt(i),a=1<<o,l=r[o];l===-1?(!(a&n)||a&s)&&(r[o]=Rx(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Tu(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Ig(){var t=No;return No<<=1,!(No&4194240)&&(No=64),t}function Ml(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function uo(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Bt(e),t[e]=n}function Dx(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-Bt(n),i=1<<r;e[r]=0,s[r]=-1,t[r]=-1,n&=~i}}function Hc(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var s=31-Bt(n),r=1<<s;r&e|t[s]&e&&(t[s]|=e),n&=~r}}var oe=0;function Ag(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var zg,Uc,Bg,Wg,$g,Ru=!1,Po=[],Vn=null,Qn=null,Yn=null,Di=new Map,Li=new Map,Mn=[],Lx="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 dh(t,e){switch(t){case"focusin":case"focusout":Vn=null;break;case"dragenter":case"dragleave":Qn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":Di.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(e.pointerId)}}function Kr(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=ho(e),e!==null&&Uc(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Fx(t,e,n,s,r){switch(e){case"focusin":return Vn=Kr(Vn,t,e,n,s,r),!0;case"dragenter":return Qn=Kr(Qn,t,e,n,s,r),!0;case"mouseover":return Yn=Kr(Yn,t,e,n,s,r),!0;case"pointerover":var i=r.pointerId;return Di.set(i,Kr(Di.get(i)||null,t,e,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Li.set(i,Kr(Li.get(i)||null,t,e,n,s,r)),!0}return!1}function Hg(t){var e=vs(t.target);if(e!==null){var n=Vs(e);if(n!==null){if(e=n.tag,e===13){if(e=Tg(n),e!==null){t.blockedOn=e,$g(t.priority,function(){Bg(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 na(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Ou(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var s=new n.constructor(n.type,n);Nu=s,n.target.dispatchEvent(s),Nu=null}else return e=ho(n),e!==null&&Uc(e),t.blockedOn=n,!1;e.shift()}return!0}function hh(t,e,n){na(t)&&n.delete(e)}function Ix(){Ru=!1,Vn!==null&&na(Vn)&&(Vn=null),Qn!==null&&na(Qn)&&(Qn=null),Yn!==null&&na(Yn)&&(Yn=null),Di.forEach(hh),Li.forEach(hh)}function Xr(t,e){t.blockedOn===e&&(t.blockedOn=null,Ru||(Ru=!0,pt.unstable_scheduleCallback(pt.unstable_NormalPriority,Ix)))}function Fi(t){function e(r){return Xr(r,t)}if(0<Po.length){Xr(Po[0],t);for(var n=1;n<Po.length;n++){var s=Po[n];s.blockedOn===t&&(s.blockedOn=null)}}for(Vn!==null&&Xr(Vn,t),Qn!==null&&Xr(Qn,t),Yn!==null&&Xr(Yn,t),Di.forEach(e),Li.forEach(e),n=0;n<Mn.length;n++)s=Mn[n],s.blockedOn===t&&(s.blockedOn=null);for(;0<Mn.length&&(n=Mn[0],n.blockedOn===null);)Hg(n),n.blockedOn===null&&Mn.shift()}var dr=kn.ReactCurrentBatchConfig,_a=!0;function Ax(t,e,n,s){var r=oe,i=dr.transition;dr.transition=null;try{oe=1,Vc(t,e,n,s)}finally{oe=r,dr.transition=i}}function zx(t,e,n,s){var r=oe,i=dr.transition;dr.transition=null;try{oe=4,Vc(t,e,n,s)}finally{oe=r,dr.transition=i}}function Vc(t,e,n,s){if(_a){var r=Ou(t,e,n,s);if(r===null)Bl(t,e,s,Sa,n),dh(t,s);else if(Fx(r,t,e,n,s))s.stopPropagation();else if(dh(t,s),e&4&&-1<Lx.indexOf(t)){for(;r!==null;){var i=ho(r);if(i!==null&&zg(i),i=Ou(t,e,n,s),i===null&&Bl(t,e,s,Sa,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Bl(t,e,s,null,n)}}var Sa=null;function Ou(t,e,n,s){if(Sa=null,t=Wc(s),t=vs(t),t!==null)if(e=Vs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Tg(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 Sa=t,null}function Ug(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(jx()){case $c:return 1;case Lg:return 4;case wa:case Nx:return 16;case Fg:return 536870912;default:return 16}default:return 16}}var Bn=null,Qc=null,sa=null;function Vg(){if(sa)return sa;var t,e=Qc,n=e.length,s,r="value"in Bn?Bn.value:Bn.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 sa=r.slice(t,1<s?1-s:void 0)}function ra(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 Mo(){return!0}function fh(){return!1}function mt(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)?Mo:fh,this.isPropagationStopped=fh,this}return xe(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=Mo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),e}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yc=mt(zr),co=xe({},zr,{view:0,detail:0}),Bx=mt(co),Tl,Rl,qr,sl=xe({},co,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kc,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!==qr&&(qr&&t.type==="mousemove"?(Tl=t.screenX-qr.screenX,Rl=t.screenY-qr.screenY):Rl=Tl=0,qr=t),Tl)},movementY:function(t){return"movementY"in t?t.movementY:Rl}}),ph=mt(sl),Wx=xe({},sl,{dataTransfer:0}),$x=mt(Wx),Hx=xe({},co,{relatedTarget:0}),Ol=mt(Hx),Ux=xe({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),Vx=mt(Ux),Qx=xe({},zr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Yx=mt(Qx),Kx=xe({},zr,{data:0}),gh=mt(Kx),Xx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qx={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"},Gx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jx(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Gx[t])?!!e[t]:!1}function Kc(){return Jx}var Zx=xe({},co,{key:function(t){if(t.key){var e=Xx[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ra(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?qx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kc,charCode:function(t){return t.type==="keypress"?ra(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ra(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ev=mt(Zx),tv=xe({},sl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mh=mt(tv),nv=xe({},co,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kc}),sv=mt(nv),rv=xe({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),iv=mt(rv),ov=xe({},sl,{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}),av=mt(ov),lv=[9,13,27,32],Xc=yn&&"CompositionEvent"in window,vi=null;yn&&"documentMode"in document&&(vi=document.documentMode);var uv=yn&&"TextEvent"in window&&!vi,Qg=yn&&(!Xc||vi&&8<vi&&11>=vi),yh=" ",xh=!1;function Yg(t,e){switch(t){case"keyup":return lv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gs=!1;function cv(t,e){switch(t){case"compositionend":return Kg(e);case"keypress":return e.which!==32?null:(xh=!0,yh);case"textInput":return t=e.data,t===yh&&xh?null:t;default:return null}}function dv(t,e){if(Gs)return t==="compositionend"||!Xc&&Yg(t,e)?(t=Vg(),sa=Qc=Bn=null,Gs=!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 Qg&&e.locale!=="ko"?null:e.data;default:return null}}var hv={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 vh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!hv[t.type]:e==="textarea"}function Xg(t,e,n,s){jg(s),e=Ca(e,"onChange"),0<e.length&&(n=new Yc("onChange","change",null,n,s),t.push({event:n,listeners:e}))}var bi=null,Ii=null;function fv(t){om(t,0)}function rl(t){var e=er(t);if(vg(e))return t}function pv(t,e){if(t==="change")return e}var qg=!1;if(yn){var Dl;if(yn){var Ll="oninput"in document;if(!Ll){var bh=document.createElement("div");bh.setAttribute("oninput","return;"),Ll=typeof bh.oninput=="function"}Dl=Ll}else Dl=!1;qg=Dl&&(!document.documentMode||9<document.documentMode)}function wh(){bi&&(bi.detachEvent("onpropertychange",Gg),Ii=bi=null)}function Gg(t){if(t.propertyName==="value"&&rl(Ii)){var e=[];Xg(e,Ii,t,Wc(t)),Mg(fv,e)}}function gv(t,e,n){t==="focusin"?(wh(),bi=e,Ii=n,bi.attachEvent("onpropertychange",Gg)):t==="focusout"&&wh()}function mv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return rl(Ii)}function yv(t,e){if(t==="click")return rl(e)}function xv(t,e){if(t==="input"||t==="change")return rl(e)}function vv(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var $t=typeof Object.is=="function"?Object.is:vv;function Ai(t,e){if($t(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(!gu.call(e,r)||!$t(t[r],e[r]))return!1}return!0}function kh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _h(t,e){var n=kh(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=kh(n)}}function Jg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Jg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Zg(){for(var t=window,e=xa();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=xa(t.document)}return e}function qc(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 bv(t){var e=Zg(),n=t.focusedElem,s=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Jg(n.ownerDocument.documentElement,n)){if(s!==null&&qc(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=_h(n,i);var o=_h(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 wv=yn&&"documentMode"in document&&11>=document.documentMode,Js=null,Du=null,wi=null,Lu=!1;function Sh(t,e,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lu||Js==null||Js!==xa(s)||(s=Js,"selectionStart"in s&&qc(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}),wi&&Ai(wi,s)||(wi=s,s=Ca(Du,"onSelect"),0<s.length&&(e=new Yc("onSelect","select",null,e,n),t.push({event:e,listeners:s}),e.target=Js)))}function To(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Zs={animationend:To("Animation","AnimationEnd"),animationiteration:To("Animation","AnimationIteration"),animationstart:To("Animation","AnimationStart"),transitionend:To("Transition","TransitionEnd")},Fl={},em={};yn&&(em=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function il(t){if(Fl[t])return Fl[t];if(!Zs[t])return t;var e=Zs[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in em)return Fl[t]=e[n];return t}var tm=il("animationend"),nm=il("animationiteration"),sm=il("animationstart"),rm=il("transitionend"),im=new Map,Ch="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 as(t,e){im.set(t,e),Us(e,[t])}for(var Il=0;Il<Ch.length;Il++){var Al=Ch[Il],kv=Al.toLowerCase(),_v=Al[0].toUpperCase()+Al.slice(1);as(kv,"on"+_v)}as(tm,"onAnimationEnd");as(nm,"onAnimationIteration");as(sm,"onAnimationStart");as("dblclick","onDoubleClick");as("focusin","onFocus");as("focusout","onBlur");as(rm,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);Us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Us("onBeforeInput",["compositionend","keypress","textInput","paste"]);Us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var di="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(" "),Sv=new Set("cancel close invalid load scroll toggle".split(" ").concat(di));function jh(t,e,n){var s=t.type||"unknown-event";t.currentTarget=n,kx(s,e,void 0,t),t.currentTarget=null}function om(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],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&r.isPropagationStopped())break e;jh(r,a,u),i=l}else for(o=0;o<s.length;o++){if(a=s[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&r.isPropagationStopped())break e;jh(r,a,u),i=l}}}if(ba)throw t=Mu,ba=!1,Mu=null,t}function de(t,e){var n=e[Bu];n===void 0&&(n=e[Bu]=new Set);var s=t+"__bubble";n.has(s)||(am(e,t,2,!1),n.add(s))}function zl(t,e,n){var s=0;e&&(s|=4),am(n,t,s,e)}var Ro="_reactListening"+Math.random().toString(36).slice(2);function zi(t){if(!t[Ro]){t[Ro]=!0,pg.forEach(function(n){n!=="selectionchange"&&(Sv.has(n)||zl(n,!1,t),zl(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ro]||(e[Ro]=!0,zl("selectionchange",!1,e))}}function am(t,e,n,s){switch(Ug(e)){case 1:var r=Ax;break;case 4:r=zx;break;default:r=Vc}n=r.bind(null,e,n,t),r=void 0,!Pu||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 Bl(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 l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=vs(a),o===null)return;if(l=o.tag,l===5||l===6){s=i=o;continue e}a=a.parentNode}}s=s.return}Mg(function(){var u=i,d=Wc(n),h=[];e:{var f=im.get(t);if(f!==void 0){var p=Yc,x=t;switch(t){case"keypress":if(ra(n)===0)break e;case"keydown":case"keyup":p=ev;break;case"focusin":x="focus",p=Ol;break;case"focusout":x="blur",p=Ol;break;case"beforeblur":case"afterblur":p=Ol;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":p=ph;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=$x;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=sv;break;case tm:case nm:case sm:p=Vx;break;case rm:p=iv;break;case"scroll":p=Bx;break;case"wheel":p=av;break;case"copy":case"cut":case"paste":p=Yx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=mh}var y=(e&4)!==0,b=!y&&t==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var m=u,v;m!==null;){v=m;var w=v.stateNode;if(v.tag===5&&w!==null&&(v=w,g!==null&&(w=Oi(m,g),w!=null&&y.push(Bi(m,w,v)))),b)break;m=m.return}0<y.length&&(f=new p(f,x,null,n,d),h.push({event:f,listeners:y}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==Nu&&(x=n.relatedTarget||n.fromElement)&&(vs(x)||x[xn]))break e;if((p||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,p?(x=n.relatedTarget||n.toElement,p=u,x=x?vs(x):null,x!==null&&(b=Vs(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=u),p!==x)){if(y=ph,w="onMouseLeave",g="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(y=mh,w="onPointerLeave",g="onPointerEnter",m="pointer"),b=p==null?f:er(p),v=x==null?f:er(x),f=new y(w,m+"leave",p,n,d),f.target=b,f.relatedTarget=v,w=null,vs(d)===u&&(y=new y(g,m+"enter",x,n,d),y.target=v,y.relatedTarget=b,w=y),b=w,p&&x)t:{for(y=p,g=x,m=0,v=y;v;v=Qs(v))m++;for(v=0,w=g;w;w=Qs(w))v++;for(;0<m-v;)y=Qs(y),m--;for(;0<v-m;)g=Qs(g),v--;for(;m--;){if(y===g||g!==null&&y===g.alternate)break t;y=Qs(y),g=Qs(g)}y=null}else y=null;p!==null&&Nh(h,f,p,y,!1),x!==null&&b!==null&&Nh(h,b,x,y,!0)}}e:{if(f=u?er(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var j=pv;else if(vh(f))if(qg)j=xv;else{j=mv;var E=gv}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(j=yv);if(j&&(j=j(t,u))){Xg(h,j,n,d);break e}E&&E(t,f,u),t==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&ku(f,"number",f.value)}switch(E=u?er(u):window,t){case"focusin":(vh(E)||E.contentEditable==="true")&&(Js=E,Du=u,wi=null);break;case"focusout":wi=Du=Js=null;break;case"mousedown":Lu=!0;break;case"contextmenu":case"mouseup":case"dragend":Lu=!1,Sh(h,n,d);break;case"selectionchange":if(wv)break;case"keydown":case"keyup":Sh(h,n,d)}var k;if(Xc)e:{switch(t){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Gs?Yg(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Qg&&n.locale!=="ko"&&(Gs||N!=="onCompositionStart"?N==="onCompositionEnd"&&Gs&&(k=Vg()):(Bn=d,Qc="value"in Bn?Bn.value:Bn.textContent,Gs=!0)),E=Ca(u,N),0<E.length&&(N=new gh(N,t,null,n,d),h.push({event:N,listeners:E}),k?N.data=k:(k=Kg(n),k!==null&&(N.data=k)))),(k=uv?cv(t,n):dv(t,n))&&(u=Ca(u,"onBeforeInput"),0<u.length&&(d=new gh("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}om(h,e)})}function Bi(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Ca(t,e){for(var n=e+"Capture",s=[];t!==null;){var r=t,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Oi(t,n),i!=null&&s.unshift(Bi(t,i,r)),i=Oi(t,e),i!=null&&s.push(Bi(t,i,r))),t=t.return}return s}function Qs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Nh(t,e,n,s,r){for(var i=e._reactName,o=[];n!==null&&n!==s;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===s)break;a.tag===5&&u!==null&&(a=u,r?(l=Oi(n,i),l!=null&&o.unshift(Bi(n,l,a))):r||(l=Oi(n,i),l!=null&&o.push(Bi(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var Cv=/\r\n?/g,jv=/\u0000|\uFFFD/g;function Eh(t){return(typeof t=="string"?t:""+t).replace(Cv,`
38
+ `).replace(jv,"")}function Oo(t,e,n){if(e=Eh(e),Eh(t)!==e&&n)throw Error(M(425))}function ja(){}var Fu=null,Iu=null;function Au(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 zu=typeof setTimeout=="function"?setTimeout:void 0,Nv=typeof clearTimeout=="function"?clearTimeout:void 0,Ph=typeof Promise=="function"?Promise:void 0,Ev=typeof queueMicrotask=="function"?queueMicrotask:typeof Ph<"u"?function(t){return Ph.resolve(null).then(t).catch(Pv)}:zu;function Pv(t){setTimeout(function(){throw t})}function Wl(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),Fi(e);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Fi(e)}function Kn(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 Mh(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 Br=Math.random().toString(36).slice(2),en="__reactFiber$"+Br,Wi="__reactProps$"+Br,xn="__reactContainer$"+Br,Bu="__reactEvents$"+Br,Mv="__reactListeners$"+Br,Tv="__reactHandles$"+Br;function vs(t){var e=t[en];if(e)return e;for(var n=t.parentNode;n;){if(e=n[xn]||n[en]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Mh(t);t!==null;){if(n=t[en])return n;t=Mh(t)}return e}t=n,n=t.parentNode}return null}function ho(t){return t=t[en]||t[xn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function er(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(M(33))}function ol(t){return t[Wi]||null}var Wu=[],tr=-1;function ls(t){return{current:t}}function fe(t){0>tr||(t.current=Wu[tr],Wu[tr]=null,tr--)}function ue(t,e){tr++,Wu[tr]=t.current,t.current=e}var rs={},Ve=ls(rs),at=ls(!1),Fs=rs;function Mr(t,e){var n=t.type.contextTypes;if(!n)return rs;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 lt(t){return t=t.childContextTypes,t!=null}function Na(){fe(at),fe(Ve)}function Th(t,e,n){if(Ve.current!==rs)throw Error(M(168));ue(Ve,e),ue(at,n)}function lm(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(M(108,gx(t)||"Unknown",r));return xe({},n,s)}function Ea(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rs,Fs=Ve.current,ue(Ve,t),ue(at,at.current),!0}function Rh(t,e,n){var s=t.stateNode;if(!s)throw Error(M(169));n?(t=lm(t,e,Fs),s.__reactInternalMemoizedMergedChildContext=t,fe(at),fe(Ve),ue(Ve,t)):fe(at),ue(at,n)}var un=null,al=!1,$l=!1;function um(t){un===null?un=[t]:un.push(t)}function Rv(t){al=!0,um(t)}function us(){if(!$l&&un!==null){$l=!0;var t=0,e=oe;try{var n=un;for(oe=1;t<n.length;t++){var s=n[t];do s=s(!0);while(s!==null)}un=null,al=!1}catch(r){throw un!==null&&(un=un.slice(t+1)),Dg($c,us),r}finally{oe=e,$l=!1}}return null}var nr=[],sr=0,Pa=null,Ma=0,kt=[],_t=0,Is=null,fn=1,pn="";function gs(t,e){nr[sr++]=Ma,nr[sr++]=Pa,Pa=t,Ma=e}function cm(t,e,n){kt[_t++]=fn,kt[_t++]=pn,kt[_t++]=Is,Is=t;var s=fn;t=pn;var r=32-Bt(s)-1;s&=~(1<<r),n+=1;var i=32-Bt(e)+r;if(30<i){var o=r-r%5;i=(s&(1<<o)-1).toString(32),s>>=o,r-=o,fn=1<<32-Bt(e)+r|n<<r|s,pn=i+t}else fn=1<<i|n<<r|s,pn=t}function Gc(t){t.return!==null&&(gs(t,1),cm(t,1,0))}function Jc(t){for(;t===Pa;)Pa=nr[--sr],nr[sr]=null,Ma=nr[--sr],nr[sr]=null;for(;t===Is;)Is=kt[--_t],kt[_t]=null,pn=kt[--_t],kt[_t]=null,fn=kt[--_t],kt[_t]=null}var ft=null,dt=null,pe=!1,It=null;function dm(t,e){var n=St(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 Oh(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,ft=t,dt=Kn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,ft=t,dt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Is!==null?{id:fn,overflow:pn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=St(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,ft=t,dt=null,!0):!1;default:return!1}}function $u(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Hu(t){if(pe){var e=dt;if(e){var n=e;if(!Oh(t,e)){if($u(t))throw Error(M(418));e=Kn(n.nextSibling);var s=ft;e&&Oh(t,e)?dm(s,n):(t.flags=t.flags&-4097|2,pe=!1,ft=t)}}else{if($u(t))throw Error(M(418));t.flags=t.flags&-4097|2,pe=!1,ft=t}}}function Dh(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;ft=t}function Do(t){if(t!==ft)return!1;if(!pe)return Dh(t),pe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Au(t.type,t.memoizedProps)),e&&(e=dt)){if($u(t))throw hm(),Error(M(418));for(;e;)dm(t,e),e=Kn(e.nextSibling)}if(Dh(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(M(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){dt=Kn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}dt=null}}else dt=ft?Kn(t.stateNode.nextSibling):null;return!0}function hm(){for(var t=dt;t;)t=Kn(t.nextSibling)}function Tr(){dt=ft=null,pe=!1}function Zc(t){It===null?It=[t]:It.push(t)}var Ov=kn.ReactCurrentBatchConfig;function Gr(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(M(309));var s=n.stateNode}if(!s)throw Error(M(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(M(284));if(!n._owner)throw Error(M(290,t))}return t}function Lo(t,e){throw t=Object.prototype.toString.call(e),Error(M(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Lh(t){var e=t._init;return e(t._payload)}function fm(t){function e(g,m){if(t){var v=g.deletions;v===null?(g.deletions=[m],g.flags|=16):v.push(m)}}function n(g,m){if(!t)return null;for(;m!==null;)e(g,m),m=m.sibling;return null}function s(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function r(g,m){return g=Jn(g,m),g.index=0,g.sibling=null,g}function i(g,m,v){return g.index=v,t?(v=g.alternate,v!==null?(v=v.index,v<m?(g.flags|=2,m):v):(g.flags|=2,m)):(g.flags|=1048576,m)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,m,v,w){return m===null||m.tag!==6?(m=Xl(v,g.mode,w),m.return=g,m):(m=r(m,v),m.return=g,m)}function l(g,m,v,w){var j=v.type;return j===qs?d(g,m,v.props.children,w,v.key):m!==null&&(m.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===En&&Lh(j)===m.type)?(w=r(m,v.props),w.ref=Gr(g,m,v),w.return=g,w):(w=da(v.type,v.key,v.props,null,g.mode,w),w.ref=Gr(g,m,v),w.return=g,w)}function u(g,m,v,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=ql(v,g.mode,w),m.return=g,m):(m=r(m,v.children||[]),m.return=g,m)}function d(g,m,v,w,j){return m===null||m.tag!==7?(m=Ds(v,g.mode,w,j),m.return=g,m):(m=r(m,v),m.return=g,m)}function h(g,m,v){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Xl(""+m,g.mode,v),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case So:return v=da(m.type,m.key,m.props,null,g.mode,v),v.ref=Gr(g,null,m),v.return=g,v;case Xs:return m=ql(m,g.mode,v),m.return=g,m;case En:var w=m._init;return h(g,w(m._payload),v)}if(ui(m)||Qr(m))return m=Ds(m,g.mode,v,null),m.return=g,m;Lo(g,m)}return null}function f(g,m,v,w){var j=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return j!==null?null:a(g,m,""+v,w);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case So:return v.key===j?l(g,m,v,w):null;case Xs:return v.key===j?u(g,m,v,w):null;case En:return j=v._init,f(g,m,j(v._payload),w)}if(ui(v)||Qr(v))return j!==null?null:d(g,m,v,w,null);Lo(g,v)}return null}function p(g,m,v,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(v)||null,a(m,g,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case So:return g=g.get(w.key===null?v:w.key)||null,l(m,g,w,j);case Xs:return g=g.get(w.key===null?v:w.key)||null,u(m,g,w,j);case En:var E=w._init;return p(g,m,v,E(w._payload),j)}if(ui(w)||Qr(w))return g=g.get(v)||null,d(m,g,w,j,null);Lo(m,w)}return null}function x(g,m,v,w){for(var j=null,E=null,k=m,N=m=0,R=null;k!==null&&N<v.length;N++){k.index>N?(R=k,k=null):R=k.sibling;var C=f(g,k,v[N],w);if(C===null){k===null&&(k=R);break}t&&k&&C.alternate===null&&e(g,k),m=i(C,m,N),E===null?j=C:E.sibling=C,E=C,k=R}if(N===v.length)return n(g,k),pe&&gs(g,N),j;if(k===null){for(;N<v.length;N++)k=h(g,v[N],w),k!==null&&(m=i(k,m,N),E===null?j=k:E.sibling=k,E=k);return pe&&gs(g,N),j}for(k=s(g,k);N<v.length;N++)R=p(k,g,N,v[N],w),R!==null&&(t&&R.alternate!==null&&k.delete(R.key===null?N:R.key),m=i(R,m,N),E===null?j=R:E.sibling=R,E=R);return t&&k.forEach(function(P){return e(g,P)}),pe&&gs(g,N),j}function y(g,m,v,w){var j=Qr(v);if(typeof j!="function")throw Error(M(150));if(v=j.call(v),v==null)throw Error(M(151));for(var E=j=null,k=m,N=m=0,R=null,C=v.next();k!==null&&!C.done;N++,C=v.next()){k.index>N?(R=k,k=null):R=k.sibling;var P=f(g,k,C.value,w);if(P===null){k===null&&(k=R);break}t&&k&&P.alternate===null&&e(g,k),m=i(P,m,N),E===null?j=P:E.sibling=P,E=P,k=R}if(C.done)return n(g,k),pe&&gs(g,N),j;if(k===null){for(;!C.done;N++,C=v.next())C=h(g,C.value,w),C!==null&&(m=i(C,m,N),E===null?j=C:E.sibling=C,E=C);return pe&&gs(g,N),j}for(k=s(g,k);!C.done;N++,C=v.next())C=p(k,g,N,C.value,w),C!==null&&(t&&C.alternate!==null&&k.delete(C.key===null?N:C.key),m=i(C,m,N),E===null?j=C:E.sibling=C,E=C);return t&&k.forEach(function(z){return e(g,z)}),pe&&gs(g,N),j}function b(g,m,v,w){if(typeof v=="object"&&v!==null&&v.type===qs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case So:e:{for(var j=v.key,E=m;E!==null;){if(E.key===j){if(j=v.type,j===qs){if(E.tag===7){n(g,E.sibling),m=r(E,v.props.children),m.return=g,g=m;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===En&&Lh(j)===E.type){n(g,E.sibling),m=r(E,v.props),m.ref=Gr(g,E,v),m.return=g,g=m;break e}n(g,E);break}else e(g,E);E=E.sibling}v.type===qs?(m=Ds(v.props.children,g.mode,w,v.key),m.return=g,g=m):(w=da(v.type,v.key,v.props,null,g.mode,w),w.ref=Gr(g,m,v),w.return=g,g=w)}return o(g);case Xs:e:{for(E=v.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(g,m.sibling),m=r(m,v.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else e(g,m);m=m.sibling}m=ql(v,g.mode,w),m.return=g,g=m}return o(g);case En:return E=v._init,b(g,m,E(v._payload),w)}if(ui(v))return x(g,m,v,w);if(Qr(v))return y(g,m,v,w);Lo(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(g,m.sibling),m=r(m,v),m.return=g,g=m):(n(g,m),m=Xl(v,g.mode,w),m.return=g,g=m),o(g)):n(g,m)}return b}var Rr=fm(!0),pm=fm(!1),Ta=ls(null),Ra=null,rr=null,ed=null;function td(){ed=rr=Ra=null}function nd(t){var e=Ta.current;fe(Ta),t._currentValue=e}function Uu(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 hr(t,e){Ra=t,ed=rr=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(ot=!0),t.firstContext=null)}function Nt(t){var e=t._currentValue;if(ed!==t)if(t={context:t,memoizedValue:e,next:null},rr===null){if(Ra===null)throw Error(M(308));rr=t,Ra.dependencies={lanes:0,firstContext:t}}else rr=rr.next=t;return e}var bs=null;function sd(t){bs===null?bs=[t]:bs.push(t)}function gm(t,e,n,s){var r=e.interleaved;return r===null?(n.next=n,sd(e)):(n.next=r.next,r.next=n),e.interleaved=n,vn(t,s)}function vn(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 Pn=!1;function rd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mm(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 gn(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,Z&2){var r=s.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),s.pending=e,vn(t,n)}return r=s.interleaved,r===null?(e.next=e,sd(s)):(e.next=r.next,r.next=e),s.interleaved=e,vn(t,n)}function ia(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,Hc(t,n)}}function Fh(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 Oa(t,e,n,s){var r=t.updateQueue;Pn=!1;var i=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var h=r.baseState;o=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((s&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=t,y=a;switch(f=e,p=n,y.tag){case 1:if(x=y.payload,typeof x=="function"){h=x.call(p,h,f);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,f=typeof x=="function"?x.call(p,h,f):x,f==null)break e;h=xe({},h,f);break e;case 2:Pn=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=r.effects,f===null?r.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(d===null&&(l=h),r.baseState=l,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);zs|=o,t.lanes=o,t.memoizedState=h}}function Ih(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(M(191,r));r.call(s)}}}var fo={},nn=ls(fo),$i=ls(fo),Hi=ls(fo);function ws(t){if(t===fo)throw Error(M(174));return t}function id(t,e){switch(ue(Hi,e),ue($i,t),ue(nn,fo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Su(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Su(e,t)}fe(nn),ue(nn,e)}function Or(){fe(nn),fe($i),fe(Hi)}function ym(t){ws(Hi.current);var e=ws(nn.current),n=Su(e,t.type);e!==n&&(ue($i,t),ue(nn,n))}function od(t){$i.current===t&&(fe(nn),fe($i))}var me=ls(0);function Da(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 Hl=[];function ad(){for(var t=0;t<Hl.length;t++)Hl[t]._workInProgressVersionPrimary=null;Hl.length=0}var oa=kn.ReactCurrentDispatcher,Ul=kn.ReactCurrentBatchConfig,As=0,ye=null,Ne=null,Te=null,La=!1,ki=!1,Ui=0,Dv=0;function ze(){throw Error(M(321))}function ld(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!$t(t[n],e[n]))return!1;return!0}function ud(t,e,n,s,r,i){if(As=i,ye=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,oa.current=t===null||t.memoizedState===null?Av:zv,t=n(s,r),ki){i=0;do{if(ki=!1,Ui=0,25<=i)throw Error(M(301));i+=1,Te=Ne=null,e.updateQueue=null,oa.current=Bv,t=n(s,r)}while(ki)}if(oa.current=Fa,e=Ne!==null&&Ne.next!==null,As=0,Te=Ne=ye=null,La=!1,e)throw Error(M(300));return t}function cd(){var t=Ui!==0;return Ui=0,t}function Xt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?ye.memoizedState=Te=t:Te=Te.next=t,Te}function Et(){if(Ne===null){var t=ye.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var e=Te===null?ye.memoizedState:Te.next;if(e!==null)Te=e,Ne=t;else{if(t===null)throw Error(M(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Te===null?ye.memoizedState=Te=t:Te=Te.next=t}return Te}function Vi(t,e){return typeof e=="function"?e(t):e}function Vl(t){var e=Et(),n=e.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=t;var s=Ne,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,l=null,u=i;do{var d=u.lane;if((As&d)===d)l!==null&&(l=l.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 h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=h,o=s):l=l.next=h,ye.lanes|=d,zs|=d}u=u.next}while(u!==null&&u!==i);l===null?o=s:l.next=a,$t(s,e.memoizedState)||(ot=!0),e.memoizedState=s,e.baseState=o,e.baseQueue=l,n.lastRenderedState=s}if(t=n.interleaved,t!==null){r=t;do i=r.lane,ye.lanes|=i,zs|=i,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ql(t){var e=Et(),n=e.queue;if(n===null)throw Error(M(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);$t(i,e.memoizedState)||(ot=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,s]}function xm(){}function vm(t,e){var n=ye,s=Et(),r=e(),i=!$t(s.memoizedState,r);if(i&&(s.memoizedState=r,ot=!0),s=s.queue,dd(km.bind(null,n,s,t),[t]),s.getSnapshot!==e||i||Te!==null&&Te.memoizedState.tag&1){if(n.flags|=2048,Qi(9,wm.bind(null,n,s,r,e),void 0,null),Re===null)throw Error(M(349));As&30||bm(n,e,r)}return r}function bm(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ye.updateQueue,e===null?(e={lastEffect:null,stores:null},ye.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function wm(t,e,n,s){e.value=n,e.getSnapshot=s,_m(e)&&Sm(t)}function km(t,e,n){return n(function(){_m(e)&&Sm(t)})}function _m(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!$t(t,n)}catch{return!0}}function Sm(t){var e=vn(t,1);e!==null&&Wt(e,t,1,-1)}function Ah(t){var e=Xt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:t},e.queue=t,t=t.dispatch=Iv.bind(null,ye,t),[e.memoizedState,t]}function Qi(t,e,n,s){return t={tag:t,create:e,destroy:n,deps:s,next:null},e=ye.updateQueue,e===null?(e={lastEffect:null,stores:null},ye.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 Cm(){return Et().memoizedState}function aa(t,e,n,s){var r=Xt();ye.flags|=t,r.memoizedState=Qi(1|e,n,void 0,s===void 0?null:s)}function ll(t,e,n,s){var r=Et();s=s===void 0?null:s;var i=void 0;if(Ne!==null){var o=Ne.memoizedState;if(i=o.destroy,s!==null&&ld(s,o.deps)){r.memoizedState=Qi(e,n,i,s);return}}ye.flags|=t,r.memoizedState=Qi(1|e,n,i,s)}function zh(t,e){return aa(8390656,8,t,e)}function dd(t,e){return ll(2048,8,t,e)}function jm(t,e){return ll(4,2,t,e)}function Nm(t,e){return ll(4,4,t,e)}function Em(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 Pm(t,e,n){return n=n!=null?n.concat([t]):null,ll(4,4,Em.bind(null,e,t),n)}function hd(){}function Mm(t,e){var n=Et();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&ld(e,s[1])?s[0]:(n.memoizedState=[t,e],t)}function Tm(t,e){var n=Et();e=e===void 0?null:e;var s=n.memoizedState;return s!==null&&e!==null&&ld(e,s[1])?s[0]:(t=t(),n.memoizedState=[t,e],t)}function Rm(t,e,n){return As&21?($t(n,e)||(n=Ig(),ye.lanes|=n,zs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,ot=!0),t.memoizedState=n)}function Lv(t,e){var n=oe;oe=n!==0&&4>n?n:4,t(!0);var s=Ul.transition;Ul.transition={};try{t(!1),e()}finally{oe=n,Ul.transition=s}}function Om(){return Et().memoizedState}function Fv(t,e,n){var s=Gn(t);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Dm(t))Lm(e,n);else if(n=gm(t,e,n,s),n!==null){var r=Ge();Wt(n,t,s,r),Fm(n,e,s)}}function Iv(t,e,n){var s=Gn(t),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dm(t))Lm(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,$t(a,o)){var l=e.interleaved;l===null?(r.next=r,sd(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=gm(t,e,r,s),n!==null&&(r=Ge(),Wt(n,t,s,r),Fm(n,e,s))}}function Dm(t){var e=t.alternate;return t===ye||e!==null&&e===ye}function Lm(t,e){ki=La=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function Fm(t,e,n){if(n&4194240){var s=e.lanes;s&=t.pendingLanes,n|=s,e.lanes=n,Hc(t,n)}}var Fa={readContext:Nt,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useInsertionEffect:ze,useLayoutEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useMutableSource:ze,useSyncExternalStore:ze,useId:ze,unstable_isNewReconciler:!1},Av={readContext:Nt,useCallback:function(t,e){return Xt().memoizedState=[t,e===void 0?null:e],t},useContext:Nt,useEffect:zh,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,aa(4194308,4,Em.bind(null,e,t),n)},useLayoutEffect:function(t,e){return aa(4194308,4,t,e)},useInsertionEffect:function(t,e){return aa(4,2,t,e)},useMemo:function(t,e){var n=Xt();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var s=Xt();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=Fv.bind(null,ye,t),[s.memoizedState,t]},useRef:function(t){var e=Xt();return t={current:t},e.memoizedState=t},useState:Ah,useDebugValue:hd,useDeferredValue:function(t){return Xt().memoizedState=t},useTransition:function(){var t=Ah(!1),e=t[0];return t=Lv.bind(null,t[1]),Xt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var s=ye,r=Xt();if(pe){if(n===void 0)throw Error(M(407));n=n()}else{if(n=e(),Re===null)throw Error(M(349));As&30||bm(s,e,n)}r.memoizedState=n;var i={value:n,getSnapshot:e};return r.queue=i,zh(km.bind(null,s,i,t),[t]),s.flags|=2048,Qi(9,wm.bind(null,s,i,n,e),void 0,null),n},useId:function(){var t=Xt(),e=Re.identifierPrefix;if(pe){var n=pn,s=fn;n=(s&~(1<<32-Bt(s)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ui++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=Dv++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},zv={readContext:Nt,useCallback:Mm,useContext:Nt,useEffect:dd,useImperativeHandle:Pm,useInsertionEffect:jm,useLayoutEffect:Nm,useMemo:Tm,useReducer:Vl,useRef:Cm,useState:function(){return Vl(Vi)},useDebugValue:hd,useDeferredValue:function(t){var e=Et();return Rm(e,Ne.memoizedState,t)},useTransition:function(){var t=Vl(Vi)[0],e=Et().memoizedState;return[t,e]},useMutableSource:xm,useSyncExternalStore:vm,useId:Om,unstable_isNewReconciler:!1},Bv={readContext:Nt,useCallback:Mm,useContext:Nt,useEffect:dd,useImperativeHandle:Pm,useInsertionEffect:jm,useLayoutEffect:Nm,useMemo:Tm,useReducer:Ql,useRef:Cm,useState:function(){return Ql(Vi)},useDebugValue:hd,useDeferredValue:function(t){var e=Et();return Ne===null?e.memoizedState=t:Rm(e,Ne.memoizedState,t)},useTransition:function(){var t=Ql(Vi)[0],e=Et().memoizedState;return[t,e]},useMutableSource:xm,useSyncExternalStore:vm,useId:Om,unstable_isNewReconciler:!1};function Ot(t,e){if(t&&t.defaultProps){e=xe({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Vu(t,e,n,s){e=t.memoizedState,n=n(s,e),n=n==null?e:xe({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var ul={isMounted:function(t){return(t=t._reactInternals)?Vs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var s=Ge(),r=Gn(t),i=gn(s,r);i.payload=e,n!=null&&(i.callback=n),e=Xn(t,i,r),e!==null&&(Wt(e,t,r,s),ia(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var s=Ge(),r=Gn(t),i=gn(s,r);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=Xn(t,i,r),e!==null&&(Wt(e,t,r,s),ia(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Ge(),s=Gn(t),r=gn(n,s);r.tag=2,e!=null&&(r.callback=e),e=Xn(t,r,s),e!==null&&(Wt(e,t,s,n),ia(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?!Ai(n,s)||!Ai(r,i):!0}function Im(t,e,n){var s=!1,r=rs,i=e.contextType;return typeof i=="object"&&i!==null?i=Nt(i):(r=lt(e)?Fs:Ve.current,s=e.contextTypes,i=(s=s!=null)?Mr(t,r):rs),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=ul,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=i),e}function Wh(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&&ul.enqueueReplaceState(e,e.state,null)}function Qu(t,e,n,s){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},rd(t);var i=e.contextType;typeof i=="object"&&i!==null?r.context=Nt(i):(i=lt(e)?Fs:Ve.current,r.context=Mr(t,i)),r.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Vu(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&&ul.enqueueReplaceState(r,r.state,null),Oa(t,n,r,s),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function Dr(t,e){try{var n="",s=e;do n+=px(s),s=s.return;while(s);var r=n}catch(i){r=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:t,source:e,stack:r,digest:null}}function Yl(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Yu(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Wv=typeof WeakMap=="function"?WeakMap:Map;function Am(t,e,n){n=gn(-1,n),n.tag=3,n.payload={element:null};var s=e.value;return n.callback=function(){Aa||(Aa=!0,sc=s),Yu(t,e)},n}function zm(t,e,n){n=gn(-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(){Yu(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Yu(t,e),typeof s!="function"&&(qn===null?qn=new Set([this]):qn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function $h(t,e,n){var s=t.pingCache;if(s===null){s=t.pingCache=new Wv;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=tb.bind(null,t,e,n),e.then(t,t))}function Hh(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 Uh(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=gn(-1,1),e.tag=2,Xn(n,e,1))),n.lanes|=1),t)}var $v=kn.ReactCurrentOwner,ot=!1;function qe(t,e,n,s){e.child=t===null?pm(e,null,n,s):Rr(e,t.child,n,s)}function Vh(t,e,n,s,r){n=n.render;var i=e.ref;return hr(e,r),s=ud(t,e,n,s,i,r),n=cd(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,bn(t,e,r)):(pe&&n&&Gc(e),e.flags|=1,qe(t,e,s,r),e.child)}function Qh(t,e,n,s,r){if(t===null){var i=n.type;return typeof i=="function"&&!bd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,Bm(t,e,i,s,r)):(t=da(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:Ai,n(o,s)&&t.ref===e.ref)return bn(t,e,r)}return e.flags|=1,t=Jn(i,s),t.ref=e.ref,t.return=e,e.child=t}function Bm(t,e,n,s,r){if(t!==null){var i=t.memoizedProps;if(Ai(i,s)&&t.ref===e.ref)if(ot=!1,e.pendingProps=s=i,(t.lanes&r)!==0)t.flags&131072&&(ot=!0);else return e.lanes=t.lanes,bn(t,e,r)}return Ku(t,e,n,s,r)}function Wm(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},ue(or,ct),ct|=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,ue(or,ct),ct|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,ue(or,ct),ct|=s}else i!==null?(s=i.baseLanes|n,e.memoizedState=null):s=n,ue(or,ct),ct|=s;return qe(t,e,r,n),e.child}function $m(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ku(t,e,n,s,r){var i=lt(n)?Fs:Ve.current;return i=Mr(e,i),hr(e,r),n=ud(t,e,n,s,i,r),s=cd(),t!==null&&!ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,bn(t,e,r)):(pe&&s&&Gc(e),e.flags|=1,qe(t,e,n,r),e.child)}function Yh(t,e,n,s,r){if(lt(n)){var i=!0;Ea(e)}else i=!1;if(hr(e,r),e.stateNode===null)la(t,e),Im(e,n,s),Qu(e,n,s,r),s=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Nt(u):(u=lt(n)?Fs:Ve.current,u=Mr(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==s||l!==u)&&Wh(e,o,s,u),Pn=!1;var f=e.memoizedState;o.state=f,Oa(e,s,o,r),l=e.memoizedState,a!==s||f!==l||at.current||Pn?(typeof d=="function"&&(Vu(e,n,d,s),l=e.memoizedState),(a=Pn||Bh(e,n,a,s,f,l,u))?(h||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=l),o.props=s,o.state=l,o.context=u,s=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{o=e.stateNode,mm(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Ot(e.type,a),o.props=u,h=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Nt(l):(l=lt(n)?Fs:Ve.current,l=Mr(e,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&Wh(e,o,s,l),Pn=!1,f=e.memoizedState,o.state=f,Oa(e,s,o,r);var x=e.memoizedState;a!==h||f!==x||at.current||Pn?(typeof p=="function"&&(Vu(e,n,p,s),x=e.memoizedState),(u=Pn||Bh(e,n,u,s,f,x,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,x,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,x,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=x),o.props=s,o.state=x,o.context=l,s=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),s=!1)}return Xu(t,e,n,s,i,r)}function Xu(t,e,n,s,r,i){$m(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return r&&Rh(e,n,!1),bn(t,e,i);s=e.stateNode,$v.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=Rr(e,t.child,null,i),e.child=Rr(e,null,a,i)):qe(t,e,a,i),e.memoizedState=s.state,r&&Rh(e,n,!0),e.child}function Hm(t){var e=t.stateNode;e.pendingContext?Th(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Th(t,e.context,!1),id(t,e.containerInfo)}function Kh(t,e,n,s,r){return Tr(),Zc(r),e.flags|=256,qe(t,e,n,s),e.child}var qu={dehydrated:null,treeContext:null,retryLane:0};function Gu(t){return{baseLanes:t,cachePool:null,transitions:null}}function Um(t,e,n){var s=e.pendingProps,r=me.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),ue(me,r&1),t===null)return Hu(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=hl(o,s,0,null),t=Ds(t,s,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Gu(n),e.memoizedState=qu,t):fd(e,o));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return Hv(t,e,o,s,a,r,n);if(i){i=s.fallback,o=e.mode,r=t.child,a=r.sibling;var l={mode:"hidden",children:s.children};return!(o&1)&&e.child!==r?(s=e.child,s.childLanes=0,s.pendingProps=l,e.deletions=null):(s=Jn(r,l),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=Jn(a,i):(i=Ds(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?Gu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=qu,s}return i=t.child,t=i.sibling,s=Jn(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 fd(t,e){return e=hl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Fo(t,e,n,s){return s!==null&&Zc(s),Rr(e,t.child,null,n),t=fd(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Hv(t,e,n,s,r,i,o){if(n)return e.flags&256?(e.flags&=-257,s=Yl(Error(M(422))),Fo(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=s.fallback,r=e.mode,s=hl({mode:"visible",children:s.children},r,0,null),i=Ds(i,r,o,null),i.flags|=2,s.return=e,i.return=e,s.sibling=i,e.child=s,e.mode&1&&Rr(e,t.child,null,o),e.child.memoizedState=Gu(o),e.memoizedState=qu,i);if(!(e.mode&1))return Fo(t,e,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(M(419)),s=Yl(i,s,void 0),Fo(t,e,o,s)}if(a=(o&t.childLanes)!==0,ot||a){if(s=Re,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,vn(t,r),Wt(s,t,r,-1))}return vd(),s=Yl(Error(M(421))),Fo(t,e,o,s)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=nb.bind(null,t),r._reactRetry=e,null):(t=i.treeContext,dt=Kn(r.nextSibling),ft=e,pe=!0,It=null,t!==null&&(kt[_t++]=fn,kt[_t++]=pn,kt[_t++]=Is,fn=t.id,pn=t.overflow,Is=e),e=fd(e,s.children),e.flags|=4096,e)}function Xh(t,e,n){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),Uu(t.return,e,n)}function Kl(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 Vm(t,e,n){var s=e.pendingProps,r=s.revealOrder,i=s.tail;if(qe(t,e,s.children,n),s=me.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&&Xh(t,n,e);else if(t.tag===19)Xh(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(ue(me,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&&Da(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Kl(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&&Da(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Kl(e,!0,n,null,i);break;case"together":Kl(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function la(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function bn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),zs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(M(153));if(e.child!==null){for(t=e.child,n=Jn(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Jn(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Uv(t,e,n){switch(e.tag){case 3:Hm(e),Tr();break;case 5:ym(e);break;case 1:lt(e.type)&&Ea(e);break;case 4:id(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,r=e.memoizedProps.value;ue(Ta,s._currentValue),s._currentValue=r;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(ue(me,me.current&1),e.flags|=128,null):n&e.child.childLanes?Um(t,e,n):(ue(me,me.current&1),t=bn(t,e,n),t!==null?t.sibling:null);ue(me,me.current&1);break;case 19:if(s=(n&e.childLanes)!==0,t.flags&128){if(s)return Vm(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ue(me,me.current),s)break;return null;case 22:case 23:return e.lanes=0,Wm(t,e,n)}return bn(t,e,n)}var Qm,Ju,Ym,Km;Qm=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}};Ju=function(){};Ym=function(t,e,n,s){var r=t.memoizedProps;if(r!==s){t=e.stateNode,ws(nn.current);var i=null;switch(n){case"input":r=bu(t,r),s=bu(t,s),i=[];break;case"select":r=xe({},r,{value:void 0}),s=xe({},s,{value:void 0}),i=[];break;case"textarea":r=_u(t,r),s=_u(t,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=ja)}Cu(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"&&(Ti.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in s){var l=s[u];if(a=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ti.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&de("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Km=function(t,e,n,s){n!==s&&(e.flags|=4)};function Jr(t,e){if(!pe)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 Vv(t,e,n){var s=e.pendingProps;switch(Jc(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 lt(e.type)&&Na(),Be(e),null;case 3:return s=e.stateNode,Or(),fe(at),fe(Ve),ad(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Do(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,It!==null&&(oc(It),It=null))),Ju(t,e),Be(e),null;case 5:od(e);var r=ws(Hi.current);if(n=e.type,t!==null&&e.stateNode!=null)Ym(t,e,n,s,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(M(166));return Be(e),null}if(t=ws(nn.current),Do(e)){s=e.stateNode,n=e.type;var i=e.memoizedProps;switch(s[en]=e,s[Wi]=i,t=(e.mode&1)!==0,n){case"dialog":de("cancel",s),de("close",s);break;case"iframe":case"object":case"embed":de("load",s);break;case"video":case"audio":for(r=0;r<di.length;r++)de(di[r],s);break;case"source":de("error",s);break;case"img":case"image":case"link":de("error",s),de("load",s);break;case"details":de("toggle",s);break;case"input":rh(s,i),de("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},de("invalid",s);break;case"textarea":oh(s,i),de("invalid",s)}Cu(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&&Oo(s.textContent,a,t),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Oo(s.textContent,a,t),r=["children",""+a]):Ti.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&de("scroll",s)}switch(n){case"input":Co(s),ih(s,i,!0);break;case"textarea":Co(s),ah(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=ja)}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=kg(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[en]=e,t[Wi]=s,Qm(t,e,!1,!1),e.stateNode=t;e:{switch(o=ju(n,s),n){case"dialog":de("cancel",t),de("close",t),r=s;break;case"iframe":case"object":case"embed":de("load",t),r=s;break;case"video":case"audio":for(r=0;r<di.length;r++)de(di[r],t);r=s;break;case"source":de("error",t),r=s;break;case"img":case"image":case"link":de("error",t),de("load",t),r=s;break;case"details":de("toggle",t),r=s;break;case"input":rh(t,s),r=bu(t,s),de("invalid",t);break;case"option":r=s;break;case"select":t._wrapperState={wasMultiple:!!s.multiple},r=xe({},s,{value:void 0}),de("invalid",t);break;case"textarea":oh(t,s),r=_u(t,s),de("invalid",t);break;default:r=s}Cu(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Cg(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&_g(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ri(t,l):typeof l=="number"&&Ri(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ti.hasOwnProperty(i)?l!=null&&i==="onScroll"&&de("scroll",t):l!=null&&Ic(t,i,l,o))}switch(n){case"input":Co(t),ih(t,s,!1);break;case"textarea":Co(t),ah(t);break;case"option":s.value!=null&&t.setAttribute("value",""+ss(s.value));break;case"select":t.multiple=!!s.multiple,i=s.value,i!=null?lr(t,!!s.multiple,i,!1):s.defaultValue!=null&&lr(t,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=ja)}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)Km(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(M(166));if(n=ws(Hi.current),ws(nn.current),Do(e)){if(s=e.stateNode,n=e.memoizedProps,s[en]=e,(i=s.nodeValue!==n)&&(t=ft,t!==null))switch(t.tag){case 3:Oo(s.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Oo(s.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[en]=e,e.stateNode=s}return Be(e),null;case 13:if(fe(me),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(pe&&dt!==null&&e.mode&1&&!(e.flags&128))hm(),Tr(),e.flags|=98560,i=!1;else if(i=Do(e),s!==null&&s.dehydrated!==null){if(t===null){if(!i)throw Error(M(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(M(317));i[en]=e}else Tr(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Be(e),i=!1}else It!==null&&(oc(It),It=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||me.current&1?Pe===0&&(Pe=3):vd())),e.updateQueue!==null&&(e.flags|=4),Be(e),null);case 4:return Or(),Ju(t,e),t===null&&zi(e.stateNode.containerInfo),Be(e),null;case 10:return nd(e.type._context),Be(e),null;case 17:return lt(e.type)&&Na(),Be(e),null;case 19:if(fe(me),i=e.memoizedState,i===null)return Be(e),null;if(s=(e.flags&128)!==0,o=i.rendering,o===null)if(s)Jr(i,!1);else{if(Pe!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Da(t),o!==null){for(e.flags|=128,Jr(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 ue(me,me.current&1|2),e.child}t=t.sibling}i.tail!==null&&ke()>Lr&&(e.flags|=128,s=!0,Jr(i,!1),e.lanes=4194304)}else{if(!s)if(t=Da(o),t!==null){if(e.flags|=128,s=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Jr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pe)return Be(e),null}else 2*ke()-i.renderingStartTime>Lr&&n!==1073741824&&(e.flags|=128,s=!0,Jr(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=ke(),e.sibling=null,n=me.current,ue(me,s?n&1|2:n&1),e):(Be(e),null);case 22:case 23:return xd(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?ct&1073741824&&(Be(e),e.subtreeFlags&6&&(e.flags|=8192)):Be(e),null;case 24:return null;case 25:return null}throw Error(M(156,e.tag))}function Qv(t,e){switch(Jc(e),e.tag){case 1:return lt(e.type)&&Na(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Or(),fe(at),fe(Ve),ad(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return od(e),null;case 13:if(fe(me),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(M(340));Tr()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fe(me),null;case 4:return Or(),null;case 10:return nd(e.type._context),null;case 22:case 23:return xd(),null;case 24:return null;default:return null}}var Io=!1,$e=!1,Yv=typeof WeakSet=="function"?WeakSet:Set,I=null;function ir(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){be(t,e,s)}else n.current=null}function Zu(t,e,n){try{n()}catch(s){be(t,e,s)}}var qh=!1;function Kv(t,e){if(Fu=_a,t=Zg(),qc(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,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||r!==0&&h.nodeType!==3||(a=o+r),h!==i||s!==0&&h.nodeType!==3||(l=o+s),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===r&&(a=o),f===i&&++d===s&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Iu={focusedElem:t,selectionRange:n},_a=!1,I=e;I!==null;)if(e=I,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,I=t;else for(;I!==null;){e=I;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,b=x.memoizedState,g=e.stateNode,m=g.getSnapshotBeforeUpdate(e.elementType===e.type?y:Ot(e.type,y),b);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(w){be(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,I=t;break}I=e.return}return x=qh,qh=!1,x}function _i(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&&Zu(e,n,i)}r=r.next}while(r!==s)}}function cl(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 ec(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 Xm(t){var e=t.alternate;e!==null&&(t.alternate=null,Xm(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[en],delete e[Wi],delete e[Bu],delete e[Mv],delete e[Tv])),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 qm(t){return t.tag===5||t.tag===3||t.tag===4}function Gh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||qm(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 tc(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=ja));else if(s!==4&&(t=t.child,t!==null))for(tc(t,e,n),t=t.sibling;t!==null;)tc(t,e,n),t=t.sibling}function nc(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(nc(t,e,n),t=t.sibling;t!==null;)nc(t,e,n),t=t.sibling}var De=null,Ft=!1;function Sn(t,e,n){for(n=n.child;n!==null;)Gm(t,e,n),n=n.sibling}function Gm(t,e,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(nl,n)}catch{}switch(n.tag){case 5:$e||ir(n,e);case 6:var s=De,r=Ft;De=null,Sn(t,e,n),De=s,Ft=r,De!==null&&(Ft?(t=De,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):De.removeChild(n.stateNode));break;case 18:De!==null&&(Ft?(t=De,n=n.stateNode,t.nodeType===8?Wl(t.parentNode,n):t.nodeType===1&&Wl(t,n),Fi(t)):Wl(De,n.stateNode));break;case 4:s=De,r=Ft,De=n.stateNode.containerInfo,Ft=!0,Sn(t,e,n),De=s,Ft=r;break;case 0:case 11:case 14:case 15:if(!$e&&(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)&&Zu(n,e,o),r=r.next}while(r!==s)}Sn(t,e,n);break;case 1:if(!$e&&(ir(n,e),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){be(n,e,a)}Sn(t,e,n);break;case 21:Sn(t,e,n);break;case 22:n.mode&1?($e=(s=$e)||n.memoizedState!==null,Sn(t,e,n),$e=s):Sn(t,e,n);break;default:Sn(t,e,n)}}function Jh(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Yv),e.forEach(function(s){var r=sb.bind(null,t,s);n.has(s)||(n.add(s),s.then(r,r))})}}function Rt(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:De=a.stateNode,Ft=!1;break e;case 3:De=a.stateNode.containerInfo,Ft=!0;break e;case 4:De=a.stateNode.containerInfo,Ft=!0;break e}a=a.return}if(De===null)throw Error(M(160));Gm(i,o,r),De=null,Ft=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(u){be(r,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Jm(e,t),e=e.sibling}function Jm(t,e){var n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Rt(e,t),Qt(t),s&4){try{_i(3,t,t.return),cl(3,t)}catch(y){be(t,t.return,y)}try{_i(5,t,t.return)}catch(y){be(t,t.return,y)}}break;case 1:Rt(e,t),Qt(t),s&512&&n!==null&&ir(n,n.return);break;case 5:if(Rt(e,t),Qt(t),s&512&&n!==null&&ir(n,n.return),t.flags&32){var r=t.stateNode;try{Ri(r,"")}catch(y){be(t,t.return,y)}}if(s&4&&(r=t.stateNode,r!=null)){var i=t.memoizedProps,o=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&bg(r,i),ju(a,o);var u=ju(a,i);for(o=0;o<l.length;o+=2){var d=l[o],h=l[o+1];d==="style"?Cg(r,h):d==="dangerouslySetInnerHTML"?_g(r,h):d==="children"?Ri(r,h):Ic(r,d,h,u)}switch(a){case"input":wu(r,i);break;case"textarea":wg(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?lr(r,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?lr(r,!!i.multiple,i.defaultValue,!0):lr(r,!!i.multiple,i.multiple?[]:"",!1))}r[Wi]=i}catch(y){be(t,t.return,y)}}break;case 6:if(Rt(e,t),Qt(t),s&4){if(t.stateNode===null)throw Error(M(162));r=t.stateNode,i=t.memoizedProps;try{r.nodeValue=i}catch(y){be(t,t.return,y)}}break;case 3:if(Rt(e,t),Qt(t),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Fi(e.containerInfo)}catch(y){be(t,t.return,y)}break;case 4:Rt(e,t),Qt(t);break;case 13:Rt(e,t),Qt(t),r=t.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(md=ke())),s&4&&Jh(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?($e=(u=$e)||d,Rt(e,t),$e=u):Rt(e,t),Qt(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(I=t,d=t.child;d!==null;){for(h=I=d;I!==null;){switch(f=I,p=f.child,f.tag){case 0:case 11:case 14:case 15:_i(4,f,f.return);break;case 1:ir(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){s=f,n=f.return;try{e=s,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(y){be(s,n,y)}}break;case 5:ir(f,f.return);break;case 22:if(f.memoizedState!==null){ef(h);continue}}p!==null?(p.return=f,I=p):ef(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{r=h.stateNode,u?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Sg("display",o))}catch(y){be(t,t.return,y)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(y){be(t,t.return,y)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Rt(e,t),Qt(t),s&4&&Jh(t);break;case 21:break;default:Rt(e,t),Qt(t)}}function Qt(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(qm(n)){var s=n;break e}n=n.return}throw Error(M(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Ri(r,""),s.flags&=-33);var i=Gh(t);nc(t,i,r);break;case 3:case 4:var o=s.stateNode.containerInfo,a=Gh(t);tc(t,a,o);break;default:throw Error(M(161))}}catch(l){be(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Xv(t,e,n){I=t,Zm(t)}function Zm(t,e,n){for(var s=(t.mode&1)!==0;I!==null;){var r=I,i=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Io;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||$e;a=Io;var u=$e;if(Io=o,($e=l)&&!u)for(I=r;I!==null;)o=I,l=o.child,o.tag===22&&o.memoizedState!==null?tf(r):l!==null?(l.return=o,I=l):tf(r);for(;i!==null;)I=i,Zm(i),i=i.sibling;I=r,Io=a,$e=u}Zh(t)}else r.subtreeFlags&8772&&i!==null?(i.return=r,I=i):Zh(t)}}function Zh(t){for(;I!==null;){var e=I;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:$e||cl(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!$e)if(n===null)s.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:Ot(e.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Ih(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}Ih(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.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 h=d.dehydrated;h!==null&&Fi(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}$e||e.flags&512&&ec(e)}catch(f){be(e,e.return,f)}}if(e===t){I=null;break}if(n=e.sibling,n!==null){n.return=e.return,I=n;break}I=e.return}}function ef(t){for(;I!==null;){var e=I;if(e===t){I=null;break}var n=e.sibling;if(n!==null){n.return=e.return,I=n;break}I=e.return}}function tf(t){for(;I!==null;){var e=I;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{cl(4,e)}catch(l){be(e,n,l)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var r=e.return;try{s.componentDidMount()}catch(l){be(e,r,l)}}var i=e.return;try{ec(e)}catch(l){be(e,i,l)}break;case 5:var o=e.return;try{ec(e)}catch(l){be(e,o,l)}}}catch(l){be(e,e.return,l)}if(e===t){I=null;break}var a=e.sibling;if(a!==null){a.return=e.return,I=a;break}I=e.return}}var qv=Math.ceil,Ia=kn.ReactCurrentDispatcher,pd=kn.ReactCurrentOwner,jt=kn.ReactCurrentBatchConfig,Z=0,Re=null,je=null,Fe=0,ct=0,or=ls(0),Pe=0,Yi=null,zs=0,dl=0,gd=0,Si=null,rt=null,md=0,Lr=1/0,ln=null,Aa=!1,sc=null,qn=null,Ao=!1,Wn=null,za=0,Ci=0,rc=null,ua=-1,ca=0;function Ge(){return Z&6?ke():ua!==-1?ua:ua=ke()}function Gn(t){return t.mode&1?Z&2&&Fe!==0?Fe&-Fe:Ov.transition!==null?(ca===0&&(ca=Ig()),ca):(t=oe,t!==0||(t=window.event,t=t===void 0?16:Ug(t.type)),t):1}function Wt(t,e,n,s){if(50<Ci)throw Ci=0,rc=null,Error(M(185));uo(t,n,s),(!(Z&2)||t!==Re)&&(t===Re&&(!(Z&2)&&(dl|=n),Pe===4&&Tn(t,Fe)),ut(t,s),n===1&&Z===0&&!(e.mode&1)&&(Lr=ke()+500,al&&us()))}function ut(t,e){var n=t.callbackNode;Ox(t,e);var s=ka(t,t===Re?Fe:0);if(s===0)n!==null&&ch(n),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(n!=null&&ch(n),e===1)t.tag===0?Rv(nf.bind(null,t)):um(nf.bind(null,t)),Ev(function(){!(Z&6)&&us()}),n=null;else{switch(Ag(s)){case 1:n=$c;break;case 4:n=Lg;break;case 16:n=wa;break;case 536870912:n=Fg;break;default:n=wa}n=a0(n,e0.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function e0(t,e){if(ua=-1,ca=0,Z&6)throw Error(M(327));var n=t.callbackNode;if(fr()&&t.callbackNode!==n)return null;var s=ka(t,t===Re?Fe:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Ba(t,s);else{e=s;var r=Z;Z|=2;var i=n0();(Re!==t||Fe!==e)&&(ln=null,Lr=ke()+500,Os(t,e));do try{Zv();break}catch(a){t0(t,a)}while(!0);td(),Ia.current=i,Z=r,je!==null?e=0:(Re=null,Fe=0,e=Pe)}if(e!==0){if(e===2&&(r=Tu(t),r!==0&&(s=r,e=ic(t,r))),e===1)throw n=Yi,Os(t,0),Tn(t,s),ut(t,ke()),n;if(e===6)Tn(t,s);else{if(r=t.current.alternate,!(s&30)&&!Gv(r)&&(e=Ba(t,s),e===2&&(i=Tu(t),i!==0&&(s=i,e=ic(t,i))),e===1))throw n=Yi,Os(t,0),Tn(t,s),ut(t,ke()),n;switch(t.finishedWork=r,t.finishedLanes=s,e){case 0:case 1:throw Error(M(345));case 2:ms(t,rt,ln);break;case 3:if(Tn(t,s),(s&130023424)===s&&(e=md+500-ke(),10<e)){if(ka(t,0)!==0)break;if(r=t.suspendedLanes,(r&s)!==s){Ge(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=zu(ms.bind(null,t,rt,ln),e);break}ms(t,rt,ln);break;case 4:if(Tn(t,s),(s&4194240)===s)break;for(e=t.eventTimes,r=-1;0<s;){var o=31-Bt(s);i=1<<o,o=e[o],o>r&&(r=o),s&=~i}if(s=r,s=ke()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*qv(s/1960))-s,10<s){t.timeoutHandle=zu(ms.bind(null,t,rt,ln),s);break}ms(t,rt,ln);break;case 5:ms(t,rt,ln);break;default:throw Error(M(329))}}}return ut(t,ke()),t.callbackNode===n?e0.bind(null,t):null}function ic(t,e){var n=Si;return t.current.memoizedState.isDehydrated&&(Os(t,e).flags|=256),t=Ba(t,e),t!==2&&(e=rt,rt=n,e!==null&&oc(e)),t}function oc(t){rt===null?rt=t:rt.push.apply(rt,t)}function Gv(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(!$t(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 Tn(t,e){for(e&=~gd,e&=~dl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Bt(e),s=1<<n;t[n]=-1,e&=~s}}function nf(t){if(Z&6)throw Error(M(327));fr();var e=ka(t,0);if(!(e&1))return ut(t,ke()),null;var n=Ba(t,e);if(t.tag!==0&&n===2){var s=Tu(t);s!==0&&(e=s,n=ic(t,s))}if(n===1)throw n=Yi,Os(t,0),Tn(t,e),ut(t,ke()),n;if(n===6)throw Error(M(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ms(t,rt,ln),ut(t,ke()),null}function yd(t,e){var n=Z;Z|=1;try{return t(e)}finally{Z=n,Z===0&&(Lr=ke()+500,al&&us())}}function Bs(t){Wn!==null&&Wn.tag===0&&!(Z&6)&&fr();var e=Z;Z|=1;var n=jt.transition,s=oe;try{if(jt.transition=null,oe=1,t)return t()}finally{oe=s,jt.transition=n,Z=e,!(Z&6)&&us()}}function xd(){ct=or.current,fe(or)}function Os(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,Nv(n)),je!==null)for(n=je.return;n!==null;){var s=n;switch(Jc(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Na();break;case 3:Or(),fe(at),fe(Ve),ad();break;case 5:od(s);break;case 4:Or();break;case 13:fe(me);break;case 19:fe(me);break;case 10:nd(s.type._context);break;case 22:case 23:xd()}n=n.return}if(Re=t,je=t=Jn(t.current,null),Fe=ct=e,Pe=0,Yi=null,gd=dl=zs=0,rt=Si=null,bs!==null){for(e=0;e<bs.length;e++)if(n=bs[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}bs=null}return t}function t0(t,e){do{var n=je;try{if(td(),oa.current=Fa,La){for(var s=ye.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}La=!1}if(As=0,Te=Ne=ye=null,ki=!1,Ui=0,pd.current=null,n===null||n.return===null){Pe=1,Yi=e,je=null;break}e:{var i=t,o=n.return,a=n,l=e;if(e=Fe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Hh(o);if(p!==null){p.flags&=-257,Uh(p,o,a,i,e),p.mode&1&&$h(i,u,e),e=p,l=u;var x=e.updateQueue;if(x===null){var y=new Set;y.add(l),e.updateQueue=y}else x.add(l);break e}else{if(!(e&1)){$h(i,u,e),vd();break e}l=Error(M(426))}}else if(pe&&a.mode&1){var b=Hh(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Uh(b,o,a,i,e),Zc(Dr(l,a));break e}}i=l=Dr(l,a),Pe!==4&&(Pe=2),Si===null?Si=[i]:Si.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=Am(i,l,e);Fh(i,g);break e;case 1:a=l;var m=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(qn===null||!qn.has(v)))){i.flags|=65536,e&=-e,i.lanes|=e;var w=zm(i,a,e);Fh(i,w);break e}}i=i.return}while(i!==null)}r0(n)}catch(j){e=j,je===n&&n!==null&&(je=n=n.return);continue}break}while(!0)}function n0(){var t=Ia.current;return Ia.current=Fa,t===null?Fa:t}function vd(){(Pe===0||Pe===3||Pe===2)&&(Pe=4),Re===null||!(zs&268435455)&&!(dl&268435455)||Tn(Re,Fe)}function Ba(t,e){var n=Z;Z|=2;var s=n0();(Re!==t||Fe!==e)&&(ln=null,Os(t,e));do try{Jv();break}catch(r){t0(t,r)}while(!0);if(td(),Z=n,Ia.current=s,je!==null)throw Error(M(261));return Re=null,Fe=0,Pe}function Jv(){for(;je!==null;)s0(je)}function Zv(){for(;je!==null&&!Sx();)s0(je)}function s0(t){var e=o0(t.alternate,t,ct);t.memoizedProps=t.pendingProps,e===null?r0(t):je=e,pd.current=null}function r0(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=Qv(n,e),n!==null){n.flags&=32767,je=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pe=6,je=null;return}}else if(n=Vv(n,e,ct),n!==null){je=n;return}if(e=e.sibling,e!==null){je=e;return}je=e=t}while(e!==null);Pe===0&&(Pe=5)}function ms(t,e,n){var s=oe,r=jt.transition;try{jt.transition=null,oe=1,eb(t,e,n,s)}finally{jt.transition=r,oe=s}return null}function eb(t,e,n,s){do fr();while(Wn!==null);if(Z&6)throw Error(M(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(M(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(Dx(t,i),t===Re&&(je=Re=null,Fe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ao||(Ao=!0,a0(wa,function(){return fr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=jt.transition,jt.transition=null;var o=oe;oe=1;var a=Z;Z|=4,pd.current=null,Kv(t,n),Jm(n,t),bv(Iu),_a=!!Fu,Iu=Fu=null,t.current=n,Xv(n),Cx(),Z=a,oe=o,jt.transition=i}else t.current=n;if(Ao&&(Ao=!1,Wn=t,za=r),i=t.pendingLanes,i===0&&(qn=null),Ex(n.stateNode),ut(t,ke()),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(Aa)throw Aa=!1,t=sc,sc=null,t;return za&1&&t.tag!==0&&fr(),i=t.pendingLanes,i&1?t===rc?Ci++:(Ci=0,rc=t):Ci=0,us(),null}function fr(){if(Wn!==null){var t=Ag(za),e=jt.transition,n=oe;try{if(jt.transition=null,oe=16>t?16:t,Wn===null)var s=!1;else{if(t=Wn,Wn=null,za=0,Z&6)throw Error(M(331));var r=Z;for(Z|=4,I=t.current;I!==null;){var i=I,o=i.child;if(I.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(I=u;I!==null;){var d=I;switch(d.tag){case 0:case 11:case 15:_i(8,d,i)}var h=d.child;if(h!==null)h.return=d,I=h;else for(;I!==null;){d=I;var f=d.sibling,p=d.return;if(Xm(d),d===u){I=null;break}if(f!==null){f.return=p,I=f;break}I=p}}}var x=i.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}I=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,I=o;else e:for(;I!==null;){if(i=I,i.flags&2048)switch(i.tag){case 0:case 11:case 15:_i(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,I=g;break e}I=i.return}}var m=t.current;for(I=m;I!==null;){o=I;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,I=v;else e:for(o=m;I!==null;){if(a=I,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:cl(9,a)}}catch(j){be(a,a.return,j)}if(a===o){I=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,I=w;break e}I=a.return}}if(Z=r,us(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(nl,t)}catch{}s=!0}return s}finally{oe=n,jt.transition=e}}return!1}function sf(t,e,n){e=Dr(n,e),e=Am(t,e,1),t=Xn(t,e,1),e=Ge(),t!==null&&(uo(t,1,e),ut(t,e))}function be(t,e,n){if(t.tag===3)sf(t,t,n);else for(;e!==null;){if(e.tag===3){sf(e,t,n);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(qn===null||!qn.has(s))){t=Dr(n,t),t=zm(e,t,1),e=Xn(e,t,1),t=Ge(),e!==null&&(uo(e,1,t),ut(e,t));break}}e=e.return}}function tb(t,e,n){var s=t.pingCache;s!==null&&s.delete(e),e=Ge(),t.pingedLanes|=t.suspendedLanes&n,Re===t&&(Fe&n)===n&&(Pe===4||Pe===3&&(Fe&130023424)===Fe&&500>ke()-md?Os(t,0):gd|=n),ut(t,e)}function i0(t,e){e===0&&(t.mode&1?(e=Eo,Eo<<=1,!(Eo&130023424)&&(Eo=4194304)):e=1);var n=Ge();t=vn(t,e),t!==null&&(uo(t,e,n),ut(t,n))}function nb(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),i0(t,n)}function sb(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(M(314))}s!==null&&s.delete(e),i0(t,n)}var o0;o0=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||at.current)ot=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return ot=!1,Uv(t,e,n);ot=!!(t.flags&131072)}else ot=!1,pe&&e.flags&1048576&&cm(e,Ma,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;la(t,e),t=e.pendingProps;var r=Mr(e,Ve.current);hr(e,n),r=ud(null,e,s,t,r,n);var i=cd();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,lt(s)?(i=!0,Ea(e)):i=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,rd(e),r.updater=ul,e.stateNode=r,r._reactInternals=e,Qu(e,s,t,n),e=Xu(null,e,s,!0,i,n)):(e.tag=0,pe&&i&&Gc(e),qe(null,e,r,n),e=e.child),e;case 16:s=e.elementType;e:{switch(la(t,e),t=e.pendingProps,r=s._init,s=r(s._payload),e.type=s,r=e.tag=ib(s),t=Ot(s,t),r){case 0:e=Ku(null,e,s,t,n);break e;case 1:e=Yh(null,e,s,t,n);break e;case 11:e=Vh(null,e,s,t,n);break e;case 14:e=Qh(null,e,s,Ot(s.type,t),n);break e}throw Error(M(306,s,""))}return e;case 0:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Ku(t,e,s,r,n);case 1:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Yh(t,e,s,r,n);case 3:e:{if(Hm(e),t===null)throw Error(M(387));s=e.pendingProps,i=e.memoizedState,r=i.element,mm(t,e),Oa(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=Dr(Error(M(423)),e),e=Kh(t,e,s,n,r);break e}else if(s!==r){r=Dr(Error(M(424)),e),e=Kh(t,e,s,n,r);break e}else for(dt=Kn(e.stateNode.containerInfo.firstChild),ft=e,pe=!0,It=null,n=pm(e,null,s,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),s===r){e=bn(t,e,n);break e}qe(t,e,s,n)}e=e.child}return e;case 5:return ym(e),t===null&&Hu(e),s=e.type,r=e.pendingProps,i=t!==null?t.memoizedProps:null,o=r.children,Au(s,r)?o=null:i!==null&&Au(s,i)&&(e.flags|=32),$m(t,e),qe(t,e,o,n),e.child;case 6:return t===null&&Hu(e),null;case 13:return Um(t,e,n);case 4:return id(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=Rr(e,null,s,n):qe(t,e,s,n),e.child;case 11:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),Vh(t,e,s,r,n);case 7:return qe(t,e,e.pendingProps,n),e.child;case 8:return qe(t,e,e.pendingProps.children,n),e.child;case 12:return qe(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,ue(Ta,s._currentValue),s._currentValue=o,i!==null)if($t(i.value,o)){if(i.children===r.children&&!at.current){e=bn(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 l=a.firstContext;l!==null;){if(l.context===s){if(i.tag===1){l=gn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Uu(i.return,n,e),a.lanes|=n;break}l=l.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(M(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Uu(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}qe(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,s=e.pendingProps.children,hr(e,n),r=Nt(r),s=s(r),e.flags|=1,qe(t,e,s,n),e.child;case 14:return s=e.type,r=Ot(s,e.pendingProps),r=Ot(s.type,r),Qh(t,e,s,r,n);case 15:return Bm(t,e,e.type,e.pendingProps,n);case 17:return s=e.type,r=e.pendingProps,r=e.elementType===s?r:Ot(s,r),la(t,e),e.tag=1,lt(s)?(t=!0,Ea(e)):t=!1,hr(e,n),Im(e,s,r),Qu(e,s,r,n),Xu(null,e,s,!0,t,n);case 19:return Vm(t,e,n);case 22:return Wm(t,e,n)}throw Error(M(156,e.tag))};function a0(t,e){return Dg(t,e)}function rb(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 St(t,e,n,s){return new rb(t,e,n,s)}function bd(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ib(t){if(typeof t=="function")return bd(t)?1:0;if(t!=null){if(t=t.$$typeof,t===zc)return 11;if(t===Bc)return 14}return 2}function Jn(t,e){var n=t.alternate;return n===null?(n=St(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 da(t,e,n,s,r,i){var o=2;if(s=t,typeof t=="function")bd(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case qs:return Ds(n.children,r,i,e);case Ac:o=8,r|=8;break;case mu:return t=St(12,n,e,r|2),t.elementType=mu,t.lanes=i,t;case yu:return t=St(13,n,e,r),t.elementType=yu,t.lanes=i,t;case xu:return t=St(19,n,e,r),t.elementType=xu,t.lanes=i,t;case yg:return hl(n,r,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case gg:o=10;break e;case mg:o=9;break e;case zc:o=11;break e;case Bc:o=14;break e;case En:o=16,s=null;break e}throw Error(M(130,t==null?t:typeof t,""))}return e=St(o,n,e,r),e.elementType=t,e.type=s,e.lanes=i,e}function Ds(t,e,n,s){return t=St(7,t,s,e),t.lanes=n,t}function hl(t,e,n,s){return t=St(22,t,s,e),t.elementType=yg,t.lanes=n,t.stateNode={isHidden:!1},t}function Xl(t,e,n){return t=St(6,t,null,e),t.lanes=n,t}function ql(t,e,n){return e=St(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function ob(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=Ml(0),this.expirationTimes=Ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ml(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function wd(t,e,n,s,r,i,o,a,l){return t=new ob(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=St(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},rd(i),t}function ab(t,e,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:s==null?null:""+s,children:t,containerInfo:e,implementation:n}}function l0(t){if(!t)return rs;t=t._reactInternals;e:{if(Vs(t)!==t||t.tag!==1)throw Error(M(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(lt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(M(171))}if(t.tag===1){var n=t.type;if(lt(n))return lm(t,n,e)}return e}function u0(t,e,n,s,r,i,o,a,l){return t=wd(n,s,!0,t,r,i,o,a,l),t.context=l0(null),n=t.current,s=Ge(),r=Gn(n),i=gn(s,r),i.callback=e??null,Xn(n,i,r),t.current.lanes=r,uo(t,r,s),ut(t,s),t}function fl(t,e,n,s){var r=e.current,i=Ge(),o=Gn(r);return n=l0(n),e.context===null?e.context=n:e.pendingContext=n,e=gn(i,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=Xn(r,e,o),t!==null&&(Wt(t,r,o,i),ia(t,r,o)),o}function Wa(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 rf(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function kd(t,e){rf(t,e),(t=t.alternate)&&rf(t,e)}function lb(){return null}var c0=typeof reportError=="function"?reportError:function(t){console.error(t)};function _d(t){this._internalRoot=t}pl.prototype.render=_d.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(M(409));fl(t,e,null,null)};pl.prototype.unmount=_d.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Bs(function(){fl(null,t,null,null)}),e[xn]=null}};function pl(t){this._internalRoot=t}pl.prototype.unstable_scheduleHydration=function(t){if(t){var e=Wg();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Mn.length&&e!==0&&e<Mn[n].priority;n++);Mn.splice(n,0,t),n===0&&Hg(t)}};function Sd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function gl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function of(){}function ub(t,e,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=Wa(o);i.call(u)}}var o=u0(e,s,t,0,null,!1,!1,"",of);return t._reactRootContainer=o,t[xn]=o.current,zi(t.nodeType===8?t.parentNode:t),Bs(),o}for(;r=t.lastChild;)t.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=Wa(l);a.call(u)}}var l=wd(t,0,!1,null,null,!1,!1,"",of);return t._reactRootContainer=l,t[xn]=l.current,zi(t.nodeType===8?t.parentNode:t),Bs(function(){fl(e,l,n,s)}),l}function ml(t,e,n,s,r){var i=n._reactRootContainer;if(i){var o=i;if(typeof r=="function"){var a=r;r=function(){var l=Wa(o);a.call(l)}}fl(e,o,t,r)}else o=ub(n,e,t,r,s);return Wa(o)}zg=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ci(e.pendingLanes);n!==0&&(Hc(e,n|1),ut(e,ke()),!(Z&6)&&(Lr=ke()+500,us()))}break;case 13:Bs(function(){var s=vn(t,1);if(s!==null){var r=Ge();Wt(s,t,1,r)}}),kd(t,1)}};Uc=function(t){if(t.tag===13){var e=vn(t,134217728);if(e!==null){var n=Ge();Wt(e,t,134217728,n)}kd(t,134217728)}};Bg=function(t){if(t.tag===13){var e=Gn(t),n=vn(t,e);if(n!==null){var s=Ge();Wt(n,t,e,s)}kd(t,e)}};Wg=function(){return oe};$g=function(t,e){var n=oe;try{return oe=t,e()}finally{oe=n}};Eu=function(t,e,n){switch(e){case"input":if(wu(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=ol(s);if(!r)throw Error(M(90));vg(s),wu(s,r)}}}break;case"textarea":wg(t,n);break;case"select":e=n.value,e!=null&&lr(t,!!n.multiple,e,!1)}};Eg=yd;Pg=Bs;var cb={usingClientEntryPoint:!1,Events:[ho,er,ol,jg,Ng,yd]},Zr={findFiberByHostInstance:vs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},db={bundleType:Zr.bundleType,version:Zr.version,rendererPackageName:Zr.rendererPackageName,rendererConfig:Zr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Rg(t),t===null?null:t.stateNode},findFiberByHostInstance:Zr.findFiberByHostInstance||lb,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 zo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zo.isDisabled&&zo.supportsFiber)try{nl=zo.inject(db),tn=zo}catch{}}gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cb;gt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sd(e))throw Error(M(200));return ab(t,e,null,n)};gt.createRoot=function(t,e){if(!Sd(t))throw Error(M(299));var n=!1,s="",r=c0;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=wd(t,1,!1,null,null,n,!1,s,r),t[xn]=e.current,zi(t.nodeType===8?t.parentNode:t),new _d(e)};gt.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(M(188)):(t=Object.keys(t).join(","),Error(M(268,t)));return t=Rg(e),t=t===null?null:t.stateNode,t};gt.flushSync=function(t){return Bs(t)};gt.hydrate=function(t,e,n){if(!gl(e))throw Error(M(200));return ml(null,t,e,!0,n)};gt.hydrateRoot=function(t,e,n){if(!Sd(t))throw Error(M(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",o=c0;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=u0(e,null,t,1,n??null,r,!1,i,o),t[xn]=e.current,zi(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 pl(e)};gt.render=function(t,e,n){if(!gl(e))throw Error(M(200));return ml(null,t,e,!1,n)};gt.unmountComponentAtNode=function(t){if(!gl(t))throw Error(M(40));return t._reactRootContainer?(Bs(function(){ml(null,null,t,!1,function(){t._reactRootContainer=null,t[xn]=null})}),!0):!1};gt.unstable_batchedUpdates=yd;gt.unstable_renderSubtreeIntoContainer=function(t,e,n,s){if(!gl(n))throw Error(M(200));if(t==null||t._reactInternals===void 0)throw Error(M(38));return ml(t,e,n,!1,s)};gt.version="18.3.1-next-f1338f8080-20240426";function d0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d0)}catch(t){console.error(t)}}d0(),dg.exports=gt;var hb=dg.exports,af=hb;pu.createRoot=af.createRoot,pu.hydrateRoot=af.hydrateRoot;var po=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fb={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Rn,Mc,Up,pb=(Up=class{constructor(){H(this,Rn,fb);H(this,Mc,!1)}setTimeoutProvider(t){F(this,Rn,t)}setTimeout(t,e){return _(this,Rn).setTimeout(t,e)}clearTimeout(t){_(this,Rn).clearTimeout(t)}setInterval(t,e){return _(this,Rn).setInterval(t,e)}clearInterval(t){_(this,Rn).clearInterval(t)}},Rn=new WeakMap,Mc=new WeakMap,Up),ks=new pb;function gb(t){setTimeout(t,0)}var Ws=typeof window>"u"||"Deno"in globalThis;function st(){}function mb(t,e){return typeof t=="function"?t(e):t}function ac(t){return typeof t=="number"&&t>=0&&t!==1/0}function h0(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Zn(t,e){return typeof t=="function"?t(e):t}function wt(t,e){return typeof t=="function"?t(e):t}function lf(t,e){const{type:n="all",exact:s,fetchStatus:r,predicate:i,queryKey:o,stale:a}=t;if(o){if(s){if(e.queryHash!==Cd(o,e.options))return!1}else if(!Xi(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||i&&!i(e))}function uf(t,e){const{exact:n,status:s,predicate:r,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Ki(e.options.mutationKey)!==Ki(i))return!1}else if(!Xi(e.options.mutationKey,i))return!1}return!(s&&e.state.status!==s||r&&!r(e))}function Cd(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ki)(t)}function Ki(t){return JSON.stringify(t,(e,n)=>uc(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function Xi(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Xi(t[n],e[n])):!1}var yb=Object.prototype.hasOwnProperty;function f0(t,e){if(t===e)return t;const n=cf(t)&&cf(e);if(!n&&!(uc(t)&&uc(e)))return e;const r=(n?t:Object.keys(t)).length,i=n?e:Object.keys(e),o=i.length,a=n?new Array(o):{};let l=0;for(let u=0;u<o;u++){const d=n?u:i[u],h=t[d],f=e[d];if(h===f){a[d]=h,(n?u<r:yb.call(t,d))&&l++;continue}if(h===null||f===null||typeof h!="object"||typeof f!="object"){a[d]=f;continue}const p=f0(h,f);a[d]=p,p===h&&l++}return r===o&&l===r?t:a}function lc(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function cf(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uc(t){if(!df(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!df(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function df(t){return Object.prototype.toString.call(t)==="[object Object]"}function xb(t){return new Promise(e=>{ks.setTimeout(e,t)})}function cc(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?f0(t,e):e}function vb(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function bb(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var jd=Symbol();function p0(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===jd?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function g0(t,e){return typeof t=="function"?t(...e):!!t}function wb(t,e,n){let s=!1,r;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(r??(r=e()),s||(s=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)}),t}var Ss,On,yr,Vp,kb=(Vp=class extends po{constructor(){super();H(this,Ss);H(this,On);H(this,yr);F(this,yr,e=>{if(!Ws&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,On)||this.setEventListener(_(this,yr))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,On))==null||e.call(this),F(this,On,void 0))}setEventListener(e){var n;F(this,yr,e),(n=_(this,On))==null||n.call(this),F(this,On,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){_(this,Ss)!==e&&(F(this,Ss,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof _(this,Ss)=="boolean"?_(this,Ss):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ss=new WeakMap,On=new WeakMap,yr=new WeakMap,Vp),Nd=new kb;function dc(){let t,e;const n=new Promise((r,i)=>{t=r,e=i});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),t(r)},n.reject=r=>{s({status:"rejected",reason:r}),e(r)},n}var _b=gb;function Sb(){let t=[],e=0,n=a=>{a()},s=a=>{a()},r=_b;const i=a=>{e?t.push(a):r(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{s(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{r=a}}}var Le=Sb(),xr,Dn,vr,Qp,Cb=(Qp=class extends po{constructor(){super();H(this,xr,!0);H(this,Dn);H(this,vr);F(this,vr,e=>{if(!Ws&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){_(this,Dn)||this.setEventListener(_(this,vr))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Dn))==null||e.call(this),F(this,Dn,void 0))}setEventListener(e){var n;F(this,vr,e),(n=_(this,Dn))==null||n.call(this),F(this,Dn,e(this.setOnline.bind(this)))}setOnline(e){_(this,xr)!==e&&(F(this,xr,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return _(this,xr)}},xr=new WeakMap,Dn=new WeakMap,vr=new WeakMap,Qp),$a=new Cb;function jb(t){return Math.min(1e3*2**t,3e4)}function m0(t){return(t??"online")==="online"?$a.isOnline():!0}var hc=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function y0(t){let e=!1,n=0,s;const r=dc(),i=()=>r.status!=="pending",o=y=>{var b;if(!i()){const g=new hc(y);f(g),(b=t.onCancel)==null||b.call(t,g)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>Nd.isFocused()&&(t.networkMode==="always"||$a.isOnline())&&t.canRun(),d=()=>m0(t.networkMode)&&t.canRun(),h=y=>{i()||(s==null||s(),r.resolve(y))},f=y=>{i()||(s==null||s(),r.reject(y))},p=()=>new Promise(y=>{var b;s=g=>{(i()||u())&&y(g)},(b=t.onPause)==null||b.call(t)}).then(()=>{var y;s=void 0,i()||(y=t.onContinue)==null||y.call(t)}),x=()=>{if(i())return;let y;const b=n===0?t.initialPromise:void 0;try{y=b??t.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(h).catch(g=>{var E;if(i())return;const m=t.retry??(Ws?0:3),v=t.retryDelay??jb,w=typeof v=="function"?v(n,g):v,j=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,g);if(e||!j){f(g);return}n++,(E=t.onFail)==null||E.call(t,n,g),xb(w).then(()=>u()?void 0:p()).then(()=>{e?f(g):x()})})};return{promise:r,status:()=>r.status,cancel:o,continue:()=>(s==null||s(),r),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():p().then(x),r)}}var Cs,Yp,x0=(Yp=class{constructor(){H(this,Cs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ac(this.gcTime)&&F(this,Cs,ks.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ws?1/0:5*60*1e3))}clearGcTimeout(){_(this,Cs)&&(ks.clearTimeout(_(this,Cs)),F(this,Cs,void 0))}},Cs=new WeakMap,Yp),js,br,bt,Ns,Me,so,Es,Dt,rn,Kp,Nb=(Kp=class extends x0{constructor(e){super();H(this,Dt);H(this,js);H(this,br);H(this,bt);H(this,Ns);H(this,Me);H(this,so);H(this,Es);F(this,Es,!1),F(this,so,e.defaultOptions),this.setOptions(e.options),this.observers=[],F(this,Ns,e.client),F(this,bt,_(this,Ns).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,F(this,js,ff(this.options)),this.state=e.state??_(this,js),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=_(this,Me))==null?void 0:e.promise}setOptions(e){if(this.options={..._(this,so),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ff(this.options);n.data!==void 0&&(this.setState(hf(n.data,n.dataUpdatedAt)),F(this,js,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,bt).remove(this)}setData(e,n){const s=cc(this.state.data,e,this.options);return X(this,Dt,rn).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){X(this,Dt,rn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,r;const n=(s=_(this,Me))==null?void 0:s.promise;return(r=_(this,Me))==null||r.cancel(e),n?n.then(st).catch(st):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,js))}isActive(){return this.observers.some(e=>wt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!h0(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Me))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Me))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),_(this,bt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(_(this,Me)&&(_(this,Es)?_(this,Me).cancel({revert:!0}):_(this,Me).cancelRetry()),this.scheduleGc()),_(this,bt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||X(this,Dt,rn).call(this,{type:"invalidate"})}async fetch(e,n){var l,u,d,h,f,p,x,y,b,g,m,v;if(this.state.fetchStatus!=="idle"&&((l=_(this,Me))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Me))return _(this,Me).continueRetry(),_(this,Me).promise}if(e&&this.setOptions(e),!this.options.queryFn){const w=this.observers.find(j=>j.options.queryFn);w&&this.setOptions(w.options)}const s=new AbortController,r=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(F(this,Es,!0),s.signal)})},i=()=>{const w=p0(this.options,n),E=(()=>{const k={client:_(this,Ns),queryKey:this.queryKey,meta:this.meta};return r(k),k})();return F(this,Es,!1),this.options.persister?this.options.persister(w,E,this):w(E)},a=(()=>{const w={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,Ns),state:this.state,fetchFn:i};return r(w),w})();(u=this.options.behavior)==null||u.onFetch(a,this),F(this,br,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&X(this,Dt,rn).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta}),F(this,Me,y0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:w=>{w instanceof hc&&w.revert&&this.setState({..._(this,br),fetchStatus:"idle"}),s.abort()},onFail:(w,j)=>{X(this,Dt,rn).call(this,{type:"failed",failureCount:w,error:j})},onPause:()=>{X(this,Dt,rn).call(this,{type:"pause"})},onContinue:()=>{X(this,Dt,rn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const w=await _(this,Me).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(p=(f=_(this,bt).config).onSuccess)==null||p.call(f,w,this),(y=(x=_(this,bt).config).onSettled)==null||y.call(x,w,this.state.error,this),w}catch(w){if(w instanceof hc){if(w.silent)return _(this,Me).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw X(this,Dt,rn).call(this,{type:"error",error:w}),(g=(b=_(this,bt).config).onError)==null||g.call(b,w,this),(v=(m=_(this,bt).config).onSettled)==null||v.call(m,this.state.data,w,this),w}finally{this.scheduleGc()}}},js=new WeakMap,br=new WeakMap,bt=new WeakMap,Ns=new WeakMap,Me=new WeakMap,so=new WeakMap,Es=new WeakMap,Dt=new WeakSet,rn=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...v0(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...hf(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return F(this,br,e.manual?r:void 0),r;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),Le.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),_(this,bt).notify({query:this,type:"updated",action:e})})},Kp);function v0(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:m0(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function hf(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ff(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var nt,q,ro,Ke,Ps,wr,dn,Ln,io,kr,_r,Ms,Ts,Fn,Sr,ne,hi,fc,pc,gc,mc,yc,xc,vc,b0,Xp,Eb=(Xp=class extends po{constructor(e,n){super();H(this,ne);H(this,nt);H(this,q);H(this,ro);H(this,Ke);H(this,Ps);H(this,wr);H(this,dn);H(this,Ln);H(this,io);H(this,kr);H(this,_r);H(this,Ms);H(this,Ts);H(this,Fn);H(this,Sr,new Set);this.options=n,F(this,nt,e),F(this,Ln,null),F(this,dn,dc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,q).addObserver(this),pf(_(this,q),this.options)?X(this,ne,hi).call(this):this.updateResult(),X(this,ne,mc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bc(_(this,q),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bc(_(this,q),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,X(this,ne,yc).call(this),X(this,ne,xc).call(this),_(this,q).removeObserver(this)}setOptions(e){const n=this.options,s=_(this,q);if(this.options=_(this,nt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof wt(this.options.enabled,_(this,q))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");X(this,ne,vc).call(this),_(this,q).setOptions(this.options),n._defaulted&&!lc(this.options,n)&&_(this,nt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,q),observer:this});const r=this.hasListeners();r&&gf(_(this,q),s,this.options,n)&&X(this,ne,hi).call(this),this.updateResult(),r&&(_(this,q)!==s||wt(this.options.enabled,_(this,q))!==wt(n.enabled,_(this,q))||Zn(this.options.staleTime,_(this,q))!==Zn(n.staleTime,_(this,q)))&&X(this,ne,fc).call(this);const i=X(this,ne,pc).call(this);r&&(_(this,q)!==s||wt(this.options.enabled,_(this,q))!==wt(n.enabled,_(this,q))||i!==_(this,Fn))&&X(this,ne,gc).call(this,i)}getOptimisticResult(e){const n=_(this,nt).getQueryCache().build(_(this,nt),e),s=this.createResult(n,e);return Mb(this,s)&&(F(this,Ke,s),F(this,wr,this.options),F(this,Ps,_(this,q).state)),s}getCurrentResult(){return _(this,Ke)}trackResult(e,n){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),n==null||n(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,dn).status==="pending"&&_(this,dn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){_(this,Sr).add(e)}getCurrentQuery(){return _(this,q)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=_(this,nt).defaultQueryOptions(e),s=_(this,nt).getQueryCache().build(_(this,nt),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return X(this,ne,hi).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Ke)))}createResult(e,n){var R;const s=_(this,q),r=this.options,i=_(this,Ke),o=_(this,Ps),a=_(this,wr),u=e!==s?e.state:_(this,ro),{state:d}=e;let h={...d},f=!1,p;if(n._optimisticResults){const C=this.hasListeners(),P=!C&&pf(e,n),z=C&&gf(e,s,n,r);(P||z)&&(h={...h,...v0(d.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:y,status:b}=h;p=h.data;let g=!1;if(n.placeholderData!==void 0&&p===void 0&&b==="pending"){let C;i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(C=i.data,g=!0):C=typeof n.placeholderData=="function"?n.placeholderData((R=_(this,_r))==null?void 0:R.state.data,_(this,_r)):n.placeholderData,C!==void 0&&(b="success",p=cc(i==null?void 0:i.data,C,n),f=!0)}if(n.select&&p!==void 0&&!g)if(i&&p===(o==null?void 0:o.data)&&n.select===_(this,io))p=_(this,kr);else try{F(this,io,n.select),p=n.select(p),p=cc(i==null?void 0:i.data,p,n),F(this,kr,p),F(this,Ln,null)}catch(C){F(this,Ln,C)}_(this,Ln)&&(x=_(this,Ln),p=_(this,kr),y=Date.now(),b="error");const m=h.fetchStatus==="fetching",v=b==="pending",w=b==="error",j=v&&m,E=p!==void 0,N={status:b,fetchStatus:h.fetchStatus,isPending:v,isSuccess:b==="success",isError:w,isInitialLoading:j,isLoading:j,data:p,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:w&&!E,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:Ed(e,n),refetch:this.refetch,promise:_(this,dn),isEnabled:wt(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const C=Y=>{N.status==="error"?Y.reject(N.error):N.data!==void 0&&Y.resolve(N.data)},P=()=>{const Y=F(this,dn,N.promise=dc());C(Y)},z=_(this,dn);switch(z.status){case"pending":e.queryHash===s.queryHash&&C(z);break;case"fulfilled":(N.status==="error"||N.data!==z.value)&&P();break;case"rejected":(N.status!=="error"||N.error!==z.reason)&&P();break}}return N}updateResult(){const e=_(this,Ke),n=this.createResult(_(this,q),this.options);if(F(this,Ps,_(this,q).state),F(this,wr,this.options),_(this,Ps).data!==void 0&&F(this,_r,_(this,q)),lc(n,e))return;F(this,Ke,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!_(this,Sr).size)return!0;const o=new Set(i??_(this,Sr));return this.options.throwOnError&&o.add("error"),Object.keys(_(this,Ke)).some(a=>{const l=a;return _(this,Ke)[l]!==e[l]&&o.has(l)})};X(this,ne,b0).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&X(this,ne,mc).call(this)}},nt=new WeakMap,q=new WeakMap,ro=new WeakMap,Ke=new WeakMap,Ps=new WeakMap,wr=new WeakMap,dn=new WeakMap,Ln=new WeakMap,io=new WeakMap,kr=new WeakMap,_r=new WeakMap,Ms=new WeakMap,Ts=new WeakMap,Fn=new WeakMap,Sr=new WeakMap,ne=new WeakSet,hi=function(e){X(this,ne,vc).call(this);let n=_(this,q).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(st)),n},fc=function(){X(this,ne,yc).call(this);const e=Zn(this.options.staleTime,_(this,q));if(Ws||_(this,Ke).isStale||!ac(e))return;const s=h0(_(this,Ke).dataUpdatedAt,e)+1;F(this,Ms,ks.setTimeout(()=>{_(this,Ke).isStale||this.updateResult()},s))},pc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,q)):this.options.refetchInterval)??!1},gc=function(e){X(this,ne,xc).call(this),F(this,Fn,e),!(Ws||wt(this.options.enabled,_(this,q))===!1||!ac(_(this,Fn))||_(this,Fn)===0)&&F(this,Ts,ks.setInterval(()=>{(this.options.refetchIntervalInBackground||Nd.isFocused())&&X(this,ne,hi).call(this)},_(this,Fn)))},mc=function(){X(this,ne,fc).call(this),X(this,ne,gc).call(this,X(this,ne,pc).call(this))},yc=function(){_(this,Ms)&&(ks.clearTimeout(_(this,Ms)),F(this,Ms,void 0))},xc=function(){_(this,Ts)&&(ks.clearInterval(_(this,Ts)),F(this,Ts,void 0))},vc=function(){const e=_(this,nt).getQueryCache().build(_(this,nt),this.options);if(e===_(this,q))return;const n=_(this,q);F(this,q,e),F(this,ro,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},b0=function(e){Le.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(_(this,Ke))}),_(this,nt).getQueryCache().notify({query:_(this,q),type:"observerResultsUpdated"})})},Xp);function Pb(t,e){return wt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function pf(t,e){return Pb(t,e)||t.state.data!==void 0&&bc(t,e,e.refetchOnMount)}function bc(t,e,n){if(wt(e.enabled,t)!==!1&&Zn(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Ed(t,e)}return!1}function gf(t,e,n,s){return(t!==e||wt(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Ed(t,n)}function Ed(t,e){return wt(e.enabled,t)!==!1&&t.isStaleByTime(Zn(e.staleTime,t))}function Mb(t,e){return!lc(t.getCurrentResult(),e)}function mf(t){return{onFetch:(e,n)=>{var d,h,f,p,x;const s=e.options,r=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=e.state.data)==null?void 0:p.pages)||[],o=((x=e.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const b=v=>{wb(v,()=>e.signal,()=>y=!0)},g=p0(e.options,e.fetchOptions),m=async(v,w,j)=>{if(y)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:w,direction:j?"backward":"forward",meta:e.options.meta};return b(P),P})(),N=await g(k),{maxPages:R}=e.options,C=j?bb:vb;return{pages:C(v.pages,N,R),pageParams:C(v.pageParams,w,R)}};if(r&&i.length){const v=r==="backward",w=v?Tb:yf,j={pages:i,pageParams:o},E=w(s,j);a=await m(j,E,v)}else{const v=t??i.length;do{const w=l===0?o[0]??s.initialPageParam:yf(s,a);if(l>0&&w==null)break;a=await m(a,w),l++}while(l<v)}return a};e.options.persister?e.fetchFn=()=>{var y,b;return(b=(y=e.options).persister)==null?void 0:b.call(y,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function yf(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function Tb(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}var oo,Gt,Xe,Rs,Jt,Nn,qp,Rb=(qp=class extends x0{constructor(e){super();H(this,Jt);H(this,oo);H(this,Gt);H(this,Xe);H(this,Rs);F(this,oo,e.client),this.mutationId=e.mutationId,F(this,Xe,e.mutationCache),F(this,Gt,[]),this.state=e.state||Ob(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){_(this,Gt).includes(e)||(_(this,Gt).push(e),this.clearGcTimeout(),_(this,Xe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){F(this,Gt,_(this,Gt).filter(n=>n!==e)),this.scheduleGc(),_(this,Xe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){_(this,Gt).length||(this.state.status==="pending"?this.scheduleGc():_(this,Xe).remove(this))}continue(){var e;return((e=_(this,Rs))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,l,u,d,h,f,p,x,y,b,g,m,v,w,j,E,k,N,R;const n=()=>{X(this,Jt,Nn).call(this,{type:"continue"})},s={client:_(this,oo),meta:this.options.meta,mutationKey:this.options.mutationKey};F(this,Rs,y0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(C,P)=>{X(this,Jt,Nn).call(this,{type:"failed",failureCount:C,error:P})},onPause:()=>{X(this,Jt,Nn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Xe).canRun(this)}));const r=this.state.status==="pending",i=!_(this,Rs).canStart();try{if(r)n();else{X(this,Jt,Nn).call(this,{type:"pending",variables:e,isPaused:i}),await((a=(o=_(this,Xe).config).onMutate)==null?void 0:a.call(o,e,this,s));const P=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,s));P!==this.state.context&&X(this,Jt,Nn).call(this,{type:"pending",context:P,variables:e,isPaused:i})}const C=await _(this,Rs).start();return await((h=(d=_(this,Xe).config).onSuccess)==null?void 0:h.call(d,C,e,this.state.context,this,s)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,C,e,this.state.context,s)),await((y=(x=_(this,Xe).config).onSettled)==null?void 0:y.call(x,C,null,this.state.variables,this.state.context,this,s)),await((g=(b=this.options).onSettled)==null?void 0:g.call(b,C,null,e,this.state.context,s)),X(this,Jt,Nn).call(this,{type:"success",data:C}),C}catch(C){try{await((v=(m=_(this,Xe).config).onError)==null?void 0:v.call(m,C,e,this.state.context,this,s))}catch(P){Promise.reject(P)}try{await((j=(w=this.options).onError)==null?void 0:j.call(w,C,e,this.state.context,s))}catch(P){Promise.reject(P)}try{await((k=(E=_(this,Xe).config).onSettled)==null?void 0:k.call(E,void 0,C,this.state.variables,this.state.context,this,s))}catch(P){Promise.reject(P)}try{await((R=(N=this.options).onSettled)==null?void 0:R.call(N,void 0,C,e,this.state.context,s))}catch(P){Promise.reject(P)}throw X(this,Jt,Nn).call(this,{type:"error",error:C}),C}finally{_(this,Xe).runNext(this)}}},oo=new WeakMap,Gt=new WeakMap,Xe=new WeakMap,Rs=new WeakMap,Jt=new WeakSet,Nn=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Le.batch(()=>{_(this,Gt).forEach(s=>{s.onMutationUpdate(e)}),_(this,Xe).notify({mutation:this,type:"updated",action:e})})},qp);function Ob(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hn,Lt,ao,Gp,Db=(Gp=class extends po{constructor(e={}){super();H(this,hn);H(this,Lt);H(this,ao);this.config=e,F(this,hn,new Set),F(this,Lt,new Map),F(this,ao,0)}build(e,n,s){const r=new Rb({client:e,mutationCache:this,mutationId:++ko(this,ao)._,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){_(this,hn).add(e);const n=Bo(e);if(typeof n=="string"){const s=_(this,Lt).get(n);s?s.push(e):_(this,Lt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(_(this,hn).delete(e)){const n=Bo(e);if(typeof n=="string"){const s=_(this,Lt).get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&_(this,Lt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Bo(e);if(typeof n=="string"){const s=_(this,Lt).get(n),r=s==null?void 0:s.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){var s;const n=Bo(e);if(typeof n=="string"){const r=(s=_(this,Lt).get(n))==null?void 0:s.find(i=>i!==e&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Le.batch(()=>{_(this,hn).forEach(e=>{this.notify({type:"removed",mutation:e})}),_(this,hn).clear(),_(this,Lt).clear()})}getAll(){return Array.from(_(this,hn))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>uf(n,s))}findAll(e={}){return this.getAll().filter(n=>uf(e,n))}notify(e){Le.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Le.batch(()=>Promise.all(e.map(n=>n.continue().catch(st))))}},hn=new WeakMap,Lt=new WeakMap,ao=new WeakMap,Gp);function Bo(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Zt,Jp,Lb=(Jp=class extends po{constructor(e={}){super();H(this,Zt);this.config=e,F(this,Zt,new Map)}build(e,n,s){const r=n.queryKey,i=n.queryHash??Cd(r,n);let o=this.get(i);return o||(o=new Nb({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){_(this,Zt).has(e.queryHash)||(_(this,Zt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=_(this,Zt).get(e.queryHash);n&&(e.destroy(),n===e&&_(this,Zt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Le.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return _(this,Zt).get(e)}getAll(){return[..._(this,Zt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>lf(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>lf(e,s)):n}notify(e){Le.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Le.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Le.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zt=new WeakMap,Jp),ve,In,An,Cr,jr,zn,Nr,Er,Zp,Fb=(Zp=class{constructor(t={}){H(this,ve);H(this,In);H(this,An);H(this,Cr);H(this,jr);H(this,zn);H(this,Nr);H(this,Er);F(this,ve,t.queryCache||new Lb),F(this,In,t.mutationCache||new Db),F(this,An,t.defaultOptions||{}),F(this,Cr,new Map),F(this,jr,new Map),F(this,zn,0)}mount(){ko(this,zn)._++,_(this,zn)===1&&(F(this,Nr,Nd.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,ve).onFocus())})),F(this,Er,$a.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,ve).onOnline())})))}unmount(){var t,e;ko(this,zn)._--,_(this,zn)===0&&((t=_(this,Nr))==null||t.call(this),F(this,Nr,void 0),(e=_(this,Er))==null||e.call(this),F(this,Er,void 0))}isFetching(t){return _(this,ve).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,In).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,ve).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=_(this,ve).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Zn(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return _(this,ve).findAll(t).map(({queryKey:e,state:n})=>{const s=n.data;return[e,s]})}setQueryData(t,e,n){const s=this.defaultQueryOptions({queryKey:t}),r=_(this,ve).get(s.queryHash),i=r==null?void 0:r.state.data,o=mb(e,i);if(o!==void 0)return _(this,ve).build(this,s).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return Le.batch(()=>_(this,ve).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,ve).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=_(this,ve);Le.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=_(this,ve);return Le.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Le.batch(()=>_(this,ve).findAll(t).map(r=>r.cancel(n)));return Promise.all(s).then(st).catch(st)}invalidateQueries(t,e={}){return Le.batch(()=>(_(this,ve).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=Le.batch(()=>_(this,ve).findAll(t).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let i=r.fetch(void 0,n);return n.throwOnError||(i=i.catch(st)),r.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(st)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=_(this,ve).build(this,e);return n.isStaleByTime(Zn(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(st).catch(st)}fetchInfiniteQuery(t){return t.behavior=mf(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(st).catch(st)}ensureInfiniteQueryData(t){return t.behavior=mf(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return $a.isOnline()?_(this,In).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ve)}getMutationCache(){return _(this,In)}getDefaultOptions(){return _(this,An)}setDefaultOptions(t){F(this,An,t)}setQueryDefaults(t,e){_(this,Cr).set(Ki(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[..._(this,Cr).values()],n={};return e.forEach(s=>{Xi(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){_(this,jr).set(Ki(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[..._(this,jr).values()],n={};return e.forEach(s=>{Xi(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={..._(this,An).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Cd(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===jd&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,An).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,ve).clear(),_(this,In).clear()}},ve=new WeakMap,In=new WeakMap,An=new WeakMap,Cr=new WeakMap,jr=new WeakMap,zn=new WeakMap,Nr=new WeakMap,Er=new WeakMap,Zp),w0=S.createContext(void 0),Ib=t=>{const e=S.useContext(w0);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ab=({client:t,children:e})=>(S.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(w0.Provider,{value:t,children:e})),k0=S.createContext(!1),zb=()=>S.useContext(k0);k0.Provider;function Bb(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Wb=S.createContext(Bb()),$b=()=>S.useContext(Wb),Hb=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?g0(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},Ub=t=>{S.useEffect(()=>{t.clearReset()},[t])},Vb=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:r})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(r&&t.data===void 0||g0(n,[t.error,s])),Qb=t=>{if(t.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Yb=(t,e)=>t.isLoading&&t.isFetching&&!e,Kb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,xf=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Xb(t,e,n){var f,p,x,y;const s=zb(),r=$b(),i=Ib(),o=i.defaultQueryOptions(t);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o);const a=i.getQueryCache().get(o.queryHash);o._optimisticResults=s?"isRestoring":"optimistic",Qb(o),Hb(o,r,a),Ub(r);const l=!i.getQueryCache().get(o.queryHash),[u]=S.useState(()=>new e(i,o)),d=u.getOptimisticResult(o),h=!s&&t.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const g=h?u.subscribe(Le.batchCalls(b)):st;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),S.useEffect(()=>{u.setOptions(o)},[o,u]),Kb(o,d))throw xf(o,u,r);if(Vb({result:d,errorResetBoundary:r,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw d.error;if((y=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||y.call(x,o,d),o.experimental_prefetchInRender&&!Ws&&Yb(d,s)){const b=l?xf(o,u,r):a==null?void 0:a.promise;b==null||b.catch(st).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?d:u.trackResult(d)}function yl(t,e){return Xb(t,Eb)}/**
41
+ * react-router v7.11.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var vf="popstate";function qb(t={}){function e(s,r){let{pathname:i,search:o,hash:a}=s.location;return wc("",{pathname:i,search:o,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:qi(r)}return Jb(e,n,null,t)}function ge(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Pt(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Gb(){return Math.random().toString(36).substring(2,10)}function bf(t,e){return{usr:t.state,key:t.key,idx:e}}function wc(t,e,n=null,s){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Wr(e):e,state:n,key:e&&e.key||s||Gb()}}function qi({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Wr(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function Jb(t,e,n,s={}){let{window:r=document.defaultView,v5Compat:i=!1}=s,o=r.history,a="POP",l=null,u=d();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function d(){return(o.state||{idx:null}).idx}function h(){a="POP";let b=d(),g=b==null?null:b-u;u=b,l&&l({action:a,location:y.location,delta:g})}function f(b,g){a="PUSH";let m=wc(y.location,b,g);u=d()+1;let v=bf(m,u),w=y.createHref(m);try{o.pushState(v,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(w)}i&&l&&l({action:a,location:y.location,delta:1})}function p(b,g){a="REPLACE";let m=wc(y.location,b,g);u=d();let v=bf(m,u),w=y.createHref(m);o.replaceState(v,"",w),i&&l&&l({action:a,location:y.location,delta:0})}function x(b){return Zb(b)}let y={get action(){return a},get location(){return t(r,o)},listen(b){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(vf,h),l=b,()=>{r.removeEventListener(vf,h),l=null}},createHref(b){return e(r,b)},createURL:x,encodeLocation(b){let g=x(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:p,go(b){return o.go(b)}};return y}function Zb(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ge(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:qi(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function _0(t,e,n="/"){return ew(t,e,n,!1)}function ew(t,e,n,s){let r=typeof e=="string"?Wr(e):e,i=wn(r.pathname||"/",n);if(i==null)return null;let o=S0(t);tw(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=hw(i);a=cw(o[l],u,s)}return a}function S0(t,e=[],n=[],s="",r=!1){let i=(o,a,l=r,u)=>{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(s)&&l)return;ge(d.relativePath.startsWith(s),`Absolute route path "${d.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(s.length)}let h=mn([s,d.relativePath]),f=n.concat(d);o.children&&o.children.length>0&&(ge(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),S0(o.children,e,f,h,l)),!(o.path==null&&!o.index)&&e.push({path:h,score:lw(h,o.index),routesMeta:f})};return t.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,a);else for(let u of C0(o.path))i(o,a,!0,u)}),e}function C0(t){let e=t.split("/");if(e.length===0)return[];let[n,...s]=e,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let o=C0(s.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),r&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function tw(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:uw(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var nw=/^:[\w-]+$/,sw=3,rw=2,iw=1,ow=10,aw=-2,wf=t=>t==="*";function lw(t,e){let n=t.split("/"),s=n.length;return n.some(wf)&&(s+=aw),e&&(s+=rw),n.filter(r=>!wf(r)).reduce((r,i)=>r+(nw.test(i)?sw:i===""?iw:ow),s)}function uw(t,e){return t.length===e.length&&t.slice(0,-1).every((s,r)=>s===e[r])?t[t.length-1]-e[e.length-1]:0}function cw(t,e,n=!1){let{routesMeta:s}=t,r={},i="/",o=[];for(let a=0;a<s.length;++a){let l=s[a],u=a===s.length-1,d=i==="/"?e:e.slice(i.length)||"/",h=Ha({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!h&&u&&n&&!s[s.length-1].route.index&&(h=Ha({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!h)return null;Object.assign(r,h.params),o.push({params:r,pathname:mn([i,h.pathname]),pathnameBase:mw(mn([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=mn([i,h.pathnameBase]))}return o}function Ha(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=dw(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let i=r[0],o=i.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:s.reduce((u,{paramName:d,isOptional:h},f)=>{if(d==="*"){let x=a[f]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const p=a[f];return h&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function dw(t,e=!1,n=!0){Pt(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(s.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),s]}function hw(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Pt(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function wn(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,s=t.charAt(n);return s&&s!=="/"?null:t.slice(n)||"/"}var j0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fw=t=>j0.test(t);function pw(t,e="/"){let{pathname:n,search:s="",hash:r=""}=typeof t=="string"?Wr(t):t,i;if(n)if(fw(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Pt(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?i=kf(n.substring(1),"/"):i=kf(n,e)}else i=e;return{pathname:i,search:yw(s),hash:xw(r)}}function kf(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Gl(t,e,n,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function gw(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Pd(t){let e=gw(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function Md(t,e,n,s=!1){let r;typeof t=="string"?r=Wr(t):(r={...t},ge(!r.pathname||!r.pathname.includes("?"),Gl("?","pathname","search",r)),ge(!r.pathname||!r.pathname.includes("#"),Gl("#","pathname","hash",r)),ge(!r.search||!r.search.includes("#"),Gl("#","search","hash",r)));let i=t===""||r.pathname==="",o=i?"/":r.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;r.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=pw(r,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}var mn=t=>t.join("/").replace(/\/\/+/g,"/"),mw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),yw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,xw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,vw=class{constructor(t,e,n,s=!1){this.status=t,this.statusText=e||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bw(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ww(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var N0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function E0(t,e){let n=t;if(typeof n!="string"||!j0.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,r=!1;if(N0)try{let i=new URL(window.location.href),o=n.startsWith("//")?new URL(i.protocol+n):new URL(n),a=wn(o.pathname,e);o.origin===i.origin&&a!=null?n=a+o.search+o.hash:r=!0}catch{Pt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var P0=["POST","PUT","PATCH","DELETE"];new Set(P0);var kw=["GET",...P0];new Set(kw);var $r=S.createContext(null);$r.displayName="DataRouter";var xl=S.createContext(null);xl.displayName="DataRouterState";var _w=S.createContext(!1),M0=S.createContext({isTransitioning:!1});M0.displayName="ViewTransition";var Sw=S.createContext(new Map);Sw.displayName="Fetchers";var Cw=S.createContext(null);Cw.displayName="Await";var yt=S.createContext(null);yt.displayName="Navigation";var go=S.createContext(null);go.displayName="Location";var Ht=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ht.displayName="Route";var Td=S.createContext(null);Td.displayName="RouteError";var T0="REACT_ROUTER_ERROR",jw="REDIRECT",Nw="ROUTE_ERROR_RESPONSE";function Ew(t){if(t.startsWith(`${T0}:${jw}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function Pw(t){if(t.startsWith(`${T0}:${Nw}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new vw(e.status,e.statusText,e.data)}catch{}}function Mw(t,{relative:e}={}){ge(Hr(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=S.useContext(yt),{hash:r,pathname:i,search:o}=yo(t,{relative:e}),a=i;return n!=="/"&&(a=i==="/"?n:mn([n,i])),s.createHref({pathname:a,search:o,hash:r})}function Hr(){return S.useContext(go)!=null}function _n(){return ge(Hr(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(go).location}var R0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function O0(t){S.useContext(yt).static||S.useLayoutEffect(t)}function mo(){let{isDataRoute:t}=S.useContext(Ht);return t?Hw():Tw()}function Tw(){ge(Hr(),"useNavigate() may be used only in the context of a <Router> component.");let t=S.useContext($r),{basename:e,navigator:n}=S.useContext(yt),{matches:s}=S.useContext(Ht),{pathname:r}=_n(),i=JSON.stringify(Pd(s)),o=S.useRef(!1);return O0(()=>{o.current=!0}),S.useCallback((l,u={})=>{if(Pt(o.current,R0),!o.current)return;if(typeof l=="number"){n.go(l);return}let d=Md(l,JSON.parse(i),r,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:mn([e,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[e,n,i,r,t])}S.createContext(null);function D0(){let{matches:t}=S.useContext(Ht),e=t[t.length-1];return e?e.params:{}}function yo(t,{relative:e}={}){let{matches:n}=S.useContext(Ht),{pathname:s}=_n(),r=JSON.stringify(Pd(n));return S.useMemo(()=>Md(t,JSON.parse(r),s,e==="path"),[t,r,s,e])}function Rw(t,e){return L0(t,e)}function L0(t,e,n,s,r){var m;ge(Hr(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=S.useContext(yt),{matches:o}=S.useContext(Ht),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",d=a?a.pathnameBase:"/",h=a&&a.route;{let v=h&&h.path||"";I0(u,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let f=_n(),p;if(e){let v=typeof e=="string"?Wr(e):e;ge(d==="/"||((m=v.pathname)==null?void 0:m.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${v.pathname}" was given in the \`location\` prop.`),p=v}else p=f;let x=p.pathname||"/",y=x;if(d!=="/"){let v=d.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let b=_0(t,{pathname:y});Pt(h||b!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Pt(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Iw(b&&b.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:mn([d,i.encodeLocation?i.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?d:mn([d,i.encodeLocation?i.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),o,n,s,r);return e&&g?S.createElement(go.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...p},navigationType:"POP"}},g):g}function Ow(){let t=$w(),e=bw(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:s},i={padding:"2px 4px",backgroundColor:s},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:i},"ErrorBoundary")," or"," ",S.createElement("code",{style:i},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},e),n?S.createElement("pre",{style:r},n):null,o)}var Dw=S.createElement(Ow,null),F0=class extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=Pw(t.digest);n&&(t=n)}let e=t!==void 0?S.createElement(Ht.Provider,{value:this.props.routeContext},S.createElement(Td.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?S.createElement(Lw,{error:t},e):e}};F0.contextType=_w;var Jl=new WeakMap;function Lw({children:t,error:e}){let{basename:n}=S.useContext(yt);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=Ew(e.digest);if(s){let r=Jl.get(e);if(r)throw r;let i=E0(s.location,n);if(N0&&!Jl.get(e))if(i.isExternal||s.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:s.replace}));throw Jl.set(e,o),o}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function Fw({routeContext:t,match:e,children:n}){let s=S.useContext($r);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),S.createElement(Ht.Provider,{value:t},n)}function Iw(t,e=[],n=null,s=null,r=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,o=n==null?void 0:n.errors;if(o!=null){let d=i.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);ge(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let a=!1,l=-1;if(n)for(let d=0;d<i.length;d++){let h=i[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(l=d),h.route.id){let{loaderData:f,errors:p}=n,x=h.route.loader&&!f.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||x){a=!0,l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}let u=n&&s?(d,h)=>{var f,p;s(d,{location:n.location,params:((p=(f=n.matches)==null?void 0:f[0])==null?void 0:p.params)??{},unstable_pattern:ww(n.matches),errorInfo:h})}:void 0;return i.reduceRight((d,h,f)=>{let p,x=!1,y=null,b=null;n&&(p=o&&h.route.id?o[h.route.id]:void 0,y=h.route.errorElement||Dw,a&&(l<0&&f===0?(I0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):l===f&&(x=!0,b=h.route.hydrateFallbackElement||null)));let g=e.concat(i.slice(0,f+1)),m=()=>{let v;return p?v=y:x?v=b:h.route.Component?v=S.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=d,S.createElement(Fw,{match:h,routeContext:{outlet:d,matches:g,isDataRoute:n!=null},children:v})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?S.createElement(F0,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):m()},null)}function Rd(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Aw(t){let e=S.useContext($r);return ge(e,Rd(t)),e}function zw(t){let e=S.useContext(xl);return ge(e,Rd(t)),e}function Bw(t){let e=S.useContext(Ht);return ge(e,Rd(t)),e}function Od(t){let e=Bw(t),n=e.matches[e.matches.length-1];return ge(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function Ww(){return Od("useRouteId")}function $w(){var s;let t=S.useContext(Td),e=zw("useRouteError"),n=Od("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function Hw(){let{router:t}=Aw("useNavigate"),e=Od("useNavigate"),n=S.useRef(!1);return O0(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{Pt(n.current,R0),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...i}))},[t,e])}var _f={};function I0(t,e,n){!e&&!_f[t]&&(_f[t]=!0,Pt(!1,n))}S.memo(Uw);function Uw({routes:t,future:e,state:n,onError:s}){return L0(t,void 0,n,s,e)}function Vw({to:t,replace:e,state:n,relative:s}){ge(Hr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=S.useContext(yt);Pt(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=S.useContext(Ht),{pathname:o}=_n(),a=mo(),l=Md(t,Pd(i),o,s==="path"),u=JSON.stringify(l);return S.useEffect(()=>{a(JSON.parse(u),{replace:e,state:n,relative:s})},[a,u,s,e,n]),null}function fi(t){ge(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Qw({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:r,static:i=!1,unstable_useTransitions:o}){ge(!Hr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=t.replace(/^\/*/,"/"),l=S.useMemo(()=>({basename:a,navigator:r,static:i,unstable_useTransitions:o,future:{}}),[a,r,i,o]);typeof n=="string"&&(n=Wr(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:p="default"}=n,x=S.useMemo(()=>{let y=wn(u,a);return y==null?null:{location:{pathname:y,search:d,hash:h,state:f,key:p},navigationType:s}},[a,u,d,h,f,p,s]);return Pt(x!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:S.createElement(yt.Provider,{value:l},S.createElement(go.Provider,{children:e,value:x}))}function Yw({children:t,location:e}){return Rw(kc(t),e)}function kc(t,e=[]){let n=[];return S.Children.forEach(t,(s,r)=>{if(!S.isValidElement(s))return;let i=[...e,r];if(s.type===S.Fragment){n.push.apply(n,kc(s.props.children,i));return}ge(s.type===fi,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ge(!s.props.index||!s.props.children,"An index route cannot have child routes.");let o={id:s.props.id||i.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=kc(s.props.children,i)),n.push(o)}),n}var ha="get",fa="application/x-www-form-urlencoded";function vl(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Kw(t){return vl(t)&&t.tagName.toLowerCase()==="button"}function Xw(t){return vl(t)&&t.tagName.toLowerCase()==="form"}function qw(t){return vl(t)&&t.tagName.toLowerCase()==="input"}function Gw(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Jw(t,e){return t.button===0&&(!e||e==="_self")&&!Gw(t)}var Wo=null;function Zw(){if(Wo===null)try{new FormData(document.createElement("form"),0),Wo=!1}catch{Wo=!0}return Wo}var e1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zl(t){return t!=null&&!e1.has(t)?(Pt(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fa}"`),null):t}function t1(t,e){let n,s,r,i,o;if(Xw(t)){let a=t.getAttribute("action");s=a?wn(a,e):null,n=t.getAttribute("method")||ha,r=Zl(t.getAttribute("enctype"))||fa,i=new FormData(t)}else if(Kw(t)||qw(t)&&(t.type==="submit"||t.type==="image")){let a=t.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=t.getAttribute("formaction")||a.getAttribute("action");if(s=l?wn(l,e):null,n=t.getAttribute("formmethod")||a.getAttribute("method")||ha,r=Zl(t.getAttribute("formenctype"))||Zl(a.getAttribute("enctype"))||fa,i=new FormData(a,t),!Zw()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?`${u}.`:"";i.append(`${f}x`,"0"),i.append(`${f}y`,"0")}else u&&i.append(u,h)}}else{if(vl(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ha,s=null,r=fa,o=t}return i&&r==="text/plain"&&(o=i,i=void 0),{action:s,method:n.toLowerCase(),encType:r,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Dd(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function n1(t,e,n){let s=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return s.pathname==="/"?s.pathname=`_root.${n}`:e&&wn(s.pathname,e)==="/"?s.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${n}`,s}async function s1(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function r1(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function i1(t,e,n){let s=await Promise.all(t.map(async r=>{let i=e.routes[r.route.id];if(i){let o=await s1(i,n);return o.links?o.links():[]}return[]}));return u1(s.flat(1).filter(r1).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function Sf(t,e,n,s,r,i){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>{var d;return n[u].pathname!==l.pathname||((d=n[u].route.path)==null?void 0:d.endsWith("*"))&&n[u].params["*"]!==l.params["*"]};return i==="assets"?e.filter((l,u)=>o(l,u)||a(l,u)):i==="data"?e.filter((l,u)=>{var h;let d=s.routes[l.route.id];if(!d||!d.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let f=l.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(t,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function o1(t,e,{includeHydrateFallback:n}={}){return a1(t.map(s=>{let r=e.routes[s.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function a1(t){return[...new Set(t)]}function l1(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function u1(t,e){let n=new Set;return new Set(e),t.reduce((s,r)=>{let i=JSON.stringify(l1(r));return n.has(i)||(n.add(i),s.push({key:i,link:r})),s},[])}function A0(){let t=S.useContext($r);return Dd(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function c1(){let t=S.useContext(xl);return Dd(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Ld=S.createContext(void 0);Ld.displayName="FrameworkContext";function z0(){let t=S.useContext(Ld);return Dd(t,"You must render this element inside a <HydratedRouter> element"),t}function d1(t,e){let n=S.useContext(Ld),[s,r]=S.useState(!1),[i,o]=S.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=e,f=S.useRef(null);S.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let y=g=>{g.forEach(m=>{o(m.isIntersecting)})},b=new IntersectionObserver(y,{threshold:.5});return f.current&&b.observe(f.current),()=>{b.disconnect()}}},[t]),S.useEffect(()=>{if(s){let y=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(y)}}},[s]);let p=()=>{r(!0)},x=()=>{r(!1),o(!1)};return n?t!=="intent"?[i,f,{}]:[i,f,{onFocus:ei(a,p),onBlur:ei(l,x),onMouseEnter:ei(u,p),onMouseLeave:ei(d,x),onTouchStart:ei(h,p)}]:[!1,f,{}]}function ei(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function h1({page:t,...e}){let{router:n}=A0(),s=S.useMemo(()=>_0(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?S.createElement(p1,{page:t,matches:s,...e}):null}function f1(t){let{manifest:e,routeModules:n}=z0(),[s,r]=S.useState([]);return S.useEffect(()=>{let i=!1;return i1(t,e,n).then(o=>{i||r(o)}),()=>{i=!0}},[t,e,n]),s}function p1({page:t,matches:e,...n}){let s=_n(),{manifest:r,routeModules:i}=z0(),{basename:o}=A0(),{loaderData:a,matches:l}=c1(),u=S.useMemo(()=>Sf(t,e,l,r,s,"data"),[t,e,l,r,s]),d=S.useMemo(()=>Sf(t,e,l,r,s,"assets"),[t,e,l,r,s]),h=S.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let x=new Set,y=!1;if(e.forEach(g=>{var v;let m=r.routes[g.route.id];!m||!m.hasLoader||(!u.some(w=>w.route.id===g.route.id)&&g.route.id in a&&((v=i[g.route.id])!=null&&v.shouldRevalidate)||m.hasClientLoader?y=!0:x.add(g.route.id))}),x.size===0)return[];let b=n1(t,o,"data");return y&&x.size>0&&b.searchParams.set("_routes",e.filter(g=>x.has(g.route.id)).map(g=>g.route.id).join(",")),[b.pathname+b.search]},[o,a,s,r,u,e,t,i]),f=S.useMemo(()=>o1(d,r),[d,r]),p=f1(d);return S.createElement(S.Fragment,null,h.map(x=>S.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),f.map(x=>S.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),p.map(({key:x,link:y})=>S.createElement("link",{key:x,nonce:n.nonce,...y})))}function g1(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var m1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{m1&&(window.__reactRouterVersion="7.11.0")}catch{}function y1({basename:t,children:e,unstable_useTransitions:n,window:s}){let r=S.useRef();r.current==null&&(r.current=qb({window:s,v5Compat:!0}));let i=r.current,[o,a]=S.useState({action:i.action,location:i.location}),l=S.useCallback(u=>{n===!1?a(u):S.startTransition(()=>a(u))},[n]);return S.useLayoutEffect(()=>i.listen(l),[i,l]),S.createElement(Qw,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:i,unstable_useTransitions:n})}var B0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fd=S.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:r,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},x){let{basename:y,unstable_useTransitions:b}=S.useContext(yt),g=typeof u=="string"&&B0.test(u),m=E0(u,y);u=m.to;let v=Mw(u,{relative:r}),[w,j,E]=d1(s,p),k=w1(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:r,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:b});function N(C){e&&e(C),C.defaultPrevented||k(C)}let R=S.createElement("a",{...p,...E,href:m.absoluteURL||v,onClick:m.isExternal||i?e:N,ref:g1(x,j),target:l,"data-discover":!g&&n==="render"?"true":void 0});return w&&!g?S.createElement(S.Fragment,null,R,S.createElement(h1,{page:v})):R});Fd.displayName="Link";var x1=S.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:r=!1,style:i,to:o,viewTransition:a,children:l,...u},d){let h=yo(o,{relative:u.relative}),f=_n(),p=S.useContext(xl),{navigator:x,basename:y}=S.useContext(yt),b=p!=null&&j1(h)&&a===!0,g=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,m=f.pathname,v=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;n||(m=m.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&y&&(v=wn(v,y)||v);const w=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let j=m===g||!r&&m.startsWith(g)&&m.charAt(w)==="/",E=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)==="/"),k={isActive:j,isPending:E,isTransitioning:b},N=j?e:void 0,R;typeof s=="function"?R=s(k):R=[s,j?"active":null,E?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let C=typeof i=="function"?i(k):i;return S.createElement(Fd,{...u,"aria-current":N,className:R,ref:d,style:C,to:o,viewTransition:a},typeof l=="function"?l(k):l)});x1.displayName="NavLink";var v1=S.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:r,state:i,method:o=ha,action:a,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},x)=>{let{unstable_useTransitions:y}=S.useContext(yt),b=S1(),g=C1(a,{relative:u}),m=o.toLowerCase()==="get"?"get":"post",v=typeof a=="string"&&B0.test(a),w=j=>{if(l&&l(j),j.defaultPrevented)return;j.preventDefault();let E=j.nativeEvent.submitter,k=(E==null?void 0:E.getAttribute("formmethod"))||o,N=()=>b(E||j.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:r,state:i,relative:u,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f});y&&n!==!1?S.startTransition(()=>N()):N()};return S.createElement("form",{ref:x,method:m,action:g,onSubmit:s?l:w,...p,"data-discover":!v&&t==="render"?"true":void 0})});v1.displayName="Form";function b1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function W0(t){let e=S.useContext($r);return ge(e,b1(t)),e}function w1(t,{target:e,replace:n,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a,unstable_useTransitions:l}={}){let u=mo(),d=_n(),h=yo(t,{relative:i});return S.useCallback(f=>{if(Jw(f,e)){f.preventDefault();let p=n!==void 0?n:qi(d)===qi(h),x=()=>u(t,{replace:p,state:s,preventScrollReset:r,relative:i,viewTransition:o,unstable_defaultShouldRevalidate:a});l?S.startTransition(()=>x()):x()}},[d,u,h,n,s,e,t,r,i,o,a,l])}var k1=0,_1=()=>`__${String(++k1)}__`;function S1(){let{router:t}=W0("useSubmit"),{basename:e}=S.useContext(yt),n=Ww(),s=t.fetch,r=t.navigate;return S.useCallback(async(i,o={})=>{let{action:a,method:l,encType:u,formData:d,body:h}=t1(i,e);if(o.navigate===!1){let f=o.fetcherKey||_1();await s(f,n,o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||l,formEncType:o.encType||u,flushSync:o.flushSync})}else await r(o.action||a,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:d,body:h,formMethod:o.method||l,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[s,r,e,n])}function C1(t,{relative:e}={}){let{basename:n}=S.useContext(yt),s=S.useContext(Ht);ge(s,"useFormAction must be used inside a RouteContext");let[r]=s.matches.slice(-1),i={...yo(t||".",{relative:e})},o=_n();if(t==null){i.search=o.search;let a=new URLSearchParams(i.search),l=a.getAll("index");if(l.some(d=>d==="")){a.delete("index"),l.filter(h=>h).forEach(h=>a.append("index",h));let d=a.toString();i.search=d?`?${d}`:""}}return(!t||t===".")&&r.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:mn([n,i.pathname])),qi(i)}function j1(t,{relative:e}={}){let n=S.useContext(M0);ge(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=W0("useViewTransitionState"),r=yo(t,{relative:e});if(!n.isTransitioning)return!1;let i=wn(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=wn(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Ha(r.pathname,o)!=null||Ha(r.pathname,i)!=null}function Ut(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function $s(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}const $0=6048e5,N1=864e5;let E1={};function bl(){return E1}function Gi(t,e){var a,l,u,d;const n=bl(),s=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,r=Ut(t),i=r.getDay(),o=(i<s?7:0)+i-s;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function Ua(t){return Gi(t,{weekStartsOn:1})}function H0(t){const e=Ut(t),n=e.getFullYear(),s=$s(t,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const r=Ua(s),i=$s(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Ua(i);return e.getTime()>=r.getTime()?n+1:e.getTime()>=o.getTime()?n:n-1}function Cf(t){const e=Ut(t);return e.setHours(0,0,0,0),e}function jf(t){const e=Ut(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function P1(t,e){const n=Cf(t),s=Cf(e),r=+n-jf(n),i=+s-jf(s);return Math.round((r-i)/N1)}function M1(t){const e=H0(t),n=$s(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Ua(n)}function T1(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function R1(t){if(!T1(t)&&typeof t!="number")return!1;const e=Ut(t);return!isNaN(Number(e))}function O1(t){const e=Ut(t),n=$s(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}const D1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},L1=(t,e,n)=>{let s;const r=D1[t];return typeof r=="string"?s=r:e===1?s=r.one:s=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function eu(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const F1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},A1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},z1={date:eu({formats:F1,defaultWidth:"full"}),time:eu({formats:I1,defaultWidth:"full"}),dateTime:eu({formats:A1,defaultWidth:"full"})},B1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},W1=(t,e,n,s)=>B1[t];function ti(t){return(e,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n!=null&&n.width?String(n.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return r[i]}}const $1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},U1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},V1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Q1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Y1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K1=(t,e)=>{const n=Number(t),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},X1={ordinalNumber:K1,era:ti({values:$1,defaultWidth:"wide"}),quarter:ti({values:H1,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ti({values:U1,defaultWidth:"wide"}),day:ti({values:V1,defaultWidth:"wide"}),dayPeriod:ti({values:Q1,defaultWidth:"wide",formattingValues:Y1,defaultFormattingWidth:"wide"})};function ni(t){return(e,n={})=>{const s=n.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=e.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?G1(a,h=>h.test(o)):q1(a,h=>h.test(o));let u;u=t.valueCallback?t.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function q1(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function G1(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function J1(t){return(e,n={})=>{const s=e.match(t.matchPattern);if(!s)return null;const r=s[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(r.length);return{value:o,rest:a}}}const Z1=/^(\d+)(th|st|nd|rd)?/i,ek=/\d+/i,tk={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},nk={any:[/^b/i,/^(a|c)/i]},sk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rk={any:[/1/i,/2/i,/3/i,/4/i]},ik={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ok={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ak={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},lk={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uk={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ck={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dk={ordinalNumber:J1({matchPattern:Z1,parsePattern:ek,valueCallback:t=>parseInt(t,10)}),era:ni({matchPatterns:tk,defaultMatchWidth:"wide",parsePatterns:nk,defaultParseWidth:"any"}),quarter:ni({matchPatterns:sk,defaultMatchWidth:"wide",parsePatterns:rk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ni({matchPatterns:ik,defaultMatchWidth:"wide",parsePatterns:ok,defaultParseWidth:"any"}),day:ni({matchPatterns:ak,defaultMatchWidth:"wide",parsePatterns:lk,defaultParseWidth:"any"}),dayPeriod:ni({matchPatterns:uk,defaultMatchWidth:"any",parsePatterns:ck,defaultParseWidth:"any"})},hk={code:"en-US",formatDistance:L1,formatLong:z1,formatRelative:W1,localize:X1,match:dk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fk(t){const e=Ut(t);return P1(e,O1(e))+1}function pk(t){const e=Ut(t),n=+Ua(e)-+M1(e);return Math.round(n/$0)+1}function U0(t,e){var d,h,f,p;const n=Ut(t),s=n.getFullYear(),r=bl(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=$s(t,0);o.setFullYear(s+1,0,i),o.setHours(0,0,0,0);const a=Gi(o,e),l=$s(t,0);l.setFullYear(s,0,i),l.setHours(0,0,0,0);const u=Gi(l,e);return n.getTime()>=a.getTime()?s+1:n.getTime()>=u.getTime()?s:s-1}function gk(t,e){var a,l,u,d;const n=bl(),s=(e==null?void 0:e.firstWeekContainsDate)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,r=U0(t,e),i=$s(t,0);return i.setFullYear(r,0,s),i.setHours(0,0,0,0),Gi(i,e)}function mk(t,e){const n=Ut(t),s=+Gi(n,e)-+gk(n,e);return Math.round(s/$0)+1}function re(t,e){const n=t<0?"-":"",s=Math.abs(t).toString().padStart(e,"0");return n+s}const Cn={y(t,e){const n=t.getFullYear(),s=n>0?n:1-n;return re(e==="yy"?s%100:s,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):re(n+1,2)},d(t,e){return re(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return re(t.getHours()%12||12,e.length)},H(t,e){return re(t.getHours(),e.length)},m(t,e){return re(t.getMinutes(),e.length)},s(t,e){return re(t.getSeconds(),e.length)},S(t,e){const n=e.length,s=t.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return re(r,e.length)}},Ys={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Nf={G:function(t,e,n){const s=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const s=t.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Cn.y(t,e)},Y:function(t,e,n,s){const r=U0(t,s),i=r>0?r:1-r;if(e==="YY"){const o=i%100;return re(o,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):re(i,e.length)},R:function(t,e){const n=H0(t);return re(n,e.length)},u:function(t,e){const n=t.getFullYear();return re(n,e.length)},Q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return re(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(t,e,n){const s=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return re(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(t,e,n){const s=t.getMonth();switch(e){case"M":case"MM":return Cn.M(t,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(t,e,n){const s=t.getMonth();switch(e){case"L":return String(s+1);case"LL":return re(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(t,e,n,s){const r=mk(t,s);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):re(r,e.length)},I:function(t,e,n){const s=pk(t);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):re(s,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Cn.d(t,e)},D:function(t,e,n){const s=fk(t);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):re(s,e.length)},E:function(t,e,n){const s=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(t,e,n,s){const r=t.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return re(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,s){const r=t.getDay(),i=(r-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return re(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const s=t.getDay(),r=s===0?7:s;switch(e){case"i":return String(r);case"ii":return re(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const s=t.getHours();let r;switch(s===12?r=Ys.noon:s===0?r=Ys.midnight:r=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const s=t.getHours();let r;switch(s>=17?r=Ys.evening:s>=12?r=Ys.afternoon:s>=4?r=Ys.morning:r=Ys.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let s=t.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Cn.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Cn.H(t,e)},K:function(t,e,n){const s=t.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):re(s,e.length)},k:function(t,e,n){let s=t.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):re(s,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Cn.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Cn.s(t,e)},S:function(t,e){return Cn.S(t,e)},X:function(t,e,n){const s=t.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Pf(s);case"XXXX":case"XX":return ys(s);case"XXXXX":case"XXX":default:return ys(s,":")}},x:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"x":return Pf(s);case"xxxx":case"xx":return ys(s);case"xxxxx":case"xxx":default:return ys(s,":")}},O:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ef(s,":");case"OOOO":default:return"GMT"+ys(s,":")}},z:function(t,e,n){const s=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ef(s,":");case"zzzz":default:return"GMT"+ys(s,":")}},t:function(t,e,n){const s=Math.trunc(t.getTime()/1e3);return re(s,e.length)},T:function(t,e,n){const s=t.getTime();return re(s,e.length)}};function Ef(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),r=Math.trunc(s/60),i=s%60;return i===0?n+String(r):n+String(r)+e+re(i,2)}function Pf(t,e){return t%60===0?(t>0?"-":"+")+re(Math.abs(t)/60,2):ys(t,e)}function ys(t,e=""){const n=t>0?"-":"+",s=Math.abs(t),r=re(Math.trunc(s/60),2),i=re(s%60,2);return n+r+e+i}const Mf=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},V0=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},yk=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return Mf(t,e);let i;switch(s){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",Mf(s,e)).replace("{{time}}",V0(r,e))},xk={p:V0,P:yk},vk=/^D+$/,bk=/^Y+$/,wk=["D","DD","YY","YYYY"];function kk(t){return vk.test(t)}function _k(t){return bk.test(t)}function Sk(t,e,n){const s=Ck(t,e,n);if(console.warn(s),wk.includes(t))throw new RangeError(s)}function Ck(t,e,n){const s=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const jk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ek=/^'([^]*?)'?$/,Pk=/''/g,Mk=/[a-zA-Z]/;function ht(t,e,n){var d,h,f,p;const s=bl(),r=s.locale??hk,i=s.firstWeekContainsDate??((h=(d=s.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=s.weekStartsOn??((p=(f=s.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,a=Ut(t);if(!R1(a))throw new RangeError("Invalid time value");let l=e.match(Nk).map(x=>{const y=x[0];if(y==="p"||y==="P"){const b=xk[y];return b(x,r.formatLong)}return x}).join("").match(jk).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const y=x[0];if(y==="'")return{isToken:!1,value:Tk(x)};if(Nf[y])return{isToken:!0,value:x};if(y.match(Mk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:x}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:r};return l.map(x=>{if(!x.isToken)return x.value;const y=x.value;(_k(y)||kk(y))&&Sk(y,e,String(t));const b=Nf[y[0]];return b(a,y,r.localize,u)}).join("")}function Tk(t){const e=t.match(Ek);return e?e[1].replace(Pk,"'"):t}function Rk({name:t,sessionCount:e,lastActivity:n,sessions:s,selectedId:r,onSelectSession:i,initialExpanded:o=!1}){const[a,l]=S.useState(o);return S.useEffect(()=>{r&&s.some(d=>{var h;return d.id===r||((h=d.agentSessions)==null?void 0:h.some(f=>f.id===r))})&&l(!0)},[r,s]),c.jsxs("div",{className:"border-b border-gray-700",children:[c.jsx("button",{onClick:()=>l(!a),className:"sticky top-0 z-10 w-full text-left p-4 bg-gray-900 hover:bg-gray-800 transition-colors flex items-center justify-between",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("svg",{className:`w-4 h-4 transition-transform ${a?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),c.jsx("span",{className:"font-semibold text-sm truncate",children:t})]}),c.jsxs("div",{className:"text-xs text-gray-400 mt-1 ml-6",children:[e," session",e!==1?"s":""," · Last activity"," ",ht(new Date(n),"PPp")]})]})}),a&&c.jsx("div",{className:"bg-gray-900/50",children:s.map(u=>c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>i(u.id),className:`w-full text-left px-4 py-3 pl-8 hover:bg-gray-700/50 transition-colors border-l-2 ${r===u.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[u.title&&c.jsx("div",{className:"text-sm font-medium text-gray-200 mb-1 truncate",children:u.title}),c.jsx("div",{className:"text-xs text-gray-400",children:ht(new Date(u.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[u.messageCount," message",u.messageCount!==1?"s":"",u.agentSessions&&u.agentSessions.length>0&&c.jsxs("span",{className:"ml-2",children:["· ",u.agentSessions.length," task",u.agentSessions.length!==1?"s":""]})]})]}),u.agentSessions&&u.agentSessions.length>0&&c.jsx("div",{className:"bg-gray-900/70",children:u.agentSessions.map(d=>c.jsxs("button",{onClick:()=>i(d.id),className:`w-full text-left px-4 py-2 pl-14 hover:bg-gray-700/50 transition-colors border-l-2 ${r===d.id?"bg-gray-700 border-blue-500":"border-transparent"}`,children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-purple-900/50 text-purple-300 rounded",children:"TASK"}),d.title&&c.jsx("span",{className:"text-sm font-medium text-gray-300 truncate",children:d.title})]}),c.jsx("div",{className:"text-xs text-gray-400",children:ht(new Date(d.timestamp),"PPpp")}),c.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[d.messageCount," message",d.messageCount!==1?"s":""]})]},d.id))})]},u.id))})]})}function Ok({projects:t,selectedId:e,onSelect:n}){const s=r=>e?r.sessions.some(i=>{var o;return i.id===e||((o=i.agentSessions)==null?void 0:o.some(a=>a.id===e))}):!1;return c.jsx("div",{children:t.map(r=>c.jsx(Rk,{id:r.id,name:r.name,sessionCount:r.sessionCount,lastActivity:r.lastActivity,sessions:r.sessions,selectedId:e,onSelectSession:n,initialExpanded:s(r)},r.id))})}function Dk({messages:t,activeId:e,onNavigate:n}){const[s,r]=S.useState([]),i=S.useRef(null),o=S.useRef(null);S.useEffect(()=>{const l=t.map((u,d)=>{var x;const h=`message-${d}`;let f="";const p=[];if((x=u.message)!=null&&x.content&&Array.isArray(u.message.content)){const y=u.message.content.find(b=>b.type==="text");y&&(f=y.text.slice(0,50)+(y.text.length>50?"...":"")),u.message.content.forEach(b=>{b.type==="tool_use"?p.push({name:b.name,type:"tool_use"}):b.type==="tool_result"&&p.push({name:"Tool Result",type:"tool_result"})})}return{id:h,type:u.type||"system",text:f,toolUses:p,timestamp:u.timestamp}});r(l)},[t]),S.useEffect(()=>{if(i.current&&o.current){const l=o.current,u=i.current,d=l.getBoundingClientRect(),h=u.getBoundingClientRect();(h.top<d.top||h.bottom>d.bottom)&&u.scrollIntoView({behavior:"smooth",block:"nearest"})}},[e]);const a=l=>{n(l,!0)};return c.jsxs("div",{className:"w-full h-full flex flex-col border-l border-gray-700 bg-gray-800",children:[c.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800 flex-shrink-0",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Table of Contents"}),c.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[s.length," messages"]})]}),c.jsx("nav",{ref:o,className:"p-2 flex-1 overflow-y-auto",children:s.map((l,u)=>c.jsx("div",{className:"mb-1",children:c.jsxs("button",{ref:e===l.id?i:null,onClick:()=>a(l.id),className:`w-full text-left px-3 py-2 rounded text-xs transition-colors ${e===l.id?"bg-blue-900/50 text-blue-200 border-l-2 border-blue-400":"text-gray-400 hover:bg-gray-700 hover:text-gray-200"}`,style:{scrollMarginTop:"16px",scrollMarginBottom:"16px"},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("span",{className:`px-1.5 py-0.5 text-[10px] rounded ${l.type==="user"?"bg-blue-900/50 text-blue-300":l.type==="assistant"?"bg-green-900/50 text-green-300":"bg-gray-700 text-gray-400"}`,children:l.type}),c.jsxs("span",{className:"text-gray-500",children:["#",u+1]})]}),l.text&&c.jsx("div",{className:"text-gray-300 line-clamp-2 leading-tight",children:l.text}),l.toolUses.length>0&&c.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.toolUses.map((d,h)=>c.jsxs("span",{className:`px-1.5 py-0.5 text-[10px] rounded font-mono ${d.type==="tool_result"?"bg-green-900/30 text-green-400":"bg-yellow-900/30 text-yellow-400"}`,children:[d.type==="tool_result"?"✓":"🔧"," ",d.name]},h))})]})},l.id))})]})}const _c=256,Tf=640,Lk=896,Fk=Lk+_c;function Ik({sessionId:t,sessionInfo:e}){var T,A,B;const n=mo(),[s,r]=S.useState(null),[i,o]=S.useState(!0),[a,l]=S.useState(null),u=S.useRef(new Map),d=S.useRef(!1),h=S.useRef(null),f=S.useRef(null),p=S.useRef(null),x=S.useRef(null),y=S.useRef(!1),b=S.useRef(0),g=S.useRef(0),m=S.useRef(null),v=S.useRef(null),w=S.useRef(null),j=S.useRef(null),E=S.useRef(null),k=S.useRef(null),N=S.useRef(null),R=S.useRef(null),C=S.useRef(0),{data:P,isLoading:z,error:Y}=yl({queryKey:["session",t],queryFn:async()=>{const D=await fetch(`/api/sessions/${t}`);if(!D.ok)throw new Error("Failed to fetch session");return D.json()}});S.useEffect(()=>{b.current=0,g.current=0,m.current!==null&&(cancelAnimationFrame(m.current),m.current=null),C.current=0,r(null),h.current=null,y.current=!1;const D=R.current;D&&(D.scrollTop=0)},[t]);const we=D=>{const $=w.current;if(!$)return;const K=14+D*8,V=1.25+D*.25,U=D,G=D,et=Math.max(0,1-U);$.style.padding=`${K}px 24px`,j.current&&(j.current.style.fontSize=`${V}rem`),E.current&&(E.current.style.opacity=`${U}`,E.current.style.height=U>0?"auto":"0"),k.current&&(k.current.style.opacity=`${G}`,k.current.style.height=G>0?"auto":"0",k.current.style.marginTop=G>0?"1rem":"0"),N.current&&(N.current.style.opacity=`${et}`,N.current.style.pointerEvents=et>0?"auto":"none",N.current.style.position=et>0?"static":"absolute")};S.useEffect(()=>{const D=a;if(!D)return;const $=()=>{var Ae;const V=b.current,U=g.current,G=U+(V-U)*.2,et=D.scrollHeight-(G+D.clientHeight),bo=et<=5,xt=G<C.current;let Qe=y.current;Qe?et>40&&(Qe=!1):bo&&(Qe=!0),y.current=Qe;const cs=Math.max(0,1-(xt?0:Qe?80:G)/80);we(cs),g.current=G,C.current=G,Math.abs(V-G)>.5?m.current=requestAnimationFrame($):(g.current=V,C.current=V,m.current=null,Qe&&((Ae=p.current)==null||Ae.call(p)))},K=()=>{b.current=D.scrollTop,m.current===null&&(m.current=requestAnimationFrame($))};return D.addEventListener("scroll",K),()=>{D.removeEventListener("scroll",K),m.current!==null&&(cancelAnimationFrame(m.current),m.current=null)}},[t,a]),S.useEffect(()=>{if(!v.current)return;const D=v.current.parentElement??v.current,$=U=>{o(U>=Fk)},K=new ResizeObserver(U=>{for(const G of U)$(G.contentRect.width)}),V=D.getBoundingClientRect().width;return $(V),K.observe(D),()=>{K.disconnect()}},[]),S.useEffect(()=>{var bo;if(!((bo=P==null?void 0:P.session)!=null&&bo.messages))return;const D=R.current;if(!D)return;const $=new Set;let K=null;const V=()=>{if(d.current)return;const xt=[];u.current.forEach((Ye,ce)=>{const Oe=Ye.getBoundingClientRect();xt.push({id:ce,element:Ye,rect:Oe})}),xt.sort((Ye,ce)=>Ye.rect.top-ce.rect.top);const Qe=D.getBoundingClientRect(),Vt=Qe.top,cs=Qe.bottom;let Ae=null;for(const Ye of xt){const ce=Ye.rect.top>=Vt&&Ye.rect.bottom<=cs,Oe=Ye.rect.bottom>Vt&&Ye.rect.top<cs;if(ce){Ae=Ye.id;break}else Oe&&!Ae&&(Ae=Ye.id)}Ae&&Ae!==h.current&&r(Ae)},U=()=>{const xt=x.current;if(d.current&&xt){const ce=u.current.get(xt);if(ce){const Oe=D.getBoundingClientRect(),wo=ce.getBoundingClientRect();if(!(wo.top>=Oe.top&&wo.top<=Oe.top+5))return}d.current=!1,x.current=null}if(y.current){const ce=P.session.messages.length-1,Oe=ce>=0?`message-${ce}`:null;Oe&&Oe!==h.current&&r(Oe);return}if($.size===0){V();return}const Qe=D.getBoundingClientRect(),Vt=Qe.top,cs=Qe.bottom;let Ae=null;const Ye=Array.from($).map(ce=>{const Oe=u.current.get(ce);return Oe?{id:ce,rect:Oe.getBoundingClientRect()}:null}).filter(ce=>!!ce);if(Ye.length===0){V();return}Ye.sort((ce,Oe)=>ce.rect.top-Oe.rect.top);for(const ce of Ye){const Oe=ce.rect.top>=Vt&&ce.rect.bottom<=cs,wo=ce.rect.bottom>Vt&&ce.rect.top<cs;if(Oe){Ae=ce.id;break}else wo&&!Ae&&(Ae=ce.id)}Ae&&Ae!==h.current&&r(Ae)},G=()=>{K!==null&&cancelAnimationFrame(K),K=requestAnimationFrame(()=>{K=null,U()})};p.current=U;const et=new IntersectionObserver(xt=>{for(const Qe of xt){const Vt=Qe.target.dataset.messageId;Vt&&(Qe.isIntersecting?$.add(Vt):$.delete(Vt))}G()},{root:D,threshold:[0,.1,.5,1]});return u.current.forEach(xt=>et.observe(xt)),G(),()=>{et.disconnect(),p.current=null,K!==null&&cancelAnimationFrame(K)}},[(T=P==null?void 0:P.session)==null?void 0:T.messages,a]),S.useEffect(()=>{h.current=s},[s]),S.useEffect(()=>{we(1)},[(A=P==null?void 0:P.session)==null?void 0:A.id]);const se=S.useCallback(D=>{R.current=D,l($=>$===D?$:D)},[]),W=(D,$=!1)=>{if(r(D),$){d.current=!0,x.current=D,f.current&&(clearTimeout(f.current),f.current=null);const K=u.current.get(D);K&&K.scrollIntoView({behavior:"smooth",block:"start"}),f.current=setTimeout(()=>{var V;d.current=!1,x.current=null,f.current=null,(V=p.current)==null||V.call(p)},1500)}};if(S.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),z&&!P&&!e)return c.jsxs("div",{className:"h-full flex min-w-0",children:[c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Tf}px`},children:[c.jsx("div",{className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 p-6",children:c.jsxs("div",{className:"animate-pulse",children:[c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-3"}),c.jsx("div",{className:"h-5 bg-gray-700 rounded w-1/3 mb-4"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-24"})]})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:c.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(D=>c.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},D))})})]}),i&&c.jsx("div",{style:{width:`${_c}px`,flexShrink:0},className:"border-l border-gray-700 bg-gray-800/30 p-4",children:c.jsxs("div",{className:"animate-pulse space-y-3",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-3/4"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4"})]})})]});if(Y)return c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsxs("div",{className:"text-red-400",children:["Error: ",Y.message]})});const O=(P==null?void 0:P.session)||e;return c.jsxs("div",{ref:v,className:"h-full flex min-w-0",children:[c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",style:{minWidth:`${Tf}px`},children:[c.jsxs("div",{ref:w,className:"border-b border-gray-700 bg-gray-800 flex-shrink-0 transition-all duration-200",style:{padding:"22px 24px"},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[(O==null?void 0:O.isAgent)&&c.jsx("span",{className:"px-2 py-1 text-xs bg-purple-900/50 text-purple-300 rounded font-semibold",children:"TASK"}),c.jsx("h2",{ref:j,className:"font-bold truncate flex-1 transition-all duration-200",style:{fontSize:"1.5rem"},children:(O==null?void 0:O.title)||"Untitled Session"}),c.jsx("button",{ref:N,onClick:()=>(O==null?void 0:O.projectId)&&n(`/projects/${O.projectId}`),className:"px-2 py-1 text-xs bg-gray-700 text-gray-300 rounded transition-all duration-200 hover:bg-gray-600 hover:text-white",style:{opacity:0},children:(O==null?void 0:O.projectName)||(O==null?void 0:O.projectId)}),c.jsx("button",{onClick:()=>(O==null?void 0:O.projectId)&&n(`/projects/${O.projectId}`),className:"flex items-center justify-center p-2 rounded-lg transition-colors flex-shrink-0 bg-gray-700 text-gray-300 hover:bg-gray-600 hover:text-white",title:"Project Dashboard",children:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})})]}),c.jsx("div",{ref:E,onClick:()=>(O==null?void 0:O.projectId)&&n(`/projects/${O.projectId}`),className:"text-xl text-gray-300 transition-all duration-200 hover:text-white hover:underline cursor-pointer",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"-2px"},children:(O==null?void 0:O.projectName)||(O==null?void 0:O.projectId)}),c.jsxs("div",{ref:k,className:"flex items-center gap-3 text-sm text-gray-400 transition-all duration-200",style:{opacity:1,height:"auto",overflow:"hidden",marginTop:"1rem"},children:[c.jsx("span",{children:(O==null?void 0:O.timestamp)&&ht(new Date(O.timestamp),"PPpp")}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:[(O==null?void 0:O.messageCount)||0," message",(O==null?void 0:O.messageCount)!==1?"s":""]}),(O==null?void 0:O.agentSessions)&&O.agentSessions.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"•"}),c.jsxs("span",{children:[O.agentSessions.length," task",O.agentSessions.length!==1?"s":""]})]})]})]}),c.jsx("div",{ref:se,className:"flex-1 overflow-y-auto p-6",children:z&&!(O!=null&&O.messages)?c.jsx("div",{className:"max-w-4xl mx-auto space-y-6 animate-pulse",children:[1,2,3,4].map(D=>c.jsxs("div",{className:"border-l-2 border-gray-700 pl-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-8"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-16"})]}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-full"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-5/6"}),c.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5"})]})})]},D))}):c.jsx("div",{className:"max-w-4xl mx-auto space-y-6",children:(B=O==null?void 0:O.messages)==null?void 0:B.map((D,$)=>{var V;const K=`message-${$}`;return c.jsxs("div",{ref:U=>{U?u.current.set(K,U):u.current.delete(K)},"data-message-id":K,className:"border-l-2 border-gray-700 pl-4",style:{scrollMarginTop:"24px"},children:[c.jsx("div",{className:"flex items-start justify-between mb-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`px-2 py-1 text-xs rounded ${D.type==="user"?"bg-blue-900 text-blue-200":D.type==="assistant"?"bg-green-900 text-green-200":"bg-gray-700 text-gray-300"}`,children:D.type||"system"}),c.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["#",$+1]}),D.timestamp&&c.jsx("span",{className:"text-xs text-gray-500",children:ht(new Date(D.timestamp),"HH:mm:ss")})]})}),c.jsx("div",{className:"bg-gray-800 rounded-lg p-4 text-sm",children:(V=D.message)!=null&&V.content&&Array.isArray(D.message.content)?c.jsx("div",{className:"space-y-2",children:D.message.content.map((U,G)=>c.jsxs("div",{children:[U.type==="text"&&c.jsx("p",{className:"whitespace-pre-wrap",children:U.text}),U.type==="tool_use"&&c.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("div",{className:"text-yellow-400 font-mono text-xs",children:["🔧 ",U.name]}),U.name==="Task"&&U.agentId&&c.jsx(Fd,{to:`/sessions/agent-${U.agentId}`,className:"px-2 py-1 text-xs bg-purple-700 hover:bg-purple-600 text-purple-100 rounded transition-colors",children:"View Task →"})]}),c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(U.input,null,2)})]}),U.type==="tool_result"&&c.jsxs("div",{className:"bg-gray-900 p-3 rounded border border-gray-700",children:[c.jsx("div",{className:"text-green-400 font-mono text-xs mb-2",children:"✓ Tool Result"}),c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:typeof U.content=="string"?U.content:JSON.stringify(U.content,null,2)})]})]},G))}):c.jsx("pre",{className:"text-xs overflow-x-auto text-gray-400",children:JSON.stringify(D,null,2)})})]},$)})})})]}),i&&(O==null?void 0:O.messages)&&O.messages.length>0&&c.jsx("div",{style:{width:`${_c}px`,flexShrink:0},children:c.jsx(Dk,{messages:O.messages,activeId:s,onNavigate:W})})]})}/*!
52
+ * @kurkle/color v0.3.4
53
+ * https://github.com/kurkle/color#readme
54
+ * (c) 2024 Jukka Kurkela
55
+ * Released under the MIT License
56
+ */function xo(t){return t+.5|0}const $n=(t,e,n)=>Math.max(Math.min(t,n),e);function pi(t){return $n(xo(t*2.55),0,255)}function es(t){return $n(xo(t*255),0,255)}function cn(t){return $n(xo(t/2.55)/100,0,1)}function Rf(t){return $n(xo(t*100),0,100)}const vt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Sc=[..."0123456789ABCDEF"],Ak=t=>Sc[t&15],zk=t=>Sc[(t&240)>>4]+Sc[t&15],$o=t=>(t&240)>>4===(t&15),Bk=t=>$o(t.r)&&$o(t.g)&&$o(t.b)&&$o(t.a);function Wk(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&vt[t[1]]*17,g:255&vt[t[2]]*17,b:255&vt[t[3]]*17,a:e===5?vt[t[4]]*17:255}:(e===7||e===9)&&(n={r:vt[t[1]]<<4|vt[t[2]],g:vt[t[3]]<<4|vt[t[4]],b:vt[t[5]]<<4|vt[t[6]],a:e===9?vt[t[7]]<<4|vt[t[8]]:255})),n}const $k=(t,e)=>t<255?e(t):"";function Hk(t){var e=Bk(t)?Ak:zk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+$k(t.a,e):void 0}const Uk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Q0(t,e,n){const s=e*Math.min(n,1-n),r=(i,o=(i+t/30)%12)=>n-s*Math.max(Math.min(o-3,9-o,1),-1);return[r(0),r(8),r(4)]}function Vk(t,e,n){const s=(r,i=(r+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[s(5),s(3),s(1)]}function Qk(t,e,n){const s=Q0(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)s[r]*=1-e-n,s[r]+=e;return s}function Yk(t,e,n,s,r){return t===r?(e-n)/s+(e<n?6:0):e===r?(n-t)/s+2:(t-e)/s+4}function Id(t){const n=t.r/255,s=t.g/255,r=t.b/255,i=Math.max(n,s,r),o=Math.min(n,s,r),a=(i+o)/2;let l,u,d;return i!==o&&(d=i-o,u=a>.5?d/(2-i-o):d/(i+o),l=Yk(n,s,r,d,i),l=l*60+.5),[l|0,u||0,a]}function Ad(t,e,n,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,s)).map(es)}function zd(t,e,n){return Ad(Q0,t,e,n)}function Kk(t,e,n){return Ad(Qk,t,e,n)}function Xk(t,e,n){return Ad(Vk,t,e,n)}function Y0(t){return(t%360+360)%360}function qk(t){const e=Uk.exec(t);let n=255,s;if(!e)return;e[5]!==s&&(n=e[6]?pi(+e[5]):es(+e[5]));const r=Y0(+e[2]),i=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?s=Kk(r,i,o):e[1]==="hsv"?s=Xk(r,i,o):s=zd(r,i,o),{r:s[0],g:s[1],b:s[2],a:n}}function Gk(t,e){var n=Id(t);n[0]=Y0(n[0]+e),n=zd(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Jk(t){if(!t)return;const e=Id(t),n=e[0],s=Rf(e[1]),r=Rf(e[2]);return t.a<255?`hsla(${n}, ${s}%, ${r}%, ${cn(t.a)})`:`hsl(${n}, ${s}%, ${r}%)`}const Of={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Df={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Zk(){const t={},e=Object.keys(Df),n=Object.keys(Of);let s,r,i,o,a;for(s=0;s<e.length;s++){for(o=a=e[s],r=0;r<n.length;r++)i=n[r],a=a.replace(i,Of[i]);i=parseInt(Df[o],16),t[a]=[i>>16&255,i>>8&255,i&255]}return t}let Ho;function e_(t){Ho||(Ho=Zk(),Ho.transparent=[0,0,0,0]);const e=Ho[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const t_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function n_(t){const e=t_.exec(t);let n=255,s,r,i;if(e){if(e[7]!==s){const o=+e[7];n=e[8]?pi(o):$n(o*255,0,255)}return s=+e[1],r=+e[3],i=+e[5],s=255&(e[2]?pi(s):$n(s,0,255)),r=255&(e[4]?pi(r):$n(r,0,255)),i=255&(e[6]?pi(i):$n(i,0,255)),{r:s,g:r,b:i,a:n}}}function s_(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${cn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const tu=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Ks=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function r_(t,e,n){const s=Ks(cn(t.r)),r=Ks(cn(t.g)),i=Ks(cn(t.b));return{r:es(tu(s+n*(Ks(cn(e.r))-s))),g:es(tu(r+n*(Ks(cn(e.g))-r))),b:es(tu(i+n*(Ks(cn(e.b))-i))),a:t.a+n*(e.a-t.a)}}function Uo(t,e,n){if(t){let s=Id(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*n,e===0?360:1)),s=zd(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function K0(t,e){return t&&Object.assign(e||{},t)}function Lf(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=es(t[3]))):(e=K0(t,{r:0,g:0,b:0,a:1}),e.a=es(e.a)),e}function i_(t){return t.charAt(0)==="r"?n_(t):qk(t)}class Ji{constructor(e){if(e instanceof Ji)return e;const n=typeof e;let s;n==="object"?s=Lf(e):n==="string"&&(s=Wk(e)||e_(e)||i_(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=K0(this._rgb);return e&&(e.a=cn(e.a)),e}set rgb(e){this._rgb=Lf(e)}rgbString(){return this._valid?s_(this._rgb):void 0}hexString(){return this._valid?Hk(this._rgb):void 0}hslString(){return this._valid?Jk(this._rgb):void 0}mix(e,n){if(e){const s=this.rgb,r=e.rgb;let i;const o=n===i?.5:n,a=2*o-1,l=s.a-r.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-u,s.r=255&u*s.r+i*r.r+.5,s.g=255&u*s.g+i*r.g+.5,s.b=255&u*s.b+i*r.b+.5,s.a=o*s.a+(1-o)*r.a,this.rgb=s}return this}interpolate(e,n){return e&&(this._rgb=r_(this._rgb,e._rgb,n)),this}clone(){return new Ji(this.rgb)}alpha(e){return this._rgb.a=es(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=xo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Uo(this._rgb,2,e),this}darken(e){return Uo(this._rgb,2,-e),this}saturate(e){return Uo(this._rgb,1,e),this}desaturate(e){return Uo(this._rgb,1,-e),this}rotate(e){return Gk(this._rgb,e),this}}/*!
57
+ * Chart.js v4.5.1
58
+ * https://www.chartjs.org
59
+ * (c) 2025 Chart.js Contributors
60
+ * Released under the MIT License
61
+ */function sn(){}const o_=(()=>{let t=0;return()=>t++})();function ae(t){return t==null}function Ee(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function ee(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Mt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Yt(t,e){return Mt(t)?t:e}function te(t,e){return typeof t>"u"?e:t}const a_=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function he(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function ie(t,e,n,s){let r,i,o;if(Ee(t))for(i=t.length,r=0;r<i;r++)e.call(n,t[r],r);else if(ee(t))for(o=Object.keys(t),i=o.length,r=0;r<i;r++)e.call(n,t[o[r]],o[r])}function Va(t,e){let n,s,r,i;if(!t||!e||t.length!==e.length)return!1;for(n=0,s=t.length;n<s;++n)if(r=t[n],i=e[n],r.datasetIndex!==i.datasetIndex||r.index!==i.index)return!1;return!0}function Qa(t){if(Ee(t))return t.map(Qa);if(ee(t)){const e=Object.create(null),n=Object.keys(t),s=n.length;let r=0;for(;r<s;++r)e[n[r]]=Qa(t[n[r]]);return e}return t}function X0(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function l_(t,e,n,s){if(!X0(t))return;const r=e[t],i=n[t];ee(r)&&ee(i)?Zi(r,i,s):e[t]=Qa(i)}function Zi(t,e,n){const s=Ee(e)?e:[e],r=s.length;if(!ee(t))return t;n=n||{};const i=n.merger||l_;let o;for(let a=0;a<r;++a){if(o=s[a],!ee(o))continue;const l=Object.keys(o);for(let u=0,d=l.length;u<d;++u)i(l[u],t,o,n)}return t}function ji(t,e){return Zi(t,e,{merger:u_})}function u_(t,e,n){if(!X0(t))return;const s=e[t],r=n[t];ee(s)&&ee(r)?ji(s,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Qa(r))}const Ff={"":t=>t,x:t=>t.x,y:t=>t.y};function c_(t){const e=t.split("."),n=[];let s="";for(const r of e)s+=r,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function d_(t){const e=c_(t);return n=>{for(const s of e){if(s==="")break;n=n&&n[s]}return n}}function Fr(t,e){return(Ff[e]||(Ff[e]=d_(e)))(t)}function Bd(t){return t.charAt(0).toUpperCase()+t.slice(1)}const eo=t=>typeof t<"u",is=t=>typeof t=="function",If=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function h_(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ue=Math.PI,ts=2*Ue,Ya=Number.POSITIVE_INFINITY,f_=Ue/180,At=Ue/2,ds=Ue/4,Af=Ue*2/3,q0=Math.log10,ns=Math.sign;function pa(t,e,n){return Math.abs(t-e)<n}function zf(t){const e=Math.round(t);t=pa(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(q0(t))),s=t/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function p_(t){const e=[],n=Math.sqrt(t);let s;for(s=1;s<n;s++)t%s===0&&(e.push(s),e.push(t/s));return n===(n|0)&&e.push(n),e.sort((r,i)=>r-i).pop(),e}function g_(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Ka(t){return!g_(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function m_(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function y_(t,e,n){let s,r,i;for(s=0,r=t.length;s<r;s++)i=t[s][n],isNaN(i)||(e.min=Math.min(e.min,i),e.max=Math.max(e.max,i))}function _s(t){return t*(Ue/180)}function x_(t){return t*(180/Ue)}function Bf(t){if(!Mt(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function v_(t,e){const n=e.x-t.x,s=e.y-t.y,r=Math.sqrt(n*n+s*s);let i=Math.atan2(s,n);return i<-.5*Ue&&(i+=ts),{angle:i,distance:r}}function b_(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function hs(t){return(t%ts+ts)%ts}function w_(t,e,n,s){const r=hs(t),i=hs(e),o=hs(n),a=hs(i-r),l=hs(o-r),u=hs(r-i),d=hs(r-o);return r===i||r===o||s||a>l&&u<d}function zt(t,e,n){return Math.max(e,Math.min(n,t))}function k_(t){return zt(t,-32768,32767)}function ar(t,e,n,s=1e-6){return t>=Math.min(e,n)-s&&t<=Math.max(e,n)+s}function Wd(t,e,n){n=n||(o=>t[o]<e);let s=t.length-1,r=0,i;for(;s-r>1;)i=r+s>>1,n(i)?r=i:s=i;return{lo:r,hi:s}}const Cc=(t,e,n,s)=>Wd(t,n,s?r=>{const i=t[r][e];return i<n||i===n&&t[r+1][e]===n}:r=>t[r][e]<n),__=(t,e,n)=>Wd(t,n,s=>t[s][e]>=n);function S_(t,e,n){let s=0,r=t.length;for(;s<r&&t[s]<e;)s++;for(;r>s&&t[r-1]>n;)r--;return s>0||r<t.length?t.slice(s,r):t}const G0=["push","pop","shift","splice","unshift"];function C_(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),G0.forEach(n=>{const s="_onData"+Bd(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...i){const o=r.apply(this,i);return t._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...i)}),o}})})}function Wf(t,e){const n=t._chartjs;if(!n)return;const s=n.listeners,r=s.indexOf(e);r!==-1&&s.splice(r,1),!(s.length>0)&&(G0.forEach(i=>{delete t[i]}),delete t._chartjs)}function J0(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Z0=function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame}();function ey(t,e){let n=[],s=!1;return function(...r){n=r,s||(s=!0,Z0.call(window,()=>{s=!1,t.apply(e,n)}))}}function j_(t,e){let n;return function(...s){return e?(clearTimeout(n),n=setTimeout(t,e,s)):t.apply(this,s),e}}const $d=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,N_=(t,e,n,s)=>t===(s?"left":"right")?n:t==="center"?(e+n)/2:e,Vo=t=>t===0||t===1,$f=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ts/n)),Hf=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*ts/n)+1,Ni={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*At)+1,easeOutSine:t=>Math.sin(t*At),easeInOutSine:t=>-.5*(Math.cos(Ue*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Vo(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Vo(t)?t:$f(t,.075,.3),easeOutElastic:t=>Vo(t)?t:Hf(t,.075,.3),easeInOutElastic(t){return Vo(t)?t:t<.5?.5*$f(t*2,.1125,.45):.5+.5*Hf(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Ni.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Ni.easeInBounce(t*2)*.5:Ni.easeOutBounce(t*2-1)*.5+.5};function ty(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Uf(t){return ty(t)?t:new Ji(t)}function nu(t){return ty(t)?t:new Ji(t).saturate(.5).darken(.1).hexString()}const E_=["x","y","borderWidth","radius","tension"],P_=["color","borderColor","backgroundColor"];function M_(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:P_},numbers:{type:"number",properties:E_}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function T_(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Vf=new Map;function R_(t,e){e=e||{};const n=t+JSON.stringify(e);let s=Vf.get(n);return s||(s=new Intl.NumberFormat(t,e),Vf.set(n,s)),s}function ny(t,e,n){return R_(e,n).format(t)}const O_={values(t){return Ee(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const s=this.chart.options.locale;let r,i=t;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(r="scientific"),i=D_(t,n)}const o=q0(Math.abs(i)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ny(t,s,l)}};function D_(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var sy={formatters:O_};function L_(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:sy.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Hs=Object.create(null),jc=Object.create(null);function Ei(t,e){if(!e)return t;const n=e.split(".");for(let s=0,r=n.length;s<r;++s){const i=n[s];t=t[i]||(t[i]=Object.create(null))}return t}function su(t,e,n){return typeof e=="string"?Zi(Ei(t,e),n):Zi(Ei(t,""),e)}class F_{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,r)=>nu(r.backgroundColor),this.hoverBorderColor=(s,r)=>nu(r.borderColor),this.hoverColor=(s,r)=>nu(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return su(this,e,n)}get(e){return Ei(this,e)}describe(e,n){return su(jc,e,n)}override(e,n){return su(Hs,e,n)}route(e,n,s,r){const i=Ei(this,e),o=Ei(this,s),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=o[r];return ee(l)?Object.assign({},u,l):te(l,u)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var _e=new F_({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[M_,T_,L_]);function I_(t){return!t||ae(t.size)||ae(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Qf(t,e,n,s,r){let i=e[r];return i||(i=e[r]=t.measureText(r).width,n.push(r)),i>s&&(s=i),s}function fs(t,e,n){const s=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*s)/s+r}function Yf(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Kf(t,e,n,s){ry(t,e,n,s,null)}function ry(t,e,n,s,r){let i,o,a,l,u,d,h,f;const p=e.pointStyle,x=e.rotation,y=e.radius;let b=(x||0)*f_;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){t.save(),t.translate(n,s),t.rotate(b),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),t.restore();return}if(!(isNaN(y)||y<=0)){switch(t.beginPath(),p){default:r?t.ellipse(n,s,r/2,y,0,0,ts):t.arc(n,s,y,0,ts),t.closePath();break;case"triangle":d=r?r/2:y,t.moveTo(n+Math.sin(b)*d,s-Math.cos(b)*y),b+=Af,t.lineTo(n+Math.sin(b)*d,s-Math.cos(b)*y),b+=Af,t.lineTo(n+Math.sin(b)*d,s-Math.cos(b)*y),t.closePath();break;case"rectRounded":u=y*.516,l=y-u,o=Math.cos(b+ds)*l,h=Math.cos(b+ds)*(r?r/2-u:l),a=Math.sin(b+ds)*l,f=Math.sin(b+ds)*(r?r/2-u:l),t.arc(n-h,s-a,u,b-Ue,b-At),t.arc(n+f,s-o,u,b-At,b),t.arc(n+h,s+a,u,b,b+At),t.arc(n-f,s+o,u,b+At,b+Ue),t.closePath();break;case"rect":if(!x){l=Math.SQRT1_2*y,d=r?r/2:l,t.rect(n-d,s-l,2*d,2*l);break}b+=ds;case"rectRot":h=Math.cos(b)*(r?r/2:y),o=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(r?r/2:y),t.moveTo(n-h,s-a),t.lineTo(n+f,s-o),t.lineTo(n+h,s+a),t.lineTo(n-f,s+o),t.closePath();break;case"crossRot":b+=ds;case"cross":h=Math.cos(b)*(r?r/2:y),o=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(r?r/2:y),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"star":h=Math.cos(b)*(r?r/2:y),o=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(r?r/2:y),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o),b+=ds,h=Math.cos(b)*(r?r/2:y),o=Math.cos(b)*y,a=Math.sin(b)*y,f=Math.sin(b)*(r?r/2:y),t.moveTo(n-h,s-a),t.lineTo(n+h,s+a),t.moveTo(n+f,s-o),t.lineTo(n-f,s+o);break;case"line":o=r?r/2:Math.cos(b)*y,a=Math.sin(b)*y,t.moveTo(n-o,s-a),t.lineTo(n+o,s+a);break;case"dash":t.moveTo(n,s),t.lineTo(n+Math.cos(b)*(r?r/2:y),s+Math.sin(b)*y);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function iy(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Hd(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ud(t){t.restore()}function A_(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),ae(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function z_(t,e,n,s,r){if(r.strikethrough||r.underline){const i=t.measureText(s),o=e-i.actualBoundingBoxLeft,a=e+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,u=n+i.actualBoundingBoxDescent,d=r.strikethrough?(l+u)/2:u;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,d),t.lineTo(a,d),t.stroke()}}function B_(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function to(t,e,n,s,r,i={}){const o=Ee(e)?e:[e],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(t.save(),t.font=r.string,A_(t,i),l=0;l<o.length;++l)u=o[l],i.backdrop&&B_(t,i.backdrop),a&&(i.strokeColor&&(t.strokeStyle=i.strokeColor),ae(i.strokeWidth)||(t.lineWidth=i.strokeWidth),t.strokeText(u,n,s,i.maxWidth)),t.fillText(u,n,s,i.maxWidth),z_(t,n,s,u,i),s+=Number(r.lineHeight);t.restore()}function Xa(t,e){const{x:n,y:s,w:r,h:i,radius:o}=e;t.arc(n+o.topLeft,s+o.topLeft,o.topLeft,1.5*Ue,Ue,!0),t.lineTo(n,s+i-o.bottomLeft),t.arc(n+o.bottomLeft,s+i-o.bottomLeft,o.bottomLeft,Ue,At,!0),t.lineTo(n+r-o.bottomRight,s+i),t.arc(n+r-o.bottomRight,s+i-o.bottomRight,o.bottomRight,At,0,!0),t.lineTo(n+r,s+o.topRight),t.arc(n+r-o.topRight,s+o.topRight,o.topRight,0,-At,!0),t.lineTo(n+o.topLeft,s)}const W_=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,$_=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function H_(t,e){const n=(""+t).match(W_);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const U_=t=>+t||0;function oy(t,e){const n={},s=ee(e),r=s?Object.keys(e):e,i=ee(t)?s?o=>te(t[o],t[e[o]]):o=>t[o]:()=>t;for(const o of r)n[o]=U_(i(o));return n}function ay(t){return oy(t,{top:"y",right:"x",bottom:"y",left:"x"})}function pr(t){return oy(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Tt(t){const e=ay(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function He(t,e){t=t||{},e=e||_e.font;let n=te(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let s=te(t.style,e.style);s&&!(""+s).match($_)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const r={family:te(t.family,e.family),lineHeight:H_(te(t.lineHeight,e.lineHeight),n),size:n,style:s,weight:te(t.weight,e.weight),string:""};return r.string=I_(r),r}function Qo(t,e,n,s){let r,i,o;for(r=0,i=t.length;r<i;++r)if(o=t[r],o!==void 0&&o!==void 0)return o}function V_(t,e,n){const{min:s,max:r}=t,i=a_(e,(r-s)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(s,-Math.abs(i)),max:o(r,i)}}function Ur(t,e){return Object.assign(Object.create(t),e)}function Vd(t,e=[""],n,s,r=()=>t[0]){const i=n||t;typeof s>"u"&&(s=dy("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:r,override:a=>Vd([a,...t],e,i,s)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return uy(a,l,()=>Z_(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return qf(a).includes(l)},ownKeys(a){return qf(a)},set(a,l,u){const d=a._storage||(a._storage=r());return a[l]=d[l]=u,delete a._keys,!0}})}function Ir(t,e,n,s){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:ly(t,s),setContext:i=>Ir(t,i,n,s),override:i=>Ir(t.override(i),e,n,s)};return new Proxy(r,{deleteProperty(i,o){return delete i[o],delete t[o],!0},get(i,o,a){return uy(i,o,()=>Y_(i,o,a))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(t,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,o)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(i,o){return Reflect.has(t,o)},ownKeys(){return Reflect.ownKeys(t)},set(i,o,a){return t[o]=a,delete i[o],!0}})}function ly(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:s=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:s,isScriptable:is(n)?n:()=>n,isIndexable:is(s)?s:()=>s}}const Q_=(t,e)=>t?t+Bd(e):e,Qd=(t,e)=>ee(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function uy(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const s=n();return t[e]=s,s}function Y_(t,e,n){const{_proxy:s,_context:r,_subProxy:i,_descriptors:o}=t;let a=s[e];return is(a)&&o.isScriptable(e)&&(a=K_(e,a,t,n)),Ee(a)&&a.length&&(a=X_(e,a,t,o.isIndexable)),Qd(e,a)&&(a=Ir(a,r,i&&i[e],o)),a}function K_(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(i,o||s);return a.delete(t),Qd(t,l)&&(l=Yd(r._scopes,r,t,l)),l}function X_(t,e,n,s){const{_proxy:r,_context:i,_subProxy:o,_descriptors:a}=n;if(typeof i.index<"u"&&s(t))return e[i.index%e.length];if(ee(e[0])){const l=e,u=r._scopes.filter(d=>d!==l);e=[];for(const d of l){const h=Yd(u,r,t,d);e.push(Ir(h,i,o&&o[t],a))}}return e}function cy(t,e,n){return is(t)?t(e,n):t}const q_=(t,e)=>t===!0?e:typeof t=="string"?Fr(e,t):void 0;function G_(t,e,n,s,r){for(const i of e){const o=q_(n,i);if(o){t.add(o);const a=cy(o._fallback,n,r);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(o===!1&&typeof s<"u"&&n!==s)return null}return!1}function Yd(t,e,n,s){const r=e._rootScopes,i=cy(e._fallback,n,s),o=[...t,...r],a=new Set;a.add(s);let l=Xf(a,o,n,i||n,s);return l===null||typeof i<"u"&&i!==n&&(l=Xf(a,o,i,l,s),l===null)?!1:Vd(Array.from(a),[""],r,i,()=>J_(e,n,s))}function Xf(t,e,n,s,r){for(;n;)n=G_(t,e,n,s,r);return n}function J_(t,e,n){const s=t._getTarget();e in s||(s[e]={});const r=s[e];return Ee(r)&&ee(n)?n:r||{}}function Z_(t,e,n,s){let r;for(const i of e)if(r=dy(Q_(i,t),n),typeof r<"u")return Qd(t,r)?Yd(n,s,t,r):r}function dy(t,e){for(const n of e){if(!n)continue;const s=n[t];if(typeof s<"u")return s}}function qf(t){let e=t._keys;return e||(e=t._keys=eS(t._scopes)),e}function eS(t){const e=new Set;for(const n of t)for(const s of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(s);return Array.from(e)}function Kd(){return typeof window<"u"&&typeof document<"u"}function Xd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function qa(t,e,n){let s;return typeof t=="string"?(s=parseInt(t,10),t.indexOf("%")!==-1&&(s=s/100*e.parentNode[n])):s=t,s}const wl=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function tS(t,e){return wl(t).getPropertyValue(e)}const nS=["top","right","bottom","left"];function Ls(t,e,n){const s={};n=n?"-"+n:"";for(let r=0;r<4;r++){const i=nS[r];s[i]=parseFloat(t[e+"-"+i+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const sS=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function rS(t,e){const n=t.touches,s=n&&n.length?n[0]:t,{offsetX:r,offsetY:i}=s;let o=!1,a,l;if(sS(r,i,t.target))a=r,l=i;else{const u=e.getBoundingClientRect();a=s.clientX-u.left,l=s.clientY-u.top,o=!0}return{x:a,y:l,box:o}}function xs(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:s}=e,r=wl(n),i=r.boxSizing==="border-box",o=Ls(r,"padding"),a=Ls(r,"border","width"),{x:l,y:u,box:d}=rS(t,n),h=o.left+(d&&a.left),f=o.top+(d&&a.top);let{width:p,height:x}=e;return i&&(p-=o.width+a.width,x-=o.height+a.height),{x:Math.round((l-h)/p*n.width/s),y:Math.round((u-f)/x*n.height/s)}}function iS(t,e,n){let s,r;if(e===void 0||n===void 0){const i=t&&Xd(t);if(!i)e=t.clientWidth,n=t.clientHeight;else{const o=i.getBoundingClientRect(),a=wl(i),l=Ls(a,"border","width"),u=Ls(a,"padding");e=o.width-u.width-l.width,n=o.height-u.height-l.height,s=qa(a.maxWidth,i,"clientWidth"),r=qa(a.maxHeight,i,"clientHeight")}}return{width:e,height:n,maxWidth:s||Ya,maxHeight:r||Ya}}const Hn=t=>Math.round(t*10)/10;function oS(t,e,n,s){const r=wl(t),i=Ls(r,"margin"),o=qa(r.maxWidth,t,"clientWidth")||Ya,a=qa(r.maxHeight,t,"clientHeight")||Ya,l=iS(t,e,n);let{width:u,height:d}=l;if(r.boxSizing==="content-box"){const f=Ls(r,"border","width"),p=Ls(r,"padding");u-=p.width+f.width,d-=p.height+f.height}return u=Math.max(0,u-i.width),d=Math.max(0,s?u/s:d-i.height),u=Hn(Math.min(u,o,l.maxWidth)),d=Hn(Math.min(d,a,l.maxHeight)),u&&!d&&(d=Hn(u/2)),(e!==void 0||n!==void 0)&&s&&l.height&&d>l.height&&(d=l.height,u=Hn(Math.floor(d*s))),{width:u,height:d}}function Gf(t,e,n){const s=e||1,r=Hn(t.height*s),i=Hn(t.width*s);t.height=Hn(t.height),t.width=Hn(t.width);const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||o.height!==r||o.width!==i?(t.currentDevicePixelRatio=s,o.height=r,o.width=i,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}const aS=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Kd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t}();function Jf(t,e){const n=tS(t,e),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const lS=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},uS=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function gr(t,e,n){return t?lS(e,n):uS()}function hy(t,e){let n,s;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=s)}function fy(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Yo(t,e,n){return t.options.clip?t[n]:e[n]}function cS(t,e){const{xScale:n,yScale:s}=t;return n&&s?{left:Yo(n,e,"left"),right:Yo(n,e,"right"),top:Yo(s,e,"top"),bottom:Yo(s,e,"bottom")}:e}function dS(t,e){const n=e._clip;if(n.disabled)return!1;const s=cS(e,t.chartArea);return{left:n.left===!1?0:s.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:s.right+(n.right===!0?0:n.right),top:n.top===!1?0:s.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:s.bottom+(n.bottom===!0?0:n.bottom)}}/*!
62
+ * Chart.js v4.5.1
63
+ * https://www.chartjs.org
64
+ * (c) 2025 Chart.js Contributors
65
+ * Released under the MIT License
66
+ */class hS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,s,r){const i=n.listeners[r],o=n.duration;i.forEach(a=>a({chart:e,initial:n.initial,numSteps:o,currentStep:Math.min(s-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Z0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((s,r)=>{if(!s.running||!s.items.length)return;const i=s.items;let o=i.length-1,a=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(e),a=!0):(i[o]=i[i.length-1],i.pop());a&&(r.draw(),this._notify(r,s,e,"progress")),i.length||(s.running=!1,this._notify(r,s,e,"complete"),s.initial=!1),n+=i.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let s=n.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,s)),s}listen(e,n,s){this._getAnims(e).listeners[n].push(s)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,r)=>Math.max(s,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const s=n.items;let r=s.length-1;for(;r>=0;--r)s[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var on=new hS;const Zf="transparent",fS={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const s=Uf(t||Zf),r=s.valid&&Uf(e||Zf);return r&&r.valid?r.mix(s,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class pS{constructor(e,n,s,r){const i=n[s];r=Qo([e.to,r,i,e.from]);const o=Qo([e.from,i,r]);this._active=!0,this._fn=e.fn||fS[e.type||typeof o],this._easing=Ni[e.easing]||Ni.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=s,this._from=o,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,s){if(this._active){this._notify(!1);const r=this._target[this._prop],i=s-this._start,o=this._duration-i;this._start=s,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=Qo([e.to,n,r,e.from]),this._from=Qo([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,s=this._duration,r=this._prop,i=this._from,o=this._loop,a=this._to;let l;if(this._active=i!==a&&(o||n<s),!this._active){this._target[r]=a,this._notify(!0);return}if(n<0){this._target[r]=i;return}l=n/s%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(i,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,s)=>{e.push({res:n,rej:s})})}_notify(e){const n=e?"res":"rej",s=this._promises||[];for(let r=0;r<s.length;r++)s[r][n]()}}class py{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!ee(e))return;const n=Object.keys(_e.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const i=e[r];if(!ee(i))return;const o={};for(const a of n)o[a]=i[a];(Ee(i.properties)&&i.properties||[r]).forEach(a=>{(a===r||!s.has(a))&&s.set(a,o)})})}_animateOptions(e,n){const s=n.options,r=mS(e,s);if(!r)return[];const i=this._createAnimations(r,s);return s.$shared&&gS(e.options.$animations,s).then(()=>{e.options=s},()=>{}),i}_createAnimations(e,n){const s=this._properties,r=[],i=e.$animations||(e.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const u=o[l];if(u.charAt(0)==="$")continue;if(u==="options"){r.push(...this._animateOptions(e,n));continue}const d=n[u];let h=i[u];const f=s.get(u);if(h)if(f&&h.active()){h.update(f,d,a);continue}else h.cancel();if(!f||!f.duration){e[u]=d;continue}i[u]=h=new pS(f,e,u,d),r.push(h)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const s=this._createAnimations(e,n);if(s.length)return on.add(this._chart,s),!0}}function gS(t,e){const n=[],s=Object.keys(e);for(let r=0;r<s.length;r++){const i=t[s[r]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function mS(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ep(t,e){const n=t&&t.options||{},s=n.reverse,r=n.min===void 0?e:0,i=n.max===void 0?e:0;return{start:s?i:r,end:s?r:i}}function yS(t,e,n){if(n===!1)return!1;const s=ep(t,n),r=ep(e,n);return{top:r.end,right:s.end,bottom:r.start,left:s.start}}function xS(t){let e,n,s,r;return ee(t)?(e=t.top,n=t.right,s=t.bottom,r=t.left):e=n=s=r=t,{top:e,right:n,bottom:s,left:r,disabled:t===!1}}function gy(t,e){const n=[],s=t._getSortedDatasetMetas(e);let r,i;for(r=0,i=s.length;r<i;++r)n.push(s[r].index);return n}function tp(t,e,n,s={}){const r=t.keys,i=s.mode==="single";let o,a,l,u;if(e===null)return;let d=!1;for(o=0,a=r.length;o<a;++o){if(l=+r[o],l===n){if(d=!0,s.all)continue;break}u=t.values[l],Mt(u)&&(i||e===0||ns(e)===ns(u))&&(e+=u)}return!d&&!s.all?0:e}function vS(t,e){const{iScale:n,vScale:s}=e,r=n.axis==="x"?"x":"y",i=s.axis==="x"?"x":"y",o=Object.keys(t),a=new Array(o.length);let l,u,d;for(l=0,u=o.length;l<u;++l)d=o[l],a[l]={[r]:d,[i]:t[d]};return a}function ru(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function bS(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function wS(t){const{min:e,max:n,minDefined:s,maxDefined:r}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function kS(t,e,n){const s=t[e]||(t[e]={});return s[n]||(s[n]={})}function np(t,e,n,s){for(const r of e.getMatchingVisibleMetas(s).reverse()){const i=t[r.index];if(n&&i>0||!n&&i<0)return r.index}return null}function sp(t,e){const{chart:n,_cachedMeta:s}=t,r=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:a}=s,l=i.axis,u=o.axis,d=bS(i,o,s),h=e.length;let f;for(let p=0;p<h;++p){const x=e[p],{[l]:y,[u]:b}=x,g=x._stacks||(x._stacks={});f=g[u]=kS(r,d,y),f[a]=b,f._top=np(f,o,!0,s.type),f._bottom=np(f,o,!1,s.type);const m=f._visualValues||(f._visualValues={});m[a]=b}}function iu(t,e){const n=t.scales;return Object.keys(n).filter(s=>n[s].axis===e).shift()}function _S(t,e){return Ur(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function SS(t,e,n){return Ur(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function si(t,e){const n=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const r of e){const i=r._stacks;if(!i||i[s]===void 0||i[s][n]===void 0)return;delete i[s][n],i[s]._visualValues!==void 0&&i[s]._visualValues[n]!==void 0&&delete i[s]._visualValues[n]}}}const ou=t=>t==="reset"||t==="none",rp=(t,e)=>e?t:Object.assign({},t),CS=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:gy(n,!0),values:null};class Pi{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=ru(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&si(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,s=this.getDataset(),r=(h,f,p,x)=>h==="x"?f:h==="r"?x:p,i=n.xAxisID=te(s.xAxisID,iu(e,"x")),o=n.yAxisID=te(s.yAxisID,iu(e,"y")),a=n.rAxisID=te(s.rAxisID,iu(e,"r")),l=n.indexAxis,u=n.iAxisID=r(l,i,o,a),d=n.vAxisID=r(l,o,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Wf(this._data,this),e._stacked&&si(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),s=this._data;if(ee(n)){const r=this._cachedMeta;this._data=vS(n,r)}else if(s!==n){if(s){Wf(s,this);const r=this._cachedMeta;si(r),r._parsed=[]}n&&Object.isExtensible(n)&&C_(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,s=this.getDataset();let r=!1;this._dataCheck();const i=n._stacked;n._stacked=ru(n.vScale,n),n.stack!==s.stack&&(r=!0,si(n),n.stack=s.stack),this._resyncElements(e),(r||i!==n._stacked)&&(sp(this,n._parsed),n._stacked=ru(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),s=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:s,_data:r}=this,{iScale:i,_stacked:o}=s,a=i.axis;let l=e===0&&n===r.length?!0:s._sorted,u=e>0&&s._parsed[e-1],d,h,f;if(this._parsing===!1)s._parsed=r,s._sorted=!0,f=r;else{Ee(r[e])?f=this.parseArrayData(s,r,e,n):ee(r[e])?f=this.parseObjectData(s,r,e,n):f=this.parsePrimitiveData(s,r,e,n);const p=()=>h[a]===null||u&&h[a]<u[a];for(d=0;d<n;++d)s._parsed[d+e]=h=f[d],l&&(p()&&(l=!1),u=h);s._sorted=l}o&&sp(this,f)}parsePrimitiveData(e,n,s,r){const{iScale:i,vScale:o}=e,a=i.axis,l=o.axis,u=i.getLabels(),d=i===o,h=new Array(r);let f,p,x;for(f=0,p=r;f<p;++f)x=f+s,h[f]={[a]:d||i.parse(u[x],x),[l]:o.parse(n[x],x)};return h}parseArrayData(e,n,s,r){const{xScale:i,yScale:o}=e,a=new Array(r);let l,u,d,h;for(l=0,u=r;l<u;++l)d=l+s,h=n[d],a[l]={x:i.parse(h[0],d),y:o.parse(h[1],d)};return a}parseObjectData(e,n,s,r){const{xScale:i,yScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(r);let d,h,f,p;for(d=0,h=r;d<h;++d)f=d+s,p=n[f],u[d]={x:i.parse(Fr(p,a),f),y:o.parse(Fr(p,l),f)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,s){const r=this.chart,i=this._cachedMeta,o=n[e.axis],a={keys:gy(r,!0),values:n._stacks[e.axis]._visualValues};return tp(a,o,i.index,{mode:s})}updateRangeFromParsed(e,n,s,r){const i=s[n.axis];let o=i===null?NaN:i;const a=r&&s._stacks[n.axis];r&&a&&(r.values=a,o=tp(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,n){const s=this._cachedMeta,r=s._parsed,i=s._sorted&&e===s.iScale,o=r.length,a=this._getOtherScale(e),l=CS(n,s,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=wS(a);let f,p;function x(){p=r[f];const y=p[a.axis];return!Mt(p[e.axis])||d>y||h<y}for(f=0;f<o&&!(!x()&&(this.updateRangeFromParsed(u,e,p,l),i));++f);if(i){for(f=o-1;f>=0;--f)if(!x()){this.updateRangeFromParsed(u,e,p,l);break}}return u}getAllParsedValues(e){const n=this._cachedMeta._parsed,s=[];let r,i,o;for(r=0,i=n.length;r<i;++r)o=n[r][e.axis],Mt(o)&&s.push(o);return s}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,s=n.iScale,r=n.vScale,i=this.getParsed(e);return{label:s?""+s.getLabelForValue(i[s.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=xS(te(this.options.clip,yS(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,s=this._cachedMeta,r=s.data||[],i=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||r.length-a,u=this.options.drawActiveElementsOnTop;let d;for(s.dataset&&s.dataset.draw(e,i,a,l),d=a;d<a+l;++d){const h=r[d];h.hidden||(h.active&&u?o.push(h):h.draw(e,i))}for(d=0;d<o.length;++d)o[d].draw(e,i)}getStyle(e,n){const s=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(e||0,s)}getContext(e,n,s){const r=this.getDataset();let i;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];i=o.$context||(o.$context=SS(this.getContext(),e,o)),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||(this.$context=_S(this.chart.getContext(),this.index)),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=s,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",s){const r=n==="active",i=this._cachedDataOpts,o=e+"-"+n,a=i[o],l=this.enableOptionSharing&&eo(s);if(a)return rp(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,e),h=r?[`${e}Hover`,"hover",e,""]:[e,""],f=u.getOptionScopes(this.getDataset(),d),p=Object.keys(_e.elements[e]),x=()=>this.getContext(s,r,n),y=u.resolveNamedOptions(f,p,x,h);return y.$shared&&(y.$shared=l,i[o]=Object.freeze(rp(y,l))),y}_resolveAnimations(e,n,s){const r=this.chart,i=this._cachedDataOpts,o=`animation-${n}`,a=i[o];if(a)return a;let l;if(r.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(f,this.getContext(e,s,n))}const u=new py(r,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ou(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const s=this.resolveDataElementOptions(e,n),r=this._sharedOptions,i=this.getSharedOptions(s),o=this.includeOptions(n,i)||i!==r;return this.updateSharedOptions(i,n,s),{sharedOptions:i,includeOptions:o}}updateElement(e,n,s,r){ou(r)?Object.assign(e,s):this._resolveAnimations(n,r).update(e,s)}updateSharedOptions(e,n,s){e&&!ou(n)&&this._resolveAnimations(void 0,n).update(e,s)}_setStyle(e,n,s,r){e.active=r;const i=this.getStyle(n,r);this._resolveAnimations(n,s,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,n,s){this._setStyle(e,s,"active",!1)}setHoverStyle(e,n,s){this._setStyle(e,s,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,s=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const r=s.length,i=n.length,o=Math.min(i,r);o&&this.parse(0,o),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,n,s=!0){const r=this._cachedMeta,i=r.data,o=e+n;let a;const l=u=>{for(u.length+=n,a=u.length-1;a>=o;a--)u[a]=u[a-n]};for(l(i),a=e;a<o;++a)i[a]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(e,n),s&&this.updateElements(i,e,n,"reset")}updateElements(e,n,s,r){}_removeElements(e,n){const s=this._cachedMeta;if(this._parsing){const r=s._parsed.splice(e,n);s._stacked&&si(s,r)}s.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,s,r]=e;this[n](s,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const s=arguments.length-2;s&&this._sync(["_insertElements",e,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}J(Pi,"defaults",{}),J(Pi,"datasetElementType",null),J(Pi,"dataElementType",null);function jS(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let s=[];for(let r=0,i=n.length;r<i;r++)s=s.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=J0(s.sort((r,i)=>r-i))}return t._cache.$bar}function NS(t){const e=t.iScale,n=jS(e,t.type);let s=e._length,r,i,o,a;const l=()=>{o===32767||o===-32768||(eo(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(r=0,i=n.length;r<i;++r)o=e.getPixelForValue(n[r]),l();for(a=void 0,r=0,i=e.ticks.length;r<i;++r)o=e.getPixelForTick(r),l();return s}function ES(t,e,n,s){const r=n.barThickness;let i,o;return ae(r)?(i=e.min*n.categoryPercentage,o=n.barPercentage):(i=r*s,o=1),{chunk:i/s,ratio:o,start:e.pixels[t]-i/2}}function PS(t,e,n,s){const r=e.pixels,i=r[t];let o=t>0?r[t-1]:null,a=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;o===null&&(o=i-(a===null?e.end-e.start:a-i)),a===null&&(a=i+i-o);const u=i-(i-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/s,ratio:n.barPercentage,start:u}}function MS(t,e,n,s){const r=n.parse(t[0],s),i=n.parse(t[1],s),o=Math.min(r,i),a=Math.max(r,i);let l=o,u=a;Math.abs(o)>Math.abs(a)&&(l=a,u=o),e[n.axis]=u,e._custom={barStart:l,barEnd:u,start:r,end:i,min:o,max:a}}function my(t,e,n,s){return Ee(t)?MS(t,e,n,s):e[n.axis]=n.parse(t,s),e}function ip(t,e,n,s){const r=t.iScale,i=t.vScale,o=r.getLabels(),a=r===i,l=[];let u,d,h,f;for(u=n,d=n+s;u<d;++u)f=e[u],h={},h[r.axis]=a||r.parse(o[u],u),l.push(my(f,h,i,u));return l}function au(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function TS(t,e,n){return t!==0?ns(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function RS(t){let e,n,s,r,i;return t.horizontal?(e=t.base>t.x,n="left",s="right"):(e=t.base<t.y,n="bottom",s="top"),e?(r="end",i="start"):(r="start",i="end"),{start:n,end:s,reverse:e,top:r,bottom:i}}function OS(t,e,n,s){let r=e.borderSkipped;const i={};if(!r){t.borderSkipped=i;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:u,bottom:d}=RS(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===s?r=u:(n._bottom||0)===s?r=d:(i[op(d,o,a,l)]=!0,r=u)),i[op(r,o,a,l)]=!0,t.borderSkipped=i}function op(t,e,n,s){return s?(t=DS(t,e,n),t=ap(t,n,e)):t=ap(t,e,n),t}function DS(t,e,n){return t===e?n:t===n?e:t}function ap(t,e,n){return t==="start"?e:t==="end"?n:t}function LS(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class ga extends Pi{parsePrimitiveData(e,n,s,r){return ip(e,n,s,r)}parseArrayData(e,n,s,r){return ip(e,n,s,r)}parseObjectData(e,n,s,r){const{iScale:i,vScale:o}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?a:l,d=o.axis==="x"?a:l,h=[];let f,p,x,y;for(f=s,p=s+r;f<p;++f)y=n[f],x={},x[i.axis]=i.parse(Fr(y,u),f),h.push(my(Fr(y,d),x,o,f));return h}updateRangeFromParsed(e,n,s,r){super.updateRangeFromParsed(e,n,s,r);const i=s._custom;i&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:s,vScale:r}=n,i=this.getParsed(e),o=i._custom,a=au(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+s.getLabelForValue(i[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,s,r){const i=r==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,r);for(let p=n;p<n+s;p++){const x=this.getParsed(p),y=i||ae(x[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),g=(x._stacks||{})[a.axis],m={horizontal:u,base:y.base,enableBorderRadius:!g||au(x._custom)||o===g._top||o===g._bottom,x:u?y.head:b.center,y:u?b.center:y.head,height:u?b.size:Math.abs(y.size),width:u?Math.abs(y.size):b.size};f&&(m.options=h||this.resolveDataElementOptions(p,e[p].active?"active":r));const v=m.options||e[p].options;OS(m,v,g,o),LS(m,v,d.ratio),this.updateElement(e[p],p,m,r)}}_getStacks(e,n){const{iScale:s}=this._cachedMeta,r=s.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),i=s.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[s.axis],u=d=>{const h=d._parsed.find(p=>p[s.axis]===l),f=h&&h[d.vScale.axis];if(ae(f)||isNaN(f))return!0};for(const d of r)if(!(n!==void 0&&u(d))&&((i===!1||o.indexOf(d.stack)===-1||i===void 0&&d.stack===void 0)&&o.push(d.stack),d.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(s=>e[s].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)e[te(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,s){const r=this._getStacks(e,s),i=n!==void 0?r.indexOf(n):-1;return i===-1?r.length-1:i}_getRuler(){const e=this.options,n=this._cachedMeta,s=n.iScale,r=[];let i,o;for(i=0,o=n.data.length;i<o;++i)r.push(s.getPixelForValue(this.getParsed(i)[s.axis],i));const a=e.barThickness;return{min:a||NS(n),pixels:r,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:s,index:r},options:{base:i,minBarLength:o}}=this,a=i||0,l=this.getParsed(e),u=l._custom,d=au(u);let h=l[n.axis],f=0,p=s?this.applyStack(n,l,s):h,x,y;p!==h&&(f=p-h,p=h),d&&(h=u.barStart,p=u.barEnd-u.barStart,h!==0&&ns(h)!==ns(u.barEnd)&&(f=0),f+=h);const b=!ae(i)&&!d?i:f;let g=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?x=n.getPixelForValue(f+p):x=g,y=x-g,Math.abs(y)<o){y=TS(y,n,a)*o,h===a&&(g-=y/2);const m=n.getPixelForDecimal(0),v=n.getPixelForDecimal(1),w=Math.min(m,v),j=Math.max(m,v);g=Math.max(Math.min(g,j),w),x=g+y,s&&!d&&(l._stacks[n.axis]._visualValues[r]=n.getValueForPixel(x)-n.getValueForPixel(g))}if(g===n.getPixelForValue(a)){const m=ns(y)*n.getLineWidthForValue(a)/2;g+=m,y-=m}return{size:y,base:g,head:x,center:x+y/2}}_calculateBarIndexPixels(e,n){const s=n.scale,r=this.options,i=r.skipNull,o=te(r.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(n.grouped){const d=i?this._getStackCount(e):n.stackCount,h=r.barThickness==="flex"?PS(e,n,r,d*u):ES(e,n,r,d*u),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(te(f,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+p;a=h.start+h.chunk*x+h.chunk/2,l=Math.min(o,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(e)[s.axis],e),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,s=e.data,r=s.length;let i=0;for(;i<r;++i)this.getParsed(i)[n.axis]!==null&&!s[i].hidden&&s[i].draw(this._ctx)}}J(ga,"id","bar"),J(ga,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),J(ga,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function ps(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class qd{constructor(e){J(this,"options");this.options=e||{}}static override(e){Object.assign(qd.prototype,e)}init(){}formats(){return ps()}parse(){return ps()}format(){return ps()}add(){return ps()}diff(){return ps()}startOf(){return ps()}endOf(){return ps()}}var FS={_date:qd};function IS(t,e,n,s){const{controller:r,data:i,_sorted:o}=t,a=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&o&&i.length){const u=a._reversePixels?__:Cc;if(s){if(r._sharedOptions){const d=i[0],h=typeof d.getRange=="function"&&d.getRange(e);if(h){const f=u(i,e,n-h),p=u(i,e,n+h);return{lo:f.lo,hi:p.hi}}}}else{const d=u(i,e,n);if(l){const{vScale:h}=r._cachedMeta,{_parsed:f}=t,p=f.slice(0,d.lo+1).reverse().findIndex(y=>!ae(y[h.axis]));d.lo-=Math.max(0,p);const x=f.slice(d.hi).findIndex(y=>!ae(y[h.axis]));d.hi+=Math.max(0,x)}return d}}return{lo:0,hi:i.length-1}}function kl(t,e,n,s,r){const i=t.getSortedVisibleDatasetMetas(),o=n[e];for(let a=0,l=i.length;a<l;++a){const{index:u,data:d}=i[a],{lo:h,hi:f}=IS(i[a],e,o,r);for(let p=h;p<=f;++p){const x=d[p];x.skip||s(x,u,p)}}}function AS(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(s,r){const i=e?Math.abs(s.x-r.x):0,o=n?Math.abs(s.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function lu(t,e,n,s,r){const i=[];return!r&&!t.isPointInArea(e)||kl(t,n,e,function(a,l,u){!r&&!iy(a,t.chartArea,0)||a.inRange(e.x,e.y,s)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function zS(t,e,n,s){let r=[];function i(o,a,l){const{startAngle:u,endAngle:d}=o.getProps(["startAngle","endAngle"],s),{angle:h}=v_(o,{x:e.x,y:e.y});w_(h,u,d)&&r.push({element:o,datasetIndex:a,index:l})}return kl(t,n,e,i),r}function BS(t,e,n,s,r,i){let o=[];const a=AS(n);let l=Number.POSITIVE_INFINITY;function u(d,h,f){const p=d.inRange(e.x,e.y,r);if(s&&!p)return;const x=d.getCenterPoint(r);if(!(!!i||t.isPointInArea(x))&&!p)return;const b=a(e,x);b<l?(o=[{element:d,datasetIndex:h,index:f}],l=b):b===l&&o.push({element:d,datasetIndex:h,index:f})}return kl(t,n,e,u),o}function uu(t,e,n,s,r,i){return!i&&!t.isPointInArea(e)?[]:n==="r"&&!s?zS(t,e,n,r):BS(t,e,n,s,r,i)}function lp(t,e,n,s,r){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return kl(t,n,e,(l,u,d)=>{l[o]&&l[o](e[n],r)&&(i.push({element:l,datasetIndex:u,index:d}),a=a||l.inRange(e.x,e.y,r))}),s&&!a?[]:i}var WS={modes:{index(t,e,n,s){const r=xs(e,t),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?lu(t,r,i,s,o):uu(t,r,i,!1,s,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,h=u.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:u.index,index:d})}),l):[]},dataset(t,e,n,s){const r=xs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?lu(t,r,i,s,o):uu(t,r,i,!1,s,o);if(a.length>0){const l=a[0].datasetIndex,u=t.getDatasetMeta(l).data;a=[];for(let d=0;d<u.length;++d)a.push({element:u[d],datasetIndex:l,index:d})}return a},point(t,e,n,s){const r=xs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return lu(t,r,i,s,o)},nearest(t,e,n,s){const r=xs(e,t),i=n.axis||"xy",o=n.includeInvisible||!1;return uu(t,r,i,n.intersect,s,o)},x(t,e,n,s){const r=xs(e,t);return lp(t,r,"x",n.intersect,s)},y(t,e,n,s){const r=xs(e,t);return lp(t,r,"y",n.intersect,s)}}};const yy=["left","top","right","bottom"];function ri(t,e){return t.filter(n=>n.pos===e)}function up(t,e){return t.filter(n=>yy.indexOf(n.pos)===-1&&n.box.axis===e)}function ii(t,e){return t.sort((n,s)=>{const r=e?s:n,i=e?n:s;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function $S(t){const e=[];let n,s,r,i,o,a;for(n=0,s=(t||[]).length;n<s;++n)r=t[n],{position:i,options:{stack:o,stackWeight:a=1}}=r,e.push({index:n,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:a});return e}function HS(t){const e={};for(const n of t){const{stack:s,pos:r,stackWeight:i}=n;if(!s||!yy.includes(r))continue;const o=e[s]||(e[s]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return e}function US(t,e){const n=HS(t),{vBoxMaxWidth:s,hBoxMaxHeight:r}=e;let i,o,a;for(i=0,o=t.length;i<o;++i){a=t[i];const{fullSize:l}=a.box,u=n[a.stack],d=u&&a.stackWeight/u.weight;a.horizontal?(a.width=d?d*s:l&&e.availableWidth,a.height=r):(a.width=s,a.height=d?d*r:l&&e.availableHeight)}return n}function VS(t){const e=$S(t),n=ii(e.filter(u=>u.box.fullSize),!0),s=ii(ri(e,"left"),!0),r=ii(ri(e,"right")),i=ii(ri(e,"top"),!0),o=ii(ri(e,"bottom")),a=up(e,"x"),l=up(e,"y");return{fullSize:n,leftAndTop:s.concat(i),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:ri(e,"chartArea"),vertical:s.concat(r).concat(l),horizontal:i.concat(o).concat(a)}}function cp(t,e,n,s){return Math.max(t[n],e[n])+Math.max(t[s],e[s])}function xy(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function QS(t,e,n,s){const{pos:r,box:i}=n,o=t.maxPadding;if(!ee(r)){n.size&&(t[r]-=n.size);const h=s[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?i.height:i.width),n.size=h.size/h.count,t[r]+=n.size}i.getPadding&&xy(o,i.getPadding());const a=Math.max(0,e.outerWidth-cp(o,t,"left","right")),l=Math.max(0,e.outerHeight-cp(o,t,"top","bottom")),u=a!==t.w,d=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:u,other:d}:{same:d,other:u}}function YS(t){const e=t.maxPadding;function n(s){const r=Math.max(e[s]-t[s],0);return t[s]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function KS(t,e){const n=e.maxPadding;function s(r){const i={left:0,top:0,right:0,bottom:0};return r.forEach(o=>{i[o]=Math.max(e[o],n[o])}),i}return s(t?["left","right"]:["top","bottom"])}function gi(t,e,n,s){const r=[];let i,o,a,l,u,d;for(i=0,o=t.length,u=0;i<o;++i){a=t[i],l=a.box,l.update(a.width||e.w,a.height||e.h,KS(a.horizontal,e));const{same:h,other:f}=QS(e,n,a,s);u|=h&&r.length,d=d||f,l.fullSize||r.push(a)}return u&&gi(r,e,n,s)||d}function Ko(t,e,n,s,r){t.top=n,t.left=e,t.right=e+s,t.bottom=n+r,t.width=s,t.height=r}function dp(t,e,n,s){const r=n.padding;let{x:i,y:o}=e;for(const a of t){const l=a.box,u=s[a.stack]||{placed:0,weight:1},d=a.stackWeight/u.weight||1;if(a.horizontal){const h=e.w*d,f=u.size||l.height;eo(u.start)&&(o=u.start),l.fullSize?Ko(l,r.left,o,n.outerWidth-r.right-r.left,f):Ko(l,e.left+u.placed,o,h,f),u.start=o,u.placed+=h,o=l.bottom}else{const h=e.h*d,f=u.size||l.width;eo(u.start)&&(i=u.start),l.fullSize?Ko(l,i,r.top,f,n.outerHeight-r.bottom-r.top):Ko(l,i,e.top+u.placed,f,h),u.start=i,u.placed+=h,i=l.right}}e.x=i,e.y=o}var Ct={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,s){if(!t)return;const r=Tt(t.options.layout.padding),i=Math.max(e-r.width,0),o=Math.max(n-r.height,0),a=VS(t.boxes),l=a.vertical,u=a.horizontal;ie(t.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/d,hBoxMaxHeight:o/2}),f=Object.assign({},r);xy(f,Tt(s));const p=Object.assign({maxPadding:f,w:i,h:o,x:r.left,y:r.top},r),x=US(l.concat(u),h);gi(a.fullSize,p,h,x),gi(l,p,h,x),gi(u,p,h,x)&&gi(l,p,h,x),YS(p),dp(a.leftAndTop,p,h,x),p.x+=p.w,p.y+=p.h,dp(a.rightAndBottom,p,h,x),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ie(a.chartArea,y=>{const b=y.box;Object.assign(b,t.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class vy{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,s){}removeEventListener(e,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,s,r){return n=Math.max(0,n||e.width),s=s||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):s)}}isAttached(e){return!0}updateConfig(e){}}class XS extends vy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ma="$chartjs",qS={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hp=t=>t===null||t==="";function GS(t,e){const n=t.style,s=t.getAttribute("height"),r=t.getAttribute("width");if(t[ma]={initial:{height:s,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",hp(r)){const i=Jf(t,"width");i!==void 0&&(t.width=i)}if(hp(s))if(t.style.height==="")t.height=t.width/(e||2);else{const i=Jf(t,"height");i!==void 0&&(t.height=i)}return t}const by=aS?{passive:!0}:!1;function JS(t,e,n){t&&t.addEventListener(e,n,by)}function ZS(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,by)}function eC(t,e){const n=qS[t.type]||t.type,{x:s,y:r}=xs(t,e);return{type:n,chart:e,native:t,x:s!==void 0?s:null,y:r!==void 0?r:null}}function Ga(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function tC(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ga(a.addedNodes,s),o=o&&!Ga(a.removedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function nC(t,e,n){const s=t.canvas,r=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ga(a.removedNodes,s),o=o&&!Ga(a.addedNodes,s);o&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const no=new Map;let fp=0;function wy(){const t=window.devicePixelRatio;t!==fp&&(fp=t,no.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function sC(t,e){no.size||window.addEventListener("resize",wy),no.set(t,e)}function rC(t){no.delete(t),no.size||window.removeEventListener("resize",wy)}function iC(t,e,n){const s=t.canvas,r=s&&Xd(s);if(!r)return;const i=ey((a,l)=>{const u=r.clientWidth;n(a,l),u<r.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,d=l.contentRect.height;u===0&&d===0||i(u,d)});return o.observe(r),sC(t,i),o}function cu(t,e,n){n&&n.disconnect(),e==="resize"&&rC(t)}function oC(t,e,n){const s=t.canvas,r=ey(i=>{t.ctx!==null&&n(eC(i,t))},t);return JS(s,e,r),r}class aC extends vy{acquireContext(e,n){const s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(GS(e,n),s):null}releaseContext(e){const n=e.canvas;if(!n[ma])return!1;const s=n[ma].initial;["height","width"].forEach(i=>{const o=s[i];ae(o)?n.removeAttribute(i):n.setAttribute(i,o)});const r=s.style||{};return Object.keys(r).forEach(i=>{n.style[i]=r[i]}),n.width=n.width,delete n[ma],!0}addEventListener(e,n,s){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),o={attach:tC,detach:nC,resize:iC}[n]||oC;r[n]=o(e,n,s)}removeEventListener(e,n){const s=e.$proxies||(e.$proxies={}),r=s[n];if(!r)return;({attach:cu,detach:cu,resize:cu}[n]||ZS)(e,n,r),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,s,r){return oS(e,n,s,r)}isAttached(e){const n=e&&Xd(e);return!!(n&&n.isConnected)}}function lC(t){return!Kd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?XS:aC}class os{constructor(){J(this,"x");J(this,"y");J(this,"active",!1);J(this,"options");J(this,"$animations")}tooltipPosition(e){const{x:n,y:s}=this.getProps(["x","y"],e);return{x:n,y:s}}hasValue(){return Ka(this.x)&&Ka(this.y)}getProps(e,n){const s=this.$animations;if(!n||!s)return this;const r={};return e.forEach(i=>{r[i]=s[i]&&s[i].active()?s[i]._to:this[i]}),r}}J(os,"defaults",{}),J(os,"defaultRoutes");function uC(t,e){const n=t.options.ticks,s=cC(t),r=Math.min(n.maxTicksLimit||s,s),i=n.major.enabled?hC(e):[],o=i.length,a=i[0],l=i[o-1],u=[];if(o>r)return fC(e,u,i,o/r),u;const d=dC(i,e,r);if(o>0){let h,f;const p=o>1?Math.round((l-a)/(o-1)):null;for(Xo(e,u,d,ae(p)?0:a-p,a),h=0,f=o-1;h<f;h++)Xo(e,u,d,i[h],i[h+1]);return Xo(e,u,d,l,ae(p)?e.length:l+p),u}return Xo(e,u,d),u}function cC(t){const e=t.options.offset,n=t._tickSize(),s=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(s,r))}function dC(t,e,n){const s=pC(t),r=e.length/n;if(!s)return Math.max(r,1);const i=p_(s);for(let o=0,a=i.length-1;o<a;o++){const l=i[o];if(l>r)return l}return Math.max(r,1)}function hC(t){const e=[];let n,s;for(n=0,s=t.length;n<s;n++)t[n].major&&e.push(n);return e}function fC(t,e,n,s){let r=0,i=n[0],o;for(s=Math.ceil(s),o=0;o<t.length;o++)o===i&&(e.push(t[o]),r++,i=n[r*s])}function Xo(t,e,n,s,r){const i=te(s,0),o=Math.min(te(r,t.length),t.length);let a=0,l,u,d;for(n=Math.ceil(n),r&&(l=r-s,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(u=Math.max(i,0);u<o;u++)u===d&&(e.push(t[u]),a++,d=Math.round(i+a*n))}function pC(t){const e=t.length;let n,s;if(e<2)return!1;for(s=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==s)return!1;return s}const gC=t=>t==="left"?"right":t==="right"?"left":t,pp=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,gp=(t,e)=>Math.min(e||t,t);function mp(t,e){const n=[],s=t.length/e,r=t.length;let i=0;for(;i<r;i+=s)n.push(t[Math.floor(i)]);return n}function mC(t,e,n){const s=t.ticks.length,r=Math.min(e,s-1),i=t._startPixel,o=t._endPixel,a=1e-6;let l=t.getPixelForTick(r),u;if(!(n&&(s===1?u=Math.max(l-i,o-l):e===0?u=(t.getPixelForTick(1)-l)/2:u=(l-t.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<i-a||l>o+a)))return l}function yC(t,e){ie(t,n=>{const s=n.gc,r=s.length/2;let i;if(r>e){for(i=0;i<r;++i)delete n.data[s[i]];s.splice(0,r)}})}function oi(t){return t.drawTicks?t.tickLength:0}function yp(t,e){if(!t.display)return 0;const n=He(t.font,e),s=Tt(t.padding);return(Ee(t.text)?t.text.length:1)*n.lineHeight+s.height}function xC(t,e){return Ur(t,{scale:e,type:"scale"})}function vC(t,e,n){return Ur(t,{tick:n,index:e,type:"tick"})}function bC(t,e,n){let s=$d(t);return(n&&e!=="right"||!n&&e==="right")&&(s=gC(s)),s}function wC(t,e,n,s){const{top:r,left:i,bottom:o,right:a,chart:l}=t,{chartArea:u,scales:d}=l;let h=0,f,p,x;const y=o-r,b=a-i;if(t.isHorizontal()){if(p=We(s,i,a),ee(n)){const g=Object.keys(n)[0],m=n[g];x=d[g].getPixelForValue(m)+y-e}else n==="center"?x=(u.bottom+u.top)/2+y-e:x=pp(t,n,e);f=a-i}else{if(ee(n)){const g=Object.keys(n)[0],m=n[g];p=d[g].getPixelForValue(m)-b+e}else n==="center"?p=(u.left+u.right)/2-b+e:p=pp(t,n,e);x=We(s,o,r),h=n==="left"?-At:At}return{titleX:p,titleY:x,maxWidth:f,rotation:h}}class Vr extends os{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:s,_suggestedMax:r}=this;return e=Yt(e,Number.POSITIVE_INFINITY),n=Yt(n,Number.NEGATIVE_INFINITY),s=Yt(s,Number.POSITIVE_INFINITY),r=Yt(r,Number.NEGATIVE_INFINITY),{min:Yt(e,s),max:Yt(n,r),minDefined:Mt(e),maxDefined:Mt(n)}}getMinMax(e){let{min:n,max:s,minDefined:r,maxDefined:i}=this.getUserBounds(),o;if(r&&i)return{min:n,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)o=a[l].controller.getMinMax(this,e),r||(n=Math.min(n,o.min)),i||(s=Math.max(s,o.max));return n=i&&n>s?s:n,s=r&&n>s?n:s,{min:Yt(n,Yt(s,n)),max:Yt(s,Yt(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){he(this.options.beforeUpdate,[this])}update(e,n,s){const{beginAtZero:r,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=V_(this,i,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?mp(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=uC(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,e=!e),this._startPixel=n,this._endPixel=s,this._reversePixels=e,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){he(this.options.afterUpdate,[this])}beforeSetDimensions(){he(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){he(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),he(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){he(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let s,r,i;for(s=0,r=e.length;s<r;s++)i=e[s],i.label=he(n.callback,[i.value,s,e],this)}afterTickToLabelConversion(){he(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){he(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,s=gp(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,i=n.maxRotation;let o=r,a,l,u;if(!this._isVisible()||!n.display||r>=i||s<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,p=zt(this.chart.width-h,0,this.maxWidth);a=e.offset?this.maxWidth/s:p/(s-1),h+6>a&&(a=p/(s-(e.offset?.5:1)),l=this.maxHeight-oi(e.grid)-n.padding-yp(e.title,this.chart.options.font),u=Math.sqrt(h*h+f*f),o=x_(Math.min(Math.asin(zt((d.highest.height+6)/a,-1,1)),Math.asin(zt(l/u,-1,1))-Math.asin(zt(f/u,-1,1)))),o=Math.max(r,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){he(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){he(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:s,title:r,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=yp(r,n.options.font);if(a?(e.width=this.maxWidth,e.height=oi(i)+l):(e.height=this.maxHeight,e.width=oi(i)+l),s.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:f}=this._getLabelSizes(),p=s.padding*2,x=_s(this.labelRotation),y=Math.cos(x),b=Math.sin(x);if(a){const g=s.mirror?0:b*h.width+y*f.height;e.height=Math.min(this.maxHeight,e.height+g+p)}else{const g=s.mirror?0:y*h.width+b*f.height;e.width=Math.min(this.maxWidth,e.width+g+p)}this._calculatePadding(u,d,b,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,s,r){const{ticks:{align:i,padding:o},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?u?(f=r*e.width,p=s*n.height):(f=s*e.height,p=r*n.width):i==="start"?p=n.width:i==="end"?f=e.width:i!=="inner"&&(f=e.width/2,p=n.width/2),this.paddingLeft=Math.max((f-d+o)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-h+o)*this.width/(this.width-h),0)}else{let d=n.height/2,h=e.height/2;i==="start"?(d=0,h=e.height):i==="end"&&(d=n.height,h=0),this.paddingTop=d+o,this.paddingBottom=h+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){he(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,s;for(n=0,s=e.length;n<s;n++)ae(e[n].label)&&(e.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let s=this.ticks;n<s.length&&(s=mp(s,n)),this._labelSizes=e=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,s){const{ctx:r,_longestTextCache:i}=this,o=[],a=[],l=Math.floor(n/gp(n,s));let u=0,d=0,h,f,p,x,y,b,g,m,v,w,j;for(h=0;h<n;h+=l){if(x=e[h].label,y=this._resolveTickFontOptions(h),r.font=b=y.string,g=i[b]=i[b]||{data:{},gc:[]},m=y.lineHeight,v=w=0,!ae(x)&&!Ee(x))v=Qf(r,g.data,g.gc,v,x),w=m;else if(Ee(x))for(f=0,p=x.length;f<p;++f)j=x[f],!ae(j)&&!Ee(j)&&(v=Qf(r,g.data,g.gc,v,j),w+=m);o.push(v),a.push(w),u=Math.max(v,u),d=Math.max(w,d)}yC(i,n);const E=o.indexOf(u),k=a.indexOf(d),N=R=>({width:o[R]||0,height:a[R]||0});return{first:N(0),last:N(n-1),widest:N(E),highest:N(k),widths:o,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return k_(this._alignToPixels?fs(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const s=n[e];return s.$context||(s.$context=vC(this.getContext(),e,s))}return this.$context||(this.$context=xC(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=_s(this.labelRotation),s=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),i=this._getLabelSizes(),o=e.autoSkipPadding||0,a=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*s>a*r?a/s:l/r:l*r<a*s?l/s:a/r}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,s=this.chart,r=this.options,{grid:i,position:o,border:a}=r,l=i.offset,u=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=oi(i),p=[],x=a.setContext(this.getContext()),y=x.display?x.width:0,b=y/2,g=function(W){return fs(s,W,y)};let m,v,w,j,E,k,N,R,C,P,z,Y;if(o==="top")m=g(this.bottom),k=this.bottom-f,R=m-b,P=g(e.top)+b,Y=e.bottom;else if(o==="bottom")m=g(this.top),P=e.top,Y=g(e.bottom)-b,k=m+b,R=this.top+f;else if(o==="left")m=g(this.right),E=this.right-f,N=m-b,C=g(e.left)+b,z=e.right;else if(o==="right")m=g(this.left),C=e.left,z=g(e.right)-b,E=m+b,N=this.left+f;else if(n==="x"){if(o==="center")m=g((e.top+e.bottom)/2+.5);else if(ee(o)){const W=Object.keys(o)[0],O=o[W];m=g(this.chart.scales[W].getPixelForValue(O))}P=e.top,Y=e.bottom,k=m+b,R=k+f}else if(n==="y"){if(o==="center")m=g((e.left+e.right)/2);else if(ee(o)){const W=Object.keys(o)[0],O=o[W];m=g(this.chart.scales[W].getPixelForValue(O))}E=m-b,N=E-f,C=e.left,z=e.right}const we=te(r.ticks.maxTicksLimit,h),se=Math.max(1,Math.ceil(h/we));for(v=0;v<h;v+=se){const W=this.getContext(v),O=i.setContext(W),T=a.setContext(W),A=O.lineWidth,B=O.color,D=T.dash||[],$=T.dashOffset,K=O.tickWidth,V=O.tickColor,U=O.tickBorderDash||[],G=O.tickBorderDashOffset;w=mC(this,v,l),w!==void 0&&(j=fs(s,w,A),u?E=N=C=z=j:k=R=P=Y=j,p.push({tx1:E,ty1:k,tx2:N,ty2:R,x1:C,y1:P,x2:z,y2:Y,width:A,color:B,borderDash:D,borderDashOffset:$,tickWidth:K,tickColor:V,tickBorderDash:U,tickBorderDashOffset:G}))}return this._ticksLength=h,this._borderValue=m,p}_computeLabelItems(e){const n=this.axis,s=this.options,{position:r,ticks:i}=s,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:d,mirror:h}=i,f=oi(s.grid),p=f+d,x=h?-d:p,y=-_s(this.labelRotation),b=[];let g,m,v,w,j,E,k,N,R,C,P,z,Y="middle";if(r==="top")E=this.bottom-x,k=this._getXAxisLabelAlignment();else if(r==="bottom")E=this.top+x,k=this._getXAxisLabelAlignment();else if(r==="left"){const se=this._getYAxisLabelAlignment(f);k=se.textAlign,j=se.x}else if(r==="right"){const se=this._getYAxisLabelAlignment(f);k=se.textAlign,j=se.x}else if(n==="x"){if(r==="center")E=(e.top+e.bottom)/2+p;else if(ee(r)){const se=Object.keys(r)[0],W=r[se];E=this.chart.scales[se].getPixelForValue(W)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")j=(e.left+e.right)/2-p;else if(ee(r)){const se=Object.keys(r)[0],W=r[se];j=this.chart.scales[se].getPixelForValue(W)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const we=this._getLabelSizes();for(g=0,m=a.length;g<m;++g){v=a[g],w=v.label;const se=i.setContext(this.getContext(g));N=this.getPixelForTick(g)+i.labelOffset,R=this._resolveTickFontOptions(g),C=R.lineHeight,P=Ee(w)?w.length:1;const W=P/2,O=se.color,T=se.textStrokeColor,A=se.textStrokeWidth;let B=k;o?(j=N,k==="inner"&&(g===m-1?B=this.options.reverse?"left":"right":g===0?B=this.options.reverse?"right":"left":B="center"),r==="top"?u==="near"||y!==0?z=-P*C+C/2:u==="center"?z=-we.highest.height/2-W*C+C:z=-we.highest.height+C/2:u==="near"||y!==0?z=C/2:u==="center"?z=we.highest.height/2-W*C:z=we.highest.height-P*C,h&&(z*=-1),y!==0&&!se.showLabelBackdrop&&(j+=C/2*Math.sin(y))):(E=N,z=(1-P)*C/2);let D;if(se.showLabelBackdrop){const $=Tt(se.backdropPadding),K=we.heights[g],V=we.widths[g];let U=z-$.top,G=0-$.left;switch(Y){case"middle":U-=K/2;break;case"bottom":U-=K;break}switch(k){case"center":G-=V/2;break;case"right":G-=V;break;case"inner":g===m-1?G-=V:g>0&&(G-=V/2);break}D={left:G,top:U,width:V+$.width,height:K+$.height,color:se.backdropColor}}b.push({label:w,font:R,textOffset:z,options:{rotation:y,color:O,strokeColor:T,strokeWidth:A,textAlign:B,textBaseline:Y,translation:[j,E],backdrop:D}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-_s(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:s,mirror:r,padding:i}}=this.options,o=this._getLabelSizes(),a=e+i,l=o.widest.width;let u,d;return n==="left"?r?(d=this.right+i,s==="near"?u="left":s==="center"?(u="center",d+=l/2):(u="right",d+=l)):(d=this.right-a,s==="near"?u="right":s==="center"?(u="center",d-=l/2):(u="left",d=this.left)):n==="right"?r?(d=this.left+i,s==="near"?u="right":s==="center"?(u="center",d-=l/2):(u="left",d-=l)):(d=this.left+a,s==="near"?u="left":s==="center"?(u="center",d+=l/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:s,top:r,width:i,height:o}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(s,r,i,o),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(i=>i.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,s=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let i,o;const a=(l,u,d)=>{!d.width||!d.color||(s.save(),s.lineWidth=d.width,s.strokeStyle=d.color,s.setLineDash(d.borderDash||[]),s.lineDashOffset=d.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(u.x,u.y),s.stroke(),s.restore())};if(n.display)for(i=0,o=r.length;i<o;++i){const l=r[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:s,grid:r}}=this,i=s.setContext(this.getContext()),o=s.display?i.width:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,d,h,f;this.isHorizontal()?(u=fs(e,this.left,o)-o/2,d=fs(e,this.right,a)+a/2,h=f=l):(h=fs(e,this.top,o)-o/2,f=fs(e,this.bottom,a)+a/2,u=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const s=this.ctx,r=this._computeLabelArea();r&&Hd(s,r);const i=this.getLabelItems(e);for(const o of i){const a=o.options,l=o.font,u=o.label,d=o.textOffset;to(s,u,0,d,l,a)}r&&Ud(s)}drawTitle(){const{ctx:e,options:{position:n,title:s,reverse:r}}=this;if(!s.display)return;const i=He(s.font),o=Tt(s.padding),a=s.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||ee(n)?(l+=o.bottom,Ee(s.text)&&(l+=i.lineHeight*(s.text.length-1))):l+=o.top;const{titleX:u,titleY:d,maxWidth:h,rotation:f}=wC(this,l,n,a);to(e,s.text,0,0,i,{color:s.color,maxWidth:h,rotation:f,textAlign:bC(a,n,r),textBaseline:"middle",translation:[u,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,s=te(e.grid&&e.grid.z,-1),r=te(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Vr.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];a[s]===this.id&&(!e||a.type===e)&&r.push(a)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return He(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class qo{constructor(e,n,s){this.type=e,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let s;SC(n)&&(s=this.register(n));const r=this.items,i=e.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+e);return i in r||(r[i]=e,kC(e,o,s),this.override&&_e.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const n=this.items,s=e.id,r=this.scope;s in n&&delete n[s],r&&s in _e[r]&&(delete _e[r][s],this.override&&delete Hs[s])}}function kC(t,e,n){const s=Zi(Object.create(null),[n?_e.get(n):{},_e.get(e),t.defaults]);_e.set(e,s),t.defaultRoutes&&_C(e,t.defaultRoutes),t.descriptors&&_e.describe(e,t.descriptors)}function _C(t,e){Object.keys(e).forEach(n=>{const s=n.split("."),r=s.pop(),i=[t].concat(s).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");_e.route(i,r,l,a)})}function SC(t){return"id"in t&&"defaults"in t}class CC{constructor(){this.controllers=new qo(Pi,"datasets",!0),this.elements=new qo(os,"elements"),this.plugins=new qo(Object,"plugins"),this.scales=new qo(Vr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,s){[...n].forEach(r=>{const i=s||this._getRegistryForType(r);s||i.isForType(r)||i===this.plugins&&r.id?this._exec(e,i,r):ie(r,o=>{const a=s||this._getRegistryForType(o);this._exec(e,a,o)})})}_exec(e,n,s){const r=Bd(e);he(s["before"+r],[],s),n[e](s),he(s["after"+r],[],s)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const s=this._typedRegistries[n];if(s.isForType(e))return s}return this.plugins}_get(e,n,s){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+s+".");return r}}var qt=new CC;class jC{constructor(){this._init=void 0}notify(e,n,s,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const i=r?this._descriptors(e).filter(r):this._descriptors(e),o=this._notify(i,e,n,s);return n==="afterDestroy"&&(this._notify(i,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,n,s,r){r=r||{};for(const i of e){const o=i.plugin,a=o[s],l=[n,r,i.options];if(he(a,l,o)===!1&&r.cancelable)return!1}return!0}invalidate(){ae(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const s=e&&e.config,r=te(s.options&&s.options.plugins,{}),i=NC(s);return r===!1&&!n?[]:PC(e,i,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],s=this._cache,r=(i,o)=>i.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(r(n,s),e,"stop"),this._notify(r(s,n),e,"start")}}function NC(t){const e={},n=[],s=Object.keys(qt.plugins.items);for(let i=0;i<s.length;i++)n.push(qt.getPlugin(s[i]));const r=t.plugins||[];for(let i=0;i<r.length;i++){const o=r[i];n.indexOf(o)===-1&&(n.push(o),e[o.id]=!0)}return{plugins:n,localIds:e}}function EC(t,e){return!e&&t===!1?null:t===!0?{}:t}function PC(t,{plugins:e,localIds:n},s,r){const i=[],o=t.getContext();for(const a of e){const l=a.id,u=EC(s[l],r);u!==null&&i.push({plugin:a,options:MC(t.config,{plugin:a,local:n[l]},u,o)})}return i}function MC(t,{plugin:e,local:n},s,r){const i=t.pluginScopeKeys(e),o=t.getOptionScopes(s,i);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Nc(t,e){const n=_e.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function TC(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function RC(t,e){return t===e?"_index_":"_value_"}function xp(t){if(t==="x"||t==="y"||t==="r")return t}function OC(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Ec(t,...e){if(xp(t))return t;for(const n of e){const s=n.axis||OC(n.position)||t.length>1&&xp(t[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vp(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function DC(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(s=>s.xAxisID===t||s.yAxisID===t);if(n.length)return vp(t,"x",n[0])||vp(t,"y",n[0])}return{}}function LC(t,e){const n=Hs[t.type]||{scales:{}},s=e.scales||{},r=Nc(t.type,e),i=Object.create(null);return Object.keys(s).forEach(o=>{const a=s[o];if(!ee(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Ec(o,a,DC(o,t),_e.scales[a.type]),u=RC(l,r),d=n.scales||{};i[o]=ji(Object.create(null),[{axis:l},a,d[l],d[u]])}),t.data.datasets.forEach(o=>{const a=o.type||t.type,l=o.indexAxis||Nc(a,e),d=(Hs[a]||{}).scales||{};Object.keys(d).forEach(h=>{const f=TC(h,l),p=o[f+"AxisID"]||f;i[p]=i[p]||Object.create(null),ji(i[p],[{axis:f},s[p],d[h]])})}),Object.keys(i).forEach(o=>{const a=i[o];ji(a,[_e.scales[a.type],_e.scale])}),i}function ky(t){const e=t.options||(t.options={});e.plugins=te(e.plugins,{}),e.scales=LC(t,e)}function _y(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function FC(t){return t=t||{},t.data=_y(t.data),ky(t),t}const bp=new Map,Sy=new Set;function Go(t,e){let n=bp.get(t);return n||(n=e(),bp.set(t,n),Sy.add(n)),n}const ai=(t,e,n)=>{const s=Fr(e,n);s!==void 0&&t.add(s)};class IC{constructor(e){this._config=FC(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=_y(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),ky(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Go(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return Go(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return Go(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,s=this.type;return Go(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const s=this._scopeCache;let r=s.get(e);return(!r||n)&&(r=new Map,s.set(e,r)),r}getOptionScopes(e,n,s){const{options:r,type:i}=this,o=this._cachedScopes(e,s),a=o.get(n);if(a)return a;const l=new Set;n.forEach(d=>{e&&(l.add(e),d.forEach(h=>ai(l,e,h))),d.forEach(h=>ai(l,r,h)),d.forEach(h=>ai(l,Hs[i]||{},h)),d.forEach(h=>ai(l,_e,h)),d.forEach(h=>ai(l,jc,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),Sy.has(n)&&o.set(n,u),u}chartOptionScopes(){const{options:e,type:n}=this;return[e,Hs[n]||{},_e.datasets[n]||{},{type:n},_e,jc]}resolveNamedOptions(e,n,s,r=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=wp(this._resolverCache,e,r);let l=o;if(zC(o,n)){i.$shared=!1,s=is(s)?s():s;const u=this.createResolver(e,s,a);l=Ir(o,s,u)}for(const u of n)i[u]=l[u];return i}createResolver(e,n,s=[""],r){const{resolver:i}=wp(this._resolverCache,e,s);return ee(n)?Ir(i,n,void 0,r):i}}function wp(t,e,n){let s=t.get(e);s||(s=new Map,t.set(e,s));const r=n.join();let i=s.get(r);return i||(i={resolver:Vd(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(r,i)),i}const AC=t=>ee(t)&&Object.getOwnPropertyNames(t).some(e=>is(t[e]));function zC(t,e){const{isScriptable:n,isIndexable:s}=ly(t);for(const r of e){const i=n(r),o=s(r),a=(o||i)&&t[r];if(i&&(is(a)||AC(a))||o&&Ee(a))return!0}return!1}var BC="4.5.1";const WC=["top","bottom","left","right","chartArea"];function kp(t,e){return t==="top"||t==="bottom"||WC.indexOf(t)===-1&&e==="x"}function _p(t,e){return function(n,s){return n[t]===s[t]?n[e]-s[e]:n[t]-s[t]}}function Sp(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),he(n&&n.onComplete,[t],e)}function $C(t){const e=t.chart,n=e.options.animation;he(n&&n.onProgress,[t],e)}function Cy(t){return Kd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ya={},Cp=t=>{const e=Cy(t);return Object.values(ya).filter(n=>n.canvas===e).pop()};function HC(t,e,n){const s=Object.keys(t);for(const r of s){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}function UC(t,e,n,s){return!n||t.type==="mouseout"?null:s?e:t}var jn;let vo=(jn=class{static register(...e){qt.add(...e),jp()}static unregister(...e){qt.remove(...e),jp()}constructor(e,n){const s=this.config=new IC(n),r=Cy(e),i=Cp(r);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||lC(r)),this.platform.updateConfig(s);const a=this.platform.acquireContext(r,o.aspectRatio),l=a&&a.canvas,u=l&&l.height,d=l&&l.width;if(this.id=o_(),this.ctx=a,this.canvas=l,this.width=d,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new jC,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=j_(h=>this.update(h),o.resizeDelay||0),this._dataChanges=[],ya[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}on.listen(this,"complete",Sp),on.listen(this,"progress",$C),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:s,height:r,_aspectRatio:i}=this;return ae(e)?n&&i?i:r?s/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return qt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Gf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Yf(this.canvas,this.ctx),this}stop(){return on.stop(this),this}resize(e,n){on.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const s=this.options,r=this.canvas,i=s.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(r,e,n,i),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Gf(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),he(s.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};ie(n,(s,r)=>{s.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,s=this.scales,r=Object.keys(s).reduce((o,a)=>(o[a]=!1,o),{});let i=[];n&&(i=i.concat(Object.keys(n).map(o=>{const a=n[o],l=Ec(o,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),ie(i,o=>{const a=o.options,l=a.id,u=Ec(l,a),d=te(a.type,o.dtype);(a.position===void 0||kp(a.position,u)!==kp(o.dposition))&&(a.position=o.dposition),r[l]=!0;let h=null;if(l in s&&s[l].type===d)h=s[l];else{const f=qt.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(a,e)}),ie(r,(o,a)=>{o||delete s[a]}),ie(s,o=>{Ct.configure(this,o,o.options),Ct.addBox(this,o)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,s=e.length;if(e.sort((r,i)=>r.index-i.index),s>n){for(let r=n;r<s;++r)this._destroyDatasetMeta(r);e.splice(n,s-n)}this._sortedMetasets=e.slice(0).sort(_p("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((s,r)=>{n.filter(i=>i===s._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let s,r;for(this._removeUnreferencedMetasets(),s=0,r=n.length;s<r;s++){const i=n[s];let o=this.getDatasetMeta(s);const a=i.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(s),o=this.getDatasetMeta(s)),o.type=a,o.indexAxis=i.indexAxis||Nc(a,this.options),o.order=i.order||0,o.index=s,o.label=""+i.label,o.visible=this.isDatasetVisible(s),o.controller)o.controller.updateIndex(s),o.controller.linkScales();else{const l=qt.getController(a),{datasetElementType:u,dataElementType:d}=_e.datasets[a];Object.assign(l,{dataElementType:qt.getElement(d),datasetElementType:u&&qt.getElement(u)}),o.controller=new l(this,s),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ie(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,d=this.data.datasets.length;u<d;u++){const{controller:h}=this.getDatasetMeta(u),f=!r&&i.indexOf(h)===-1;h.buildOrUpdateElements(f),o=Math.max(+h.getMaxOverflow(),o)}o=this._minPadding=s.layout.autoPadding?o:0,this._updateLayout(o),r||ie(i,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(_p("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ie(this.scales,e=>{Ct.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(e.events);(!If(n,s)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:r,count:i}of n){const o=s==="_removeElements"?-i:i;HC(e,r,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=i=>new Set(e.filter(o=>o[0]===i).map((o,a)=>a+","+o.splice(1).join(","))),r=s(0);for(let i=1;i<n;i++)if(!If(r,s(i)))return;return Array.from(r).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ct.update(this,this.width,this.height,e);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],ie(this.boxes,r=>{s&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,i)=>{r._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,is(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const s=this.getDatasetMeta(e),r={meta:s,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(s.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(on.has(this)?this.attached&&!on.running(this)&&on.start(this):(this.draw(),Sp({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:s,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,s=[];let r,i;for(r=0,i=n.length;r<i;++r){const o=n[r];(!e||o.visible)&&s.push(o)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,s={meta:e,index:e.index,cancelable:!0},r=dS(this,e);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Hd(n,r),e.controller.draw(),r&&Ud(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(e){return iy(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,s,r){const i=WS.modes[n];return typeof i=="function"?i(this,e,s,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],s=this._metasets;let r=s.filter(i=>i&&i._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},s.push(r)),r}getContext(){return this.$context||(this.$context=Ur(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const s=this.getDatasetMeta(e);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(e,n){const s=this.getDatasetMeta(e);s.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,s){const r=s?"show":"hide",i=this.getDatasetMeta(e),o=i.controller._resolveAnimations(void 0,r);eo(n)?(i.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(e,s),o.update(i,{visible:s}),this.update(a=>a.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),on.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Yf(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete ya[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,s=(i,o)=>{n.addEventListener(this,i,o),e[i]=o},r=(i,o,a)=>{i.offsetX=o,i.offsetY=a,this._eventHandler(i)};ie(this.options.events,i=>s(i,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,s=(l,u)=>{n.addEventListener(this,l,u),e[l]=u},r=(l,u)=>{e[l]&&(n.removeEventListener(this,l,u),delete e[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};let o;const a=()=>{r("attach",a),this.attached=!0,this.resize(),s("resize",i),s("detach",o)};o=()=>{this.attached=!1,r("resize",i),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){ie(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},ie(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,s){const r=s?"set":"remove";let i,o,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller["_"+r+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){o=e[a];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[r+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],s=e.map(({datasetIndex:i,index:o})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[o],index:o}});!Va(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(e,n,s){return this._plugins.notify(this,e,n,s)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,s){const r=this.options.hover,i=(l,u)=>l.filter(d=>!u.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),o=i(n,e),a=s?e:i(e,n);o.length&&this.updateHoverStyle(o,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,n){const s={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",s,r)===!1)return;const i=this._handleEvent(e,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,r),(i||s.changed)&&this.render(),this}_handleEvent(e,n,s){const{_active:r=[],options:i}=this,o=n,a=this._getActiveElements(e,r,s,o),l=h_(e),u=UC(e,this._lastEvent,s,l);s&&(this._lastEvent=null,he(i.onHover,[e,a,this],this),l&&he(i.onClick,[e,a,this],this));const d=!Va(a,r);return(d||n)&&(this._active=a,this._updateHoverStyles(a,r,n)),this._lastEvent=u,d}_getActiveElements(e,n,s,r){if(e.type==="mouseout")return[];if(!s)return n;const i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}},J(jn,"defaults",_e),J(jn,"instances",ya),J(jn,"overrides",Hs),J(jn,"registry",qt),J(jn,"version",BC),J(jn,"getChart",Cp),jn);function jp(){return ie(vo.instances,t=>t._plugins.invalidate())}function jy(t,e){const{x:n,y:s,base:r,width:i,height:o}=t.getProps(["x","y","base","width","height"],e);let a,l,u,d,h;return t.horizontal?(h=o/2,a=Math.min(n,r),l=Math.max(n,r),u=s-h,d=s+h):(h=i/2,a=n-h,l=n+h,u=Math.min(s,r),d=Math.max(s,r)),{left:a,top:u,right:l,bottom:d}}function Un(t,e,n,s){return t?0:zt(e,n,s)}function VC(t,e,n){const s=t.options.borderWidth,r=t.borderSkipped,i=ay(s);return{t:Un(r.top,i.top,0,n),r:Un(r.right,i.right,0,e),b:Un(r.bottom,i.bottom,0,n),l:Un(r.left,i.left,0,e)}}function QC(t,e,n){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,i=pr(r),o=Math.min(e,n),a=t.borderSkipped,l=s||ee(r);return{topLeft:Un(!l||a.top||a.left,i.topLeft,0,o),topRight:Un(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Un(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Un(!l||a.bottom||a.right,i.bottomRight,0,o)}}function YC(t){const e=jy(t),n=e.right-e.left,s=e.bottom-e.top,r=VC(t,n/2,s/2),i=QC(t,n/2,s/2);return{outer:{x:e.left,y:e.top,w:n,h:s,radius:i},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:s-r.t-r.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,i.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(r.b,r.r))}}}}function du(t,e,n,s){const r=e===null,i=n===null,a=t&&!(r&&i)&&jy(t,s);return a&&(r||ar(e,a.left,a.right))&&(i||ar(n,a.top,a.bottom))}function KC(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function XC(t,e){t.rect(e.x,e.y,e.w,e.h)}function hu(t,e,n={}){const s=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,i=(t.x+t.w!==n.x+n.w?e:0)-s,o=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+s,y:t.y+r,w:t.w+i,h:t.h+o,radius:t.radius}}class Mi extends os{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:s,backgroundColor:r}}=this,{inner:i,outer:o}=YC(this),a=KC(o.radius)?Xa:XC;e.save(),(o.w!==i.w||o.h!==i.h)&&(e.beginPath(),a(e,hu(o,n,i)),e.clip(),a(e,hu(i,-n,o)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),a(e,hu(i,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,s){return du(this,e,n,s)}inXRange(e,n){return du(this,e,null,n)}inYRange(e,n){return du(this,null,e,n)}getCenterPoint(e){const{x:n,y:s,base:r,horizontal:i}=this.getProps(["x","y","base","horizontal"],e);return{x:i?(n+r)/2:n,y:i?s:(s+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}J(Mi,"id","bar"),J(Mi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),J(Mi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Np=(t,e)=>{let{boxHeight:n=e,boxWidth:s=e}=t;return t.usePointStyle&&(n=Math.min(n,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(e,n)}},qC=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class Ep extends os{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,s){this.maxWidth=e,this.maxHeight=n,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=he(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(s=>e.filter(s,this.chart.data))),e.sort&&(n=n.sort((s,r)=>e.sort(s,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const s=e.labels,r=He(s.font),i=r.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Np(s,i);let u,d;n.font=r.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(o,i,a,l)+10):(d=this.maxHeight,u=this._fitCols(o,r,a,l)+10),this.width=Math.min(u,e.maxWidth||this.maxWidth),this.height=Math.min(d,e.maxHeight||this.maxHeight)}_fitRows(e,n,s,r){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],d=r+a;let h=e;i.textAlign="left",i.textBaseline="middle";let f=-1,p=-d;return this.legendItems.forEach((x,y)=>{const b=s+n/2+i.measureText(x.text).width;(y===0||u[u.length-1]+b+2*a>o)&&(h+=d,u[u.length-(y>0?0:1)]=0,p+=d,f++),l[y]={left:0,top:p,row:f,width:b,height:r},u[u.length-1]+=b+a}),h}_fitCols(e,n,s,r){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],d=o-e;let h=a,f=0,p=0,x=0,y=0;return this.legendItems.forEach((b,g)=>{const{itemWidth:m,itemHeight:v}=GC(s,n,i,b,r);g>0&&p+v+2*a>d&&(h+=f+a,u.push({width:f,height:p}),x+=f+a,y++,f=p=0),l[g]={left:x,top:p,col:y,width:m,height:v},f=Math.max(f,m),p+=v+a}),h+=f,u.push({width:f,height:p}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:r},rtl:i}}=this,o=gr(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=We(s,this.left+r,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=We(s,this.left+r,this.right-this.lineWidths[a])),u.top+=this.top+e+r,u.left=o.leftForLtr(o.x(l),u.width),l+=u.width+r}else{let a=0,l=We(s,this.top+e+r,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=We(s,this.top+e+r,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+r,u.left=o.leftForLtr(o.x(u.left),u.width),l+=u.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Hd(e,this),this._draw(),Ud(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:s,ctx:r}=this,{align:i,labels:o}=e,a=_e.color,l=gr(e.rtl,this.left,this.width),u=He(o.font),{padding:d}=o,h=u.size,f=h/2;let p;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=u.string;const{boxWidth:x,boxHeight:y,itemHeight:b}=Np(o,h),g=function(E,k,N){if(isNaN(x)||x<=0||isNaN(y)||y<0)return;r.save();const R=te(N.lineWidth,1);if(r.fillStyle=te(N.fillStyle,a),r.lineCap=te(N.lineCap,"butt"),r.lineDashOffset=te(N.lineDashOffset,0),r.lineJoin=te(N.lineJoin,"miter"),r.lineWidth=R,r.strokeStyle=te(N.strokeStyle,a),r.setLineDash(te(N.lineDash,[])),o.usePointStyle){const C={radius:y*Math.SQRT2/2,pointStyle:N.pointStyle,rotation:N.rotation,borderWidth:R},P=l.xPlus(E,x/2),z=k+f;ry(r,C,P,z,o.pointStyleWidth&&x)}else{const C=k+Math.max((h-y)/2,0),P=l.leftForLtr(E,x),z=pr(N.borderRadius);r.beginPath(),Object.values(z).some(Y=>Y!==0)?Xa(r,{x:P,y:C,w:x,h:y,radius:z}):r.rect(P,C,x,y),r.fill(),R!==0&&r.stroke()}r.restore()},m=function(E,k,N){to(r,N.text,E,k+b/2,u,{strikethrough:N.hidden,textAlign:l.textAlign(N.textAlign)})},v=this.isHorizontal(),w=this._computeTitleHeight();v?p={x:We(i,this.left+d,this.right-s[0]),y:this.top+d+w,line:0}:p={x:this.left+d,y:We(i,this.top+w+d,this.bottom-n[0].height),line:0},hy(this.ctx,e.textDirection);const j=b+d;this.legendItems.forEach((E,k)=>{r.strokeStyle=E.fontColor,r.fillStyle=E.fontColor;const N=r.measureText(E.text).width,R=l.textAlign(E.textAlign||(E.textAlign=o.textAlign)),C=x+f+N;let P=p.x,z=p.y;l.setWidth(this.width),v?k>0&&P+C+d>this.right&&(z=p.y+=j,p.line++,P=p.x=We(i,this.left+d,this.right-s[p.line])):k>0&&z+j>this.bottom&&(P=p.x=P+n[p.line].width+d,p.line++,z=p.y=We(i,this.top+w+d,this.bottom-n[p.line].height));const Y=l.x(P);if(g(Y,z,E),P=N_(R,P+x+f,v?P+C:this.right,e.rtl),m(l.x(P),z,E),v)p.x+=C+d;else if(typeof E.text!="string"){const we=u.lineHeight;p.y+=Ny(E,we)+d}else p.y+=j}),fy(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,s=He(n.font),r=Tt(n.padding);if(!n.display)return;const i=gr(e.rtl,this.left,this.width),o=this.ctx,a=n.position,l=s.size/2,u=r.top+l;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+u,h=We(e.align,h,this.right-f);else{const x=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);d=u+We(e.align,this.top,this.bottom-x-e.labels.padding-this._computeTitleHeight())}const p=We(a,h,h+f);o.textAlign=i.textAlign($d(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=s.string,to(o,n.text,p,d,s)}_computeTitleHeight(){const e=this.options.title,n=He(e.font),s=Tt(e.padding);return e.display?n.lineHeight+s.height:0}_getLegendItemAt(e,n){let s,r,i;if(ar(e,this.left,this.right)&&ar(n,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(r=i[s],ar(e,r.left,r.left+r.width)&&ar(n,r.top,r.top+r.height))return this.legendItems[s]}return null}handleEvent(e){const n=this.options;if(!e2(e.type,n))return;const s=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,i=qC(r,s);r&&!i&&he(n.onLeave,[e,r,this],this),this._hoveredItem=s,s&&!i&&he(n.onHover,[e,s,this],this)}else s&&he(n.onClick,[e,s,this],this)}}function GC(t,e,n,s,r){const i=JC(s,t,e,n),o=ZC(r,s,e.lineHeight);return{itemWidth:i,itemHeight:o}}function JC(t,e,n,s){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((i,o)=>i.length>o.length?i:o)),e+n.size/2+s.measureText(r).width}function ZC(t,e,n){let s=t;return typeof e.text!="string"&&(s=Ny(e,n)),s}function Ny(t,e){const n=t.text?t.text.length:0;return e*n}function e2(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Ey={id:"legend",_element:Ep,start(t,e,n){const s=t.legend=new Ep({ctx:t.ctx,options:n,chart:t});Ct.configure(t,s,n),Ct.addBox(t,s)},stop(t){Ct.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const s=t.legend;Ct.configure(t,s,n),s.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const s=e.datasetIndex,r=n.chart;r.isDatasetVisible(s)?(r.hide(s),e.hidden=!0):(r.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:r,color:i,useBorderRadius:o,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(n?0:void 0),d=Tt(u.borderWidth);return{text:e[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:s||u.pointStyle,rotation:u.rotation,textAlign:r||u.textAlign,borderRadius:o&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Py extends os{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const r=Ee(s.text)?s.text.length:1;this._padding=Tt(s.padding);const i=r*He(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:s,bottom:r,right:i,options:o}=this,a=o.align;let l=0,u,d,h;return this.isHorizontal()?(d=We(a,s,i),h=n+e,u=i-s):(o.position==="left"?(d=s+e,h=We(a,r,n),l=Ue*-.5):(d=i-e,h=We(a,n,r),l=Ue*.5),u=r-n),{titleX:d,titleY:h,maxWidth:u,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const s=He(n.font),i=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);to(e,n.text,0,0,s,{color:n.color,maxWidth:l,rotation:u,textAlign:$d(n.align),textBaseline:"middle",translation:[o,a]})}}function t2(t,e){const n=new Py({ctx:t.ctx,options:e,chart:t});Ct.configure(t,n,e),Ct.addBox(t,n),t.titleBlock=n}var My={id:"title",_element:Py,start(t,e,n){t2(t,n)},stop(t){const e=t.titleBlock;Ct.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const s=t.titleBlock;Ct.configure(t,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const mi={average(t){if(!t.length)return!1;let e,n,s=new Set,r=0,i=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),r+=l.y,++i}}return i===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:r/i}},nearest(t,e){if(!t.length)return!1;let n=e.x,s=e.y,r=Number.POSITIVE_INFINITY,i,o,a;for(i=0,o=t.length;i<o;++i){const l=t[i].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),d=b_(e,u);d<r&&(r=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,s=l.y}return{x:n,y:s}}};function Kt(t,e){return e&&(Ee(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function an(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
67
+ `)>-1?t.split(`
68
+ `):t}function n2(t,e){const{element:n,datasetIndex:s,index:r}=e,i=t.getDatasetMeta(s).controller,{label:o,value:a}=i.getLabelAndValue(r);return{chart:t,label:o,parsed:i.getParsed(r),raw:t.data.datasets[s].data[r],formattedValue:a,dataset:i.getDataset(),dataIndex:r,datasetIndex:s,element:n}}function Pp(t,e){const n=t.chart.ctx,{body:s,footer:r,title:i}=t,{boxWidth:o,boxHeight:a}=e,l=He(e.bodyFont),u=He(e.titleFont),d=He(e.footerFont),h=i.length,f=r.length,p=s.length,x=Tt(e.padding);let y=x.height,b=0,g=s.reduce((w,j)=>w+j.before.length+j.lines.length+j.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,h&&(y+=h*u.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),g){const w=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*w+(g-p)*l.lineHeight+(g-1)*e.bodySpacing}f&&(y+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let m=0;const v=function(w){b=Math.max(b,n.measureText(w).width+m)};return n.save(),n.font=u.string,ie(t.title,v),n.font=l.string,ie(t.beforeBody.concat(t.afterBody),v),m=e.displayColors?o+2+e.boxPadding:0,ie(s,w=>{ie(w.before,v),ie(w.lines,v),ie(w.after,v)}),m=0,n.font=d.string,ie(t.footer,v),n.restore(),b+=x.width,{width:b,height:y}}function s2(t,e){const{y:n,height:s}=e;return n<s/2?"top":n>t.height-s/2?"bottom":"center"}function r2(t,e,n,s){const{x:r,width:i}=s,o=n.caretSize+n.caretPadding;if(t==="left"&&r+i+o>e.width||t==="right"&&r-i-o<0)return!0}function i2(t,e,n,s){const{x:r,width:i}=n,{width:o,chartArea:{left:a,right:l}}=t;let u="center";return s==="center"?u=r<=(a+l)/2?"left":"right":r<=i/2?u="left":r>=o-i/2&&(u="right"),r2(u,t,e,n)&&(u="center"),u}function Mp(t,e,n){const s=n.yAlign||e.yAlign||s2(t,n);return{xAlign:n.xAlign||e.xAlign||i2(t,e,n,s),yAlign:s}}function o2(t,e){let{x:n,width:s}=t;return e==="right"?n-=s:e==="center"&&(n-=s/2),n}function a2(t,e,n){let{y:s,height:r}=t;return e==="top"?s+=n:e==="bottom"?s-=r+n:s-=r/2,s}function Tp(t,e,n,s){const{caretSize:r,caretPadding:i,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,u=r+i,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=pr(o);let x=o2(e,a);const y=a2(e,l,u);return l==="center"?a==="left"?x+=u:a==="right"&&(x-=u):a==="left"?x-=Math.max(d,f)+r:a==="right"&&(x+=Math.max(h,p)+r),{x:zt(x,0,s.width-e.width),y:zt(y,0,s.height-e.height)}}function Jo(t,e,n){const s=Tt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}function Rp(t){return Kt([],an(t))}function l2(t,e,n){return Ur(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Op(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Ty={beforeTitle:sn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return n[e.dataIndex]}return""},afterTitle:sn,beforeBody:sn,beforeLabel:sn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return ae(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:sn,afterBody:sn,beforeFooter:sn,footer:sn,afterFooter:sn};function tt(t,e,n,s){const r=t[e].call(n,s);return typeof r>"u"?Ty[e].call(n,s):r}class Pc extends os{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,s=this.options.setContext(this.getContext()),r=s.enabled&&n.options.animation&&s.animations,i=new py(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=l2(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:s}=n,r=tt(s,"beforeTitle",this,e),i=tt(s,"title",this,e),o=tt(s,"afterTitle",this,e);let a=[];return a=Kt(a,an(r)),a=Kt(a,an(i)),a=Kt(a,an(o)),a}getBeforeBody(e,n){return Rp(tt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:s}=n,r=[];return ie(e,i=>{const o={before:[],lines:[],after:[]},a=Op(s,i);Kt(o.before,an(tt(a,"beforeLabel",this,i))),Kt(o.lines,tt(a,"label",this,i)),Kt(o.after,an(tt(a,"afterLabel",this,i))),r.push(o)}),r}getAfterBody(e,n){return Rp(tt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:s}=n,r=tt(s,"beforeFooter",this,e),i=tt(s,"footer",this,e),o=tt(s,"afterFooter",this,e);let a=[];return a=Kt(a,an(r)),a=Kt(a,an(i)),a=Kt(a,an(o)),a}_createItems(e){const n=this._active,s=this.chart.data,r=[],i=[],o=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(n2(this.chart,n[l]));return e.filter&&(a=a.filter((d,h,f)=>e.filter(d,h,f,s))),e.itemSort&&(a=a.sort((d,h)=>e.itemSort(d,h,s))),ie(a,d=>{const h=Op(e.callbacks,d);r.push(tt(h,"labelColor",this,d)),i.push(tt(h,"labelPointStyle",this,d)),o.push(tt(h,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=a,a}update(e,n){const s=this.options.setContext(this.getContext()),r=this._active;let i,o=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{const a=mi[s.position].call(this,r,this._eventPosition);o=this._createItems(s),this.title=this.getTitle(o,s),this.beforeBody=this.getBeforeBody(o,s),this.body=this.getBody(o,s),this.afterBody=this.getAfterBody(o,s),this.footer=this.getFooter(o,s);const l=this._size=Pp(this,s),u=Object.assign({},a,l),d=Mp(this.chart,s,u),h=Tp(s,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,s,r){const i=this.getCaretPosition(e,s,r);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,s){const{xAlign:r,yAlign:i}=this,{caretSize:o,cornerRadius:a}=s,{topLeft:l,topRight:u,bottomLeft:d,bottomRight:h}=pr(a),{x:f,y:p}=e,{width:x,height:y}=n;let b,g,m,v,w,j;return i==="center"?(w=p+y/2,r==="left"?(b=f,g=b-o,v=w+o,j=w-o):(b=f+x,g=b+o,v=w-o,j=w+o),m=b):(r==="left"?g=f+Math.max(l,d)+o:r==="right"?g=f+x-Math.max(u,h)-o:g=this.caretX,i==="top"?(v=p,w=v-o,b=g-o,m=g+o):(v=p+y,w=v+o,b=g+o,m=g-o),j=v),{x1:b,x2:g,x3:m,y1:v,y2:w,y3:j}}drawTitle(e,n,s){const r=this.title,i=r.length;let o,a,l;if(i){const u=gr(s.rtl,this.x,this.width);for(e.x=Jo(this,s.titleAlign,s),n.textAlign=u.textAlign(s.titleAlign),n.textBaseline="middle",o=He(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=o.string,l=0;l<i;++l)n.fillText(r[l],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+a,l+1===i&&(e.y+=s.titleMarginBottom-a)}}_drawColorBox(e,n,s,r,i){const o=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:u}=i,d=He(i.bodyFont),h=Jo(this,"left",i),f=r.x(h),p=l<d.lineHeight?(d.lineHeight-l)/2:0,x=n.y+p;if(i.usePointStyle){const y={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},b=r.leftForLtr(f,u)+u/2,g=x+l/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Kf(e,y,b,g),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Kf(e,y,b,g)}else{e.lineWidth=ee(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const y=r.leftForLtr(f,u),b=r.leftForLtr(r.xPlus(f,1),u-2),g=pr(o.borderRadius);Object.values(g).some(m=>m!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Xa(e,{x:y,y:x,w:u,h:l,radius:g}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Xa(e,{x:b,y:x+1,w:u-2,h:l-2,radius:g}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(y,x,u,l),e.strokeRect(y,x,u,l),e.fillStyle=o.backgroundColor,e.fillRect(b,x+1,u-2,l-2))}e.fillStyle=this.labelTextColors[s]}drawBody(e,n,s){const{body:r}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:d}=s,h=He(s.bodyFont);let f=h.lineHeight,p=0;const x=gr(s.rtl,this.x,this.width),y=function(N){n.fillText(N,x.x(e.x+p),e.y+f/2),e.y+=f+i},b=x.textAlign(o);let g,m,v,w,j,E,k;for(n.textAlign=o,n.textBaseline="middle",n.font=h.string,e.x=Jo(this,b,s),n.fillStyle=s.bodyColor,ie(this.beforeBody,y),p=a&&b!=="right"?o==="center"?u/2+d:u+2+d:0,w=0,E=r.length;w<E;++w){for(g=r[w],m=this.labelTextColors[w],n.fillStyle=m,ie(g.before,y),v=g.lines,a&&v.length&&(this._drawColorBox(n,e,w,x,s),f=Math.max(h.lineHeight,l)),j=0,k=v.length;j<k;++j)y(v[j]),f=h.lineHeight;ie(g.after,y)}p=0,f=h.lineHeight,ie(this.afterBody,y),e.y-=i}drawFooter(e,n,s){const r=this.footer,i=r.length;let o,a;if(i){const l=gr(s.rtl,this.x,this.width);for(e.x=Jo(this,s.footerAlign,s),e.y+=s.footerMarginTop,n.textAlign=l.textAlign(s.footerAlign),n.textBaseline="middle",o=He(s.footerFont),n.fillStyle=s.footerColor,n.font=o.string,a=0;a<i;++a)n.fillText(r[a],l.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+s.footerSpacing}}drawBackground(e,n,s,r){const{xAlign:i,yAlign:o}=this,{x:a,y:l}=e,{width:u,height:d}=s,{topLeft:h,topRight:f,bottomLeft:p,bottomRight:x}=pr(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(a+h,l),o==="top"&&this.drawCaret(e,n,s,r),n.lineTo(a+u-f,l),n.quadraticCurveTo(a+u,l,a+u,l+f),o==="center"&&i==="right"&&this.drawCaret(e,n,s,r),n.lineTo(a+u,l+d-x),n.quadraticCurveTo(a+u,l+d,a+u-x,l+d),o==="bottom"&&this.drawCaret(e,n,s,r),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),o==="center"&&i==="left"&&this.drawCaret(e,n,s,r),n.lineTo(a,l+h),n.quadraticCurveTo(a,l,a+h,l),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,s=this.$animations,r=s&&s.x,i=s&&s.y;if(r||i){const o=mi[e.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Pp(this,e),l=Object.assign({},o,this._size),u=Mp(n,e,l),d=Tp(e,l,u,n);(r._to!==d.x||i._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},i={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const o=Tt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=s,this.drawBackground(i,e,r,n),hy(e,n.textDirection),i.y+=o.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),fy(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const s=this._active,r=e.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),i=!Va(s,r),o=this._positionChanged(r,n);(i||o)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,i=this._active||[],o=this._getActiveElements(e,i,n,s),a=this._positionChanged(o,e),l=n||!Va(o,i)||a;return l&&(this._active=o,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,s,r){const i=this.options;if(e.type==="mouseout")return[];if(!r)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,i.mode,i,s);return i.reverse&&o.reverse(),o}_positionChanged(e,n){const{caretX:s,caretY:r,options:i}=this,o=mi[i.position].call(this,e,n);return o!==!1&&(s!==o.x||r!==o.y)}}J(Pc,"positioners",mi);var Ry={id:"tooltip",_element:Pc,positioners:mi,afterInit(t,e,n){n&&(t.tooltip=new Pc({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ty},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const u2=(t,e,n,s)=>(typeof e=="string"?(n=t.push(e)-1,s.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function c2(t,e,n,s){const r=t.indexOf(e);if(r===-1)return u2(t,e,n,s);const i=t.lastIndexOf(e);return r!==i?n:r}const d2=(t,e)=>t===null?null:zt(Math.round(t),0,e);function Dp(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Ja extends Vr{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const s=this.getLabels();for(const{index:r,label:i}of n)s[r]===i&&s.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(ae(e))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===e?n:c2(s,e,te(n,e),this._addedLabels),d2(n,s.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(s=0),n||(r=this.getLabels().length-1)),this.min=s,this.max=r}buildTicks(){const e=this.min,n=this.max,s=this.options.offset,r=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let o=e;o<=n;o++)r.push({value:o});return r}getLabelForValue(e){return Dp.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}J(Ja,"id","category"),J(Ja,"defaults",{ticks:{callback:Dp}});function h2(t,e){const n=[],{bounds:r,step:i,min:o,max:a,precision:l,count:u,maxTicks:d,maxDigits:h,includeBounds:f}=t,p=i||1,x=d-1,{min:y,max:b}=e,g=!ae(o),m=!ae(a),v=!ae(u),w=(b-y)/(h+1);let j=zf((b-y)/x/p)*p,E,k,N,R;if(j<1e-14&&!g&&!m)return[{value:y},{value:b}];R=Math.ceil(b/j)-Math.floor(y/j),R>x&&(j=zf(R*j/x/p)*p),ae(l)||(E=Math.pow(10,l),j=Math.ceil(j*E)/E),r==="ticks"?(k=Math.floor(y/j)*j,N=Math.ceil(b/j)*j):(k=y,N=b),g&&m&&i&&m_((a-o)/i,j/1e3)?(R=Math.round(Math.min((a-o)/j,d)),j=(a-o)/R,k=o,N=a):v?(k=g?o:k,N=m?a:N,R=u-1,j=(N-k)/R):(R=(N-k)/j,pa(R,Math.round(R),j/1e3)?R=Math.round(R):R=Math.ceil(R));const C=Math.max(Bf(j),Bf(k));E=Math.pow(10,ae(l)?C:l),k=Math.round(k*E)/E,N=Math.round(N*E)/E;let P=0;for(g&&(f&&k!==o?(n.push({value:o}),k<o&&P++,pa(Math.round((k+P*j)*E)/E,o,Lp(o,w,t))&&P++):k<o&&P++);P<R;++P){const z=Math.round((k+P*j)*E)/E;if(m&&z>a)break;n.push({value:z})}return m&&f&&N!==a?n.length&&pa(n[n.length-1].value,a,Lp(a,w,t))?n[n.length-1].value=a:n.push({value:a}):(!m||N===a)&&n.push({value:N}),n}function Lp(t,e,{horizontal:n,minRotation:s}){const r=_s(s),i=(n?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/i,o)}class f2 extends Vr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return ae(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:r,max:i}=this;const o=l=>r=n?r:l,a=l=>i=s?i:l;if(e){const l=ns(r),u=ns(i);l<0&&u<0?a(0):l>0&&u>0&&o(0)}if(r===i){let l=i===0?1:Math.abs(i*.05);a(i+l),e||o(r-l)}this.min=r,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=e,r;return s?(r=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let s=this.getTickLimit();s=Math.max(2,s);const r={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,o=h2(r,i);return e.bounds==="ticks"&&y_(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){const r=(s-n)/Math.max(e.length-1,1)/2;n-=r,s+=r}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(e){return ny(e,this.chart.options.locale,this.options.ticks.format)}}class Za extends f2{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Mt(e)?e:0,this.max=Mt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,s=_s(this.options.ticks.minRotation),r=(e?Math.sin(s):Math.cos(s))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}J(Za,"id","linear"),J(Za,"defaults",{ticks:{callback:sy.formatters.numeric}});const _l={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},it=Object.keys(_l);function Fp(t,e){return t-e}function Ip(t,e){if(ae(e))return null;const n=t._adapter,{parser:s,round:r,isoWeekday:i}=t._parseOpts;let o=e;return typeof s=="function"&&(o=s(o)),Mt(o)||(o=typeof s=="string"?n.parse(o,s):n.parse(o)),o===null?null:(r&&(o=r==="week"&&(Ka(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,r)),+o)}function Ap(t,e,n,s){const r=it.length;for(let i=it.indexOf(t);i<r-1;++i){const o=_l[it[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-e)/(a*o.size))<=s)return it[i]}return it[r-1]}function p2(t,e,n,s,r){for(let i=it.length-1;i>=it.indexOf(n);i--){const o=it[i];if(_l[o].common&&t._adapter.diff(r,s,o)>=e-1)return o}return it[n?it.indexOf(n):0]}function g2(t){for(let e=it.indexOf(t)+1,n=it.length;e<n;++e)if(_l[it[e]].common)return it[e]}function zp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:s,hi:r}=Wd(n,e),i=n[s]>=e?n[s]:n[r];t[i]=!0}}function m2(t,e,n,s){const r=t._adapter,i=+r.startOf(e[0].value,s),o=e[e.length-1].value;let a,l;for(a=i;a<=o;a=+r.add(a,1,s))l=n[a],l>=0&&(e[l].major=!0);return e}function Bp(t,e,n){const s=[],r={},i=e.length;let o,a;for(o=0;o<i;++o)a=e[o],r[a]=o,s.push({value:a,major:!1});return i===0||!n?s:m2(t,s,r,n)}class el extends Vr{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const s=e.time||(e.time={}),r=this._adapter=new FS._date(e.adapters.date);r.init(n),ji(s.displayFormats,r.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Ip(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,s=e.time.unit||"day";let{min:r,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function l(u){!o&&!isNaN(u.min)&&(r=Math.min(r,u.min)),!a&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!o||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Mt(r)&&!isNaN(r)?r:+n.startOf(Date.now(),s),i=Mt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),s)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],s=e[e.length-1]),{min:n,max:s}}buildTicks(){const e=this.options,n=e.time,s=e.ticks,r=s.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const i=this.min,o=this.max,a=S_(r,i,o);return this._unit=n.unit||(s.autoSkip?Ap(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):p2(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:g2(this._unit),this.initOffsets(r),e.reverse&&a.reverse(),Bp(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,s=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?s=i:s=(i-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;n=zt(n,0,o),s=zt(s,0,o),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const e=this._adapter,n=this.min,s=this.max,r=this.options,i=r.time,o=i.unit||Ap(i.minUnit,n,s,this._getLabelCapacity(n)),a=te(r.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,u=Ka(l)||l===!0,d={};let h=n,f,p;if(u&&(h=+e.startOf(h,"isoWeek",l)),h=+e.startOf(h,u?"day":o),e.diff(s,n,o)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+o);const x=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,p=0;f<s;f=+e.add(f,a,o),p++)zp(d,f,x);return(f===s||r.bounds==="ticks"||p===1)&&zp(d,f,x),Object.keys(d).sort(Fp).map(y=>+y)}getLabelForValue(e){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(e,s.tooltipFormat):n.format(e,s.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,i=this._unit,o=n||r[i];return this._adapter.format(e,o)}_tickFormatFunction(e,n,s,r){const i=this.options,o=i.ticks.callback;if(o)return he(o,[e,n,s],this);const a=i.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],h=u&&a[u],f=s[n],p=u&&h&&f&&f.major;return this._adapter.format(e,r||(p?h:d))}generateTickLabels(e){let n,s,r;for(n=0,s=e.length;n<s;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,s=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,s=this.ctx.measureText(e).width,r=_s(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(r),o=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:s*i+a*o,h:s*o+a*i}}_getLabelCapacity(e){const n=this.options.time,s=n.displayFormats,r=s[n.unit]||s.millisecond,i=this._tickFormatFunction(e,0,Bp(this,[e],this._majorUnit),r),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,s;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,s=r.length;n<s;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,s;if(e.length)return e;const r=this.getLabels();for(n=0,s=r.length;n<s;++n)e.push(Ip(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return J0(e.sort(Fp))}}J(el,"id","time"),J(el,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Zo(t,e,n){let s=0,r=t.length-1,i,o,a,l;n?(e>=t[s].pos&&e<=t[r].pos&&({lo:s,hi:r}=Cc(t,"pos",e)),{pos:i,time:a}=t[s],{pos:o,time:l}=t[r]):(e>=t[s].time&&e<=t[r].time&&({lo:s,hi:r}=Cc(t,"time",e)),{time:i,pos:a}=t[s],{time:o,pos:l}=t[r]);const u=o-i;return u?a+(l-a)*(e-i)/u:a}class Wp extends el{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Zo(n,this.min),this._tableRange=Zo(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:s}=this,r=[],i=[];let o,a,l,u,d;for(o=0,a=e.length;o<a;++o)u=e[o],u>=n&&u<=s&&r.push(u);if(r.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(o=0,a=r.length;o<a;++o)d=r[o+1],l=r[o-1],u=r[o],Math.round((d+l)/2)!==u&&i.push({time:u,pos:o/(a-1)});return i}_generate(){const e=this.min,n=this.max;let s=super.getDataTimestamps();return(!s.includes(e)||!s.length)&&s.splice(0,0,e),(!s.includes(n)||s.length===1)&&s.push(n),s.sort((r,i)=>r-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?e=this.normalize(n.concat(s)):e=n.length?n:s,e=this._cache.all=e,e}getDecimalForValue(e){return(Zo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,s=this.getDecimalForPixel(e)/n.factor-n.end;return Zo(this._table,s*this._tableRange+this._minPos,!0)}}J(Wp,"id","timeseries"),J(Wp,"defaults",el.defaults);const Oy="label";function $p(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function y2(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Dy(t,e){t.labels=e}function Ly(t,e,n=Oy){const s=[];t.datasets=e.map(r=>{const i=t.datasets.find(o=>o[n]===r[n]);return!i||!r.data||s.includes(i)?{...r}:(s.push(i),Object.assign(i,r),i)})}function x2(t,e=Oy){const n={labels:[],datasets:[]};return Dy(n,t.labels),Ly(n,t.datasets,e),n}function v2(t,e){const{height:n=150,width:s=300,redraw:r=!1,datasetIdKey:i,type:o,data:a,options:l,plugins:u=[],fallbackContent:d,updateMode:h,...f}=t,p=S.useRef(null),x=S.useRef(null),y=()=>{p.current&&(x.current=new vo(p.current,{type:o,data:x2(a,i),options:l&&{...l},plugins:u}),$p(e,x.current))},b=()=>{$p(e,null),x.current&&(x.current.destroy(),x.current=null)};return S.useEffect(()=>{!r&&x.current&&l&&y2(x.current,l)},[r,l]),S.useEffect(()=>{!r&&x.current&&Dy(x.current.config.data,a.labels)},[r,a.labels]),S.useEffect(()=>{!r&&x.current&&a.datasets&&Ly(x.current.config.data,a.datasets,i)},[r,a.datasets]),S.useEffect(()=>{x.current&&(r?(b(),setTimeout(y)):x.current.update(h))},[r,l,a.labels,a.datasets,h]),S.useEffect(()=>{x.current&&(b(),setTimeout(y))},[o]),S.useEffect(()=>(y(),()=>b()),[]),c.jsx("canvas",{ref:p,role:"img",height:n,width:s,...f,children:d})}const b2=S.forwardRef(v2);function w2(t,e){return vo.register(e),S.forwardRef((n,s)=>c.jsx(b2,{...n,ref:s,type:t}))}const mr=w2("bar",ga);function k2(t,e="12px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s?(s.font=e,s.measureText(t).width):0}function Se({label:t,percentage:e,color:n,title:s}){const r=S.useRef(null),[i,o]=S.useState(!1),[a,l]=S.useState(!1);return S.useEffect(()=>{const u=()=>{if(r.current){const h=r.current.offsetWidth,f=k2(t,'bold 12px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');o(h>=f+8)}};u(),window.addEventListener("resize",u);const d=new ResizeObserver(u);return r.current&&d.observe(r.current),()=>{window.removeEventListener("resize",u),d.disconnect()}},[t,e]),c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:r,className:`${n} flex items-center justify-center text-xs font-semibold transition-all`,style:{width:`${e}%`,minWidth:"2px"},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:i&&c.jsx("span",{className:"text-white",children:t})}),a&&r.current&&c.jsxs("div",{className:"fixed px-3 py-2 bg-gray-900 text-white text-xs rounded-lg shadow-lg border border-gray-700 whitespace-nowrap z-50 pointer-events-none",style:{left:`${r.current.getBoundingClientRect().left+r.current.getBoundingClientRect().width/2}px`,top:`${r.current.getBoundingClientRect().top-10}px`,transform:"translate(-50%, -100%)"},children:[s,c.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px",children:c.jsx("div",{className:"border-4 border-transparent border-t-gray-900"})})]})]})}function Ce({title:t,value:e,subtitle:n,color:s="blue"}){const r={blue:"bg-blue-500/10 border-blue-500/20",green:"bg-green-500/10 border-green-500/20",purple:"bg-purple-500/10 border-purple-500/20",orange:"bg-orange-500/10 border-orange-500/20",pink:"bg-pink-500/10 border-pink-500/20",cyan:"bg-cyan-500/10 border-cyan-500/20"};return c.jsxs("div",{className:`p-6 rounded-lg border ${r[s]||r.blue}`,children:[c.jsx("div",{className:"text-sm text-gray-400 mb-1",children:t}),c.jsx("div",{className:"text-3xl font-bold mb-1",children:e}),n&&c.jsx("div",{className:"text-xs text-gray-500",children:n})]})}function L(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(2)}K`:t.toLocaleString()}function le(t){return`$${t.toFixed(2)}`}vo.register(Ja,Za,Mi,My,Ry,Ey);function _2(){const[t,e]=S.useState("7"),{data:n,isLoading:s,error:r}=yl({queryKey:["usage-statistics",t],queryFn:async()=>{const l=await fetch(`/api/statistics/overall?days=${t}`);if(!l.ok)throw new Error("Failed to fetch usage statistics");return l.json()}}),i=()=>c.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),c.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),o=()=>c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),c.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),a=()=>{if(r)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsxs("div",{className:"text-red-400",children:["Error loading statistics: ",r.message]})});if(!n)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:l,daily:u,byProject:d,byModel:h,cache:f,cost:p,productivity:x,trends:y}=n,b=[...u.map(k=>k.tokenUsage.totalTokens)].sort((k,N)=>k-N),g=Math.floor(b.length*.95),m=Math.max(b[g]||1,1),v=u.map(k=>k.tokenUsage.totalTokens),w=v.length>0?Math.min(...v):0,j=v.length>0?Math.max(...v):0,E=v.length>0?v.reduce((k,N)=>k+N,0)/v.length:0;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-gray-400 mb-6",children:[ht(new Date(l.dateRange.start),"MMM d, yyyy")," - ",ht(new Date(l.dateRange.end),"MMM d, yyyy")]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(Ce,{title:"Total Tokens",value:L(l.tokenUsage.totalTokens),subtitle:`${l.sessionCount} sessions`,color:"blue"}),c.jsx(Ce,{title:"Total Cost",value:le(p.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(Ce,{title:"Cache Hit Rate",value:`${f.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(f.estimatedSavings)}`,color:"purple"}),c.jsx(Ce,{title:"Messages",value:L(l.messageCount),subtitle:`${l.sessionCount} sessions`,color:"orange"})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Token Distribution"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[L(l.tokenUsage.totalTokens)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"Input",percentage:l.tokenUsage.inputTokens/l.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${L(l.tokenUsage.inputTokens)}`}),c.jsx(Se,{label:"Output",percentage:l.tokenUsage.outputTokens/l.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${L(l.tokenUsage.outputTokens)}`}),c.jsx(Se,{label:"Cache Create",percentage:l.tokenUsage.cacheCreationTokens/l.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${L(l.tokenUsage.cacheCreationTokens)}`}),c.jsx(Se,{label:"Cache Read",percentage:l.tokenUsage.cacheReadTokens/l.tokenUsage.totalTokens*100,color:"bg-cyan-500",title:`Cache Read: ${L(l.tokenUsage.cacheReadTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",L(l.tokenUsage.inputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",L(l.tokenUsage.outputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",L(l.tokenUsage.cacheCreationTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",L(l.tokenUsage.cacheReadTokens),")"]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cache Creation Breakdown"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[L(f.totalCacheCreation)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"5-minute",percentage:f.totalCacheCreation>0?f.ephemeral5mTokens/f.totalCacheCreation*100:0,color:"bg-yellow-500",title:`5-minute: ${L(f.ephemeral5mTokens)}`}),c.jsx(Se,{label:"1-hour",percentage:f.totalCacheCreation>0?f.ephemeral1hTokens/f.totalCacheCreation*100:0,color:"bg-orange-500",title:`1-hour: ${L(f.ephemeral1hTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded"}),c.jsxs("span",{children:["5-minute (",L(f.ephemeral5mTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-orange-500 rounded"}),c.jsxs("span",{children:["1-hour (",L(f.ephemeral1hTokens),")"]})]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Cost Distribution"}),c.jsx("span",{className:"text-sm text-white font-semibold",children:le(p.totalCost)})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"Input",percentage:p.inputCost/p.totalCost*100,color:"bg-blue-500",title:`Input: ${le(p.inputCost)}`}),c.jsx(Se,{label:"Output",percentage:p.outputCost/p.totalCost*100,color:"bg-green-500",title:`Output: ${le(p.outputCost)}`}),c.jsx(Se,{label:"Cache Create",percentage:p.cacheCreationCost/p.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(p.cacheCreationCost)}`}),c.jsx(Se,{label:"Cache Read",percentage:p.cacheReadCost/p.totalCost*100,color:"bg-cyan-500",title:`Cache Read: ${le(p.cacheReadCost)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",le(p.inputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",le(p.outputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",le(p.cacheCreationCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",le(p.cacheReadCost),")"]})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),c.jsx("div",{className:"text-2xl font-bold text-green-400",children:le(f.estimatedSavings)})]}),c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Cache Hit Rate"}),c.jsxs("div",{className:"text-2xl font-bold text-purple-400",children:[f.cacheHitRate.toFixed(1),"%"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),u.length===0?c.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{children:"No daily data available"}),c.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",l.sessionCount]}),c.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",u.length]})]})}):c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:u.map(k=>ht(new Date(k.date),"MMM d")),datasets:[{label:"Input",data:u.map(k=>k.tokenUsage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:u.map(k=>k.tokenUsage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:u.map(k=>k.tokenUsage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:u.map(k=>k.tokenUsage.outputTokens),backgroundColor:"rgb(34, 197, 94)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:0,autoSkip:!0,maxTicksLimit:15}},y:{stacked:!0,max:m,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(k){return typeof k=="number"?L(k):k}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:k=>{if(k.length>0){const N=k[0].dataIndex;return ht(new Date(u[N].date),"MMM d, yyyy")}return""},label:k=>{const N=k.dataset.label||"",R=k.parsed.y!==null?L(k.parsed.y):"0";return`${N}: ${R}`},footer:k=>{if(k.length>0){const N=k[0].dataIndex,R=L(u[N].tokenUsage.totalTokens),C=u[N].sessionCount;return`Total: ${R}
69
+ ${C} sessions`}return""}}}}},height:300})}),c.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsx("span",{children:"Input"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsx("span",{children:"Cache Create"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsx("span",{children:"Cache Read"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsx("span",{children:"Output"})]})]}),u.length>0&&c.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6 pt-6 border-t border-gray-700",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Min Daily"}),c.jsx("div",{className:"font-mono text-sm text-gray-300",children:L(w)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Avg Daily"}),c.jsx("div",{className:"font-mono text-sm text-blue-400",children:L(E)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Max Daily"}),c.jsx("div",{className:"font-mono text-sm text-green-400",children:L(j)})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Project"}),c.jsx("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:d.slice(0,10).map((k,N)=>{const R=d.reduce((P,z)=>P+z.tokenUsage.totalTokens,0),C=k.tokenUsage.totalTokens/R*100;return c.jsxs("div",{className:"bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-baseline mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.name}),c.jsxs("div",{className:"text-xs text-gray-500",children:[k.sessionCount," sessions"]})]}),c.jsxs("div",{className:"text-right flex-shrink-0 ml-4",children:[c.jsx("div",{className:"font-mono text-sm",children:L(k.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:L(k.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:L(k.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:L(k.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:L(k.tokenUsage.outputTokens)})]})]})]},N)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),c.jsx("div",{className:"space-y-4",children:h.map((k,N)=>{const R=h.reduce((P,z)=>P+z.tokenUsage.totalTokens,0),C=k.tokenUsage.totalTokens/R*100;return c.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.model}),c.jsxs("div",{className:"text-xs text-gray-500",children:[k.messageCount," messages"]})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"font-mono text-sm",children:L(k.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.toFixed(1),"%"]})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${C}%`}})}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:L(k.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:L(k.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:L(k.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:L(k.tokenUsage.outputTokens)})]})]})]},N)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[c.jsx(Ce,{title:"Total Tool Calls",value:L(x.totalToolCalls),subtitle:`Across ${l.sessionCount} sessions`,color:"blue"}),c.jsx(Ce,{title:"Agent Sessions",value:L(x.agentSessions),subtitle:`${x.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(Ce,{title:"Avg Tools per Session",value:(x.totalToolCalls/x.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:x.toolUsage.map((k,N)=>c.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:k.toolName}),c.jsxs("div",{className:"text-xs text-gray-500",children:[c.jsxs("span",{className:"hidden @[300px]:inline",children:[k.successfulUses," successful / ",k.totalUses," total calls"]}),c.jsxs("span",{className:"@[300px]:hidden",children:[k.successfulUses," / ",k.totalUses," calls"]})]})]}),c.jsxs("div",{className:"text-right ml-2",children:[c.jsxs("div",{className:`font-mono text-sm ${k.successRate>=90?"text-green-400":k.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[k.successRate.toFixed(1),"%"]}),c.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full ${k.successRate>=90?"bg-green-500":k.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(k.successRate,100)}%`}})})]},N))})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsx(Ce,{title:"Total Cache Created",value:L(f.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(Ce,{title:"Total Cache Read",value:L(f.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(Ce,{title:"Cache Hit Rate",value:`${f.cacheHitRate.toFixed(2)}%`,subtitle:`${le(f.estimatedSavings)} saved`,color:"green"})]}),c.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:L(f.ephemeral5mTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[f.totalCacheCreation>0?(f.ephemeral5mTokens/f.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),c.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:L(f.ephemeral1hTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[f.totalCacheCreation>0?(f.ephemeral1hTokens/f.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),c.jsxs("div",{className:"mb-8",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:y.byHour.map(k=>`${k.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:y.byHour.map(k=>k.messageCount),backgroundColor:"rgba(59, 130, 246, 0.8)",borderColor:"rgb(59, 130, 246)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:45,minRotation:45}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:k=>{const N=y.byHour[k.dataIndex];return[`Messages: ${N.messageCount}`,`Sessions: ${N.sessionCount}`,`Tokens: ${L(N.tokenUsage.totalTokens)}`]}}}}},height:250})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:y.byWeekday.map(k=>k.weekdayName),datasets:[{label:"Messages",data:y.byWeekday.map(k=>k.messageCount),backgroundColor:"rgba(34, 197, 94, 0.8)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:k=>{const N=y.byWeekday[k.dataIndex];return[`Messages: ${N.messageCount}`,`Sessions: ${N.sessionCount}`,`Tokens: ${L(N.tokenUsage.totalTokens)}`]}}}}},height:250})})]})]})]})};return c.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:c.jsxs("div",{className:"max-w-7xl mx-auto",children:[c.jsx("div",{className:"mb-2",children:c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Dashboard"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>e("7"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="7"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 7 Days"}),c.jsx("button",{onClick:()=>e("30"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="30"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 30 Days"}),c.jsx("button",{onClick:()=>e("all"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${t==="all"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"All Time"})]})]})}),s?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-64 mb-8 animate-pulse"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(i,{}),c.jsx(i,{}),c.jsx(i,{}),c.jsx(i,{})]}),c.jsx(o,{}),c.jsx("div",{className:"mt-8",children:c.jsx(o,{})}),c.jsx("div",{className:"mt-8",children:c.jsx(o,{})})]}):a()]})})}vo.register(Ja,Za,Mi,My,Ry,Ey);function S2({projectInfo:t}){var h;const{projectId:e}=D0(),n=mo(),[s,r]=S.useState("7"),{data:i,isLoading:o,error:a}=yl({queryKey:["project-statistics",e,s],queryFn:async()=>{const f=await fetch(`/api/statistics/projects/${e}?days=${s}`);if(!f.ok)throw f.status===404?new Error("Project not found"):new Error("Failed to fetch project statistics");return f.json()},enabled:!!e}),l=()=>c.jsxs("div",{className:"p-6 rounded-lg border bg-gray-800/50 border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-4 bg-gray-700 rounded w-1/2 mb-3"}),c.jsx("div",{className:"h-8 bg-gray-700 rounded w-3/4 mb-2"}),c.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3"})]}),u=()=>c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 border border-gray-700 animate-pulse",children:[c.jsx("div",{className:"h-6 bg-gray-700 rounded w-1/3 mb-6"}),c.jsx("div",{className:"h-64 bg-gray-700 rounded"})]}),d=()=>{if(a)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsxs("div",{className:"text-center",children:[c.jsxs("div",{className:"text-red-400 mb-4",children:["Error loading statistics: ",a.message]}),c.jsx("button",{onClick:()=>n("/dashboard"),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Back to Dashboard"})]})});if(!i)return c.jsx("div",{className:"flex items-center justify-center h-96",children:c.jsx("div",{className:"text-gray-400",children:"No data available"})});const{overview:f,daily:p,byModel:x,cache:y,cost:b,productivity:g,trends:m}=i;i.byProject[0];const v=[...p.map(C=>C.tokenUsage.totalTokens)].sort((C,P)=>C-P),w=Math.floor(v.length*.95),j=Math.max(v[w]||1,1),E=p.map(C=>C.tokenUsage.totalTokens),k=E.length>0?Math.min(...E):0,N=E.length>0?Math.max(...E):0,R=E.length>0?E.reduce((C,P)=>C+P,0)/E.length:0;return c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"text-gray-400 mb-6",children:[ht(new Date(f.dateRange.start),"MMM d, yyyy")," - ",ht(new Date(f.dateRange.end),"MMM d, yyyy")]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(Ce,{title:"Total Tokens",value:L(f.tokenUsage.totalTokens),subtitle:`${f.sessionCount} sessions`,color:"blue"}),c.jsx(Ce,{title:"Total Cost",value:le(b.totalCost),subtitle:"Estimated",color:"green"}),c.jsx(Ce,{title:"Cache Hit Rate",value:`${y.cacheHitRate.toFixed(1)}%`,subtitle:`Saved ${le(y.estimatedSavings)}`,color:"purple"}),c.jsx(Ce,{title:"Messages",value:L(f.messageCount),subtitle:`${f.sessionCount} sessions`,color:"orange"})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Token Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Token Distribution"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[L(f.tokenUsage.totalTokens)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"Input",percentage:f.tokenUsage.inputTokens/f.tokenUsage.totalTokens*100,color:"bg-blue-500",title:`Input: ${L(f.tokenUsage.inputTokens)}`}),c.jsx(Se,{label:"Output",percentage:f.tokenUsage.outputTokens/f.tokenUsage.totalTokens*100,color:"bg-green-500",title:`Output: ${L(f.tokenUsage.outputTokens)}`}),c.jsx(Se,{label:"Cache Create",percentage:f.tokenUsage.cacheCreationTokens/f.tokenUsage.totalTokens*100,color:"bg-purple-500",title:`Cache Create: ${L(f.tokenUsage.cacheCreationTokens)}`}),c.jsx(Se,{label:"Cache Read",percentage:f.tokenUsage.cacheReadTokens/f.tokenUsage.totalTokens*100,color:"bg-cyan-500",title:`Cache Read: ${L(f.tokenUsage.cacheReadTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",L(f.tokenUsage.inputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",L(f.tokenUsage.outputTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",L(f.tokenUsage.cacheCreationTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",L(f.tokenUsage.cacheReadTokens),")"]})]})]})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cache Creation Breakdown"}),c.jsxs("span",{className:"text-sm text-white font-semibold",children:[L(y.totalCacheCreation)," tokens"]})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"5-minute",percentage:y.totalCacheCreation>0?y.ephemeral5mTokens/y.totalCacheCreation*100:0,color:"bg-yellow-500",title:`5-minute: ${L(y.ephemeral5mTokens)}`}),c.jsx(Se,{label:"1-hour",percentage:y.totalCacheCreation>0?y.ephemeral1hTokens/y.totalCacheCreation*100:0,color:"bg-orange-500",title:`1-hour: ${L(y.ephemeral1hTokens)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded"}),c.jsxs("span",{children:["5-minute (",L(y.ephemeral5mTokens),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-orange-500 rounded"}),c.jsxs("span",{children:["1-hour (",L(y.ephemeral1hTokens),")"]})]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cost Breakdown"}),c.jsxs("div",{className:"mb-8",children:[c.jsxs("div",{className:"flex justify-between items-center mb-2",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Total Cost Distribution"}),c.jsx("span",{className:"text-sm text-white font-semibold",children:le(b.totalCost)})]}),c.jsx("div",{className:"relative",children:c.jsxs("div",{className:"h-8 w-full bg-gray-700 overflow-hidden flex",children:[c.jsx(Se,{label:"Input",percentage:b.inputCost/b.totalCost*100,color:"bg-blue-500",title:`Input: ${le(b.inputCost)}`}),c.jsx(Se,{label:"Output",percentage:b.outputCost/b.totalCost*100,color:"bg-green-500",title:`Output: ${le(b.outputCost)}`}),c.jsx(Se,{label:"Cache Create",percentage:b.cacheCreationCost/b.totalCost*100,color:"bg-purple-500",title:`Cache Create: ${le(b.cacheCreationCost)}`}),c.jsx(Se,{label:"Cache Read",percentage:b.cacheReadCost/b.totalCost*100,color:"bg-cyan-500",title:`Cache Read: ${le(b.cacheReadCost)}`})]})}),c.jsxs("div",{className:"flex gap-4 mt-3 text-xs justify-center flex-wrap",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsxs("span",{children:["Input (",le(b.inputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsxs("span",{children:["Output (",le(b.outputCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsxs("span",{children:["Cache Create (",le(b.cacheCreationCost),")"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsxs("span",{children:["Cache Read (",le(b.cacheReadCost),")"]})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Estimated savings from cache"}),c.jsx("div",{className:"text-2xl font-bold text-green-400",children:le(y.estimatedSavings)})]}),c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400",children:"Cache Hit Rate"}),c.jsxs("div",{className:"text-2xl font-bold text-purple-400",children:[y.cacheHitRate.toFixed(1),"%"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Daily Token Usage"}),p.length===0?c.jsx("div",{className:"h-64 flex items-center justify-center text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("p",{children:"No daily data available"}),c.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Total sessions: ",f.sessionCount]}),c.jsxs("p",{className:"text-sm text-gray-600",children:["Daily entries: ",p.length]})]})}):c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:p.map(C=>ht(new Date(C.date),"MMM d")),datasets:[{label:"Input",data:p.map(C=>C.tokenUsage.inputTokens),backgroundColor:"rgb(59, 130, 246)",borderColor:"rgb(59, 130, 246)",borderWidth:0},{label:"Cache Create",data:p.map(C=>C.tokenUsage.cacheCreationTokens),backgroundColor:"rgb(168, 85, 247)",borderColor:"rgb(168, 85, 247)",borderWidth:0},{label:"Cache Read",data:p.map(C=>C.tokenUsage.cacheReadTokens),backgroundColor:"rgb(6, 182, 212)",borderColor:"rgb(6, 182, 212)",borderWidth:0},{label:"Output",data:p.map(C=>C.tokenUsage.outputTokens),backgroundColor:"rgb(34, 197, 94)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{stacked:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:0,autoSkip:!0,maxTicksLimit:15}},y:{stacked:!0,max:j,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",callback:function(C){return typeof C=="number"?L(C):C}}}},plugins:{legend:{display:!1},tooltip:{callbacks:{title:C=>{if(C.length>0){const P=C[0].dataIndex;return ht(new Date(p[P].date),"MMM d, yyyy")}return""},label:C=>{const P=C.dataset.label||"",z=C.parsed.y!==null?L(C.parsed.y):"0";return`${P}: ${z}`},footer:C=>{if(C.length>0){const P=C[0].dataIndex,z=L(p[P].tokenUsage.totalTokens),Y=p[P].sessionCount;return`Total: ${z}
70
+ ${Y} sessions`}return""}}}}},height:300})}),c.jsxs("div",{className:"flex gap-4 mt-4 text-xs justify-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded"}),c.jsx("span",{children:"Input"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-purple-500 rounded"}),c.jsx("span",{children:"Cache Create"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded"}),c.jsx("span",{children:"Cache Read"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-3 h-3 bg-green-500 rounded"}),c.jsx("span",{children:"Output"})]})]}),p.length>0&&c.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6 pt-6 border-t border-gray-700",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Min Daily"}),c.jsx("div",{className:"font-mono text-sm text-gray-300",children:L(k)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Avg Daily"}),c.jsx("div",{className:"font-mono text-sm text-blue-400",children:L(R)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Max Daily"}),c.jsx("div",{className:"font-mono text-sm text-green-400",children:L(N)})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Usage by Model"}),c.jsx("div",{className:"space-y-4",children:x.map((C,P)=>{const z=x.reduce((we,se)=>we+se.tokenUsage.totalTokens,0),Y=C.tokenUsage.totalTokens/z*100;return c.jsxs("div",{className:"border-b border-gray-700 pb-4 last:border-b-0 last:pb-0",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:C.model}),c.jsxs("div",{className:"text-xs text-gray-500",children:[C.messageCount," messages"]})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"font-mono text-sm",children:L(C.tokenUsage.totalTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[Y.toFixed(1),"%"]})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:"h-2 rounded-full bg-gradient-to-r from-blue-500 to-green-500",style:{width:`${Y}%`}})}),c.jsxs("div",{className:"grid grid-cols-4 gap-2 text-xs mt-2",children:[c.jsxs("div",{className:"text-left",children:[c.jsx("div",{className:"text-gray-500",children:"Input"}),c.jsx("div",{className:"text-blue-400 font-mono",children:L(C.tokenUsage.inputTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Create"}),c.jsx("div",{className:"text-purple-400 font-mono",children:L(C.tokenUsage.cacheCreationTokens)})]}),c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-gray-500",children:"Cache Read"}),c.jsx("div",{className:"text-cyan-400 font-mono",children:L(C.tokenUsage.cacheReadTokens)})]}),c.jsxs("div",{className:"text-right",children:[c.jsx("div",{className:"text-gray-500",children:"Output"}),c.jsx("div",{className:"text-green-400 font-mono",children:L(C.tokenUsage.outputTokens)})]})]})]},P)})})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Productivity Metrics"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[c.jsx(Ce,{title:"Total Tool Calls",value:L(g.totalToolCalls),subtitle:`Across ${f.sessionCount} sessions`,color:"blue"}),c.jsx(Ce,{title:"Agent Sessions",value:L(g.agentSessions),subtitle:`${g.agentUsageRate.toFixed(1)}% of sessions`,color:"purple"}),c.jsx(Ce,{title:"Avg Tools per Session",value:(g.totalToolCalls/g.totalSessions).toFixed(1),subtitle:"Tool calls per session",color:"cyan"})]}),c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Tool Usage & Success Rates"}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 auto-rows-fr",children:g.toolUsage.map((C,P)=>c.jsxs("div",{className:"@container bg-gray-800/30 rounded-lg p-4 border border-gray-700",children:[c.jsxs("div",{className:"flex justify-between items-start mb-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"font-semibold text-gray-200",children:C.toolName}),c.jsxs("div",{className:"text-xs text-gray-500",children:[c.jsxs("span",{className:"hidden @[300px]:inline",children:[C.successfulUses," successful / ",C.totalUses," total calls"]}),c.jsxs("span",{className:"@[300px]:hidden",children:[C.successfulUses," / ",C.totalUses," calls"]})]})]}),c.jsxs("div",{className:"text-right ml-2",children:[c.jsxs("div",{className:`font-mono text-sm ${C.successRate>=90?"text-green-400":C.successRate>=70?"text-yellow-400":"text-red-400"}`,children:[C.successRate.toFixed(1),"%"]}),c.jsx("div",{className:"text-xs text-gray-500",children:"success"})]})]}),c.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full ${C.successRate>=90?"bg-green-500":C.successRate>=70?"bg-yellow-500":"bg-red-500"}`,style:{width:`${Math.min(C.successRate,100)}%`}})})]},P))})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Cache Efficiency Analysis"}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsx(Ce,{title:"Total Cache Created",value:L(y.totalCacheCreation),subtitle:"Tokens cached",color:"purple"}),c.jsx(Ce,{title:"Total Cache Read",value:L(y.totalCacheRead),subtitle:"Tokens from cache",color:"cyan"}),c.jsx(Ce,{title:"Cache Hit Rate",value:`${y.cacheHitRate.toFixed(2)}%`,subtitle:`${le(y.estimatedSavings)} saved`,color:"green"})]}),c.jsxs("div",{className:"mt-6 grid grid-cols-1 lg:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"p-4 bg-purple-500/10 border border-purple-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"5-minute Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:L(y.ephemeral5mTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[y.totalCacheCreation>0?(y.ephemeral5mTokens/y.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]}),c.jsxs("div",{className:"p-4 bg-orange-500/10 border border-orange-500/20 rounded",children:[c.jsx("div",{className:"text-sm text-gray-400 mb-2",children:"1-hour Cache"}),c.jsx("div",{className:"text-2xl font-bold mb-1",children:L(y.ephemeral1hTokens)}),c.jsxs("div",{className:"text-xs text-gray-500",children:[y.totalCacheCreation>0?(y.ephemeral1hTokens/y.totalCacheCreation*100).toFixed(1):0,"% of total cache"]})]})]})]}),c.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-6 mb-8 border border-gray-700",children:[c.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Activity Trends"}),c.jsxs("div",{className:"mb-8",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Hour of Day"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:m.byHour.map(C=>`${C.hour.toString().padStart(2,"0")}:00`),datasets:[{label:"Messages",data:m.byHour.map(C=>C.messageCount),backgroundColor:"rgba(59, 130, 246, 0.8)",borderColor:"rgb(59, 130, 246)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)",maxRotation:45,minRotation:45}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:C=>{const P=m.byHour[C.dataIndex];return[`Messages: ${P.messageCount}`,`Sessions: ${P.sessionCount}`,`Tokens: ${L(P.tokenUsage.totalTokens)}`]}}}}},height:250})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-300",children:"Activity by Day of Week"}),c.jsx("div",{className:"bg-gray-900/50 rounded p-4",children:c.jsx(mr,{data:{labels:m.byWeekday.map(C=>C.weekdayName),datasets:[{label:"Messages",data:m.byWeekday.map(C=>C.messageCount),backgroundColor:"rgba(34, 197, 94, 0.8)",borderColor:"rgb(34, 197, 94)",borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,scales:{x:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}},y:{grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.6)"}}},plugins:{legend:{display:!1},tooltip:{callbacks:{label:C=>{const P=m.byWeekday[C.dataIndex];return[`Messages: ${P.messageCount}`,`Sessions: ${P.sessionCount}`,`Tokens: ${L(P.tokenUsage.totalTokens)}`]}}}}},height:250})})]})]})]})};return c.jsx("div",{className:"h-screen overflow-y-auto bg-gray-900 text-white p-8",children:c.jsxs("div",{className:"max-w-7xl mx-auto",children:[c.jsx("div",{className:"mb-2",children:c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o&&!t?c.jsx("div",{className:"h-10 bg-gray-700 rounded w-64 animate-pulse"}):c.jsx("h1",{className:"text-4xl font-bold",children:((h=i==null?void 0:i.byProject[0])==null?void 0:h.name)||(t==null?void 0:t.name)||e}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>r("7"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="7"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 7 Days"}),c.jsx("button",{onClick:()=>r("30"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="30"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"Last 30 Days"}),c.jsx("button",{onClick:()=>r("all"),className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s==="all"?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-300"}`,children:"All Time"})]})]})}),o?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-5 bg-gray-700 rounded w-64 mb-8 animate-pulse"}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[c.jsx(l,{}),c.jsx(l,{}),c.jsx(l,{}),c.jsx(l,{})]}),c.jsx(u,{}),c.jsx("div",{className:"mt-8",children:c.jsx(u,{})}),c.jsx("div",{className:"mt-8",children:c.jsx(u,{})})]}):d()]})})}const Fy=new Fb,Hp="claude-session-viewer-sidebar-width",C2=320,j2=200,N2=600;function fu(){const t=mo(),e=_n(),n=D0(),s=n.sessionId||null,r=n.projectId||null,i=e.pathname==="/dashboard",o=e.pathname.startsWith("/projects/")&&!e.pathname.includes("/sessions"),[a,l]=S.useState(()=>{const W=localStorage.getItem(Hp);return W?parseInt(W,10):C2}),[u,d]=S.useState(!1),[h,f]=S.useState(0),[p,x]=S.useState(!1),y=S.useRef(null),b=S.useRef(null),g=S.useRef(0),{data:m,isLoading:v,error:w,refetch:j}=yl({queryKey:["sessions"],queryFn:async()=>{const W=await fetch("/api/sessions");if(!W.ok)throw new Error("Failed to fetch sessions");return W.json()}}),E=W=>{t(`/sessions/${W}`)},k=s?m==null?void 0:m.projects.flatMap(W=>W.sessions).flatMap(W=>[W,...W.agentSessions||[]]).find(W=>W.id===s):null,N=r?m==null?void 0:m.projects.find(W=>W.id===r):null;S.useEffect(()=>{const W=b.current;if(!W)return;const O=()=>{const T=W.scrollTop,A=T<g.current;f(T),x(A),g.current=T};return W.addEventListener("scroll",O),()=>W.removeEventListener("scroll",O)},[]),S.useEffect(()=>{const W=T=>{if(!u)return;const A=T.clientX;A>=j2&&A<=N2&&(l(A),localStorage.setItem(Hp,A.toString()))},O=()=>{d(!1),document.body.style.cursor="",document.body.style.userSelect=""};return u&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",W),document.addEventListener("mouseup",O)),()=>{document.removeEventListener("mousemove",W),document.removeEventListener("mouseup",O)}},[u]),S.useEffect(()=>{const O=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;let T=null,A=!1,B=null,D=0,$=!0;const K=()=>{T=new WebSocket(O),A=!1,T.onopen=()=>{if(A){T==null||T.close();return}D=0},T.onmessage=V=>{const U=JSON.parse(V.data);(U.type==="file-added"||U.type==="file-changed"||U.type==="file-deleted")&&(j(),s&&Fy.invalidateQueries({queryKey:["session",s]}))},T.onerror=V=>{console.error("WebSocket error:",V)},T.onclose=()=>{if(!$)return;const V=Math.min(1e3*2**D,1e4);D+=1,B=setTimeout(K,V)}};return K(),()=>{$=!1,B&&clearTimeout(B),T&&T.readyState===WebSocket.CONNECTING?A=!0:T==null||T.close()}},[j,s]);const C=Math.max(0,1-(p?0:h)/80),P=12+C*12,z=1.125+C*.375,Y=C,we=8+C*6,se=8+C*20;return c.jsxs("div",{className:"flex h-screen bg-gray-900 text-white",children:[c.jsxs("div",{className:"relative flex flex-col",style:{width:`${a}px`},children:[c.jsxs("div",{ref:y,className:"border-r border-gray-700 h-full flex flex-col",children:[c.jsxs("div",{className:"border-b border-gray-700 flex-shrink-0 transition-all duration-200 relative",style:{padding:`${P}px`,paddingRight:`${we+44}px`},children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold transition-all duration-200",style:{fontSize:`${z}rem`},children:"Claude Sessions"}),c.jsx("p",{className:"text-sm text-gray-400 mt-1 transition-opacity duration-200",style:{opacity:Y,height:Y>0?"auto":0,overflow:"hidden"},children:v?"Loading...":`${(m==null?void 0:m.projects.length)||0} project${(m==null?void 0:m.projects.length)!==1?"s":""}`})]}),c.jsx("button",{onClick:()=>t("/dashboard"),className:`absolute flex items-center justify-center p-2 rounded-lg transition-all duration-200 ${i?"bg-blue-600 text-white":"bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-white"}`,style:{top:`${se}px`,right:`${we}px`},title:"Dashboard",children:c.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})})]}),c.jsx("div",{ref:b,className:"flex-1 overflow-y-auto",children:w?c.jsxs("div",{className:"p-4 text-red-400 text-sm",children:["Error loading sessions: ",w.message]}):c.jsx(Ok,{projects:(m==null?void 0:m.projects)||[],selectedId:s,onSelect:E})})]}),c.jsx("div",{className:"absolute top-0 right-0 w-4 h-full cursor-col-resize group z-10",onMouseDown:W=>{W.preventDefault(),d(!0)},style:{touchAction:"none"},children:c.jsx("div",{className:`w-1 h-full ml-auto transition-colors ${u?"bg-blue-500":"bg-transparent group-hover:bg-blue-500"}`})})]}),c.jsx("div",{className:"flex-1 min-w-0",children:i?c.jsx(_2,{}):o?c.jsx(S2,{projectInfo:N}):s?c.jsx(Ik,{sessionId:s,sessionInfo:k}):c.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:c.jsxs("div",{className:"text-center",children:[c.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),c.jsx("h3",{className:"mt-2 text-sm font-medium",children:"No session selected"}),c.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Select a session from the sidebar to view details"})]})})})]})}function E2(){return c.jsx(Ab,{client:Fy,children:c.jsx(y1,{children:c.jsxs(Yw,{children:[c.jsx(fi,{path:"/",element:c.jsx(Vw,{to:"/dashboard",replace:!0})}),c.jsx(fi,{path:"/dashboard",element:c.jsx(fu,{})}),c.jsx(fi,{path:"/projects/:projectId",element:c.jsx(fu,{})}),c.jsx(fi,{path:"/sessions/:sessionId",element:c.jsx(fu,{})})]})})})}pu.createRoot(document.getElementById("root")).render(c.jsx(tx.StrictMode,{children:c.jsx(E2,{})}));