heyio 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,478 +0,0 @@
1
- var SM=Object.defineProperty;var kM=(t,e,r)=>e in t?SM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Je=(t,e,r)=>kM(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var hf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ze(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jm={exports:{}},Sl={},Pm={exports:{}},De={};/**
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 HS;function EM(){if(HS)return De;HS=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=h&&B[h]||B["@@iterator"],typeof B=="function"?B:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function b(B,z,J){this.props=B,this.context=z,this.refs=_,this.updater=J||y}b.prototype.isReactComponent={},b.prototype.setState=function(B,z){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,z,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function k(){}k.prototype=b.prototype;function O(B,z,J){this.props=B,this.context=z,this.refs=_,this.updater=J||y}var A=O.prototype=new k;A.constructor=O,w(A,b.prototype),A.isPureReactComponent=!0;var j=Array.isArray,E=Object.prototype.hasOwnProperty,T={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function R(B,z,J){var ae,se={},de=null,Ce=null;if(z!=null)for(ae in z.ref!==void 0&&(Ce=z.ref),z.key!==void 0&&(de=""+z.key),z)E.call(z,ae)&&!C.hasOwnProperty(ae)&&(se[ae]=z[ae]);var pe=arguments.length-2;if(pe===1)se.children=J;else if(1<pe){for(var ne=Array(pe),_e=0;_e<pe;_e++)ne[_e]=arguments[_e+2];se.children=ne}if(B&&B.defaultProps)for(ae in pe=B.defaultProps,pe)se[ae]===void 0&&(se[ae]=pe[ae]);return{$$typeof:t,type:B,key:de,ref:Ce,props:se,_owner:T.current}}function D(B,z){return{$$typeof:t,type:B.type,key:z,ref:B.ref,props:B.props,_owner:B._owner}}function X(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function $(B){var z={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(J){return z[J]})}var I=/\/+/g;function q(B,z){return typeof B=="object"&&B!==null&&B.key!=null?$(""+B.key):z.toString(36)}function U(B,z,J,ae,se){var de=typeof B;(de==="undefined"||de==="boolean")&&(B=null);var Ce=!1;if(B===null)Ce=!0;else switch(de){case"string":case"number":Ce=!0;break;case"object":switch(B.$$typeof){case t:case e:Ce=!0}}if(Ce)return Ce=B,se=se(Ce),B=ae===""?"."+q(Ce,0):ae,j(se)?(J="",B!=null&&(J=B.replace(I,"$&/")+"/"),U(se,z,J,"",function(_e){return _e})):se!=null&&(X(se)&&(se=D(se,J+(!se.key||Ce&&Ce.key===se.key?"":(""+se.key).replace(I,"$&/")+"/")+B)),z.push(se)),1;if(Ce=0,ae=ae===""?".":ae+":",j(B))for(var pe=0;pe<B.length;pe++){de=B[pe];var ne=ae+q(de,pe);Ce+=U(de,z,J,ne,se)}else if(ne=g(B),typeof ne=="function")for(B=ne.call(B),pe=0;!(de=B.next()).done;)de=de.value,ne=ae+q(de,pe++),Ce+=U(de,z,J,ne,se);else if(de==="object")throw z=String(B),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return Ce}function V(B,z,J){if(B==null)return B;var ae=[],se=0;return U(B,ae,"","",function(de){return z.call(J,de,se++)}),ae}function G(B){if(B._status===-1){var z=B._result;z=z(),z.then(function(J){(B._status===0||B._status===-1)&&(B._status=1,B._result=J)},function(J){(B._status===0||B._status===-1)&&(B._status=2,B._result=J)}),B._status===-1&&(B._status=0,B._result=z)}if(B._status===1)return B._result.default;throw B._result}var Z={current:null},K={transition:null},te={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:K,ReactCurrentOwner:T};function H(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:V,forEach:function(B,z,J){V(B,function(){z.apply(this,arguments)},J)},count:function(B){var z=0;return V(B,function(){z++}),z},toArray:function(B){return V(B,function(z){return z})||[]},only:function(B){if(!X(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},De.Component=b,De.Fragment=r,De.Profiler=i,De.PureComponent=O,De.StrictMode=n,De.Suspense=c,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,De.act=H,De.cloneElement=function(B,z,J){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var ae=w({},B.props),se=B.key,de=B.ref,Ce=B._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,Ce=T.current),z.key!==void 0&&(se=""+z.key),B.type&&B.type.defaultProps)var pe=B.type.defaultProps;for(ne in z)E.call(z,ne)&&!C.hasOwnProperty(ne)&&(ae[ne]=z[ne]===void 0&&pe!==void 0?pe[ne]:z[ne])}var ne=arguments.length-2;if(ne===1)ae.children=J;else if(1<ne){pe=Array(ne);for(var _e=0;_e<ne;_e++)pe[_e]=arguments[_e+2];ae.children=pe}return{$$typeof:t,type:B.type,key:se,ref:de,props:ae,_owner:Ce}},De.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},De.createElement=R,De.createFactory=function(B){var z=R.bind(null,B);return z.type=B,z},De.createRef=function(){return{current:null}},De.forwardRef=function(B){return{$$typeof:u,render:B}},De.isValidElement=X,De.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:G}},De.memo=function(B,z){return{$$typeof:f,type:B,compare:z===void 0?null:z}},De.startTransition=function(B){var z=K.transition;K.transition={};try{B()}finally{K.transition=z}},De.unstable_act=H,De.useCallback=function(B,z){return Z.current.useCallback(B,z)},De.useContext=function(B){return Z.current.useContext(B)},De.useDebugValue=function(){},De.useDeferredValue=function(B){return Z.current.useDeferredValue(B)},De.useEffect=function(B,z){return Z.current.useEffect(B,z)},De.useId=function(){return Z.current.useId()},De.useImperativeHandle=function(B,z,J){return Z.current.useImperativeHandle(B,z,J)},De.useInsertionEffect=function(B,z){return Z.current.useInsertionEffect(B,z)},De.useLayoutEffect=function(B,z){return Z.current.useLayoutEffect(B,z)},De.useMemo=function(B,z){return Z.current.useMemo(B,z)},De.useReducer=function(B,z,J){return Z.current.useReducer(B,z,J)},De.useRef=function(B){return Z.current.useRef(B)},De.useState=function(B){return Z.current.useState(B)},De.useSyncExternalStore=function(B,z,J){return Z.current.useSyncExternalStore(B,z,J)},De.useTransition=function(){return Z.current.useTransition()},De.version="18.3.1",De}var WS;function Ix(){return WS||(WS=1,Pm.exports=EM()),Pm.exports}/**
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 VS;function OM(){if(VS)return Sl;VS=1;var t=Ix(),e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(u,c,f){var p,h={},g=null,y=null;f!==void 0&&(g=""+f),c.key!==void 0&&(g=""+c.key),c.ref!==void 0&&(y=c.ref);for(p in c)n.call(c,p)&&!a.hasOwnProperty(p)&&(h[p]=c[p]);if(u&&u.defaultProps)for(p in c=u.defaultProps,c)h[p]===void 0&&(h[p]=c[p]);return{$$typeof:e,type:u,key:g,ref:y,props:h,_owner:i.current}}return Sl.Fragment=r,Sl.jsx=o,Sl.jsxs=o,Sl}var KS;function AM(){return KS||(KS=1,jm.exports=OM()),jm.exports}var v=AM(),N=Ix();const M=Ze(N);var pf={},Cm={exports:{}},br={},Nm={exports:{}},Rm={};/**
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
- */var GS;function TM(){return GS||(GS=1,(function(t){function e(K,te){var H=K.length;K.push(te);e:for(;0<H;){var B=H-1>>>1,z=K[B];if(0<i(z,te))K[B]=te,K[H]=z,H=B;else break e}}function r(K){return K.length===0?null:K[0]}function n(K){if(K.length===0)return null;var te=K[0],H=K.pop();if(H!==te){K[0]=H;e:for(var B=0,z=K.length,J=z>>>1;B<J;){var ae=2*(B+1)-1,se=K[ae],de=ae+1,Ce=K[de];if(0>i(se,H))de<z&&0>i(Ce,se)?(K[B]=Ce,K[de]=H,B=de):(K[B]=se,K[ae]=H,B=ae);else if(de<z&&0>i(Ce,H))K[B]=Ce,K[de]=H,B=de;else break e}}return te}function i(K,te){var H=K.sortIndex-te.sortIndex;return H!==0?H:K.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,u=o.now();t.unstable_now=function(){return o.now()-u}}var c=[],f=[],p=1,h=null,g=3,y=!1,w=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(K){for(var te=r(f);te!==null;){if(te.callback===null)n(f);else if(te.startTime<=K)n(f),te.sortIndex=te.expirationTime,e(c,te);else break;te=r(f)}}function j(K){if(_=!1,A(K),!w)if(r(c)!==null)w=!0,G(E);else{var te=r(f);te!==null&&Z(j,te.startTime-K)}}function E(K,te){w=!1,_&&(_=!1,k(R),R=-1),y=!0;var H=g;try{for(A(te),h=r(c);h!==null&&(!(h.expirationTime>te)||K&&!$());){var B=h.callback;if(typeof B=="function"){h.callback=null,g=h.priorityLevel;var z=B(h.expirationTime<=te);te=t.unstable_now(),typeof z=="function"?h.callback=z:h===r(c)&&n(c),A(te)}else n(c);h=r(c)}if(h!==null)var J=!0;else{var ae=r(f);ae!==null&&Z(j,ae.startTime-te),J=!1}return J}finally{h=null,g=H,y=!1}}var T=!1,C=null,R=-1,D=5,X=-1;function $(){return!(t.unstable_now()-X<D)}function I(){if(C!==null){var K=t.unstable_now();X=K;var te=!0;try{te=C(!0,K)}finally{te?q():(T=!1,C=null)}}else T=!1}var q;if(typeof O=="function")q=function(){O(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=I,q=function(){V.postMessage(null)}}else q=function(){b(I,0)};function G(K){C=K,T||(T=!0,q())}function Z(K,te){R=b(function(){K(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(K){K.callback=null},t.unstable_continueExecution=function(){w||y||(w=!0,G(E))},t.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<K?Math.floor(1e3/K):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(K){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var H=g;g=te;try{return K()}finally{g=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(K,te){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var H=g;g=K;try{return te()}finally{g=H}},t.unstable_scheduleCallback=function(K,te,H){var B=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?B+H:B):H=B,K){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=H+z,K={id:p++,callback:te,priorityLevel:K,startTime:H,expirationTime:z,sortIndex:-1},H>B?(K.sortIndex=H,e(f,K),r(c)===null&&K===r(f)&&(_?(k(R),R=-1):_=!0,Z(j,H-B))):(K.sortIndex=z,e(c,K),w||y||(w=!0,G(E))),K},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(K){var te=g;return function(){var H=g;g=te;try{return K.apply(this,arguments)}finally{g=H}}}})(Rm)),Rm}var XS;function jM(){return XS||(XS=1,Nm.exports=TM()),Nm.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 YS;function PM(){if(YS)return br;YS=1;var t=Ix(),e=jM();function r(s){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+s,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(s,l){o(s,l),o(s+"Capture",l)}function o(s,l){for(i[s]=l,s=0;s<l.length;s++)n.add(l[s])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},h={};function g(s){return c.call(h,s)?!0:c.call(p,s)?!1:f.test(s)?h[s]=!0:(p[s]=!0,!1)}function y(s,l,d,m){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function w(s,l,d,m){if(l===null||typeof l>"u"||y(s,l,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(s,l,d,m,x,S,P){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=x,this.mustUseProperty=d,this.propertyName=s,this.type=l,this.sanitizeURL=S,this.removeEmptyString=P}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){b[s]=new _(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var l=s[0];b[l]=new _(l,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){b[s]=new _(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){b[s]=new _(s,2,!1,s,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(s){b[s]=new _(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){b[s]=new _(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){b[s]=new _(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){b[s]=new _(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){b[s]=new _(s,5,!1,s.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function O(s){return s[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(s){var l=s.replace(k,O);b[l]=new _(l,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var l=s.replace(k,O);b[l]=new _(l,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var l=s.replace(k,O);b[l]=new _(l,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!0,!0)});function A(s,l,d,m){var x=b.hasOwnProperty(l)?b[l]:null;(x!==null?x.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,d,x,m)&&(d=null),m||x===null?g(l)&&(d===null?s.removeAttribute(l):s.setAttribute(l,""+d)):x.mustUseProperty?s[x.propertyName]=d===null?x.type===3?!1:"":d:(l=x.attributeName,m=x.attributeNamespace,d===null?s.removeAttribute(l):(x=x.type,d=x===3||x===4&&d===!0?"":""+d,m?s.setAttributeNS(m,l,d):s.setAttribute(l,d))))}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),X=Symbol.for("react.provider"),$=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),K=Symbol.iterator;function te(s){return s===null||typeof s!="object"?null:(s=K&&s[K]||s["@@iterator"],typeof s=="function"?s:null)}var H=Object.assign,B;function z(s){if(B===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);B=l&&l[1]||""}return`
34
- `+B+s}var J=!1;function ae(s,l){if(!s||J)return"";J=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ee){var m=ee}Reflect.construct(s,[],l)}else{try{l.call()}catch(ee){m=ee}s.call(l.prototype)}else{try{throw Error()}catch(ee){m=ee}s()}}catch(ee){if(ee&&m&&typeof ee.stack=="string"){for(var x=ee.stack.split(`
35
- `),S=m.stack.split(`
36
- `),P=x.length-1,L=S.length-1;1<=P&&0<=L&&x[P]!==S[L];)L--;for(;1<=P&&0<=L;P--,L--)if(x[P]!==S[L]){if(P!==1||L!==1)do if(P--,L--,0>L||x[P]!==S[L]){var F=`
37
- `+x[P].replace(" at new "," at ");return s.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",s.displayName)),F}while(1<=P&&0<=L);break}}}finally{J=!1,Error.prepareStackTrace=d}return(s=s?s.displayName||s.name:"")?z(s):""}function se(s){switch(s.tag){case 5:return z(s.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return s=ae(s.type,!1),s;case 11:return s=ae(s.type.render,!1),s;case 1:return s=ae(s.type,!0),s;default:return""}}function de(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case C:return"Fragment";case T:return"Portal";case D:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case U:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case $:return(s.displayName||"Context")+".Consumer";case X:return(s._context.displayName||"Context")+".Provider";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case V:return l=s.displayName||null,l!==null?l:de(s.type)||"Memo";case G:l=s._payload,s=s._init;try{return de(s(l))}catch{}}return null}function Ce(s){var l=s.type;switch(s.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=l.render,s=s.displayName||s.name||"",l.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(l);case 8:return l===R?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function pe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ne(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function _e(s){var l=ne(s)?"checked":"value",d=Object.getOwnPropertyDescriptor(s.constructor.prototype,l),m=""+s[l];if(!s.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,S=d.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return x.call(this)},set:function(P){m=""+P,S.call(this,P)}}),Object.defineProperty(s,l,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(P){m=""+P},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Ee(s){s._valueTracker||(s._valueTracker=_e(s))}function ie(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var d=l.getValue(),m="";return s&&(m=ne(s)?s.checked?"true":"false":s.value),s=m,s!==d?(l.setValue(s),!0):!1}function Fe(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ne(s,l){var d=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??s._wrapperState.initialChecked})}function ct(s,l){var d=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;d=pe(l.value!=null?l.value:d),s._wrapperState={initialChecked:m,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function at(s,l){l=l.checked,l!=null&&A(s,"checked",l,!1)}function ft(s,l){at(s,l);var d=pe(l.value),m=l.type;if(d!=null)m==="number"?(d===0&&s.value===""||s.value!=d)&&(s.value=""+d):s.value!==""+d&&(s.value=""+d);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}l.hasOwnProperty("value")?Et(s,l.type,d):l.hasOwnProperty("defaultValue")&&Et(s,l.type,pe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(s.defaultChecked=!!l.defaultChecked)}function hr(s,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+s._wrapperState.initialValue,d||l===s.value||(s.value=l),s.defaultValue=l}d=s.name,d!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,d!==""&&(s.name=d)}function Et(s,l,d){(l!=="number"||Fe(s.ownerDocument)!==s)&&(d==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+d&&(s.defaultValue=""+d))}var Lr=Array.isArray;function er(s,l,d,m){if(s=s.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<s.length;d++)x=l.hasOwnProperty("$"+s[d].value),s[d].selected!==x&&(s[d].selected=x),x&&m&&(s[d].defaultSelected=!0)}else{for(d=""+pe(d),l=null,x=0;x<s.length;x++){if(s[x].value===d){s[x].selected=!0,m&&(s[x].defaultSelected=!0);return}l!==null||s[x].disabled||(l=s[x])}l!==null&&(l.selected=!0)}}function ot(s,l){if(l.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function kr(s,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(r(92));if(Lr(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),d=l}s._wrapperState={initialValue:pe(d)}}function ma(s,l){var d=pe(l.value),m=pe(l.defaultValue);d!=null&&(d=""+d,d!==s.value&&(s.value=d),l.defaultValue==null&&s.defaultValue!==d&&(s.defaultValue=d)),m!=null&&(s.defaultValue=""+m)}function ga(s){var l=s.textContent;l===s._wrapperState.initialValue&&l!==""&&l!==null&&(s.value=l)}function ya(s){switch(s){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 zs(s,l){return s==null||s==="http://www.w3.org/1999/xhtml"?ya(l):s==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var va,so=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,m,x){MSApp.execUnsafeLocalFunction(function(){return s(l,d,m,x)})}:s})(function(s,l){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=l;else{for(va=va||document.createElement("div"),va.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=va.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;l.firstChild;)s.appendChild(l.firstChild)}});function zr(s,l){if(l){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=l;return}}s.textContent=l}var ki={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},Ei=["Webkit","ms","Moz","O"];Object.keys(ki).forEach(function(s){Ei.forEach(function(l){l=l+s.charAt(0).toUpperCase()+s.substring(1),ki[l]=ki[s]})});function ic(s,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||ki.hasOwnProperty(s)&&ki[s]?(""+l).trim():l+"px"}function ac(s,l){s=s.style;for(var d in l)if(l.hasOwnProperty(d)){var m=d.indexOf("--")===0,x=ic(d,l[d],m);d==="float"&&(d="cssFloat"),m?s.setProperty(d,x):s[d]=x}}var oc=H({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 lo(s,l){if(l){if(oc[s]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(r(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(r(61))}if(l.style!=null&&typeof l.style!="object")throw Error(r(62))}}function Bs(s,l){if(s.indexOf("-")===-1)return typeof l.is=="string";switch(s){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 ba=null;function Br(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var qs=null,Oi=null,Vn=null;function Us(s){if(s=ll(s)){if(typeof qs!="function")throw Error(r(280));var l=s.stateNode;l&&(l=Ac(l),qs(s.stateNode,s.type,l))}}function $e(s){Oi?Vn?Vn.push(s):Vn=[s]:Oi=s}function wt(){if(Oi){var s=Oi,l=Vn;if(Vn=Oi=null,Us(s),l)for(s=0;s<l.length;s++)Us(l[s])}}function Ct(s,l){return s(l)}function tr(){}var Ai=!1;function Ot(s,l,d){if(Ai)return s(l,d);Ai=!0;try{return Ct(s,l,d)}finally{Ai=!1,(Oi!==null||Vn!==null)&&(tr(),wt())}}function zt(s,l){var d=s.stateNode;if(d===null)return null;var m=Ac(d);if(m===null)return null;d=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var Ti=!1;if(u)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){Ti=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch{Ti=!1}function Er(s,l,d,m,x,S,P,L,F){var ee=Array.prototype.slice.call(arguments,3);try{l.apply(d,ee)}catch(le){this.onError(le)}}var ji=!1,qr=null,Fs=!1,Gh=null,PI={onError:function(s){ji=!0,qr=s}};function CI(s,l,d,m,x,S,P,L,F){ji=!1,qr=null,Er.apply(PI,arguments)}function NI(s,l,d,m,x,S,P,L,F){if(CI.apply(this,arguments),ji){if(ji){var ee=qr;ji=!1,qr=null}else throw Error(r(198));Fs||(Fs=!0,Gh=ee)}}function xa(s){var l=s,d=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(d=l.return),s=l.return;while(s)}return l.tag===3?d:null}function h1(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function p1(s){if(xa(s)!==s)throw Error(r(188))}function RI(s){var l=s.alternate;if(!l){if(l=xa(s),l===null)throw Error(r(188));return l!==s?null:s}for(var d=s,m=l;;){var x=d.return;if(x===null)break;var S=x.alternate;if(S===null){if(m=x.return,m!==null){d=m;continue}break}if(x.child===S.child){for(S=x.child;S;){if(S===d)return p1(x),s;if(S===m)return p1(x),l;S=S.sibling}throw Error(r(188))}if(d.return!==m.return)d=x,m=S;else{for(var P=!1,L=x.child;L;){if(L===d){P=!0,d=x,m=S;break}if(L===m){P=!0,m=x,d=S;break}L=L.sibling}if(!P){for(L=S.child;L;){if(L===d){P=!0,d=S,m=x;break}if(L===m){P=!0,m=S,d=x;break}L=L.sibling}if(!P)throw Error(r(189))}}if(d.alternate!==m)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?s:l}function m1(s){return s=RI(s),s!==null?g1(s):null}function g1(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var l=g1(s);if(l!==null)return l;s=s.sibling}return null}var y1=e.unstable_scheduleCallback,v1=e.unstable_cancelCallback,$I=e.unstable_shouldYield,II=e.unstable_requestPaint,_t=e.unstable_now,MI=e.unstable_getCurrentPriorityLevel,Xh=e.unstable_ImmediatePriority,b1=e.unstable_UserBlockingPriority,sc=e.unstable_NormalPriority,DI=e.unstable_LowPriority,x1=e.unstable_IdlePriority,lc=null,Pn=null;function LI(s){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(lc,s,void 0,(s.current.flags&128)===128)}catch{}}var on=Math.clz32?Math.clz32:qI,zI=Math.log,BI=Math.LN2;function qI(s){return s>>>=0,s===0?32:31-(zI(s)/BI|0)|0}var uc=64,cc=4194304;function Hs(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function fc(s,l){var d=s.pendingLanes;if(d===0)return 0;var m=0,x=s.suspendedLanes,S=s.pingedLanes,P=d&268435455;if(P!==0){var L=P&~x;L!==0?m=Hs(L):(S&=P,S!==0&&(m=Hs(S)))}else P=d&~x,P!==0?m=Hs(P):S!==0&&(m=Hs(S));if(m===0)return 0;if(l!==0&&l!==m&&(l&x)===0&&(x=m&-m,S=l&-l,x>=S||x===16&&(S&4194240)!==0))return l;if((m&4)!==0&&(m|=d&16),l=s.entangledLanes,l!==0)for(s=s.entanglements,l&=m;0<l;)d=31-on(l),x=1<<d,m|=s[d],l&=~x;return m}function UI(s,l){switch(s){case 1:case 2:case 4:return l+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 l+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 FI(s,l){for(var d=s.suspendedLanes,m=s.pingedLanes,x=s.expirationTimes,S=s.pendingLanes;0<S;){var P=31-on(S),L=1<<P,F=x[P];F===-1?((L&d)===0||(L&m)!==0)&&(x[P]=UI(L,l)):F<=l&&(s.expiredLanes|=L),S&=~L}}function Yh(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function w1(){var s=uc;return uc<<=1,(uc&4194240)===0&&(uc=64),s}function Jh(s){for(var l=[],d=0;31>d;d++)l.push(s);return l}function Ws(s,l,d){s.pendingLanes|=l,l!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,l=31-on(l),s[l]=d}function HI(s,l){var d=s.pendingLanes&~l;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=l,s.mutableReadLanes&=l,s.entangledLanes&=l,l=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<d;){var x=31-on(d),S=1<<x;l[x]=0,m[x]=-1,s[x]=-1,d&=~S}}function Qh(s,l){var d=s.entangledLanes|=l;for(s=s.entanglements;d;){var m=31-on(d),x=1<<m;x&l|s[m]&l&&(s[m]|=l),d&=~x}}var Ye=0;function _1(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var S1,Zh,k1,E1,O1,ep=!1,dc=[],Pi=null,Ci=null,Ni=null,Vs=new Map,Ks=new Map,Ri=[],WI="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 A1(s,l){switch(s){case"focusin":case"focusout":Pi=null;break;case"dragenter":case"dragleave":Ci=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Vs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(l.pointerId)}}function Gs(s,l,d,m,x,S){return s===null||s.nativeEvent!==S?(s={blockedOn:l,domEventName:d,eventSystemFlags:m,nativeEvent:S,targetContainers:[x]},l!==null&&(l=ll(l),l!==null&&Zh(l)),s):(s.eventSystemFlags|=m,l=s.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),s)}function VI(s,l,d,m,x){switch(l){case"focusin":return Pi=Gs(Pi,s,l,d,m,x),!0;case"dragenter":return Ci=Gs(Ci,s,l,d,m,x),!0;case"mouseover":return Ni=Gs(Ni,s,l,d,m,x),!0;case"pointerover":var S=x.pointerId;return Vs.set(S,Gs(Vs.get(S)||null,s,l,d,m,x)),!0;case"gotpointercapture":return S=x.pointerId,Ks.set(S,Gs(Ks.get(S)||null,s,l,d,m,x)),!0}return!1}function T1(s){var l=wa(s.target);if(l!==null){var d=xa(l);if(d!==null){if(l=d.tag,l===13){if(l=h1(d),l!==null){s.blockedOn=l,O1(s.priority,function(){k1(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function hc(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var d=rp(s.domEventName,s.eventSystemFlags,l[0],s.nativeEvent);if(d===null){d=s.nativeEvent;var m=new d.constructor(d.type,d);ba=m,d.target.dispatchEvent(m),ba=null}else return l=ll(d),l!==null&&Zh(l),s.blockedOn=d,!1;l.shift()}return!0}function j1(s,l,d){hc(s)&&d.delete(l)}function KI(){ep=!1,Pi!==null&&hc(Pi)&&(Pi=null),Ci!==null&&hc(Ci)&&(Ci=null),Ni!==null&&hc(Ni)&&(Ni=null),Vs.forEach(j1),Ks.forEach(j1)}function Xs(s,l){s.blockedOn===l&&(s.blockedOn=null,ep||(ep=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,KI)))}function Ys(s){function l(x){return Xs(x,s)}if(0<dc.length){Xs(dc[0],s);for(var d=1;d<dc.length;d++){var m=dc[d];m.blockedOn===s&&(m.blockedOn=null)}}for(Pi!==null&&Xs(Pi,s),Ci!==null&&Xs(Ci,s),Ni!==null&&Xs(Ni,s),Vs.forEach(l),Ks.forEach(l),d=0;d<Ri.length;d++)m=Ri[d],m.blockedOn===s&&(m.blockedOn=null);for(;0<Ri.length&&(d=Ri[0],d.blockedOn===null);)T1(d),d.blockedOn===null&&Ri.shift()}var uo=j.ReactCurrentBatchConfig,pc=!0;function GI(s,l,d,m){var x=Ye,S=uo.transition;uo.transition=null;try{Ye=1,tp(s,l,d,m)}finally{Ye=x,uo.transition=S}}function XI(s,l,d,m){var x=Ye,S=uo.transition;uo.transition=null;try{Ye=4,tp(s,l,d,m)}finally{Ye=x,uo.transition=S}}function tp(s,l,d,m){if(pc){var x=rp(s,l,d,m);if(x===null)bp(s,l,m,mc,d),A1(s,m);else if(VI(x,s,l,d,m))m.stopPropagation();else if(A1(s,m),l&4&&-1<WI.indexOf(s)){for(;x!==null;){var S=ll(x);if(S!==null&&S1(S),S=rp(s,l,d,m),S===null&&bp(s,l,m,mc,d),S===x)break;x=S}x!==null&&m.stopPropagation()}else bp(s,l,m,null,d)}}var mc=null;function rp(s,l,d,m){if(mc=null,s=Br(m),s=wa(s),s!==null)if(l=xa(s),l===null)s=null;else if(d=l.tag,d===13){if(s=h1(l),s!==null)return s;s=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null);return mc=s,null}function P1(s){switch(s){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(MI()){case Xh:return 1;case b1:return 4;case sc:case DI:return 16;case x1:return 536870912;default:return 16}default:return 16}}var $i=null,np=null,gc=null;function C1(){if(gc)return gc;var s,l=np,d=l.length,m,x="value"in $i?$i.value:$i.textContent,S=x.length;for(s=0;s<d&&l[s]===x[s];s++);var P=d-s;for(m=1;m<=P&&l[d-m]===x[S-m];m++);return gc=x.slice(s,1<m?1-m:void 0)}function yc(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function vc(){return!0}function N1(){return!1}function Or(s){function l(d,m,x,S,P){this._reactName=d,this._targetInst=x,this.type=m,this.nativeEvent=S,this.target=P,this.currentTarget=null;for(var L in s)s.hasOwnProperty(L)&&(d=s[L],this[L]=d?d(S):S[L]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?vc:N1,this.isPropagationStopped=N1,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=vc)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=vc)},persist:function(){},isPersistent:vc}),l}var co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ip=Or(co),Js=H({},co,{view:0,detail:0}),YI=Or(Js),ap,op,Qs,bc=H({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Qs&&(Qs&&s.type==="mousemove"?(ap=s.screenX-Qs.screenX,op=s.screenY-Qs.screenY):op=ap=0,Qs=s),ap)},movementY:function(s){return"movementY"in s?s.movementY:op}}),R1=Or(bc),JI=H({},bc,{dataTransfer:0}),QI=Or(JI),ZI=H({},Js,{relatedTarget:0}),sp=Or(ZI),e3=H({},co,{animationName:0,elapsedTime:0,pseudoElement:0}),t3=Or(e3),r3=H({},co,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),n3=Or(r3),i3=H({},co,{data:0}),$1=Or(i3),a3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},o3={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"},s3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l3(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=s3[s])?!!l[s]:!1}function lp(){return l3}var u3=H({},Js,{key:function(s){if(s.key){var l=a3[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=yc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?o3[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lp,charCode:function(s){return s.type==="keypress"?yc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?yc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),c3=Or(u3),f3=H({},bc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),I1=Or(f3),d3=H({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lp}),h3=Or(d3),p3=H({},co,{propertyName:0,elapsedTime:0,pseudoElement:0}),m3=Or(p3),g3=H({},bc,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),y3=Or(g3),v3=[9,13,27,32],up=u&&"CompositionEvent"in window,Zs=null;u&&"documentMode"in document&&(Zs=document.documentMode);var b3=u&&"TextEvent"in window&&!Zs,M1=u&&(!up||Zs&&8<Zs&&11>=Zs),D1=" ",L1=!1;function z1(s,l){switch(s){case"keyup":return v3.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B1(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var fo=!1;function x3(s,l){switch(s){case"compositionend":return B1(l);case"keypress":return l.which!==32?null:(L1=!0,D1);case"textInput":return s=l.data,s===D1&&L1?null:s;default:return null}}function w3(s,l){if(fo)return s==="compositionend"||!up&&z1(s,l)?(s=C1(),gc=np=$i=null,fo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return M1&&l.locale!=="ko"?null:l.data;default:return null}}var _3={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 q1(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!_3[s.type]:l==="textarea"}function U1(s,l,d,m){$e(m),l=kc(l,"onChange"),0<l.length&&(d=new ip("onChange","change",null,d,m),s.push({event:d,listeners:l}))}var el=null,tl=null;function S3(s){o_(s,0)}function xc(s){var l=yo(s);if(ie(l))return s}function k3(s,l){if(s==="change")return l}var F1=!1;if(u){var cp;if(u){var fp="oninput"in document;if(!fp){var H1=document.createElement("div");H1.setAttribute("oninput","return;"),fp=typeof H1.oninput=="function"}cp=fp}else cp=!1;F1=cp&&(!document.documentMode||9<document.documentMode)}function W1(){el&&(el.detachEvent("onpropertychange",V1),tl=el=null)}function V1(s){if(s.propertyName==="value"&&xc(tl)){var l=[];U1(l,tl,s,Br(s)),Ot(S3,l)}}function E3(s,l,d){s==="focusin"?(W1(),el=l,tl=d,el.attachEvent("onpropertychange",V1)):s==="focusout"&&W1()}function O3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return xc(tl)}function A3(s,l){if(s==="click")return xc(l)}function T3(s,l){if(s==="input"||s==="change")return xc(l)}function j3(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var sn=typeof Object.is=="function"?Object.is:j3;function rl(s,l){if(sn(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var d=Object.keys(s),m=Object.keys(l);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var x=d[m];if(!c.call(l,x)||!sn(s[x],l[x]))return!1}return!0}function K1(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function G1(s,l){var d=K1(s);s=0;for(var m;d;){if(d.nodeType===3){if(m=s+d.textContent.length,s<=l&&m>=l)return{node:d,offset:l-s};s=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=K1(d)}}function X1(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?X1(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function Y1(){for(var s=window,l=Fe();l instanceof s.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)s=l.contentWindow;else break;l=Fe(s.document)}return l}function dp(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}function P3(s){var l=Y1(),d=s.focusedElem,m=s.selectionRange;if(l!==d&&d&&d.ownerDocument&&X1(d.ownerDocument.documentElement,d)){if(m!==null&&dp(d)){if(l=m.start,s=m.end,s===void 0&&(s=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(s,d.value.length);else if(s=(l=d.ownerDocument||document)&&l.defaultView||window,s.getSelection){s=s.getSelection();var x=d.textContent.length,S=Math.min(m.start,x);m=m.end===void 0?S:Math.min(m.end,x),!s.extend&&S>m&&(x=m,m=S,S=x),x=G1(d,S);var P=G1(d,m);x&&P&&(s.rangeCount!==1||s.anchorNode!==x.node||s.anchorOffset!==x.offset||s.focusNode!==P.node||s.focusOffset!==P.offset)&&(l=l.createRange(),l.setStart(x.node,x.offset),s.removeAllRanges(),S>m?(s.addRange(l),s.extend(P.node,P.offset)):(l.setEnd(P.node,P.offset),s.addRange(l)))}}for(l=[],s=d;s=s.parentNode;)s.nodeType===1&&l.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)s=l[d],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var C3=u&&"documentMode"in document&&11>=document.documentMode,ho=null,hp=null,nl=null,pp=!1;function J1(s,l,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;pp||ho==null||ho!==Fe(m)||(m=ho,"selectionStart"in m&&dp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),nl&&rl(nl,m)||(nl=m,m=kc(hp,"onSelect"),0<m.length&&(l=new ip("onSelect","select",null,l,d),s.push({event:l,listeners:m}),l.target=ho)))}function wc(s,l){var d={};return d[s.toLowerCase()]=l.toLowerCase(),d["Webkit"+s]="webkit"+l,d["Moz"+s]="moz"+l,d}var po={animationend:wc("Animation","AnimationEnd"),animationiteration:wc("Animation","AnimationIteration"),animationstart:wc("Animation","AnimationStart"),transitionend:wc("Transition","TransitionEnd")},mp={},Q1={};u&&(Q1=document.createElement("div").style,"AnimationEvent"in window||(delete po.animationend.animation,delete po.animationiteration.animation,delete po.animationstart.animation),"TransitionEvent"in window||delete po.transitionend.transition);function _c(s){if(mp[s])return mp[s];if(!po[s])return s;var l=po[s],d;for(d in l)if(l.hasOwnProperty(d)&&d in Q1)return mp[s]=l[d];return s}var Z1=_c("animationend"),e_=_c("animationiteration"),t_=_c("animationstart"),r_=_c("transitionend"),n_=new Map,i_="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 Ii(s,l){n_.set(s,l),a(l,[s])}for(var gp=0;gp<i_.length;gp++){var yp=i_[gp],N3=yp.toLowerCase(),R3=yp[0].toUpperCase()+yp.slice(1);Ii(N3,"on"+R3)}Ii(Z1,"onAnimationEnd"),Ii(e_,"onAnimationIteration"),Ii(t_,"onAnimationStart"),Ii("dblclick","onDoubleClick"),Ii("focusin","onFocus"),Ii("focusout","onBlur"),Ii(r_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var il="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(" "),$3=new Set("cancel close invalid load scroll toggle".split(" ").concat(il));function a_(s,l,d){var m=s.type||"unknown-event";s.currentTarget=d,NI(m,l,void 0,s),s.currentTarget=null}function o_(s,l){l=(l&4)!==0;for(var d=0;d<s.length;d++){var m=s[d],x=m.event;m=m.listeners;e:{var S=void 0;if(l)for(var P=m.length-1;0<=P;P--){var L=m[P],F=L.instance,ee=L.currentTarget;if(L=L.listener,F!==S&&x.isPropagationStopped())break e;a_(x,L,ee),S=F}else for(P=0;P<m.length;P++){if(L=m[P],F=L.instance,ee=L.currentTarget,L=L.listener,F!==S&&x.isPropagationStopped())break e;a_(x,L,ee),S=F}}}if(Fs)throw s=Gh,Fs=!1,Gh=null,s}function st(s,l){var d=l[Ep];d===void 0&&(d=l[Ep]=new Set);var m=s+"__bubble";d.has(m)||(s_(l,s,2,!1),d.add(m))}function vp(s,l,d){var m=0;l&&(m|=4),s_(d,s,m,l)}var Sc="_reactListening"+Math.random().toString(36).slice(2);function al(s){if(!s[Sc]){s[Sc]=!0,n.forEach(function(d){d!=="selectionchange"&&($3.has(d)||vp(d,!1,s),vp(d,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Sc]||(l[Sc]=!0,vp("selectionchange",!1,l))}}function s_(s,l,d,m){switch(P1(l)){case 1:var x=GI;break;case 4:x=XI;break;default:x=tp}d=x.bind(null,l,d,s),x=void 0,!Ti||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),m?x!==void 0?s.addEventListener(l,d,{capture:!0,passive:x}):s.addEventListener(l,d,!0):x!==void 0?s.addEventListener(l,d,{passive:x}):s.addEventListener(l,d,!1)}function bp(s,l,d,m,x){var S=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var P=m.tag;if(P===3||P===4){var L=m.stateNode.containerInfo;if(L===x||L.nodeType===8&&L.parentNode===x)break;if(P===4)for(P=m.return;P!==null;){var F=P.tag;if((F===3||F===4)&&(F=P.stateNode.containerInfo,F===x||F.nodeType===8&&F.parentNode===x))return;P=P.return}for(;L!==null;){if(P=wa(L),P===null)return;if(F=P.tag,F===5||F===6){m=S=P;continue e}L=L.parentNode}}m=m.return}Ot(function(){var ee=S,le=Br(d),ue=[];e:{var oe=n_.get(s);if(oe!==void 0){var me=ip,xe=s;switch(s){case"keypress":if(yc(d)===0)break e;case"keydown":case"keyup":me=c3;break;case"focusin":xe="focus",me=sp;break;case"focusout":xe="blur",me=sp;break;case"beforeblur":case"afterblur":me=sp;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=R1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=QI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=h3;break;case Z1:case e_:case t_:me=t3;break;case r_:me=m3;break;case"scroll":me=YI;break;case"wheel":me=y3;break;case"copy":case"cut":case"paste":me=n3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=I1}var Se=(l&4)!==0,St=!Se&&s==="scroll",Y=Se?oe!==null?oe+"Capture":null:oe;Se=[];for(var W=ee,Q;W!==null;){Q=W;var ce=Q.stateNode;if(Q.tag===5&&ce!==null&&(Q=ce,Y!==null&&(ce=zt(W,Y),ce!=null&&Se.push(ol(W,ce,Q)))),St)break;W=W.return}0<Se.length&&(oe=new me(oe,xe,null,d,le),ue.push({event:oe,listeners:Se}))}}if((l&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",oe&&d!==ba&&(xe=d.relatedTarget||d.fromElement)&&(wa(xe)||xe[Kn]))break e;if((me||oe)&&(oe=le.window===le?le:(oe=le.ownerDocument)?oe.defaultView||oe.parentWindow:window,me?(xe=d.relatedTarget||d.toElement,me=ee,xe=xe?wa(xe):null,xe!==null&&(St=xa(xe),xe!==St||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(me=null,xe=ee),me!==xe)){if(Se=R1,ce="onMouseLeave",Y="onMouseEnter",W="mouse",(s==="pointerout"||s==="pointerover")&&(Se=I1,ce="onPointerLeave",Y="onPointerEnter",W="pointer"),St=me==null?oe:yo(me),Q=xe==null?oe:yo(xe),oe=new Se(ce,W+"leave",me,d,le),oe.target=St,oe.relatedTarget=Q,ce=null,wa(le)===ee&&(Se=new Se(Y,W+"enter",xe,d,le),Se.target=Q,Se.relatedTarget=St,ce=Se),St=ce,me&&xe)t:{for(Se=me,Y=xe,W=0,Q=Se;Q;Q=mo(Q))W++;for(Q=0,ce=Y;ce;ce=mo(ce))Q++;for(;0<W-Q;)Se=mo(Se),W--;for(;0<Q-W;)Y=mo(Y),Q--;for(;W--;){if(Se===Y||Y!==null&&Se===Y.alternate)break t;Se=mo(Se),Y=mo(Y)}Se=null}else Se=null;me!==null&&l_(ue,oe,me,Se,!1),xe!==null&&St!==null&&l_(ue,St,xe,Se,!0)}}e:{if(oe=ee?yo(ee):window,me=oe.nodeName&&oe.nodeName.toLowerCase(),me==="select"||me==="input"&&oe.type==="file")var ke=k3;else if(q1(oe))if(F1)ke=T3;else{ke=O3;var Oe=E3}else(me=oe.nodeName)&&me.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(ke=A3);if(ke&&(ke=ke(s,ee))){U1(ue,ke,d,le);break e}Oe&&Oe(s,oe,ee),s==="focusout"&&(Oe=oe._wrapperState)&&Oe.controlled&&oe.type==="number"&&Et(oe,"number",oe.value)}switch(Oe=ee?yo(ee):window,s){case"focusin":(q1(Oe)||Oe.contentEditable==="true")&&(ho=Oe,hp=ee,nl=null);break;case"focusout":nl=hp=ho=null;break;case"mousedown":pp=!0;break;case"contextmenu":case"mouseup":case"dragend":pp=!1,J1(ue,d,le);break;case"selectionchange":if(C3)break;case"keydown":case"keyup":J1(ue,d,le)}var Ae;if(up)e:{switch(s){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else fo?z1(s,d)&&(Pe="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(Pe="onCompositionStart");Pe&&(M1&&d.locale!=="ko"&&(fo||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&fo&&(Ae=C1()):($i=le,np="value"in $i?$i.value:$i.textContent,fo=!0)),Oe=kc(ee,Pe),0<Oe.length&&(Pe=new $1(Pe,s,null,d,le),ue.push({event:Pe,listeners:Oe}),Ae?Pe.data=Ae:(Ae=B1(d),Ae!==null&&(Pe.data=Ae)))),(Ae=b3?x3(s,d):w3(s,d))&&(ee=kc(ee,"onBeforeInput"),0<ee.length&&(le=new $1("onBeforeInput","beforeinput",null,d,le),ue.push({event:le,listeners:ee}),le.data=Ae))}o_(ue,l)})}function ol(s,l,d){return{instance:s,listener:l,currentTarget:d}}function kc(s,l){for(var d=l+"Capture",m=[];s!==null;){var x=s,S=x.stateNode;x.tag===5&&S!==null&&(x=S,S=zt(s,d),S!=null&&m.unshift(ol(s,S,x)),S=zt(s,l),S!=null&&m.push(ol(s,S,x))),s=s.return}return m}function mo(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function l_(s,l,d,m,x){for(var S=l._reactName,P=[];d!==null&&d!==m;){var L=d,F=L.alternate,ee=L.stateNode;if(F!==null&&F===m)break;L.tag===5&&ee!==null&&(L=ee,x?(F=zt(d,S),F!=null&&P.unshift(ol(d,F,L))):x||(F=zt(d,S),F!=null&&P.push(ol(d,F,L)))),d=d.return}P.length!==0&&s.push({event:l,listeners:P})}var I3=/\r\n?/g,M3=/\u0000|\uFFFD/g;function u_(s){return(typeof s=="string"?s:""+s).replace(I3,`
38
- `).replace(M3,"")}function Ec(s,l,d){if(l=u_(l),u_(s)!==l&&d)throw Error(r(425))}function Oc(){}var xp=null,wp=null;function _p(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Sp=typeof setTimeout=="function"?setTimeout:void 0,D3=typeof clearTimeout=="function"?clearTimeout:void 0,c_=typeof Promise=="function"?Promise:void 0,L3=typeof queueMicrotask=="function"?queueMicrotask:typeof c_<"u"?function(s){return c_.resolve(null).then(s).catch(z3)}:Sp;function z3(s){setTimeout(function(){throw s})}function kp(s,l){var d=l,m=0;do{var x=d.nextSibling;if(s.removeChild(d),x&&x.nodeType===8)if(d=x.data,d==="/$"){if(m===0){s.removeChild(x),Ys(l);return}m--}else d!=="$"&&d!=="$?"&&d!=="$!"||m++;d=x}while(d);Ys(l)}function Mi(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return s}function f_(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return s;l--}else d==="/$"&&l++}s=s.previousSibling}return null}var go=Math.random().toString(36).slice(2),Cn="__reactFiber$"+go,sl="__reactProps$"+go,Kn="__reactContainer$"+go,Ep="__reactEvents$"+go,B3="__reactListeners$"+go,q3="__reactHandles$"+go;function wa(s){var l=s[Cn];if(l)return l;for(var d=s.parentNode;d;){if(l=d[Kn]||d[Cn]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(s=f_(s);s!==null;){if(d=s[Cn])return d;s=f_(s)}return l}s=d,d=s.parentNode}return null}function ll(s){return s=s[Cn]||s[Kn],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function yo(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function Ac(s){return s[sl]||null}var Op=[],vo=-1;function Di(s){return{current:s}}function lt(s){0>vo||(s.current=Op[vo],Op[vo]=null,vo--)}function rt(s,l){vo++,Op[vo]=s.current,s.current=l}var Li={},rr=Di(Li),pr=Di(!1),_a=Li;function bo(s,l){var d=s.type.contextTypes;if(!d)return Li;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var x={},S;for(S in d)x[S]=l[S];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=l,s.__reactInternalMemoizedMaskedChildContext=x),x}function mr(s){return s=s.childContextTypes,s!=null}function Tc(){lt(pr),lt(rr)}function d_(s,l,d){if(rr.current!==Li)throw Error(r(168));rt(rr,l),rt(pr,d)}function h_(s,l,d){var m=s.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var x in m)if(!(x in l))throw Error(r(108,Ce(s)||"Unknown",x));return H({},d,m)}function jc(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Li,_a=rr.current,rt(rr,s),rt(pr,pr.current),!0}function p_(s,l,d){var m=s.stateNode;if(!m)throw Error(r(169));d?(s=h_(s,l,_a),m.__reactInternalMemoizedMergedChildContext=s,lt(pr),lt(rr),rt(rr,s)):lt(pr),rt(pr,d)}var Gn=null,Pc=!1,Ap=!1;function m_(s){Gn===null?Gn=[s]:Gn.push(s)}function U3(s){Pc=!0,m_(s)}function zi(){if(!Ap&&Gn!==null){Ap=!0;var s=0,l=Ye;try{var d=Gn;for(Ye=1;s<d.length;s++){var m=d[s];do m=m(!0);while(m!==null)}Gn=null,Pc=!1}catch(x){throw Gn!==null&&(Gn=Gn.slice(s+1)),y1(Xh,zi),x}finally{Ye=l,Ap=!1}}return null}var xo=[],wo=0,Cc=null,Nc=0,Ur=[],Fr=0,Sa=null,Xn=1,Yn="";function ka(s,l){xo[wo++]=Nc,xo[wo++]=Cc,Cc=s,Nc=l}function g_(s,l,d){Ur[Fr++]=Xn,Ur[Fr++]=Yn,Ur[Fr++]=Sa,Sa=s;var m=Xn;s=Yn;var x=32-on(m)-1;m&=~(1<<x),d+=1;var S=32-on(l)+x;if(30<S){var P=x-x%5;S=(m&(1<<P)-1).toString(32),m>>=P,x-=P,Xn=1<<32-on(l)+x|d<<x|m,Yn=S+s}else Xn=1<<S|d<<x|m,Yn=s}function Tp(s){s.return!==null&&(ka(s,1),g_(s,1,0))}function jp(s){for(;s===Cc;)Cc=xo[--wo],xo[wo]=null,Nc=xo[--wo],xo[wo]=null;for(;s===Sa;)Sa=Ur[--Fr],Ur[Fr]=null,Yn=Ur[--Fr],Ur[Fr]=null,Xn=Ur[--Fr],Ur[Fr]=null}var Ar=null,Tr=null,dt=!1,ln=null;function y_(s,l){var d=Kr(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=s,l=s.deletions,l===null?(s.deletions=[d],s.flags|=16):l.push(d)}function v_(s,l){switch(s.tag){case 5:var d=s.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(s.stateNode=l,Ar=s,Tr=Mi(l.firstChild),!0):!1;case 6:return l=s.pendingProps===""||l.nodeType!==3?null:l,l!==null?(s.stateNode=l,Ar=s,Tr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=Sa!==null?{id:Xn,overflow:Yn}:null,s.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=Kr(18,null,null,0),d.stateNode=l,d.return=s,s.child=d,Ar=s,Tr=null,!0):!1;default:return!1}}function Pp(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Cp(s){if(dt){var l=Tr;if(l){var d=l;if(!v_(s,l)){if(Pp(s))throw Error(r(418));l=Mi(d.nextSibling);var m=Ar;l&&v_(s,l)?y_(m,d):(s.flags=s.flags&-4097|2,dt=!1,Ar=s)}}else{if(Pp(s))throw Error(r(418));s.flags=s.flags&-4097|2,dt=!1,Ar=s}}}function b_(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Ar=s}function Rc(s){if(s!==Ar)return!1;if(!dt)return b_(s),dt=!0,!1;var l;if((l=s.tag!==3)&&!(l=s.tag!==5)&&(l=s.type,l=l!=="head"&&l!=="body"&&!_p(s.type,s.memoizedProps)),l&&(l=Tr)){if(Pp(s))throw x_(),Error(r(418));for(;l;)y_(s,l),l=Mi(l.nextSibling)}if(b_(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,l=0;s;){if(s.nodeType===8){var d=s.data;if(d==="/$"){if(l===0){Tr=Mi(s.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}s=s.nextSibling}Tr=null}}else Tr=Ar?Mi(s.stateNode.nextSibling):null;return!0}function x_(){for(var s=Tr;s;)s=Mi(s.nextSibling)}function _o(){Tr=Ar=null,dt=!1}function Np(s){ln===null?ln=[s]:ln.push(s)}var F3=j.ReactCurrentBatchConfig;function ul(s,l,d){if(s=d.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(r(309));var m=d.stateNode}if(!m)throw Error(r(147,s));var x=m,S=""+s;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===S?l.ref:(l=function(P){var L=x.refs;P===null?delete L[S]:L[S]=P},l._stringRef=S,l)}if(typeof s!="string")throw Error(r(284));if(!d._owner)throw Error(r(290,s))}return s}function $c(s,l){throw s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s))}function w_(s){var l=s._init;return l(s._payload)}function __(s){function l(Y,W){if(s){var Q=Y.deletions;Q===null?(Y.deletions=[W],Y.flags|=16):Q.push(W)}}function d(Y,W){if(!s)return null;for(;W!==null;)l(Y,W),W=W.sibling;return null}function m(Y,W){for(Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function x(Y,W){return Y=Ki(Y,W),Y.index=0,Y.sibling=null,Y}function S(Y,W,Q){return Y.index=Q,s?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<W?(Y.flags|=2,W):Q):(Y.flags|=2,W)):(Y.flags|=1048576,W)}function P(Y){return s&&Y.alternate===null&&(Y.flags|=2),Y}function L(Y,W,Q,ce){return W===null||W.tag!==6?(W=Sm(Q,Y.mode,ce),W.return=Y,W):(W=x(W,Q),W.return=Y,W)}function F(Y,W,Q,ce){var ke=Q.type;return ke===C?le(Y,W,Q.props.children,ce,Q.key):W!==null&&(W.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===G&&w_(ke)===W.type)?(ce=x(W,Q.props),ce.ref=ul(Y,W,Q),ce.return=Y,ce):(ce=af(Q.type,Q.key,Q.props,null,Y.mode,ce),ce.ref=ul(Y,W,Q),ce.return=Y,ce)}function ee(Y,W,Q,ce){return W===null||W.tag!==4||W.stateNode.containerInfo!==Q.containerInfo||W.stateNode.implementation!==Q.implementation?(W=km(Q,Y.mode,ce),W.return=Y,W):(W=x(W,Q.children||[]),W.return=Y,W)}function le(Y,W,Q,ce,ke){return W===null||W.tag!==7?(W=Na(Q,Y.mode,ce,ke),W.return=Y,W):(W=x(W,Q),W.return=Y,W)}function ue(Y,W,Q){if(typeof W=="string"&&W!==""||typeof W=="number")return W=Sm(""+W,Y.mode,Q),W.return=Y,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case E:return Q=af(W.type,W.key,W.props,null,Y.mode,Q),Q.ref=ul(Y,null,W),Q.return=Y,Q;case T:return W=km(W,Y.mode,Q),W.return=Y,W;case G:var ce=W._init;return ue(Y,ce(W._payload),Q)}if(Lr(W)||te(W))return W=Na(W,Y.mode,Q,null),W.return=Y,W;$c(Y,W)}return null}function oe(Y,W,Q,ce){var ke=W!==null?W.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return ke!==null?null:L(Y,W,""+Q,ce);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case E:return Q.key===ke?F(Y,W,Q,ce):null;case T:return Q.key===ke?ee(Y,W,Q,ce):null;case G:return ke=Q._init,oe(Y,W,ke(Q._payload),ce)}if(Lr(Q)||te(Q))return ke!==null?null:le(Y,W,Q,ce,null);$c(Y,Q)}return null}function me(Y,W,Q,ce,ke){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return Y=Y.get(Q)||null,L(W,Y,""+ce,ke);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case E:return Y=Y.get(ce.key===null?Q:ce.key)||null,F(W,Y,ce,ke);case T:return Y=Y.get(ce.key===null?Q:ce.key)||null,ee(W,Y,ce,ke);case G:var Oe=ce._init;return me(Y,W,Q,Oe(ce._payload),ke)}if(Lr(ce)||te(ce))return Y=Y.get(Q)||null,le(W,Y,ce,ke,null);$c(W,ce)}return null}function xe(Y,W,Q,ce){for(var ke=null,Oe=null,Ae=W,Pe=W=0,Ut=null;Ae!==null&&Pe<Q.length;Pe++){Ae.index>Pe?(Ut=Ae,Ae=null):Ut=Ae.sibling;var We=oe(Y,Ae,Q[Pe],ce);if(We===null){Ae===null&&(Ae=Ut);break}s&&Ae&&We.alternate===null&&l(Y,Ae),W=S(We,W,Pe),Oe===null?ke=We:Oe.sibling=We,Oe=We,Ae=Ut}if(Pe===Q.length)return d(Y,Ae),dt&&ka(Y,Pe),ke;if(Ae===null){for(;Pe<Q.length;Pe++)Ae=ue(Y,Q[Pe],ce),Ae!==null&&(W=S(Ae,W,Pe),Oe===null?ke=Ae:Oe.sibling=Ae,Oe=Ae);return dt&&ka(Y,Pe),ke}for(Ae=m(Y,Ae);Pe<Q.length;Pe++)Ut=me(Ae,Y,Pe,Q[Pe],ce),Ut!==null&&(s&&Ut.alternate!==null&&Ae.delete(Ut.key===null?Pe:Ut.key),W=S(Ut,W,Pe),Oe===null?ke=Ut:Oe.sibling=Ut,Oe=Ut);return s&&Ae.forEach(function(Gi){return l(Y,Gi)}),dt&&ka(Y,Pe),ke}function Se(Y,W,Q,ce){var ke=te(Q);if(typeof ke!="function")throw Error(r(150));if(Q=ke.call(Q),Q==null)throw Error(r(151));for(var Oe=ke=null,Ae=W,Pe=W=0,Ut=null,We=Q.next();Ae!==null&&!We.done;Pe++,We=Q.next()){Ae.index>Pe?(Ut=Ae,Ae=null):Ut=Ae.sibling;var Gi=oe(Y,Ae,We.value,ce);if(Gi===null){Ae===null&&(Ae=Ut);break}s&&Ae&&Gi.alternate===null&&l(Y,Ae),W=S(Gi,W,Pe),Oe===null?ke=Gi:Oe.sibling=Gi,Oe=Gi,Ae=Ut}if(We.done)return d(Y,Ae),dt&&ka(Y,Pe),ke;if(Ae===null){for(;!We.done;Pe++,We=Q.next())We=ue(Y,We.value,ce),We!==null&&(W=S(We,W,Pe),Oe===null?ke=We:Oe.sibling=We,Oe=We);return dt&&ka(Y,Pe),ke}for(Ae=m(Y,Ae);!We.done;Pe++,We=Q.next())We=me(Ae,Y,Pe,We.value,ce),We!==null&&(s&&We.alternate!==null&&Ae.delete(We.key===null?Pe:We.key),W=S(We,W,Pe),Oe===null?ke=We:Oe.sibling=We,Oe=We);return s&&Ae.forEach(function(_M){return l(Y,_M)}),dt&&ka(Y,Pe),ke}function St(Y,W,Q,ce){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case E:e:{for(var ke=Q.key,Oe=W;Oe!==null;){if(Oe.key===ke){if(ke=Q.type,ke===C){if(Oe.tag===7){d(Y,Oe.sibling),W=x(Oe,Q.props.children),W.return=Y,Y=W;break e}}else if(Oe.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===G&&w_(ke)===Oe.type){d(Y,Oe.sibling),W=x(Oe,Q.props),W.ref=ul(Y,Oe,Q),W.return=Y,Y=W;break e}d(Y,Oe);break}else l(Y,Oe);Oe=Oe.sibling}Q.type===C?(W=Na(Q.props.children,Y.mode,ce,Q.key),W.return=Y,Y=W):(ce=af(Q.type,Q.key,Q.props,null,Y.mode,ce),ce.ref=ul(Y,W,Q),ce.return=Y,Y=ce)}return P(Y);case T:e:{for(Oe=Q.key;W!==null;){if(W.key===Oe)if(W.tag===4&&W.stateNode.containerInfo===Q.containerInfo&&W.stateNode.implementation===Q.implementation){d(Y,W.sibling),W=x(W,Q.children||[]),W.return=Y,Y=W;break e}else{d(Y,W);break}else l(Y,W);W=W.sibling}W=km(Q,Y.mode,ce),W.return=Y,Y=W}return P(Y);case G:return Oe=Q._init,St(Y,W,Oe(Q._payload),ce)}if(Lr(Q))return xe(Y,W,Q,ce);if(te(Q))return Se(Y,W,Q,ce);$c(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,W!==null&&W.tag===6?(d(Y,W.sibling),W=x(W,Q),W.return=Y,Y=W):(d(Y,W),W=Sm(Q,Y.mode,ce),W.return=Y,Y=W),P(Y)):d(Y,W)}return St}var So=__(!0),S_=__(!1),Ic=Di(null),Mc=null,ko=null,Rp=null;function $p(){Rp=ko=Mc=null}function Ip(s){var l=Ic.current;lt(Ic),s._currentValue=l}function Mp(s,l,d){for(;s!==null;){var m=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),s===d)break;s=s.return}}function Eo(s,l){Mc=s,Rp=ko=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&l)!==0&&(gr=!0),s.firstContext=null)}function Hr(s){var l=s._currentValue;if(Rp!==s)if(s={context:s,memoizedValue:l,next:null},ko===null){if(Mc===null)throw Error(r(308));ko=s,Mc.dependencies={lanes:0,firstContext:s}}else ko=ko.next=s;return l}var Ea=null;function Dp(s){Ea===null?Ea=[s]:Ea.push(s)}function k_(s,l,d,m){var x=l.interleaved;return x===null?(d.next=d,Dp(l)):(d.next=x.next,x.next=d),l.interleaved=d,Jn(s,m)}function Jn(s,l){s.lanes|=l;var d=s.alternate;for(d!==null&&(d.lanes|=l),d=s,s=s.return;s!==null;)s.childLanes|=l,d=s.alternate,d!==null&&(d.childLanes|=l),d=s,s=s.return;return d.tag===3?d.stateNode:null}var Bi=!1;function Lp(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function E_(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Qn(s,l){return{eventTime:s,lane:l,tag:0,payload:null,callback:null,next:null}}function qi(s,l,d){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(He&2)!==0){var x=m.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),m.pending=l,Jn(s,d)}return x=m.interleaved,x===null?(l.next=l,Dp(m)):(l.next=x.next,x.next=l),m.interleaved=l,Jn(s,d)}function Dc(s,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var m=l.lanes;m&=s.pendingLanes,d|=m,l.lanes=d,Qh(s,d)}}function O_(s,l){var d=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var x=null,S=null;if(d=d.firstBaseUpdate,d!==null){do{var P={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};S===null?x=S=P:S=S.next=P,d=d.next}while(d!==null);S===null?x=S=l:S=S.next=l}else x=S=l;d={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:m.shared,effects:m.effects},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=l:s.next=l,d.lastBaseUpdate=l}function Lc(s,l,d,m){var x=s.updateQueue;Bi=!1;var S=x.firstBaseUpdate,P=x.lastBaseUpdate,L=x.shared.pending;if(L!==null){x.shared.pending=null;var F=L,ee=F.next;F.next=null,P===null?S=ee:P.next=ee,P=F;var le=s.alternate;le!==null&&(le=le.updateQueue,L=le.lastBaseUpdate,L!==P&&(L===null?le.firstBaseUpdate=ee:L.next=ee,le.lastBaseUpdate=F))}if(S!==null){var ue=x.baseState;P=0,le=ee=F=null,L=S;do{var oe=L.lane,me=L.eventTime;if((m&oe)===oe){le!==null&&(le=le.next={eventTime:me,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var xe=s,Se=L;switch(oe=l,me=d,Se.tag){case 1:if(xe=Se.payload,typeof xe=="function"){ue=xe.call(me,ue,oe);break e}ue=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Se.payload,oe=typeof xe=="function"?xe.call(me,ue,oe):xe,oe==null)break e;ue=H({},ue,oe);break e;case 2:Bi=!0}}L.callback!==null&&L.lane!==0&&(s.flags|=64,oe=x.effects,oe===null?x.effects=[L]:oe.push(L))}else me={eventTime:me,lane:oe,tag:L.tag,payload:L.payload,callback:L.callback,next:null},le===null?(ee=le=me,F=ue):le=le.next=me,P|=oe;if(L=L.next,L===null){if(L=x.shared.pending,L===null)break;oe=L,L=oe.next,oe.next=null,x.lastBaseUpdate=oe,x.shared.pending=null}}while(!0);if(le===null&&(F=ue),x.baseState=F,x.firstBaseUpdate=ee,x.lastBaseUpdate=le,l=x.shared.interleaved,l!==null){x=l;do P|=x.lane,x=x.next;while(x!==l)}else S===null&&(x.shared.lanes=0);Ta|=P,s.lanes=P,s.memoizedState=ue}}function A_(s,l,d){if(s=l.effects,l.effects=null,s!==null)for(l=0;l<s.length;l++){var m=s[l],x=m.callback;if(x!==null){if(m.callback=null,m=d,typeof x!="function")throw Error(r(191,x));x.call(m)}}}var cl={},Nn=Di(cl),fl=Di(cl),dl=Di(cl);function Oa(s){if(s===cl)throw Error(r(174));return s}function zp(s,l){switch(rt(dl,l),rt(fl,s),rt(Nn,cl),s=l.nodeType,s){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:zs(null,"");break;default:s=s===8?l.parentNode:l,l=s.namespaceURI||null,s=s.tagName,l=zs(l,s)}lt(Nn),rt(Nn,l)}function Oo(){lt(Nn),lt(fl),lt(dl)}function T_(s){Oa(dl.current);var l=Oa(Nn.current),d=zs(l,s.type);l!==d&&(rt(fl,s),rt(Nn,d))}function Bp(s){fl.current===s&&(lt(Nn),lt(fl))}var gt=Di(0);function zc(s){for(var l=s;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var qp=[];function Up(){for(var s=0;s<qp.length;s++)qp[s]._workInProgressVersionPrimary=null;qp.length=0}var Bc=j.ReactCurrentDispatcher,Fp=j.ReactCurrentBatchConfig,Aa=0,yt=null,Nt=null,Bt=null,qc=!1,hl=!1,pl=0,H3=0;function nr(){throw Error(r(321))}function Hp(s,l){if(l===null)return!1;for(var d=0;d<l.length&&d<s.length;d++)if(!sn(s[d],l[d]))return!1;return!0}function Wp(s,l,d,m,x,S){if(Aa=S,yt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Bc.current=s===null||s.memoizedState===null?G3:X3,s=d(m,x),hl){S=0;do{if(hl=!1,pl=0,25<=S)throw Error(r(301));S+=1,Bt=Nt=null,l.updateQueue=null,Bc.current=Y3,s=d(m,x)}while(hl)}if(Bc.current=Hc,l=Nt!==null&&Nt.next!==null,Aa=0,Bt=Nt=yt=null,qc=!1,l)throw Error(r(300));return s}function Vp(){var s=pl!==0;return pl=0,s}function Rn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?yt.memoizedState=Bt=s:Bt=Bt.next=s,Bt}function Wr(){if(Nt===null){var s=yt.alternate;s=s!==null?s.memoizedState:null}else s=Nt.next;var l=Bt===null?yt.memoizedState:Bt.next;if(l!==null)Bt=l,Nt=s;else{if(s===null)throw Error(r(310));Nt=s,s={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Bt===null?yt.memoizedState=Bt=s:Bt=Bt.next=s}return Bt}function ml(s,l){return typeof l=="function"?l(s):l}function Kp(s){var l=Wr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=s;var m=Nt,x=m.baseQueue,S=d.pending;if(S!==null){if(x!==null){var P=x.next;x.next=S.next,S.next=P}m.baseQueue=x=S,d.pending=null}if(x!==null){S=x.next,m=m.baseState;var L=P=null,F=null,ee=S;do{var le=ee.lane;if((Aa&le)===le)F!==null&&(F=F.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),m=ee.hasEagerState?ee.eagerState:s(m,ee.action);else{var ue={lane:le,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};F===null?(L=F=ue,P=m):F=F.next=ue,yt.lanes|=le,Ta|=le}ee=ee.next}while(ee!==null&&ee!==S);F===null?P=m:F.next=L,sn(m,l.memoizedState)||(gr=!0),l.memoizedState=m,l.baseState=P,l.baseQueue=F,d.lastRenderedState=m}if(s=d.interleaved,s!==null){x=s;do S=x.lane,yt.lanes|=S,Ta|=S,x=x.next;while(x!==s)}else x===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function Gp(s){var l=Wr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=s;var m=d.dispatch,x=d.pending,S=l.memoizedState;if(x!==null){d.pending=null;var P=x=x.next;do S=s(S,P.action),P=P.next;while(P!==x);sn(S,l.memoizedState)||(gr=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),d.lastRenderedState=S}return[S,m]}function j_(){}function P_(s,l){var d=yt,m=Wr(),x=l(),S=!sn(m.memoizedState,x);if(S&&(m.memoizedState=x,gr=!0),m=m.queue,Xp(R_.bind(null,d,m,s),[s]),m.getSnapshot!==l||S||Bt!==null&&Bt.memoizedState.tag&1){if(d.flags|=2048,gl(9,N_.bind(null,d,m,x,l),void 0,null),qt===null)throw Error(r(349));(Aa&30)!==0||C_(d,l,x)}return x}function C_(s,l,d){s.flags|=16384,s={getSnapshot:l,value:d},l=yt.updateQueue,l===null?(l={lastEffect:null,stores:null},yt.updateQueue=l,l.stores=[s]):(d=l.stores,d===null?l.stores=[s]:d.push(s))}function N_(s,l,d,m){l.value=d,l.getSnapshot=m,$_(l)&&I_(s)}function R_(s,l,d){return d(function(){$_(l)&&I_(s)})}function $_(s){var l=s.getSnapshot;s=s.value;try{var d=l();return!sn(s,d)}catch{return!0}}function I_(s){var l=Jn(s,1);l!==null&&dn(l,s,1,-1)}function M_(s){var l=Rn();return typeof s=="function"&&(s=s()),l.memoizedState=l.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:s},l.queue=s,s=s.dispatch=K3.bind(null,yt,s),[l.memoizedState,s]}function gl(s,l,d,m){return s={tag:s,create:l,destroy:d,deps:m,next:null},l=yt.updateQueue,l===null?(l={lastEffect:null,stores:null},yt.updateQueue=l,l.lastEffect=s.next=s):(d=l.lastEffect,d===null?l.lastEffect=s.next=s:(m=d.next,d.next=s,s.next=m,l.lastEffect=s)),s}function D_(){return Wr().memoizedState}function Uc(s,l,d,m){var x=Rn();yt.flags|=s,x.memoizedState=gl(1|l,d,void 0,m===void 0?null:m)}function Fc(s,l,d,m){var x=Wr();m=m===void 0?null:m;var S=void 0;if(Nt!==null){var P=Nt.memoizedState;if(S=P.destroy,m!==null&&Hp(m,P.deps)){x.memoizedState=gl(l,d,S,m);return}}yt.flags|=s,x.memoizedState=gl(1|l,d,S,m)}function L_(s,l){return Uc(8390656,8,s,l)}function Xp(s,l){return Fc(2048,8,s,l)}function z_(s,l){return Fc(4,2,s,l)}function B_(s,l){return Fc(4,4,s,l)}function q_(s,l){if(typeof l=="function")return s=s(),l(s),function(){l(null)};if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function U_(s,l,d){return d=d!=null?d.concat([s]):null,Fc(4,4,q_.bind(null,l,s),d)}function Yp(){}function F_(s,l){var d=Wr();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&Hp(l,m[1])?m[0]:(d.memoizedState=[s,l],s)}function H_(s,l){var d=Wr();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&Hp(l,m[1])?m[0]:(s=s(),d.memoizedState=[s,l],s)}function W_(s,l,d){return(Aa&21)===0?(s.baseState&&(s.baseState=!1,gr=!0),s.memoizedState=d):(sn(d,l)||(d=w1(),yt.lanes|=d,Ta|=d,s.baseState=!0),l)}function W3(s,l){var d=Ye;Ye=d!==0&&4>d?d:4,s(!0);var m=Fp.transition;Fp.transition={};try{s(!1),l()}finally{Ye=d,Fp.transition=m}}function V_(){return Wr().memoizedState}function V3(s,l,d){var m=Wi(s);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},K_(s))G_(l,d);else if(d=k_(s,l,d,m),d!==null){var x=fr();dn(d,s,m,x),X_(d,l,m)}}function K3(s,l,d){var m=Wi(s),x={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(K_(s))G_(l,x);else{var S=s.alternate;if(s.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var P=l.lastRenderedState,L=S(P,d);if(x.hasEagerState=!0,x.eagerState=L,sn(L,P)){var F=l.interleaved;F===null?(x.next=x,Dp(l)):(x.next=F.next,F.next=x),l.interleaved=x;return}}catch{}finally{}d=k_(s,l,x,m),d!==null&&(x=fr(),dn(d,s,m,x),X_(d,l,m))}}function K_(s){var l=s.alternate;return s===yt||l!==null&&l===yt}function G_(s,l){hl=qc=!0;var d=s.pending;d===null?l.next=l:(l.next=d.next,d.next=l),s.pending=l}function X_(s,l,d){if((d&4194240)!==0){var m=l.lanes;m&=s.pendingLanes,d|=m,l.lanes=d,Qh(s,d)}}var Hc={readContext:Hr,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},G3={readContext:Hr,useCallback:function(s,l){return Rn().memoizedState=[s,l===void 0?null:l],s},useContext:Hr,useEffect:L_,useImperativeHandle:function(s,l,d){return d=d!=null?d.concat([s]):null,Uc(4194308,4,q_.bind(null,l,s),d)},useLayoutEffect:function(s,l){return Uc(4194308,4,s,l)},useInsertionEffect:function(s,l){return Uc(4,2,s,l)},useMemo:function(s,l){var d=Rn();return l=l===void 0?null:l,s=s(),d.memoizedState=[s,l],s},useReducer:function(s,l,d){var m=Rn();return l=d!==void 0?d(l):l,m.memoizedState=m.baseState=l,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:l},m.queue=s,s=s.dispatch=V3.bind(null,yt,s),[m.memoizedState,s]},useRef:function(s){var l=Rn();return s={current:s},l.memoizedState=s},useState:M_,useDebugValue:Yp,useDeferredValue:function(s){return Rn().memoizedState=s},useTransition:function(){var s=M_(!1),l=s[0];return s=W3.bind(null,s[1]),Rn().memoizedState=s,[l,s]},useMutableSource:function(){},useSyncExternalStore:function(s,l,d){var m=yt,x=Rn();if(dt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),qt===null)throw Error(r(349));(Aa&30)!==0||C_(m,l,d)}x.memoizedState=d;var S={value:d,getSnapshot:l};return x.queue=S,L_(R_.bind(null,m,S,s),[s]),m.flags|=2048,gl(9,N_.bind(null,m,S,d,l),void 0,null),d},useId:function(){var s=Rn(),l=qt.identifierPrefix;if(dt){var d=Yn,m=Xn;d=(m&~(1<<32-on(m)-1)).toString(32)+d,l=":"+l+"R"+d,d=pl++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=H3++,l=":"+l+"r"+d.toString(32)+":";return s.memoizedState=l},unstable_isNewReconciler:!1},X3={readContext:Hr,useCallback:F_,useContext:Hr,useEffect:Xp,useImperativeHandle:U_,useInsertionEffect:z_,useLayoutEffect:B_,useMemo:H_,useReducer:Kp,useRef:D_,useState:function(){return Kp(ml)},useDebugValue:Yp,useDeferredValue:function(s){var l=Wr();return W_(l,Nt.memoizedState,s)},useTransition:function(){var s=Kp(ml)[0],l=Wr().memoizedState;return[s,l]},useMutableSource:j_,useSyncExternalStore:P_,useId:V_,unstable_isNewReconciler:!1},Y3={readContext:Hr,useCallback:F_,useContext:Hr,useEffect:Xp,useImperativeHandle:U_,useInsertionEffect:z_,useLayoutEffect:B_,useMemo:H_,useReducer:Gp,useRef:D_,useState:function(){return Gp(ml)},useDebugValue:Yp,useDeferredValue:function(s){var l=Wr();return Nt===null?l.memoizedState=s:W_(l,Nt.memoizedState,s)},useTransition:function(){var s=Gp(ml)[0],l=Wr().memoizedState;return[s,l]},useMutableSource:j_,useSyncExternalStore:P_,useId:V_,unstable_isNewReconciler:!1};function un(s,l){if(s&&s.defaultProps){l=H({},l),s=s.defaultProps;for(var d in s)l[d]===void 0&&(l[d]=s[d]);return l}return l}function Jp(s,l,d,m){l=s.memoizedState,d=d(m,l),d=d==null?l:H({},l,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var Wc={isMounted:function(s){return(s=s._reactInternals)?xa(s)===s:!1},enqueueSetState:function(s,l,d){s=s._reactInternals;var m=fr(),x=Wi(s),S=Qn(m,x);S.payload=l,d!=null&&(S.callback=d),l=qi(s,S,x),l!==null&&(dn(l,s,x,m),Dc(l,s,x))},enqueueReplaceState:function(s,l,d){s=s._reactInternals;var m=fr(),x=Wi(s),S=Qn(m,x);S.tag=1,S.payload=l,d!=null&&(S.callback=d),l=qi(s,S,x),l!==null&&(dn(l,s,x,m),Dc(l,s,x))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var d=fr(),m=Wi(s),x=Qn(d,m);x.tag=2,l!=null&&(x.callback=l),l=qi(s,x,m),l!==null&&(dn(l,s,m,d),Dc(l,s,m))}};function Y_(s,l,d,m,x,S,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,S,P):l.prototype&&l.prototype.isPureReactComponent?!rl(d,m)||!rl(x,S):!0}function J_(s,l,d){var m=!1,x=Li,S=l.contextType;return typeof S=="object"&&S!==null?S=Hr(S):(x=mr(l)?_a:rr.current,m=l.contextTypes,S=(m=m!=null)?bo(s,x):Li),l=new l(d,S),s.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Wc,s.stateNode=l,l._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=x,s.__reactInternalMemoizedMaskedChildContext=S),l}function Q_(s,l,d,m){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,m),l.state!==s&&Wc.enqueueReplaceState(l,l.state,null)}function Qp(s,l,d,m){var x=s.stateNode;x.props=d,x.state=s.memoizedState,x.refs={},Lp(s);var S=l.contextType;typeof S=="object"&&S!==null?x.context=Hr(S):(S=mr(l)?_a:rr.current,x.context=bo(s,S)),x.state=s.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Jp(s,l,S,d),x.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(l=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),l!==x.state&&Wc.enqueueReplaceState(x,x.state,null),Lc(s,d,x,m),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308)}function Ao(s,l){try{var d="",m=l;do d+=se(m),m=m.return;while(m);var x=d}catch(S){x=`
39
- Error generating stack: `+S.message+`
40
- `+S.stack}return{value:s,source:l,stack:x,digest:null}}function Zp(s,l,d){return{value:s,source:null,stack:d??null,digest:l??null}}function em(s,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var J3=typeof WeakMap=="function"?WeakMap:Map;function Z_(s,l,d){d=Qn(-1,d),d.tag=3,d.payload={element:null};var m=l.value;return d.callback=function(){Qc||(Qc=!0,mm=m),em(s,l)},d}function eS(s,l,d){d=Qn(-1,d),d.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var x=l.value;d.payload=function(){return m(x)},d.callback=function(){em(s,l)}}var S=s.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(d.callback=function(){em(s,l),typeof m!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})}),d}function tS(s,l,d){var m=s.pingCache;if(m===null){m=s.pingCache=new J3;var x=new Set;m.set(l,x)}else x=m.get(l),x===void 0&&(x=new Set,m.set(l,x));x.has(d)||(x.add(d),s=fM.bind(null,s,l,d),l.then(s,s))}function rS(s){do{var l;if((l=s.tag===13)&&(l=s.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return s;s=s.return}while(s!==null);return null}function nS(s,l,d,m,x){return(s.mode&1)===0?(s===l?s.flags|=65536:(s.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Qn(-1,1),l.tag=2,qi(d,l,1))),d.lanes|=1),s):(s.flags|=65536,s.lanes=x,s)}var Q3=j.ReactCurrentOwner,gr=!1;function cr(s,l,d,m){l.child=s===null?S_(l,null,d,m):So(l,s.child,d,m)}function iS(s,l,d,m,x){d=d.render;var S=l.ref;return Eo(l,x),m=Wp(s,l,d,m,S,x),d=Vp(),s!==null&&!gr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~x,Zn(s,l,x)):(dt&&d&&Tp(l),l.flags|=1,cr(s,l,m,x),l.child)}function aS(s,l,d,m,x){if(s===null){var S=d.type;return typeof S=="function"&&!_m(S)&&S.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=S,oS(s,l,S,m,x)):(s=af(d.type,null,m,l,l.mode,x),s.ref=l.ref,s.return=l,l.child=s)}if(S=s.child,(s.lanes&x)===0){var P=S.memoizedProps;if(d=d.compare,d=d!==null?d:rl,d(P,m)&&s.ref===l.ref)return Zn(s,l,x)}return l.flags|=1,s=Ki(S,m),s.ref=l.ref,s.return=l,l.child=s}function oS(s,l,d,m,x){if(s!==null){var S=s.memoizedProps;if(rl(S,m)&&s.ref===l.ref)if(gr=!1,l.pendingProps=m=S,(s.lanes&x)!==0)(s.flags&131072)!==0&&(gr=!0);else return l.lanes=s.lanes,Zn(s,l,x)}return tm(s,l,d,m,x)}function sS(s,l,d){var m=l.pendingProps,x=m.children,S=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(jo,jr),jr|=d;else{if((d&1073741824)===0)return s=S!==null?S.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:s,cachePool:null,transitions:null},l.updateQueue=null,rt(jo,jr),jr|=s,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=S!==null?S.baseLanes:d,rt(jo,jr),jr|=m}else S!==null?(m=S.baseLanes|d,l.memoizedState=null):m=d,rt(jo,jr),jr|=m;return cr(s,l,x,d),l.child}function lS(s,l){var d=l.ref;(s===null&&d!==null||s!==null&&s.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function tm(s,l,d,m,x){var S=mr(d)?_a:rr.current;return S=bo(l,S),Eo(l,x),d=Wp(s,l,d,m,S,x),m=Vp(),s!==null&&!gr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~x,Zn(s,l,x)):(dt&&m&&Tp(l),l.flags|=1,cr(s,l,d,x),l.child)}function uS(s,l,d,m,x){if(mr(d)){var S=!0;jc(l)}else S=!1;if(Eo(l,x),l.stateNode===null)Kc(s,l),J_(l,d,m),Qp(l,d,m,x),m=!0;else if(s===null){var P=l.stateNode,L=l.memoizedProps;P.props=L;var F=P.context,ee=d.contextType;typeof ee=="object"&&ee!==null?ee=Hr(ee):(ee=mr(d)?_a:rr.current,ee=bo(l,ee));var le=d.getDerivedStateFromProps,ue=typeof le=="function"||typeof P.getSnapshotBeforeUpdate=="function";ue||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(L!==m||F!==ee)&&Q_(l,P,m,ee),Bi=!1;var oe=l.memoizedState;P.state=oe,Lc(l,m,P,x),F=l.memoizedState,L!==m||oe!==F||pr.current||Bi?(typeof le=="function"&&(Jp(l,d,le,m),F=l.memoizedState),(L=Bi||Y_(l,d,L,m,oe,F,ee))?(ue||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(l.flags|=4194308)):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=F),P.props=m,P.state=F,P.context=ee,m=L):(typeof P.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{P=l.stateNode,E_(s,l),L=l.memoizedProps,ee=l.type===l.elementType?L:un(l.type,L),P.props=ee,ue=l.pendingProps,oe=P.context,F=d.contextType,typeof F=="object"&&F!==null?F=Hr(F):(F=mr(d)?_a:rr.current,F=bo(l,F));var me=d.getDerivedStateFromProps;(le=typeof me=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(L!==ue||oe!==F)&&Q_(l,P,m,F),Bi=!1,oe=l.memoizedState,P.state=oe,Lc(l,m,P,x);var xe=l.memoizedState;L!==ue||oe!==xe||pr.current||Bi?(typeof me=="function"&&(Jp(l,d,me,m),xe=l.memoizedState),(ee=Bi||Y_(l,d,ee,m,oe,xe,F)||!1)?(le||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(m,xe,F),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(m,xe,F)),typeof P.componentDidUpdate=="function"&&(l.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof P.componentDidUpdate!="function"||L===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||L===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=xe),P.props=m,P.state=xe,P.context=F,m=ee):(typeof P.componentDidUpdate!="function"||L===s.memoizedProps&&oe===s.memoizedState||(l.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||L===s.memoizedProps&&oe===s.memoizedState||(l.flags|=1024),m=!1)}return rm(s,l,d,m,S,x)}function rm(s,l,d,m,x,S){lS(s,l);var P=(l.flags&128)!==0;if(!m&&!P)return x&&p_(l,d,!1),Zn(s,l,S);m=l.stateNode,Q3.current=l;var L=P&&typeof d.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,s!==null&&P?(l.child=So(l,s.child,null,S),l.child=So(l,null,L,S)):cr(s,l,L,S),l.memoizedState=m.state,x&&p_(l,d,!0),l.child}function cS(s){var l=s.stateNode;l.pendingContext?d_(s,l.pendingContext,l.pendingContext!==l.context):l.context&&d_(s,l.context,!1),zp(s,l.containerInfo)}function fS(s,l,d,m,x){return _o(),Np(x),l.flags|=256,cr(s,l,d,m),l.child}var nm={dehydrated:null,treeContext:null,retryLane:0};function im(s){return{baseLanes:s,cachePool:null,transitions:null}}function dS(s,l,d){var m=l.pendingProps,x=gt.current,S=!1,P=(l.flags&128)!==0,L;if((L=P)||(L=s!==null&&s.memoizedState===null?!1:(x&2)!==0),L?(S=!0,l.flags&=-129):(s===null||s.memoizedState!==null)&&(x|=1),rt(gt,x&1),s===null)return Cp(l),s=l.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((l.mode&1)===0?l.lanes=1:s.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(P=m.children,s=m.fallback,S?(m=l.mode,S=l.child,P={mode:"hidden",children:P},(m&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=P):S=of(P,m,0,null),s=Na(s,m,d,null),S.return=l,s.return=l,S.sibling=s,l.child=S,l.child.memoizedState=im(d),l.memoizedState=nm,s):am(l,P));if(x=s.memoizedState,x!==null&&(L=x.dehydrated,L!==null))return Z3(s,l,P,m,L,x,d);if(S){S=m.fallback,P=l.mode,x=s.child,L=x.sibling;var F={mode:"hidden",children:m.children};return(P&1)===0&&l.child!==x?(m=l.child,m.childLanes=0,m.pendingProps=F,l.deletions=null):(m=Ki(x,F),m.subtreeFlags=x.subtreeFlags&14680064),L!==null?S=Ki(L,S):(S=Na(S,P,d,null),S.flags|=2),S.return=l,m.return=l,m.sibling=S,l.child=m,m=S,S=l.child,P=s.child.memoizedState,P=P===null?im(d):{baseLanes:P.baseLanes|d,cachePool:null,transitions:P.transitions},S.memoizedState=P,S.childLanes=s.childLanes&~d,l.memoizedState=nm,m}return S=s.child,s=S.sibling,m=Ki(S,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=d),m.return=l,m.sibling=null,s!==null&&(d=l.deletions,d===null?(l.deletions=[s],l.flags|=16):d.push(s)),l.child=m,l.memoizedState=null,m}function am(s,l){return l=of({mode:"visible",children:l},s.mode,0,null),l.return=s,s.child=l}function Vc(s,l,d,m){return m!==null&&Np(m),So(l,s.child,null,d),s=am(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function Z3(s,l,d,m,x,S,P){if(d)return l.flags&256?(l.flags&=-257,m=Zp(Error(r(422))),Vc(s,l,P,m)):l.memoizedState!==null?(l.child=s.child,l.flags|=128,null):(S=m.fallback,x=l.mode,m=of({mode:"visible",children:m.children},x,0,null),S=Na(S,x,P,null),S.flags|=2,m.return=l,S.return=l,m.sibling=S,l.child=m,(l.mode&1)!==0&&So(l,s.child,null,P),l.child.memoizedState=im(P),l.memoizedState=nm,S);if((l.mode&1)===0)return Vc(s,l,P,null);if(x.data==="$!"){if(m=x.nextSibling&&x.nextSibling.dataset,m)var L=m.dgst;return m=L,S=Error(r(419)),m=Zp(S,m,void 0),Vc(s,l,P,m)}if(L=(P&s.childLanes)!==0,gr||L){if(m=qt,m!==null){switch(P&-P){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(m.suspendedLanes|P))!==0?0:x,x!==0&&x!==S.retryLane&&(S.retryLane=x,Jn(s,x),dn(m,s,x,-1))}return wm(),m=Zp(Error(r(421))),Vc(s,l,P,m)}return x.data==="$?"?(l.flags|=128,l.child=s.child,l=dM.bind(null,s),x._reactRetry=l,null):(s=S.treeContext,Tr=Mi(x.nextSibling),Ar=l,dt=!0,ln=null,s!==null&&(Ur[Fr++]=Xn,Ur[Fr++]=Yn,Ur[Fr++]=Sa,Xn=s.id,Yn=s.overflow,Sa=l),l=am(l,m.children),l.flags|=4096,l)}function hS(s,l,d){s.lanes|=l;var m=s.alternate;m!==null&&(m.lanes|=l),Mp(s.return,l,d)}function om(s,l,d,m,x){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:x}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=m,S.tail=d,S.tailMode=x)}function pS(s,l,d){var m=l.pendingProps,x=m.revealOrder,S=m.tail;if(cr(s,l,m.children,d),m=gt.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&hS(s,d,l);else if(s.tag===19)hS(s,d,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(rt(gt,m),(l.mode&1)===0)l.memoizedState=null;else switch(x){case"forwards":for(d=l.child,x=null;d!==null;)s=d.alternate,s!==null&&zc(s)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),om(l,!1,x,d,S);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(s=x.alternate,s!==null&&zc(s)===null){l.child=x;break}s=x.sibling,x.sibling=d,d=x,x=s}om(l,!0,d,null,S);break;case"together":om(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Kc(s,l){(l.mode&1)===0&&s!==null&&(s.alternate=null,l.alternate=null,l.flags|=2)}function Zn(s,l,d){if(s!==null&&(l.dependencies=s.dependencies),Ta|=l.lanes,(d&l.childLanes)===0)return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,d=Ki(s,s.pendingProps),l.child=d,d.return=l;s.sibling!==null;)s=s.sibling,d=d.sibling=Ki(s,s.pendingProps),d.return=l;d.sibling=null}return l.child}function eM(s,l,d){switch(l.tag){case 3:cS(l),_o();break;case 5:T_(l);break;case 1:mr(l.type)&&jc(l);break;case 4:zp(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,x=l.memoizedProps.value;rt(Ic,m._currentValue),m._currentValue=x;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(rt(gt,gt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?dS(s,l,d):(rt(gt,gt.current&1),s=Zn(s,l,d),s!==null?s.sibling:null);rt(gt,gt.current&1);break;case 19:if(m=(d&l.childLanes)!==0,(s.flags&128)!==0){if(m)return pS(s,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),rt(gt,gt.current),m)break;return null;case 22:case 23:return l.lanes=0,sS(s,l,d)}return Zn(s,l,d)}var mS,sm,gS,yS;mS=function(s,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},sm=function(){},gS=function(s,l,d,m){var x=s.memoizedProps;if(x!==m){s=l.stateNode,Oa(Nn.current);var S=null;switch(d){case"input":x=Ne(s,x),m=Ne(s,m),S=[];break;case"select":x=H({},x,{value:void 0}),m=H({},m,{value:void 0}),S=[];break;case"textarea":x=ot(s,x),m=ot(s,m),S=[];break;default:typeof x.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=Oc)}lo(d,m);var P;d=null;for(ee in x)if(!m.hasOwnProperty(ee)&&x.hasOwnProperty(ee)&&x[ee]!=null)if(ee==="style"){var L=x[ee];for(P in L)L.hasOwnProperty(P)&&(d||(d={}),d[P]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(i.hasOwnProperty(ee)?S||(S=[]):(S=S||[]).push(ee,null));for(ee in m){var F=m[ee];if(L=x!=null?x[ee]:void 0,m.hasOwnProperty(ee)&&F!==L&&(F!=null||L!=null))if(ee==="style")if(L){for(P in L)!L.hasOwnProperty(P)||F&&F.hasOwnProperty(P)||(d||(d={}),d[P]="");for(P in F)F.hasOwnProperty(P)&&L[P]!==F[P]&&(d||(d={}),d[P]=F[P])}else d||(S||(S=[]),S.push(ee,d)),d=F;else ee==="dangerouslySetInnerHTML"?(F=F?F.__html:void 0,L=L?L.__html:void 0,F!=null&&L!==F&&(S=S||[]).push(ee,F)):ee==="children"?typeof F!="string"&&typeof F!="number"||(S=S||[]).push(ee,""+F):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(i.hasOwnProperty(ee)?(F!=null&&ee==="onScroll"&&st("scroll",s),S||L===F||(S=[])):(S=S||[]).push(ee,F))}d&&(S=S||[]).push("style",d);var ee=S;(l.updateQueue=ee)&&(l.flags|=4)}},yS=function(s,l,d,m){d!==m&&(l.flags|=4)};function yl(s,l){if(!dt)switch(s.tailMode){case"hidden":l=s.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function ir(s){var l=s.alternate!==null&&s.alternate.child===s.child,d=0,m=0;if(l)for(var x=s.child;x!==null;)d|=x.lanes|x.childLanes,m|=x.subtreeFlags&14680064,m|=x.flags&14680064,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)d|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=m,s.childLanes=d,l}function tM(s,l,d){var m=l.pendingProps;switch(jp(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ir(l),null;case 1:return mr(l.type)&&Tc(),ir(l),null;case 3:return m=l.stateNode,Oo(),lt(pr),lt(rr),Up(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(Rc(l)?l.flags|=4:s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,ln!==null&&(vm(ln),ln=null))),sm(s,l),ir(l),null;case 5:Bp(l);var x=Oa(dl.current);if(d=l.type,s!==null&&l.stateNode!=null)gS(s,l,d,m,x),s.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(r(166));return ir(l),null}if(s=Oa(Nn.current),Rc(l)){m=l.stateNode,d=l.type;var S=l.memoizedProps;switch(m[Cn]=l,m[sl]=S,s=(l.mode&1)!==0,d){case"dialog":st("cancel",m),st("close",m);break;case"iframe":case"object":case"embed":st("load",m);break;case"video":case"audio":for(x=0;x<il.length;x++)st(il[x],m);break;case"source":st("error",m);break;case"img":case"image":case"link":st("error",m),st("load",m);break;case"details":st("toggle",m);break;case"input":ct(m,S),st("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!S.multiple},st("invalid",m);break;case"textarea":kr(m,S),st("invalid",m)}lo(d,S),x=null;for(var P in S)if(S.hasOwnProperty(P)){var L=S[P];P==="children"?typeof L=="string"?m.textContent!==L&&(S.suppressHydrationWarning!==!0&&Ec(m.textContent,L,s),x=["children",L]):typeof L=="number"&&m.textContent!==""+L&&(S.suppressHydrationWarning!==!0&&Ec(m.textContent,L,s),x=["children",""+L]):i.hasOwnProperty(P)&&L!=null&&P==="onScroll"&&st("scroll",m)}switch(d){case"input":Ee(m),hr(m,S,!0);break;case"textarea":Ee(m),ga(m);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(m.onclick=Oc)}m=x,l.updateQueue=m,m!==null&&(l.flags|=4)}else{P=x.nodeType===9?x:x.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=ya(d)),s==="http://www.w3.org/1999/xhtml"?d==="script"?(s=P.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=P.createElement(d,{is:m.is}):(s=P.createElement(d),d==="select"&&(P=s,m.multiple?P.multiple=!0:m.size&&(P.size=m.size))):s=P.createElementNS(s,d),s[Cn]=l,s[sl]=m,mS(s,l,!1,!1),l.stateNode=s;e:{switch(P=Bs(d,m),d){case"dialog":st("cancel",s),st("close",s),x=m;break;case"iframe":case"object":case"embed":st("load",s),x=m;break;case"video":case"audio":for(x=0;x<il.length;x++)st(il[x],s);x=m;break;case"source":st("error",s),x=m;break;case"img":case"image":case"link":st("error",s),st("load",s),x=m;break;case"details":st("toggle",s),x=m;break;case"input":ct(s,m),x=Ne(s,m),st("invalid",s);break;case"option":x=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},x=H({},m,{value:void 0}),st("invalid",s);break;case"textarea":kr(s,m),x=ot(s,m),st("invalid",s);break;default:x=m}lo(d,x),L=x;for(S in L)if(L.hasOwnProperty(S)){var F=L[S];S==="style"?ac(s,F):S==="dangerouslySetInnerHTML"?(F=F?F.__html:void 0,F!=null&&so(s,F)):S==="children"?typeof F=="string"?(d!=="textarea"||F!=="")&&zr(s,F):typeof F=="number"&&zr(s,""+F):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?F!=null&&S==="onScroll"&&st("scroll",s):F!=null&&A(s,S,F,P))}switch(d){case"input":Ee(s),hr(s,m,!1);break;case"textarea":Ee(s),ga(s);break;case"option":m.value!=null&&s.setAttribute("value",""+pe(m.value));break;case"select":s.multiple=!!m.multiple,S=m.value,S!=null?er(s,!!m.multiple,S,!1):m.defaultValue!=null&&er(s,!!m.multiple,m.defaultValue,!0);break;default:typeof x.onClick=="function"&&(s.onclick=Oc)}switch(d){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return ir(l),null;case 6:if(s&&l.stateNode!=null)yS(s,l,s.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(r(166));if(d=Oa(dl.current),Oa(Nn.current),Rc(l)){if(m=l.stateNode,d=l.memoizedProps,m[Cn]=l,(S=m.nodeValue!==d)&&(s=Ar,s!==null))switch(s.tag){case 3:Ec(m.nodeValue,d,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Ec(m.nodeValue,d,(s.mode&1)!==0)}S&&(l.flags|=4)}else m=(d.nodeType===9?d:d.ownerDocument).createTextNode(m),m[Cn]=l,l.stateNode=m}return ir(l),null;case 13:if(lt(gt),m=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(dt&&Tr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)x_(),_o(),l.flags|=98560,S=!1;else if(S=Rc(l),m!==null&&m.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=l.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Cn]=l}else _o(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;ir(l),S=!1}else ln!==null&&(vm(ln),ln=null),S=!0;if(!S)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(s===null||(gt.current&1)!==0?Rt===0&&(Rt=3):wm())),l.updateQueue!==null&&(l.flags|=4),ir(l),null);case 4:return Oo(),sm(s,l),s===null&&al(l.stateNode.containerInfo),ir(l),null;case 10:return Ip(l.type._context),ir(l),null;case 17:return mr(l.type)&&Tc(),ir(l),null;case 19:if(lt(gt),S=l.memoizedState,S===null)return ir(l),null;if(m=(l.flags&128)!==0,P=S.rendering,P===null)if(m)yl(S,!1);else{if(Rt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(P=zc(s),P!==null){for(l.flags|=128,yl(S,!1),m=P.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=d,d=l.child;d!==null;)S=d,s=m,S.flags&=14680066,P=S.alternate,P===null?(S.childLanes=0,S.lanes=s,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=P.childLanes,S.lanes=P.lanes,S.child=P.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=P.memoizedProps,S.memoizedState=P.memoizedState,S.updateQueue=P.updateQueue,S.type=P.type,s=P.dependencies,S.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),d=d.sibling;return rt(gt,gt.current&1|2),l.child}s=s.sibling}S.tail!==null&&_t()>Po&&(l.flags|=128,m=!0,yl(S,!1),l.lanes=4194304)}else{if(!m)if(s=zc(P),s!==null){if(l.flags|=128,m=!0,d=s.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),yl(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!dt)return ir(l),null}else 2*_t()-S.renderingStartTime>Po&&d!==1073741824&&(l.flags|=128,m=!0,yl(S,!1),l.lanes=4194304);S.isBackwards?(P.sibling=l.child,l.child=P):(d=S.last,d!==null?d.sibling=P:l.child=P,S.last=P)}return S.tail!==null?(l=S.tail,S.rendering=l,S.tail=l.sibling,S.renderingStartTime=_t(),l.sibling=null,d=gt.current,rt(gt,m?d&1|2:d&1),l):(ir(l),null);case 22:case 23:return xm(),m=l.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(jr&1073741824)!==0&&(ir(l),l.subtreeFlags&6&&(l.flags|=8192)):ir(l),null;case 24:return null;case 25:return null}throw Error(r(156,l.tag))}function rM(s,l){switch(jp(l),l.tag){case 1:return mr(l.type)&&Tc(),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Oo(),lt(pr),lt(rr),Up(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 5:return Bp(l),null;case 13:if(lt(gt),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));_o()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return lt(gt),null;case 4:return Oo(),null;case 10:return Ip(l.type._context),null;case 22:case 23:return xm(),null;case 24:return null;default:return null}}var Gc=!1,ar=!1,nM=typeof WeakSet=="function"?WeakSet:Set,ye=null;function To(s,l){var d=s.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){vt(s,l,m)}else d.current=null}function lm(s,l,d){try{d()}catch(m){vt(s,l,m)}}var vS=!1;function iM(s,l){if(xp=pc,s=Y1(),dp(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var x=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{d.nodeType,S.nodeType}catch{d=null;break e}var P=0,L=-1,F=-1,ee=0,le=0,ue=s,oe=null;t:for(;;){for(var me;ue!==d||x!==0&&ue.nodeType!==3||(L=P+x),ue!==S||m!==0&&ue.nodeType!==3||(F=P+m),ue.nodeType===3&&(P+=ue.nodeValue.length),(me=ue.firstChild)!==null;)oe=ue,ue=me;for(;;){if(ue===s)break t;if(oe===d&&++ee===x&&(L=P),oe===S&&++le===m&&(F=P),(me=ue.nextSibling)!==null)break;ue=oe,oe=ue.parentNode}ue=me}d=L===-1||F===-1?null:{start:L,end:F}}else d=null}d=d||{start:0,end:0}}else d=null;for(wp={focusedElem:s,selectionRange:d},pc=!1,ye=l;ye!==null;)if(l=ye,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,ye=s;else for(;ye!==null;){l=ye;try{var xe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var Se=xe.memoizedProps,St=xe.memoizedState,Y=l.stateNode,W=Y.getSnapshotBeforeUpdate(l.elementType===l.type?Se:un(l.type,Se),St);Y.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var Q=l.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ce){vt(l,l.return,ce)}if(s=l.sibling,s!==null){s.return=l.return,ye=s;break}ye=l.return}return xe=vS,vS=!1,xe}function vl(s,l,d){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var x=m=m.next;do{if((x.tag&s)===s){var S=x.destroy;x.destroy=void 0,S!==void 0&&lm(l,d,S)}x=x.next}while(x!==m)}}function Xc(s,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&s)===s){var m=d.create;d.destroy=m()}d=d.next}while(d!==l)}}function um(s){var l=s.ref;if(l!==null){var d=s.stateNode;switch(s.tag){case 5:s=d;break;default:s=d}typeof l=="function"?l(s):l.current=s}}function bS(s){var l=s.alternate;l!==null&&(s.alternate=null,bS(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&(delete l[Cn],delete l[sl],delete l[Ep],delete l[B3],delete l[q3])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function xS(s){return s.tag===5||s.tag===3||s.tag===4}function wS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||xS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function cm(s,l,d){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(s,l):d.insertBefore(s,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(s,d)):(l=d,l.appendChild(s)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Oc));else if(m!==4&&(s=s.child,s!==null))for(cm(s,l,d),s=s.sibling;s!==null;)cm(s,l,d),s=s.sibling}function fm(s,l,d){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?d.insertBefore(s,l):d.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(fm(s,l,d),s=s.sibling;s!==null;)fm(s,l,d),s=s.sibling}var Kt=null,cn=!1;function Ui(s,l,d){for(d=d.child;d!==null;)_S(s,l,d),d=d.sibling}function _S(s,l,d){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(lc,d)}catch{}switch(d.tag){case 5:ar||To(d,l);case 6:var m=Kt,x=cn;Kt=null,Ui(s,l,d),Kt=m,cn=x,Kt!==null&&(cn?(s=Kt,d=d.stateNode,s.nodeType===8?s.parentNode.removeChild(d):s.removeChild(d)):Kt.removeChild(d.stateNode));break;case 18:Kt!==null&&(cn?(s=Kt,d=d.stateNode,s.nodeType===8?kp(s.parentNode,d):s.nodeType===1&&kp(s,d),Ys(s)):kp(Kt,d.stateNode));break;case 4:m=Kt,x=cn,Kt=d.stateNode.containerInfo,cn=!0,Ui(s,l,d),Kt=m,cn=x;break;case 0:case 11:case 14:case 15:if(!ar&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){x=m=m.next;do{var S=x,P=S.destroy;S=S.tag,P!==void 0&&((S&2)!==0||(S&4)!==0)&&lm(d,l,P),x=x.next}while(x!==m)}Ui(s,l,d);break;case 1:if(!ar&&(To(d,l),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(L){vt(d,l,L)}Ui(s,l,d);break;case 21:Ui(s,l,d);break;case 22:d.mode&1?(ar=(m=ar)||d.memoizedState!==null,Ui(s,l,d),ar=m):Ui(s,l,d);break;default:Ui(s,l,d)}}function SS(s){var l=s.updateQueue;if(l!==null){s.updateQueue=null;var d=s.stateNode;d===null&&(d=s.stateNode=new nM),l.forEach(function(m){var x=hM.bind(null,s,m);d.has(m)||(d.add(m),m.then(x,x))})}}function fn(s,l){var d=l.deletions;if(d!==null)for(var m=0;m<d.length;m++){var x=d[m];try{var S=s,P=l,L=P;e:for(;L!==null;){switch(L.tag){case 5:Kt=L.stateNode,cn=!1;break e;case 3:Kt=L.stateNode.containerInfo,cn=!0;break e;case 4:Kt=L.stateNode.containerInfo,cn=!0;break e}L=L.return}if(Kt===null)throw Error(r(160));_S(S,P,x),Kt=null,cn=!1;var F=x.alternate;F!==null&&(F.return=null),x.return=null}catch(ee){vt(x,l,ee)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)kS(l,s),l=l.sibling}function kS(s,l){var d=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(fn(l,s),$n(s),m&4){try{vl(3,s,s.return),Xc(3,s)}catch(Se){vt(s,s.return,Se)}try{vl(5,s,s.return)}catch(Se){vt(s,s.return,Se)}}break;case 1:fn(l,s),$n(s),m&512&&d!==null&&To(d,d.return);break;case 5:if(fn(l,s),$n(s),m&512&&d!==null&&To(d,d.return),s.flags&32){var x=s.stateNode;try{zr(x,"")}catch(Se){vt(s,s.return,Se)}}if(m&4&&(x=s.stateNode,x!=null)){var S=s.memoizedProps,P=d!==null?d.memoizedProps:S,L=s.type,F=s.updateQueue;if(s.updateQueue=null,F!==null)try{L==="input"&&S.type==="radio"&&S.name!=null&&at(x,S),Bs(L,P);var ee=Bs(L,S);for(P=0;P<F.length;P+=2){var le=F[P],ue=F[P+1];le==="style"?ac(x,ue):le==="dangerouslySetInnerHTML"?so(x,ue):le==="children"?zr(x,ue):A(x,le,ue,ee)}switch(L){case"input":ft(x,S);break;case"textarea":ma(x,S);break;case"select":var oe=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!S.multiple;var me=S.value;me!=null?er(x,!!S.multiple,me,!1):oe!==!!S.multiple&&(S.defaultValue!=null?er(x,!!S.multiple,S.defaultValue,!0):er(x,!!S.multiple,S.multiple?[]:"",!1))}x[sl]=S}catch(Se){vt(s,s.return,Se)}}break;case 6:if(fn(l,s),$n(s),m&4){if(s.stateNode===null)throw Error(r(162));x=s.stateNode,S=s.memoizedProps;try{x.nodeValue=S}catch(Se){vt(s,s.return,Se)}}break;case 3:if(fn(l,s),$n(s),m&4&&d!==null&&d.memoizedState.isDehydrated)try{Ys(l.containerInfo)}catch(Se){vt(s,s.return,Se)}break;case 4:fn(l,s),$n(s);break;case 13:fn(l,s),$n(s),x=s.child,x.flags&8192&&(S=x.memoizedState!==null,x.stateNode.isHidden=S,!S||x.alternate!==null&&x.alternate.memoizedState!==null||(pm=_t())),m&4&&SS(s);break;case 22:if(le=d!==null&&d.memoizedState!==null,s.mode&1?(ar=(ee=ar)||le,fn(l,s),ar=ee):fn(l,s),$n(s),m&8192){if(ee=s.memoizedState!==null,(s.stateNode.isHidden=ee)&&!le&&(s.mode&1)!==0)for(ye=s,le=s.child;le!==null;){for(ue=ye=le;ye!==null;){switch(oe=ye,me=oe.child,oe.tag){case 0:case 11:case 14:case 15:vl(4,oe,oe.return);break;case 1:To(oe,oe.return);var xe=oe.stateNode;if(typeof xe.componentWillUnmount=="function"){m=oe,d=oe.return;try{l=m,xe.props=l.memoizedProps,xe.state=l.memoizedState,xe.componentWillUnmount()}catch(Se){vt(m,d,Se)}}break;case 5:To(oe,oe.return);break;case 22:if(oe.memoizedState!==null){AS(ue);continue}}me!==null?(me.return=oe,ye=me):AS(ue)}le=le.sibling}e:for(le=null,ue=s;;){if(ue.tag===5){if(le===null){le=ue;try{x=ue.stateNode,ee?(S=x.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(L=ue.stateNode,F=ue.memoizedProps.style,P=F!=null&&F.hasOwnProperty("display")?F.display:null,L.style.display=ic("display",P))}catch(Se){vt(s,s.return,Se)}}}else if(ue.tag===6){if(le===null)try{ue.stateNode.nodeValue=ee?"":ue.memoizedProps}catch(Se){vt(s,s.return,Se)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===s)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===s)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===s)break e;le===ue&&(le=null),ue=ue.return}le===ue&&(le=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:fn(l,s),$n(s),m&4&&SS(s);break;case 21:break;default:fn(l,s),$n(s)}}function $n(s){var l=s.flags;if(l&2){try{e:{for(var d=s.return;d!==null;){if(xS(d)){var m=d;break e}d=d.return}throw Error(r(160))}switch(m.tag){case 5:var x=m.stateNode;m.flags&32&&(zr(x,""),m.flags&=-33);var S=wS(s);fm(s,S,x);break;case 3:case 4:var P=m.stateNode.containerInfo,L=wS(s);cm(s,L,P);break;default:throw Error(r(161))}}catch(F){vt(s,s.return,F)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function aM(s,l,d){ye=s,ES(s)}function ES(s,l,d){for(var m=(s.mode&1)!==0;ye!==null;){var x=ye,S=x.child;if(x.tag===22&&m){var P=x.memoizedState!==null||Gc;if(!P){var L=x.alternate,F=L!==null&&L.memoizedState!==null||ar;L=Gc;var ee=ar;if(Gc=P,(ar=F)&&!ee)for(ye=x;ye!==null;)P=ye,F=P.child,P.tag===22&&P.memoizedState!==null?TS(x):F!==null?(F.return=P,ye=F):TS(x);for(;S!==null;)ye=S,ES(S),S=S.sibling;ye=x,Gc=L,ar=ee}OS(s)}else(x.subtreeFlags&8772)!==0&&S!==null?(S.return=x,ye=S):OS(s)}}function OS(s){for(;ye!==null;){var l=ye;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:ar||Xc(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!ar)if(d===null)m.componentDidMount();else{var x=l.elementType===l.type?d.memoizedProps:un(l.type,d.memoizedProps);m.componentDidUpdate(x,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var S=l.updateQueue;S!==null&&A_(l,S,m);break;case 3:var P=l.updateQueue;if(P!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}A_(l,P,d)}break;case 5:var L=l.stateNode;if(d===null&&l.flags&4){d=L;var F=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":F.autoFocus&&d.focus();break;case"img":F.src&&(d.src=F.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ee=l.alternate;if(ee!==null){var le=ee.memoizedState;if(le!==null){var ue=le.dehydrated;ue!==null&&Ys(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}ar||l.flags&512&&um(l)}catch(oe){vt(l,l.return,oe)}}if(l===s){ye=null;break}if(d=l.sibling,d!==null){d.return=l.return,ye=d;break}ye=l.return}}function AS(s){for(;ye!==null;){var l=ye;if(l===s){ye=null;break}var d=l.sibling;if(d!==null){d.return=l.return,ye=d;break}ye=l.return}}function TS(s){for(;ye!==null;){var l=ye;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{Xc(4,l)}catch(F){vt(l,d,F)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var x=l.return;try{m.componentDidMount()}catch(F){vt(l,x,F)}}var S=l.return;try{um(l)}catch(F){vt(l,S,F)}break;case 5:var P=l.return;try{um(l)}catch(F){vt(l,P,F)}}}catch(F){vt(l,l.return,F)}if(l===s){ye=null;break}var L=l.sibling;if(L!==null){L.return=l.return,ye=L;break}ye=l.return}}var oM=Math.ceil,Yc=j.ReactCurrentDispatcher,dm=j.ReactCurrentOwner,Vr=j.ReactCurrentBatchConfig,He=0,qt=null,At=null,Gt=0,jr=0,jo=Di(0),Rt=0,bl=null,Ta=0,Jc=0,hm=0,xl=null,yr=null,pm=0,Po=1/0,ei=null,Qc=!1,mm=null,Fi=null,Zc=!1,Hi=null,ef=0,wl=0,gm=null,tf=-1,rf=0;function fr(){return(He&6)!==0?_t():tf!==-1?tf:tf=_t()}function Wi(s){return(s.mode&1)===0?1:(He&2)!==0&&Gt!==0?Gt&-Gt:F3.transition!==null?(rf===0&&(rf=w1()),rf):(s=Ye,s!==0||(s=window.event,s=s===void 0?16:P1(s.type)),s)}function dn(s,l,d,m){if(50<wl)throw wl=0,gm=null,Error(r(185));Ws(s,d,m),((He&2)===0||s!==qt)&&(s===qt&&((He&2)===0&&(Jc|=d),Rt===4&&Vi(s,Gt)),vr(s,m),d===1&&He===0&&(l.mode&1)===0&&(Po=_t()+500,Pc&&zi()))}function vr(s,l){var d=s.callbackNode;FI(s,l);var m=fc(s,s===qt?Gt:0);if(m===0)d!==null&&v1(d),s.callbackNode=null,s.callbackPriority=0;else if(l=m&-m,s.callbackPriority!==l){if(d!=null&&v1(d),l===1)s.tag===0?U3(PS.bind(null,s)):m_(PS.bind(null,s)),L3(function(){(He&6)===0&&zi()}),d=null;else{switch(_1(m)){case 1:d=Xh;break;case 4:d=b1;break;case 16:d=sc;break;case 536870912:d=x1;break;default:d=sc}d=LS(d,jS.bind(null,s))}s.callbackPriority=l,s.callbackNode=d}}function jS(s,l){if(tf=-1,rf=0,(He&6)!==0)throw Error(r(327));var d=s.callbackNode;if(Co()&&s.callbackNode!==d)return null;var m=fc(s,s===qt?Gt:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||l)l=nf(s,m);else{l=m;var x=He;He|=2;var S=NS();(qt!==s||Gt!==l)&&(ei=null,Po=_t()+500,Pa(s,l));do try{uM();break}catch(L){CS(s,L)}while(!0);$p(),Yc.current=S,He=x,At!==null?l=0:(qt=null,Gt=0,l=Rt)}if(l!==0){if(l===2&&(x=Yh(s),x!==0&&(m=x,l=ym(s,x))),l===1)throw d=bl,Pa(s,0),Vi(s,m),vr(s,_t()),d;if(l===6)Vi(s,m);else{if(x=s.current.alternate,(m&30)===0&&!sM(x)&&(l=nf(s,m),l===2&&(S=Yh(s),S!==0&&(m=S,l=ym(s,S))),l===1))throw d=bl,Pa(s,0),Vi(s,m),vr(s,_t()),d;switch(s.finishedWork=x,s.finishedLanes=m,l){case 0:case 1:throw Error(r(345));case 2:Ca(s,yr,ei);break;case 3:if(Vi(s,m),(m&130023424)===m&&(l=pm+500-_t(),10<l)){if(fc(s,0)!==0)break;if(x=s.suspendedLanes,(x&m)!==m){fr(),s.pingedLanes|=s.suspendedLanes&x;break}s.timeoutHandle=Sp(Ca.bind(null,s,yr,ei),l);break}Ca(s,yr,ei);break;case 4:if(Vi(s,m),(m&4194240)===m)break;for(l=s.eventTimes,x=-1;0<m;){var P=31-on(m);S=1<<P,P=l[P],P>x&&(x=P),m&=~S}if(m=x,m=_t()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*oM(m/1960))-m,10<m){s.timeoutHandle=Sp(Ca.bind(null,s,yr,ei),m);break}Ca(s,yr,ei);break;case 5:Ca(s,yr,ei);break;default:throw Error(r(329))}}}return vr(s,_t()),s.callbackNode===d?jS.bind(null,s):null}function ym(s,l){var d=xl;return s.current.memoizedState.isDehydrated&&(Pa(s,l).flags|=256),s=nf(s,l),s!==2&&(l=yr,yr=d,l!==null&&vm(l)),s}function vm(s){yr===null?yr=s:yr.push.apply(yr,s)}function sM(s){for(var l=s;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var x=d[m],S=x.getSnapshot;x=x.value;try{if(!sn(S(),x))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Vi(s,l){for(l&=~hm,l&=~Jc,s.suspendedLanes|=l,s.pingedLanes&=~l,s=s.expirationTimes;0<l;){var d=31-on(l),m=1<<d;s[d]=-1,l&=~m}}function PS(s){if((He&6)!==0)throw Error(r(327));Co();var l=fc(s,0);if((l&1)===0)return vr(s,_t()),null;var d=nf(s,l);if(s.tag!==0&&d===2){var m=Yh(s);m!==0&&(l=m,d=ym(s,m))}if(d===1)throw d=bl,Pa(s,0),Vi(s,l),vr(s,_t()),d;if(d===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=l,Ca(s,yr,ei),vr(s,_t()),null}function bm(s,l){var d=He;He|=1;try{return s(l)}finally{He=d,He===0&&(Po=_t()+500,Pc&&zi())}}function ja(s){Hi!==null&&Hi.tag===0&&(He&6)===0&&Co();var l=He;He|=1;var d=Vr.transition,m=Ye;try{if(Vr.transition=null,Ye=1,s)return s()}finally{Ye=m,Vr.transition=d,He=l,(He&6)===0&&zi()}}function xm(){jr=jo.current,lt(jo)}function Pa(s,l){s.finishedWork=null,s.finishedLanes=0;var d=s.timeoutHandle;if(d!==-1&&(s.timeoutHandle=-1,D3(d)),At!==null)for(d=At.return;d!==null;){var m=d;switch(jp(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&Tc();break;case 3:Oo(),lt(pr),lt(rr),Up();break;case 5:Bp(m);break;case 4:Oo();break;case 13:lt(gt);break;case 19:lt(gt);break;case 10:Ip(m.type._context);break;case 22:case 23:xm()}d=d.return}if(qt=s,At=s=Ki(s.current,null),Gt=jr=l,Rt=0,bl=null,hm=Jc=Ta=0,yr=xl=null,Ea!==null){for(l=0;l<Ea.length;l++)if(d=Ea[l],m=d.interleaved,m!==null){d.interleaved=null;var x=m.next,S=d.pending;if(S!==null){var P=S.next;S.next=x,m.next=P}d.pending=m}Ea=null}return s}function CS(s,l){do{var d=At;try{if($p(),Bc.current=Hc,qc){for(var m=yt.memoizedState;m!==null;){var x=m.queue;x!==null&&(x.pending=null),m=m.next}qc=!1}if(Aa=0,Bt=Nt=yt=null,hl=!1,pl=0,dm.current=null,d===null||d.return===null){Rt=1,bl=l,At=null;break}e:{var S=s,P=d.return,L=d,F=l;if(l=Gt,L.flags|=32768,F!==null&&typeof F=="object"&&typeof F.then=="function"){var ee=F,le=L,ue=le.tag;if((le.mode&1)===0&&(ue===0||ue===11||ue===15)){var oe=le.alternate;oe?(le.updateQueue=oe.updateQueue,le.memoizedState=oe.memoizedState,le.lanes=oe.lanes):(le.updateQueue=null,le.memoizedState=null)}var me=rS(P);if(me!==null){me.flags&=-257,nS(me,P,L,S,l),me.mode&1&&tS(S,ee,l),l=me,F=ee;var xe=l.updateQueue;if(xe===null){var Se=new Set;Se.add(F),l.updateQueue=Se}else xe.add(F);break e}else{if((l&1)===0){tS(S,ee,l),wm();break e}F=Error(r(426))}}else if(dt&&L.mode&1){var St=rS(P);if(St!==null){(St.flags&65536)===0&&(St.flags|=256),nS(St,P,L,S,l),Np(Ao(F,L));break e}}S=F=Ao(F,L),Rt!==4&&(Rt=2),xl===null?xl=[S]:xl.push(S),S=P;do{switch(S.tag){case 3:S.flags|=65536,l&=-l,S.lanes|=l;var Y=Z_(S,F,l);O_(S,Y);break e;case 1:L=F;var W=S.type,Q=S.stateNode;if((S.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Fi===null||!Fi.has(Q)))){S.flags|=65536,l&=-l,S.lanes|=l;var ce=eS(S,L,l);O_(S,ce);break e}}S=S.return}while(S!==null)}$S(d)}catch(ke){l=ke,At===d&&d!==null&&(At=d=d.return);continue}break}while(!0)}function NS(){var s=Yc.current;return Yc.current=Hc,s===null?Hc:s}function wm(){(Rt===0||Rt===3||Rt===2)&&(Rt=4),qt===null||(Ta&268435455)===0&&(Jc&268435455)===0||Vi(qt,Gt)}function nf(s,l){var d=He;He|=2;var m=NS();(qt!==s||Gt!==l)&&(ei=null,Pa(s,l));do try{lM();break}catch(x){CS(s,x)}while(!0);if($p(),He=d,Yc.current=m,At!==null)throw Error(r(261));return qt=null,Gt=0,Rt}function lM(){for(;At!==null;)RS(At)}function uM(){for(;At!==null&&!$I();)RS(At)}function RS(s){var l=DS(s.alternate,s,jr);s.memoizedProps=s.pendingProps,l===null?$S(s):At=l,dm.current=null}function $S(s){var l=s;do{var d=l.alternate;if(s=l.return,(l.flags&32768)===0){if(d=tM(d,l,jr),d!==null){At=d;return}}else{if(d=rM(d,l),d!==null){d.flags&=32767,At=d;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Rt=6,At=null;return}}if(l=l.sibling,l!==null){At=l;return}At=l=s}while(l!==null);Rt===0&&(Rt=5)}function Ca(s,l,d){var m=Ye,x=Vr.transition;try{Vr.transition=null,Ye=1,cM(s,l,d,m)}finally{Vr.transition=x,Ye=m}return null}function cM(s,l,d,m){do Co();while(Hi!==null);if((He&6)!==0)throw Error(r(327));d=s.finishedWork;var x=s.finishedLanes;if(d===null)return null;if(s.finishedWork=null,s.finishedLanes=0,d===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var S=d.lanes|d.childLanes;if(HI(s,S),s===qt&&(At=qt=null,Gt=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||Zc||(Zc=!0,LS(sc,function(){return Co(),null})),S=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||S){S=Vr.transition,Vr.transition=null;var P=Ye;Ye=1;var L=He;He|=4,dm.current=null,iM(s,d),kS(d,s),P3(wp),pc=!!xp,wp=xp=null,s.current=d,aM(d),II(),He=L,Ye=P,Vr.transition=S}else s.current=d;if(Zc&&(Zc=!1,Hi=s,ef=x),S=s.pendingLanes,S===0&&(Fi=null),LI(d.stateNode),vr(s,_t()),l!==null)for(m=s.onRecoverableError,d=0;d<l.length;d++)x=l[d],m(x.value,{componentStack:x.stack,digest:x.digest});if(Qc)throw Qc=!1,s=mm,mm=null,s;return(ef&1)!==0&&s.tag!==0&&Co(),S=s.pendingLanes,(S&1)!==0?s===gm?wl++:(wl=0,gm=s):wl=0,zi(),null}function Co(){if(Hi!==null){var s=_1(ef),l=Vr.transition,d=Ye;try{if(Vr.transition=null,Ye=16>s?16:s,Hi===null)var m=!1;else{if(s=Hi,Hi=null,ef=0,(He&6)!==0)throw Error(r(331));var x=He;for(He|=4,ye=s.current;ye!==null;){var S=ye,P=S.child;if((ye.flags&16)!==0){var L=S.deletions;if(L!==null){for(var F=0;F<L.length;F++){var ee=L[F];for(ye=ee;ye!==null;){var le=ye;switch(le.tag){case 0:case 11:case 15:vl(8,le,S)}var ue=le.child;if(ue!==null)ue.return=le,ye=ue;else for(;ye!==null;){le=ye;var oe=le.sibling,me=le.return;if(bS(le),le===ee){ye=null;break}if(oe!==null){oe.return=me,ye=oe;break}ye=me}}}var xe=S.alternate;if(xe!==null){var Se=xe.child;if(Se!==null){xe.child=null;do{var St=Se.sibling;Se.sibling=null,Se=St}while(Se!==null)}}ye=S}}if((S.subtreeFlags&2064)!==0&&P!==null)P.return=S,ye=P;else e:for(;ye!==null;){if(S=ye,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:vl(9,S,S.return)}var Y=S.sibling;if(Y!==null){Y.return=S.return,ye=Y;break e}ye=S.return}}var W=s.current;for(ye=W;ye!==null;){P=ye;var Q=P.child;if((P.subtreeFlags&2064)!==0&&Q!==null)Q.return=P,ye=Q;else e:for(P=W;ye!==null;){if(L=ye,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:Xc(9,L)}}catch(ke){vt(L,L.return,ke)}if(L===P){ye=null;break e}var ce=L.sibling;if(ce!==null){ce.return=L.return,ye=ce;break e}ye=L.return}}if(He=x,zi(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(lc,s)}catch{}m=!0}return m}finally{Ye=d,Vr.transition=l}}return!1}function IS(s,l,d){l=Ao(d,l),l=Z_(s,l,1),s=qi(s,l,1),l=fr(),s!==null&&(Ws(s,1,l),vr(s,l))}function vt(s,l,d){if(s.tag===3)IS(s,s,d);else for(;l!==null;){if(l.tag===3){IS(l,s,d);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Fi===null||!Fi.has(m))){s=Ao(d,s),s=eS(l,s,1),l=qi(l,s,1),s=fr(),l!==null&&(Ws(l,1,s),vr(l,s));break}}l=l.return}}function fM(s,l,d){var m=s.pingCache;m!==null&&m.delete(l),l=fr(),s.pingedLanes|=s.suspendedLanes&d,qt===s&&(Gt&d)===d&&(Rt===4||Rt===3&&(Gt&130023424)===Gt&&500>_t()-pm?Pa(s,0):hm|=d),vr(s,l)}function MS(s,l){l===0&&((s.mode&1)===0?l=1:(l=cc,cc<<=1,(cc&130023424)===0&&(cc=4194304)));var d=fr();s=Jn(s,l),s!==null&&(Ws(s,l,d),vr(s,d))}function dM(s){var l=s.memoizedState,d=0;l!==null&&(d=l.retryLane),MS(s,d)}function hM(s,l){var d=0;switch(s.tag){case 13:var m=s.stateNode,x=s.memoizedState;x!==null&&(d=x.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(l),MS(s,d)}var DS;DS=function(s,l,d){if(s!==null)if(s.memoizedProps!==l.pendingProps||pr.current)gr=!0;else{if((s.lanes&d)===0&&(l.flags&128)===0)return gr=!1,eM(s,l,d);gr=(s.flags&131072)!==0}else gr=!1,dt&&(l.flags&1048576)!==0&&g_(l,Nc,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;Kc(s,l),s=l.pendingProps;var x=bo(l,rr.current);Eo(l,d),x=Wp(null,l,m,s,x,d);var S=Vp();return l.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,mr(m)?(S=!0,jc(l)):S=!1,l.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Lp(l),x.updater=Wc,l.stateNode=x,x._reactInternals=l,Qp(l,m,s,d),l=rm(null,l,m,!0,S,d)):(l.tag=0,dt&&S&&Tp(l),cr(null,l,x,d),l=l.child),l;case 16:m=l.elementType;e:{switch(Kc(s,l),s=l.pendingProps,x=m._init,m=x(m._payload),l.type=m,x=l.tag=mM(m),s=un(m,s),x){case 0:l=tm(null,l,m,s,d);break e;case 1:l=uS(null,l,m,s,d);break e;case 11:l=iS(null,l,m,s,d);break e;case 14:l=aS(null,l,m,un(m.type,s),d);break e}throw Error(r(306,m,""))}return l;case 0:return m=l.type,x=l.pendingProps,x=l.elementType===m?x:un(m,x),tm(s,l,m,x,d);case 1:return m=l.type,x=l.pendingProps,x=l.elementType===m?x:un(m,x),uS(s,l,m,x,d);case 3:e:{if(cS(l),s===null)throw Error(r(387));m=l.pendingProps,S=l.memoizedState,x=S.element,E_(s,l),Lc(l,m,null,d);var P=l.memoizedState;if(m=P.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){x=Ao(Error(r(423)),l),l=fS(s,l,m,d,x);break e}else if(m!==x){x=Ao(Error(r(424)),l),l=fS(s,l,m,d,x);break e}else for(Tr=Mi(l.stateNode.containerInfo.firstChild),Ar=l,dt=!0,ln=null,d=S_(l,null,m,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(_o(),m===x){l=Zn(s,l,d);break e}cr(s,l,m,d)}l=l.child}return l;case 5:return T_(l),s===null&&Cp(l),m=l.type,x=l.pendingProps,S=s!==null?s.memoizedProps:null,P=x.children,_p(m,x)?P=null:S!==null&&_p(m,S)&&(l.flags|=32),lS(s,l),cr(s,l,P,d),l.child;case 6:return s===null&&Cp(l),null;case 13:return dS(s,l,d);case 4:return zp(l,l.stateNode.containerInfo),m=l.pendingProps,s===null?l.child=So(l,null,m,d):cr(s,l,m,d),l.child;case 11:return m=l.type,x=l.pendingProps,x=l.elementType===m?x:un(m,x),iS(s,l,m,x,d);case 7:return cr(s,l,l.pendingProps,d),l.child;case 8:return cr(s,l,l.pendingProps.children,d),l.child;case 12:return cr(s,l,l.pendingProps.children,d),l.child;case 10:e:{if(m=l.type._context,x=l.pendingProps,S=l.memoizedProps,P=x.value,rt(Ic,m._currentValue),m._currentValue=P,S!==null)if(sn(S.value,P)){if(S.children===x.children&&!pr.current){l=Zn(s,l,d);break e}}else for(S=l.child,S!==null&&(S.return=l);S!==null;){var L=S.dependencies;if(L!==null){P=S.child;for(var F=L.firstContext;F!==null;){if(F.context===m){if(S.tag===1){F=Qn(-1,d&-d),F.tag=2;var ee=S.updateQueue;if(ee!==null){ee=ee.shared;var le=ee.pending;le===null?F.next=F:(F.next=le.next,le.next=F),ee.pending=F}}S.lanes|=d,F=S.alternate,F!==null&&(F.lanes|=d),Mp(S.return,d,l),L.lanes|=d;break}F=F.next}}else if(S.tag===10)P=S.type===l.type?null:S.child;else if(S.tag===18){if(P=S.return,P===null)throw Error(r(341));P.lanes|=d,L=P.alternate,L!==null&&(L.lanes|=d),Mp(P,d,l),P=S.sibling}else P=S.child;if(P!==null)P.return=S;else for(P=S;P!==null;){if(P===l){P=null;break}if(S=P.sibling,S!==null){S.return=P.return,P=S;break}P=P.return}S=P}cr(s,l,x.children,d),l=l.child}return l;case 9:return x=l.type,m=l.pendingProps.children,Eo(l,d),x=Hr(x),m=m(x),l.flags|=1,cr(s,l,m,d),l.child;case 14:return m=l.type,x=un(m,l.pendingProps),x=un(m.type,x),aS(s,l,m,x,d);case 15:return oS(s,l,l.type,l.pendingProps,d);case 17:return m=l.type,x=l.pendingProps,x=l.elementType===m?x:un(m,x),Kc(s,l),l.tag=1,mr(m)?(s=!0,jc(l)):s=!1,Eo(l,d),J_(l,m,x),Qp(l,m,x,d),rm(null,l,m,!0,s,d);case 19:return pS(s,l,d);case 22:return sS(s,l,d)}throw Error(r(156,l.tag))};function LS(s,l){return y1(s,l)}function pM(s,l,d,m){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(s,l,d,m){return new pM(s,l,d,m)}function _m(s){return s=s.prototype,!(!s||!s.isReactComponent)}function mM(s){if(typeof s=="function")return _m(s)?1:0;if(s!=null){if(s=s.$$typeof,s===I)return 11;if(s===V)return 14}return 2}function Ki(s,l){var d=s.alternate;return d===null?(d=Kr(s.tag,l,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=l,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&14680064,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,l=s.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d}function af(s,l,d,m,x,S){var P=2;if(m=s,typeof s=="function")_m(s)&&(P=1);else if(typeof s=="string")P=5;else e:switch(s){case C:return Na(d.children,x,S,l);case R:P=8,x|=8;break;case D:return s=Kr(12,d,l,x|2),s.elementType=D,s.lanes=S,s;case q:return s=Kr(13,d,l,x),s.elementType=q,s.lanes=S,s;case U:return s=Kr(19,d,l,x),s.elementType=U,s.lanes=S,s;case Z:return of(d,x,S,l);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case X:P=10;break e;case $:P=9;break e;case I:P=11;break e;case V:P=14;break e;case G:P=16,m=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return l=Kr(P,d,l,x),l.elementType=s,l.type=m,l.lanes=S,l}function Na(s,l,d,m){return s=Kr(7,s,m,l),s.lanes=d,s}function of(s,l,d,m){return s=Kr(22,s,m,l),s.elementType=Z,s.lanes=d,s.stateNode={isHidden:!1},s}function Sm(s,l,d){return s=Kr(6,s,null,l),s.lanes=d,s}function km(s,l,d){return l=Kr(4,s.children!==null?s.children:[],s.key,l),l.lanes=d,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}function gM(s,l,d,m,x){this.tag=l,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Jh(0),this.expirationTimes=Jh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jh(0),this.identifierPrefix=m,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Em(s,l,d,m,x,S,P,L,F){return s=new gM(s,l,d,L,F),l===1?(l=1,S===!0&&(l|=8)):l=0,S=Kr(3,null,null,l),s.current=S,S.stateNode=s,S.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lp(S),s}function yM(s,l,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:m==null?null:""+m,children:s,containerInfo:l,implementation:d}}function zS(s){if(!s)return Li;s=s._reactInternals;e:{if(xa(s)!==s||s.tag!==1)throw Error(r(170));var l=s;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(mr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(r(171))}if(s.tag===1){var d=s.type;if(mr(d))return h_(s,d,l)}return l}function BS(s,l,d,m,x,S,P,L,F){return s=Em(d,m,!0,s,x,S,P,L,F),s.context=zS(null),d=s.current,m=fr(),x=Wi(d),S=Qn(m,x),S.callback=l??null,qi(d,S,x),s.current.lanes=x,Ws(s,x,m),vr(s,m),s}function sf(s,l,d,m){var x=l.current,S=fr(),P=Wi(x);return d=zS(d),l.context===null?l.context=d:l.pendingContext=d,l=Qn(S,P),l.payload={element:s},m=m===void 0?null:m,m!==null&&(l.callback=m),s=qi(x,l,P),s!==null&&(dn(s,x,P,S),Dc(s,x,P)),P}function lf(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function qS(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<l?d:l}}function Om(s,l){qS(s,l),(s=s.alternate)&&qS(s,l)}function vM(){return null}var US=typeof reportError=="function"?reportError:function(s){console.error(s)};function Am(s){this._internalRoot=s}uf.prototype.render=Am.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));sf(s,l,null,null)},uf.prototype.unmount=Am.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;ja(function(){sf(null,s,null,null)}),l[Kn]=null}};function uf(s){this._internalRoot=s}uf.prototype.unstable_scheduleHydration=function(s){if(s){var l=E1();s={blockedOn:null,target:s,priority:l};for(var d=0;d<Ri.length&&l!==0&&l<Ri[d].priority;d++);Ri.splice(d,0,s),d===0&&T1(s)}};function Tm(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function cf(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function FS(){}function bM(s,l,d,m,x){if(x){if(typeof m=="function"){var S=m;m=function(){var ee=lf(P);S.call(ee)}}var P=BS(l,m,s,0,null,!1,!1,"",FS);return s._reactRootContainer=P,s[Kn]=P.current,al(s.nodeType===8?s.parentNode:s),ja(),P}for(;x=s.lastChild;)s.removeChild(x);if(typeof m=="function"){var L=m;m=function(){var ee=lf(F);L.call(ee)}}var F=Em(s,0,!1,null,null,!1,!1,"",FS);return s._reactRootContainer=F,s[Kn]=F.current,al(s.nodeType===8?s.parentNode:s),ja(function(){sf(l,F,d,m)}),F}function ff(s,l,d,m,x){var S=d._reactRootContainer;if(S){var P=S;if(typeof x=="function"){var L=x;x=function(){var F=lf(P);L.call(F)}}sf(l,P,s,x)}else P=bM(d,l,s,x,m);return lf(P)}S1=function(s){switch(s.tag){case 3:var l=s.stateNode;if(l.current.memoizedState.isDehydrated){var d=Hs(l.pendingLanes);d!==0&&(Qh(l,d|1),vr(l,_t()),(He&6)===0&&(Po=_t()+500,zi()))}break;case 13:ja(function(){var m=Jn(s,1);if(m!==null){var x=fr();dn(m,s,1,x)}}),Om(s,1)}},Zh=function(s){if(s.tag===13){var l=Jn(s,134217728);if(l!==null){var d=fr();dn(l,s,134217728,d)}Om(s,134217728)}},k1=function(s){if(s.tag===13){var l=Wi(s),d=Jn(s,l);if(d!==null){var m=fr();dn(d,s,l,m)}Om(s,l)}},E1=function(){return Ye},O1=function(s,l){var d=Ye;try{return Ye=s,l()}finally{Ye=d}},qs=function(s,l,d){switch(l){case"input":if(ft(s,d),l=d.name,d.type==="radio"&&l!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var m=d[l];if(m!==s&&m.form===s.form){var x=Ac(m);if(!x)throw Error(r(90));ie(m),ft(m,x)}}}break;case"textarea":ma(s,d);break;case"select":l=d.value,l!=null&&er(s,!!d.multiple,l,!1)}},Ct=bm,tr=ja;var xM={usingClientEntryPoint:!1,Events:[ll,yo,Ac,$e,wt,bm]},_l={findFiberByHostInstance:wa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wM={bundleType:_l.bundleType,version:_l.version,rendererPackageName:_l.rendererPackageName,rendererConfig:_l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=m1(s),s===null?null:s.stateNode},findFiberByHostInstance:_l.findFiberByHostInstance||vM,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 df=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!df.isDisabled&&df.supportsFiber)try{lc=df.inject(wM),Pn=df}catch{}}return br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xM,br.createPortal=function(s,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tm(l))throw Error(r(200));return yM(s,l,null,d)},br.createRoot=function(s,l){if(!Tm(s))throw Error(r(299));var d=!1,m="",x=US;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(x=l.onRecoverableError)),l=Em(s,1,!1,null,null,d,!1,m,x),s[Kn]=l.current,al(s.nodeType===8?s.parentNode:s),new Am(l)},br.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=m1(l),s=s===null?null:s.stateNode,s},br.flushSync=function(s){return ja(s)},br.hydrate=function(s,l,d){if(!cf(l))throw Error(r(200));return ff(null,s,l,!0,d)},br.hydrateRoot=function(s,l,d){if(!Tm(s))throw Error(r(405));var m=d!=null&&d.hydratedSources||null,x=!1,S="",P=US;if(d!=null&&(d.unstable_strictMode===!0&&(x=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onRecoverableError!==void 0&&(P=d.onRecoverableError)),l=BS(l,null,s,1,d??null,x,!1,S,P),s[Kn]=l.current,al(s),m)for(s=0;s<m.length;s++)d=m[s],x=d._getVersion,x=x(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,x]:l.mutableSourceEagerHydrationData.push(d,x);return new uf(l)},br.render=function(s,l,d){if(!cf(l))throw Error(r(200));return ff(null,s,l,!1,d)},br.unmountComponentAtNode=function(s){if(!cf(s))throw Error(r(40));return s._reactRootContainer?(ja(function(){ff(null,null,s,!1,function(){s._reactRootContainer=null,s[Kn]=null})}),!0):!1},br.unstable_batchedUpdates=bm,br.unstable_renderSubtreeIntoContainer=function(s,l,d,m){if(!cf(d))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return ff(s,l,d,!1,m)},br.version="18.3.1-next-f1338f8080-20240426",br}var JS;function WP(){if(JS)return Cm.exports;JS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Cm.exports=PM(),Cm.exports}var QS;function CM(){if(QS)return pf;QS=1;var t=WP();return pf.createRoot=t.createRoot,pf.hydrateRoot=t.hydrateRoot,pf}var NM=CM();/**
41
- * react-router v7.16.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 ZS="popstate";function ek(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function RM(t={}){function e(n,i){var f;let a=(f=i.state)==null?void 0:f.masked,{pathname:o,search:u,hash:c}=a||n.location;return V0("",{pathname:o,search:u,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,i){return typeof i=="string"?i:tu(i)}return IM(e,r,null,t)}function mt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function An(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function $M(){return Math.random().toString(36).substring(2,10)}function tk(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function V0(t,e,r=null,n,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Es(e):e,state:r,key:e&&e.key||n||$M(),mask:i}}function tu({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Es(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substring(n),t=t.substring(0,n)),t&&(e.pathname=t)}return e}function IM(t,e,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,u="POP",c=null,f=p();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function p(){return(o.state||{idx:null}).idx}function h(){u="POP";let b=p(),k=b==null?null:b-f;f=b,c&&c({action:u,location:_.location,delta:k})}function g(b,k){u="PUSH";let O=ek(b)?b:V0(_.location,b,k);f=p()+1;let A=tk(O,f),j=_.createHref(O.mask||O);try{o.pushState(A,"",j)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(j)}a&&c&&c({action:u,location:_.location,delta:1})}function y(b,k){u="REPLACE";let O=ek(b)?b:V0(_.location,b,k);f=p();let A=tk(O,f),j=_.createHref(O.mask||O);o.replaceState(A,"",j),a&&c&&c({action:u,location:_.location,delta:0})}function w(b){return MM(i,b)}let _={get action(){return u},get location(){return t(i,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ZS,h),c=b,()=>{i.removeEventListener(ZS,h),c=null}},createHref(b){return e(i,b)},createURL:w,encodeLocation(b){let k=w(b);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:y,go(b){return o.go(b)}};return _}function MM(t,e,r=!1){let n="http://localhost";t&&(n=t.location.origin!=="null"?t.location.origin:t.location.href),mt(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:tu(e);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function VP(t,e,r="/"){return DM(t,e,r,!1)}function DM(t,e,r,n,i){let a=typeof e=="string"?Es(e):e,o=pi(a.pathname||"/",r);if(o==null)return null;let u=LM(t),c=null,f=YM(o);for(let p=0;c==null&&p<u.length;++p)c=GM(u[p],f,n);return c}function LM(t){let e=KP(t);return zM(e),e}function KP(t,e=[],r=[],n="",i=!1){let a=(o,u,c=i,f)=>{let p={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:u,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&c)return;mt(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let h=On([n,p.relativePath]),g=r.concat(p);o.children&&o.children.length>0&&(mt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),KP(o.children,e,g,h,c)),!(o.path==null&&!o.index)&&e.push({path:h,score:VM(h,o.index),routesMeta:g})};return t.forEach((o,u)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,u);else for(let f of GP(o.path))a(o,u,!0,f)}),e}function GP(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=GP(n.join("/")),u=[];return u.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&u.push(...o),u.map(c=>t.startsWith("/")&&c===""?"/":c)}function zM(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:KM(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var BM=/^:[\w-]+$/,qM=3,UM=2,FM=1,HM=10,WM=-2,rk=t=>t==="*";function VM(t,e){let r=t.split("/"),n=r.length;return r.some(rk)&&(n+=WM),e&&(n+=UM),r.filter(i=>!rk(i)).reduce((i,a)=>i+(BM.test(a)?qM:a===""?FM:HM),n)}function KM(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function GM(t,e,r=!1){let{routesMeta:n}=t,i={},a="/",o=[];for(let u=0;u<n.length;++u){let c=n[u],f=u===n.length-1,p=a==="/"?e:e.slice(a.length)||"/",h=Vf({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},p),g=c.route;if(!h&&f&&r&&!n[n.length-1].route.index&&(h=Vf({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},p)),!h)return null;Object.assign(i,h.params),o.push({params:i,pathname:On([a,h.pathname]),pathnameBase:e4(On([a,h.pathnameBase])),route:g}),h.pathnameBase!=="/"&&(a=On([a,h.pathnameBase]))}return o}function Vf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=XM(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:n.reduce((f,{paramName:p,isOptional:h},g)=>{if(p==="*"){let w=u[g]||"";o=a.slice(0,a.length-w.length).replace(/(.)\/+$/,"$1")}const y=u[g];return h&&!y?f[p]=void 0:f[p]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:o,pattern:t}}function XM(t,e=!1,r=!0){An(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 n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,u,c,f,p)=>{if(n.push({paramName:u,isOptional:c!=null}),c){let h=p.charAt(f+o.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function YM(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return An(!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 pi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}var JM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function QM(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?Es(t):t,a;return r?(r=XP(r),r.startsWith("/")?a=nk(r.substring(1),"/"):a=nk(r,e)):a=e,{pathname:a,search:t4(n),hash:r4(i)}}function nk(t,e){let r=Kf(e).split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function $m(t,e,r,n){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ZM(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Mx(t){let e=ZM(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function oh(t,e,r,n=!1){let i;typeof t=="string"?i=Es(t):(i={...t},mt(!i.pathname||!i.pathname.includes("?"),$m("?","pathname","search",i)),mt(!i.pathname||!i.pathname.includes("#"),$m("#","pathname","hash",i)),mt(!i.search||!i.search.includes("#"),$m("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,u;if(o==null)u=r;else{let h=e.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),h-=1;i.pathname=g.join("/")}u=h>=0?e[h]:"/"}let c=QM(i,u),f=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(f||p)&&(c.pathname+="/"),c}var XP=t=>t.replace(/\/\/+/g,"/"),On=t=>XP(t.join("/")),Kf=t=>t.replace(/\/+$/,""),e4=t=>Kf(t).replace(/^\/*/,"/"),t4=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,r4=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,n4=class{constructor(t,e,r,n=!1){this.status=t,this.statusText=e||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function i4(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function a4(t){let e=t.map(r=>r.route.path).filter(Boolean);return On(e)||"/"}var YP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function JP(t,e){let r=t;if(typeof r!="string"||!JM.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(YP)try{let a=new URL(window.location.href),o=r.startsWith("//")?new URL(a.protocol+r):new URL(r),u=pi(o.pathname,e);o.origin===a.origin&&u!=null?r=u+o.search+o.hash:i=!0}catch{An(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var QP=["POST","PUT","PATCH","DELETE"];new Set(QP);var o4=["GET",...QP];new Set(o4);var Os=N.createContext(null);Os.displayName="DataRouter";var sh=N.createContext(null);sh.displayName="DataRouterState";var ZP=N.createContext(!1);function s4(){return N.useContext(ZP)}var eC=N.createContext({isTransitioning:!1});eC.displayName="ViewTransition";var l4=N.createContext(new Map);l4.displayName="Fetchers";var u4=N.createContext(null);u4.displayName="Await";var Dr=N.createContext(null);Dr.displayName="Navigation";var Hu=N.createContext(null);Hu.displayName="Location";var nn=N.createContext({outlet:null,matches:[],isDataRoute:!1});nn.displayName="Route";var Dx=N.createContext(null);Dx.displayName="RouteError";var tC="REACT_ROUTER_ERROR",c4="REDIRECT",f4="ROUTE_ERROR_RESPONSE";function d4(t){if(t.startsWith(`${tC}:${c4}:{`))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 h4(t){if(t.startsWith(`${tC}:${f4}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new n4(e.status,e.statusText,e.data)}catch{}}function p4(t,{relative:e}={}){mt(As(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=N.useContext(Dr),{hash:i,pathname:a,search:o}=Wu(t,{relative:e}),u=a;return r!=="/"&&(u=a==="/"?r:On([r,a])),n.createHref({pathname:u,search:o,hash:i})}function As(){return N.useContext(Hu)!=null}function Tn(){return mt(As(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Hu).location}var rC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nC(t){N.useContext(Dr).static||N.useLayoutEffect(t)}function lh(){let{isDataRoute:t}=N.useContext(nn);return t?P4():m4()}function m4(){mt(As(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(Os),{basename:e,navigator:r}=N.useContext(Dr),{matches:n}=N.useContext(nn),{pathname:i}=Tn(),a=JSON.stringify(Mx(n)),o=N.useRef(!1);return nC(()=>{o.current=!0}),N.useCallback((c,f={})=>{if(An(o.current,rC),!o.current)return;if(typeof c=="number"){r.go(c);return}let p=oh(c,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:On([e,p.pathname])),(f.replace?r.replace:r.push)(p,f.state,f)},[e,r,a,i,t])}var g4=N.createContext(null);function y4(t){let e=N.useContext(nn).outlet;return N.useMemo(()=>e&&N.createElement(g4.Provider,{value:t},e),[e,t])}function v4(){let{matches:t}=N.useContext(nn),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Wu(t,{relative:e}={}){let{matches:r}=N.useContext(nn),{pathname:n}=Tn(),i=JSON.stringify(Mx(r));return N.useMemo(()=>oh(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function b4(t,e){return iC(t,e)}function iC(t,e,r){var b;mt(As(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=N.useContext(Dr),{matches:i}=N.useContext(nn),a=i[i.length-1],o=a?a.params:{},u=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let k=f&&f.path||"";oC(u,!f||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) 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="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=Tn(),h;if(e){let k=typeof e=="string"?Es(e):e;mt(c==="/"||((b=k.pathname)==null?void 0:b.startsWith(c)),`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 "${c}" but pathname "${k.pathname}" was given in the \`location\` prop.`),h=k}else h=p;let g=h.pathname||"/",y=g;if(c!=="/"){let k=c.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=r&&r.state.matches.length?r.state.matches.map(k=>Object.assign(k,{route:r.manifest[k.route.id]||k.route})):VP(t,{pathname:y});An(f||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),An(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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 _=k4(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:On([c,n.encodeLocation?n.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?c:On([c,n.encodeLocation?n.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,r);return e&&_?N.createElement(Hu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},_):_}function x4(){let t=j4(),e=i4(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:a},"ErrorBoundary")," or"," ",N.createElement("code",{style:a},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),r?N.createElement("pre",{style:i},r):null,o)}var w4=N.createElement(x4,null),aC=class extends N.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 r=h4(t.digest);r&&(t=r)}let e=t!==void 0?N.createElement(nn.Provider,{value:this.props.routeContext},N.createElement(Dx.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?N.createElement(_4,{error:t},e):e}};aC.contextType=ZP;var Im=new WeakMap;function _4({children:t,error:e}){let{basename:r}=N.useContext(Dr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=d4(e.digest);if(n){let i=Im.get(e);if(i)throw i;let a=JP(n.location,r);if(YP&&!Im.get(e))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw Im.set(e,o),o}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function S4({routeContext:t,match:e,children:r}){let n=N.useContext(Os);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),N.createElement(nn.Provider,{value:t},r)}function k4(t,e=[],r){let n=r==null?void 0:r.state;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,a=n==null?void 0:n.errors;if(a!=null){let p=i.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);mt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,u=-1;if(r&&n){o=n.renderFallback;for(let p=0;p<i.length;p++){let h=i[p];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=p),h.route.id){let{loaderData:g,errors:y}=n,w=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!y||y[h.route.id]===void 0);if(h.route.lazy||w){r.isStatic&&(o=!0),u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}}let c=r==null?void 0:r.onError,f=n&&c?(p,h)=>{var g,y;c(p,{location:n.location,params:((y=(g=n.matches)==null?void 0:g[0])==null?void 0:y.params)??{},pattern:a4(n.matches),errorInfo:h})}:void 0;return i.reduceRight((p,h,g)=>{let y,w=!1,_=null,b=null;n&&(y=a&&h.route.id?a[h.route.id]:void 0,_=h.route.errorElement||w4,o&&(u<0&&g===0?(oC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,b=null):u===g&&(w=!0,b=h.route.hydrateFallbackElement||null)));let k=e.concat(i.slice(0,g+1)),O=()=>{let A;return y?A=_:w?A=b:h.route.Component?A=N.createElement(h.route.Component,null):h.route.element?A=h.route.element:A=p,N.createElement(S4,{match:h,routeContext:{outlet:p,matches:k,isDataRoute:n!=null},children:A})};return n&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?N.createElement(aC,{location:n.location,revalidation:n.revalidation,component:_,error:y,children:O(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:f}):O()},null)}function Lx(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function E4(t){let e=N.useContext(Os);return mt(e,Lx(t)),e}function O4(t){let e=N.useContext(sh);return mt(e,Lx(t)),e}function A4(t){let e=N.useContext(nn);return mt(e,Lx(t)),e}function zx(t){let e=A4(t),r=e.matches[e.matches.length-1];return mt(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function T4(){return zx("useRouteId")}function j4(){var n;let t=N.useContext(Dx),e=O4("useRouteError"),r=zx("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function P4(){let{router:t}=E4("useNavigate"),e=zx("useNavigate"),r=N.useRef(!1);return nC(()=>{r.current=!0}),N.useCallback(async(i,a={})=>{An(r.current,rC),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var ik={};function oC(t,e,r){!e&&!ik[t]&&(ik[t]=!0,An(!1,r))}N.memo(C4);function C4({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return iC(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function N4({to:t,replace:e,state:r,relative:n}){mt(As(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=N.useContext(Dr);An(!i,"<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:a}=N.useContext(nn),{pathname:o}=Tn(),u=lh(),c=oh(t,Mx(a),o,n==="path"),f=JSON.stringify(c);return N.useEffect(()=>{u(JSON.parse(f),{replace:e,state:r,relative:n})},[u,f,n,e,r]),null}function R4(t){return y4(t.context)}function Jr(t){mt(!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 $4({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){mt(!As(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),c=N.useMemo(()=>({basename:u,navigator:i,static:a,useTransitions:o,future:{}}),[u,i,a,o]);typeof r=="string"&&(r=Es(r));let{pathname:f="/",search:p="",hash:h="",state:g=null,key:y="default",mask:w}=r,_=N.useMemo(()=>{let b=pi(f,u);return b==null?null:{location:{pathname:b,search:p,hash:h,state:g,key:y,mask:w},navigationType:n}},[u,f,p,h,g,y,n,w]);return An(_!=null,`<Router basename="${u}"> is not able to match the URL "${f}${p}${h}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:N.createElement(Dr.Provider,{value:c},N.createElement(Hu.Provider,{children:e,value:_}))}function I4({children:t,location:e}){return b4(K0(t),e)}function K0(t,e=[]){let r=[];return N.Children.forEach(t,(n,i)=>{if(!N.isValidElement(n))return;let a=[...e,i];if(n.type===N.Fragment){r.push.apply(r,K0(n.props.children,a));return}mt(n.type===Jr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),mt(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=K0(n.props.children,a)),r.push(o)}),r}var Uf="get",Ff="application/x-www-form-urlencoded";function uh(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function M4(t){return uh(t)&&t.tagName.toLowerCase()==="button"}function D4(t){return uh(t)&&t.tagName.toLowerCase()==="form"}function L4(t){return uh(t)&&t.tagName.toLowerCase()==="input"}function z4(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function B4(t,e){return t.button===0&&(!e||e==="_self")&&!z4(t)}var mf=null;function q4(){if(mf===null)try{new FormData(document.createElement("form"),0),mf=!1}catch{mf=!0}return mf}var U4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mm(t){return t!=null&&!U4.has(t)?(An(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ff}"`),null):t}function F4(t,e){let r,n,i,a,o;if(D4(t)){let u=t.getAttribute("action");n=u?pi(u,e):null,r=t.getAttribute("method")||Uf,i=Mm(t.getAttribute("enctype"))||Ff,a=new FormData(t)}else if(M4(t)||L4(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||u.getAttribute("action");if(n=c?pi(c,e):null,r=t.getAttribute("formmethod")||u.getAttribute("method")||Uf,i=Mm(t.getAttribute("formenctype"))||Mm(u.getAttribute("enctype"))||Ff,a=new FormData(u,t),!q4()){let{name:f,type:p,value:h}=t;if(p==="image"){let g=f?`${f}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else f&&a.append(f,h)}}else{if(uh(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Uf,n=null,i=Ff,o=t}return a&&i==="text/plain"&&(o=a,a=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Bx(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function sC(t,e,r,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${n}`:i.pathname=`${i.pathname}.${n}`:i.pathname==="/"?i.pathname=`_root.${n}`:e&&pi(i.pathname,e)==="/"?i.pathname=`${Kf(e)}/_root.${n}`:i.pathname=`${Kf(i.pathname)}.${n}`,i}async function H4(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function W4(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 V4(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await H4(a,r);return o.links?o.links():[]}return[]}));return Y4(n.flat(1).filter(W4).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function ak(t,e,r,n,i,a){let o=(c,f)=>r[f]?c.route.id!==r[f].route.id:!0,u=(c,f)=>{var p;return r[f].pathname!==c.pathname||((p=r[f].route.path)==null?void 0:p.endsWith("*"))&&r[f].params["*"]!==c.params["*"]};return a==="assets"?e.filter((c,f)=>o(c,f)||u(c,f)):a==="data"?e.filter((c,f)=>{var h;let p=n.routes[c.route.id];if(!p||!p.hasLoader)return!1;if(o(c,f)||u(c,f))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((h=r[0])==null?void 0:h.params)||{},nextUrl:new URL(t,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function K4(t,e,{includeHydrateFallback:r}={}){return G4(t.map(n=>{let i=e.routes[n.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function G4(t){return[...new Set(t)]}function X4(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function Y4(t,e){let r=new Set;return new Set(e),t.reduce((n,i)=>{let a=JSON.stringify(X4(i));return r.has(a)||(r.add(a),n.push({key:a,link:i})),n},[])}function qx(){let t=N.useContext(Os);return Bx(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function J4(){let t=N.useContext(sh);return Bx(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Ux=N.createContext(void 0);Ux.displayName="FrameworkContext";function Fx(){let t=N.useContext(Ux);return Bx(t,"You must render this element inside a <HydratedRouter> element"),t}function Q4(t,e){let r=N.useContext(Ux),[n,i]=N.useState(!1),[a,o]=N.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:f,onMouseLeave:p,onTouchStart:h}=e,g=N.useRef(null);N.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let _=k=>{k.forEach(O=>{o(O.isIntersecting)})},b=new IntersectionObserver(_,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[t]),N.useEffect(()=>{if(n){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[n]);let y=()=>{i(!0)},w=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,g,{}]:[a,g,{onFocus:kl(u,y),onBlur:kl(c,w),onMouseEnter:kl(f,y),onMouseLeave:kl(p,w),onTouchStart:kl(h,y)}]:[!1,g,{}]}function kl(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function Z4({page:t,...e}){let r=s4(),{router:n}=qx(),i=N.useMemo(()=>VP(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?N.createElement(tD,{page:t,matches:i,...e}):N.createElement(rD,{page:t,matches:i,...e}):null}function eD(t){let{manifest:e,routeModules:r}=Fx(),[n,i]=N.useState([]);return N.useEffect(()=>{let a=!1;return V4(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function tD({page:t,matches:e,...r}){let n=Tn(),{future:i}=Fx(),{basename:a}=qx(),o=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let u=sC(t,a,i.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,f=[];for(let p of e)typeof p.route.shouldRevalidate=="function"?c=!0:f.push(p.route.id);return c&&f.length>0&&u.searchParams.set("_routes",f.join(",")),[u.pathname+u.search]},[a,i.v8_trailingSlashAwareDataRequests,t,n,e]);return N.createElement(N.Fragment,null,o.map(u=>N.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}function rD({page:t,matches:e,...r}){let n=Tn(),{future:i,manifest:a,routeModules:o}=Fx(),{basename:u}=qx(),{loaderData:c,matches:f}=J4(),p=N.useMemo(()=>ak(t,e,f,a,n,"data"),[t,e,f,a,n]),h=N.useMemo(()=>ak(t,e,f,a,n,"assets"),[t,e,f,a,n]),g=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let _=new Set,b=!1;if(e.forEach(O=>{var j;let A=a.routes[O.route.id];!A||!A.hasLoader||(!p.some(E=>E.route.id===O.route.id)&&O.route.id in c&&((j=o[O.route.id])!=null&&j.shouldRevalidate)||A.hasClientLoader?b=!0:_.add(O.route.id))}),_.size===0)return[];let k=sC(t,u,i.v8_trailingSlashAwareDataRequests,"data");return b&&_.size>0&&k.searchParams.set("_routes",e.filter(O=>_.has(O.route.id)).map(O=>O.route.id).join(",")),[k.pathname+k.search]},[u,i.v8_trailingSlashAwareDataRequests,c,n,a,p,e,t,o]),y=N.useMemo(()=>K4(h,a),[h,a]),w=eD(h);return N.createElement(N.Fragment,null,g.map(_=>N.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...r})),y.map(_=>N.createElement("link",{key:_,rel:"modulepreload",href:_,...r})),w.map(({key:_,link:b})=>N.createElement("link",{key:_,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function nD(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var iD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{iD&&(window.__reactRouterVersion="7.16.0")}catch{}function aD({basename:t,children:e,useTransitions:r,window:n}){let i=N.useRef();i.current==null&&(i.current=RM({window:n,v5Compat:!0}));let a=i.current,[o,u]=N.useState({action:a.action,location:a.location}),c=N.useCallback(f=>{r===!1?u(f):N.startTransition(()=>u(f))},[r]);return N.useLayoutEffect(()=>a.listen(c),[a,c]),N.createElement($4,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var lC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uC=N.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:i,reloadDocument:a,replace:o,mask:u,state:c,target:f,to:p,preventScrollReset:h,viewTransition:g,defaultShouldRevalidate:y,...w},_){let{basename:b,navigator:k,useTransitions:O}=N.useContext(Dr),A=typeof p=="string"&&lC.test(p),j=JP(p,b);p=j.to;let E=p4(p,{relative:i}),T=Tn(),C=null;if(u){let V=oh(u,[],T.mask?T.mask.pathname:"/",!0);b!=="/"&&(V.pathname=V.pathname==="/"?b:On([b,V.pathname])),C=k.createHref(V)}let[R,D,X]=Q4(n,w),$=lD(p,{replace:o,mask:u,state:c,target:f,preventScrollReset:h,relative:i,viewTransition:g,defaultShouldRevalidate:y,useTransitions:O});function I(V){e&&e(V),V.defaultPrevented||$(V)}let q=!(j.isExternal||a),U=N.createElement("a",{...w,...X,href:(q?C:void 0)||j.absoluteURL||E,onClick:q?I:e,ref:nD(_,D),target:f,"data-discover":!A&&r==="render"?"true":void 0});return R&&!A?N.createElement(N.Fragment,null,U,N.createElement(Z4,{page:E})):U});uC.displayName="Link";var cC=N.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:i=!1,style:a,to:o,viewTransition:u,children:c,...f},p){let h=Wu(o,{relative:f.relative}),g=Tn(),y=N.useContext(sh),{navigator:w,basename:_}=N.useContext(Dr),b=y!=null&&hD(h)&&u===!0,k=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,O=g.pathname,A=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(O=O.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&_&&(A=pi(A,_)||A);const j=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let E=O===k||!i&&O.startsWith(k)&&O.charAt(j)==="/",T=A!=null&&(A===k||!i&&A.startsWith(k)&&A.charAt(k.length)==="/"),C={isActive:E,isPending:T,isTransitioning:b},R=E?e:void 0,D;typeof n=="function"?D=n(C):D=[n,E?"active":null,T?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let X=typeof a=="function"?a(C):a;return N.createElement(uC,{...f,"aria-current":R,className:D,ref:p,style:X,to:o,viewTransition:u},typeof c=="function"?c(C):c)});cC.displayName="NavLink";var oD=N.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=Uf,action:u,onSubmit:c,relative:f,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:g,...y},w)=>{let{useTransitions:_}=N.useContext(Dr),b=fD(),k=dD(u,{relative:f}),O=o.toLowerCase()==="get"?"get":"post",A=typeof u=="string"&&lC.test(u),j=E=>{if(c&&c(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,C=(T==null?void 0:T.getAttribute("formmethod"))||o,R=()=>b(T||E.currentTarget,{fetcherKey:e,method:C,navigate:r,replace:i,state:a,relative:f,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:g});_&&r!==!1?N.startTransition(()=>R()):R()};return N.createElement("form",{ref:w,method:O,action:k,onSubmit:n?c:j,...y,"data-discover":!A&&t==="render"?"true":void 0})});oD.displayName="Form";function sD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fC(t){let e=N.useContext(Os);return mt(e,sD(t)),e}function lD(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:u,defaultShouldRevalidate:c,useTransitions:f}={}){let p=lh(),h=Tn(),g=Wu(t,{relative:o});return N.useCallback(y=>{if(B4(y,e)){y.preventDefault();let w=r!==void 0?r:tu(h)===tu(g),_=()=>p(t,{replace:w,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:u,defaultShouldRevalidate:c});f?N.startTransition(()=>_()):_()}},[h,p,g,r,n,i,e,t,a,o,u,c,f])}var uD=0,cD=()=>`__${String(++uD)}__`;function fD(){let{router:t}=fC("useSubmit"),{basename:e}=N.useContext(Dr),r=T4(),n=t.fetch,i=t.navigate;return N.useCallback(async(a,o={})=>{let{action:u,method:c,encType:f,formData:p,body:h}=F4(a,e);if(o.navigate===!1){let g=o.fetcherKey||cD();await n(g,r,o.action||u,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:h,formMethod:o.method||c,formEncType:o.encType||f,flushSync:o.flushSync})}else await i(o.action||u,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:h,formMethod:o.method||c,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,i,e,r])}function dD(t,{relative:e}={}){let{basename:r}=N.useContext(Dr),n=N.useContext(nn);mt(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Wu(t||".",{relative:e})},o=Tn();if(t==null){a.search=o.search;let u=new URLSearchParams(a.search),c=u.getAll("index");if(c.some(p=>p==="")){u.delete("index"),c.filter(h=>h).forEach(h=>u.append("index",h));let p=u.toString();a.search=p?`?${p}`:""}}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:On([r,a.pathname])),tu(a)}function hD(t,{relative:e}={}){let r=N.useContext(eC);mt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=fC("useViewTransitionState"),i=Wu(t,{relative:e});if(!r.isTransitioning)return!1;let a=pi(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=pi(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Vf(i.pathname,o)!=null||Vf(i.pathname,a)!=null}var pD=WP();const mD=Ze(pD);function gD(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const yD=t=>{switch(t){case"success":return xD;case"info":return _D;case"warning":return wD;case"error":return SD;default:return null}},vD=Array(12).fill(0),bD=({visible:t,className:e})=>M.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},M.createElement("div",{className:"sonner-spinner"},vD.map((r,n)=>M.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),xD=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wD=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},M.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_D=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),SD=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kD=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},M.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),M.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ED=()=>{const[t,e]=M.useState(document.hidden);return M.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let G0=1;class OD{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...i}=e,a=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:G0++,o=this.toasts.find(c=>c.id===a),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:u,title:n}):c):this.addToast({title:n,...i,dismissible:u,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,o;const u=i.then(async f=>{if(o=["resolve",f],M.isValidElement(f))a=!1,this.create({id:n,type:"default",message:f});else if(TD(f)&&!f.ok){a=!1;const h=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,w=typeof h=="object"&&!M.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...w})}else if(f instanceof Error){a=!1;const h=typeof r.error=="function"?await r.error(f):r.error,g=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!M.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:g,...w})}else if(r.success!==void 0){a=!1;const h=typeof r.success=="function"?await r.success(f):r.success,g=typeof r.description=="function"?await r.description(f):r.description,w=typeof h=="object"&&!M.isValidElement(h)?h:{message:h};this.create({id:n,type:"success",description:g,...w})}}).catch(async f=>{if(o=["reject",f],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(f):r.error,h=typeof r.description=="function"?await r.description(f):r.description,y=typeof p=="object"&&!M.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:h,...y})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),c=()=>new Promise((f,p)=>u.then(()=>o[0]==="reject"?p(o[1]):f(o[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{const n=(r==null?void 0:r.id)||G0++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const wr=new OD,AD=(t,e)=>{const r=(e==null?void 0:e.id)||G0++;return wr.addToast({title:t,...e,id:r}),r},TD=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",jD=AD,PD=()=>wr.toasts,CD=()=>wr.getActiveToasts(),et=Object.assign(jD,{success:wr.success,info:wr.info,warning:wr.warning,error:wr.error,custom:wr.custom,message:wr.message,promise:wr.promise,dismiss:wr.dismiss,loading:wr.loading},{getHistory:PD,getToasts:CD});gD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function gf(t){return t.label!==void 0}const ND=3,RD="24px",$D="16px",ok=4e3,ID=356,MD=14,DD=45,LD=200;function In(...t){return t.filter(Boolean).join(" ")}function zD(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const BD=t=>{var e,r,n,i,a,o,u,c,f;const{invert:p,toast:h,unstyled:g,interacting:y,setHeights:w,visibleToasts:_,heights:b,index:k,toasts:O,expanded:A,removeToast:j,defaultRichColors:E,closeButton:T,style:C,cancelButtonStyle:R,actionButtonStyle:D,className:X="",descriptionClassName:$="",duration:I,position:q,gap:U,expandByDefault:V,classNames:G,icons:Z,closeButtonAriaLabel:K="Close toast"}=t,[te,H]=M.useState(null),[B,z]=M.useState(null),[J,ae]=M.useState(!1),[se,de]=M.useState(!1),[Ce,pe]=M.useState(!1),[ne,_e]=M.useState(!1),[Ee,ie]=M.useState(!1),[Fe,Ne]=M.useState(0),[ct,at]=M.useState(0),ft=M.useRef(h.duration||I||ok),hr=M.useRef(null),Et=M.useRef(null),Lr=k===0,er=k+1<=_,ot=h.type,kr=h.dismissible!==!1,ma=h.className||"",ga=h.descriptionClassName||"",ya=M.useMemo(()=>b.findIndex($e=>$e.toastId===h.id)||0,[b,h.id]),zs=M.useMemo(()=>{var $e;return($e=h.closeButton)!=null?$e:T},[h.closeButton,T]),va=M.useMemo(()=>h.duration||I||ok,[h.duration,I]),so=M.useRef(0),zr=M.useRef(0),ki=M.useRef(0),Ei=M.useRef(null),[ic,ac]=q.split("-"),oc=M.useMemo(()=>b.reduce(($e,wt,Ct)=>Ct>=ya?$e:$e+wt.height,0),[b,ya]),lo=ED(),Bs=h.invert||p,ba=ot==="loading";zr.current=M.useMemo(()=>ya*U+oc,[ya,oc]),M.useEffect(()=>{ft.current=va},[va]),M.useEffect(()=>{ae(!0)},[]),M.useEffect(()=>{const $e=Et.current;if($e){const wt=$e.getBoundingClientRect().height;return at(wt),w(Ct=>[{toastId:h.id,height:wt,position:h.position},...Ct]),()=>w(Ct=>Ct.filter(tr=>tr.toastId!==h.id))}},[w,h.id]),M.useLayoutEffect(()=>{if(!J)return;const $e=Et.current,wt=$e.style.height;$e.style.height="auto";const Ct=$e.getBoundingClientRect().height;$e.style.height=wt,at(Ct),w(tr=>tr.find(Ot=>Ot.toastId===h.id)?tr.map(Ot=>Ot.toastId===h.id?{...Ot,height:Ct}:Ot):[{toastId:h.id,height:Ct,position:h.position},...tr])},[J,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const Br=M.useCallback(()=>{de(!0),Ne(zr.current),w($e=>$e.filter(wt=>wt.toastId!==h.id)),setTimeout(()=>{j(h)},LD)},[h,j,w,zr]);M.useEffect(()=>{if(h.promise&&ot==="loading"||h.duration===1/0||h.type==="loading")return;let $e;return A||y||lo?(()=>{if(ki.current<so.current){const tr=new Date().getTime()-so.current;ft.current=ft.current-tr}ki.current=new Date().getTime()})():(()=>{ft.current!==1/0&&(so.current=new Date().getTime(),$e=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Br()},ft.current))})(),()=>clearTimeout($e)},[A,y,h,ot,lo,Br]),M.useEffect(()=>{h.delete&&(Br(),h.onDismiss==null||h.onDismiss.call(h,h))},[Br,h.delete]);function qs(){var $e;if(Z!=null&&Z.loading){var wt;return M.createElement("div",{className:In(G==null?void 0:G.loader,h==null||(wt=h.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":ot==="loading"},Z.loading)}return M.createElement(bD,{className:In(G==null?void 0:G.loader,h==null||($e=h.classNames)==null?void 0:$e.loader),visible:ot==="loading"})}const Oi=h.icon||(Z==null?void 0:Z[ot])||yD(ot);var Vn,Us;return M.createElement("li",{tabIndex:0,ref:Et,className:In(X,ma,G==null?void 0:G.toast,h==null||(e=h.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[ot],h==null||(r=h.classNames)==null?void 0:r[ot]),"data-sonner-toast":"","data-rich-colors":(Vn=h.richColors)!=null?Vn:E,"data-styled":!(h.jsx||h.unstyled||g),"data-mounted":J,"data-promise":!!h.promise,"data-swiped":Ee,"data-removed":se,"data-visible":er,"data-y-position":ic,"data-x-position":ac,"data-index":k,"data-front":Lr,"data-swiping":Ce,"data-dismissible":kr,"data-type":ot,"data-invert":Bs,"data-swipe-out":ne,"data-swipe-direction":B,"data-expanded":!!(A||V&&J),"data-testid":h.testId,style:{"--index":k,"--toasts-before":k,"--z-index":O.length-k,"--offset":`${se?Fe:zr.current}px`,"--initial-height":V?"auto":`${ct}px`,...C,...h.style},onDragEnd:()=>{pe(!1),H(null),Ei.current=null},onPointerDown:$e=>{$e.button!==2&&(ba||!kr||(hr.current=new Date,Ne(zr.current),$e.target.setPointerCapture($e.pointerId),$e.target.tagName!=="BUTTON"&&(pe(!0),Ei.current={x:$e.clientX,y:$e.clientY})))},onPointerUp:()=>{var $e,wt,Ct;if(ne||!kr)return;Ei.current=null;const tr=Number((($e=Et.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ai=Number(((wt=Et.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ot=new Date().getTime()-((Ct=hr.current)==null?void 0:Ct.getTime()),zt=te==="x"?tr:Ai,Ti=Math.abs(zt)/Ot;if(Math.abs(zt)>=DD||Ti>.11){Ne(zr.current),h.onDismiss==null||h.onDismiss.call(h,h),z(te==="x"?tr>0?"right":"left":Ai>0?"down":"up"),Br(),_e(!0);return}else{var Vt,Er;(Vt=Et.current)==null||Vt.style.setProperty("--swipe-amount-x","0px"),(Er=Et.current)==null||Er.style.setProperty("--swipe-amount-y","0px")}ie(!1),pe(!1),H(null)},onPointerMove:$e=>{var wt,Ct,tr;if(!Ei.current||!kr||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;const Ot=$e.clientY-Ei.current.y,zt=$e.clientX-Ei.current.x;var Ti;const Vt=(Ti=t.swipeDirections)!=null?Ti:zD(q);!te&&(Math.abs(zt)>1||Math.abs(Ot)>1)&&H(Math.abs(zt)>Math.abs(Ot)?"x":"y");let Er={x:0,y:0};const ji=qr=>1/(1.5+Math.abs(qr)/20);if(te==="y"){if(Vt.includes("top")||Vt.includes("bottom"))if(Vt.includes("top")&&Ot<0||Vt.includes("bottom")&&Ot>0)Er.y=Ot;else{const qr=Ot*ji(Ot);Er.y=Math.abs(qr)<Math.abs(Ot)?qr:Ot}}else if(te==="x"&&(Vt.includes("left")||Vt.includes("right")))if(Vt.includes("left")&&zt<0||Vt.includes("right")&&zt>0)Er.x=zt;else{const qr=zt*ji(zt);Er.x=Math.abs(qr)<Math.abs(zt)?qr:zt}(Math.abs(Er.x)>0||Math.abs(Er.y)>0)&&ie(!0),(Ct=Et.current)==null||Ct.style.setProperty("--swipe-amount-x",`${Er.x}px`),(tr=Et.current)==null||tr.style.setProperty("--swipe-amount-y",`${Er.y}px`)}},zs&&!h.jsx&&ot!=="loading"?M.createElement("button",{"aria-label":K,"data-disabled":ba,"data-close-button":!0,onClick:ba||!kr?()=>{}:()=>{Br(),h.onDismiss==null||h.onDismiss.call(h,h)},className:In(G==null?void 0:G.closeButton,h==null||(n=h.classNames)==null?void 0:n.closeButton)},(Us=Z==null?void 0:Z.close)!=null?Us:kD):null,(ot||h.icon||h.promise)&&h.icon!==null&&((Z==null?void 0:Z[ot])!==null||h.icon)?M.createElement("div",{"data-icon":"",className:In(G==null?void 0:G.icon,h==null||(i=h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||qs():null,h.type!=="loading"?Oi:null):null,M.createElement("div",{"data-content":"",className:In(G==null?void 0:G.content,h==null||(a=h.classNames)==null?void 0:a.content)},M.createElement("div",{"data-title":"",className:In(G==null?void 0:G.title,h==null||(o=h.classNames)==null?void 0:o.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?M.createElement("div",{"data-description":"",className:In($,ga,G==null?void 0:G.description,h==null||(u=h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),M.isValidElement(h.cancel)?h.cancel:h.cancel&&gf(h.cancel)?M.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:$e=>{gf(h.cancel)&&kr&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,$e),Br())},className:In(G==null?void 0:G.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,M.isValidElement(h.action)?h.action:h.action&&gf(h.action)?M.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||D,onClick:$e=>{gf(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,$e),!$e.defaultPrevented&&Br())},className:In(G==null?void 0:G.actionButton,h==null||(f=h.classNames)==null?void 0:f.actionButton)},h.action.label):null)};function sk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function qD(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",u=a?$D:RD;function c(f){["top","right","bottom","left"].forEach(p=>{r[`${o}-${p}`]=typeof f=="number"?`${f}px`:f})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(f=>{n[f]===void 0?r[`${o}-${f}`]=u:r[`${o}-${f}`]=typeof n[f]=="number"?`${n[f]}px`:n[f]}):c(u)}),r}const UD=M.forwardRef(function(e,r){const{id:n,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:u,closeButton:c,className:f,offset:p,mobileOffset:h,theme:g="light",richColors:y,duration:w,style:_,visibleToasts:b=ND,toastOptions:k,dir:O=sk(),gap:A=MD,icons:j,containerAriaLabel:E="Notifications"}=e,[T,C]=M.useState([]),R=M.useMemo(()=>n?T.filter(J=>J.toasterId===n):T.filter(J=>!J.toasterId),[T,n]),D=M.useMemo(()=>Array.from(new Set([a].concat(R.filter(J=>J.position).map(J=>J.position)))),[R,a]),[X,$]=M.useState([]),[I,q]=M.useState(!1),[U,V]=M.useState(!1),[G,Z]=M.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=M.useRef(null),te=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=M.useRef(null),B=M.useRef(!1),z=M.useCallback(J=>{C(ae=>{var se;return(se=ae.find(de=>de.id===J.id))!=null&&se.delete||wr.dismiss(J.id),ae.filter(({id:de})=>de!==J.id)})},[]);return M.useEffect(()=>wr.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{C(ae=>ae.map(se=>se.id===J.id?{...se,delete:!0}:se))});return}setTimeout(()=>{mD.flushSync(()=>{C(ae=>{const se=ae.findIndex(de=>de.id===J.id);return se!==-1?[...ae.slice(0,se),{...ae[se],...J},...ae.slice(se+1)]:[J,...ae]})})})}),[T]),M.useEffect(()=>{if(g!=="system"){Z(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:ae})=>{Z(ae?"dark":"light")})}catch{J.addListener(({matches:se})=>{try{Z(se?"dark":"light")}catch(de){console.error(de)}})}},[g]),M.useEffect(()=>{T.length<=1&&q(!1)},[T]),M.useEffect(()=>{const J=ae=>{var se;if(o.every(pe=>ae[pe]||ae.code===pe)){var Ce;q(!0),(Ce=K.current)==null||Ce.focus()}ae.code==="Escape"&&(document.activeElement===K.current||(se=K.current)!=null&&se.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[o]),M.useEffect(()=>{if(K.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,B.current=!1)}},[K.current]),M.createElement("section",{ref:r,"aria-label":`${E} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((J,ae)=>{var se;const[de,Ce]=J.split("-");return R.length?M.createElement("ol",{key:J,dir:O==="auto"?sk():O,tabIndex:-1,ref:K,className:f,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":de,"data-x-position":Ce,style:{"--front-toast-height":`${((se=X[0])==null?void 0:se.height)||0}px`,"--width":`${ID}px`,"--gap":`${A}px`,..._,...qD(p,h)},onBlur:pe=>{B.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(B.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||B.current||(B.current=!0,H.current=pe.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{U||q(!1)},onDragEnd:()=>q(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},R.filter(pe=>!pe.position&&ae===0||pe.position===J).map((pe,ne)=>{var _e,Ee;return M.createElement(BD,{key:pe.id,icons:j,index:ne,toast:pe,defaultRichColors:y,duration:(_e=k==null?void 0:k.duration)!=null?_e:w,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Ee=k==null?void 0:k.closeButton)!=null?Ee:c,interacting:U,position:J,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:z,toasts:R.filter(ie=>ie.position==pe.position),heights:X.filter(ie=>ie.position==pe.position),setHeights:$,expandByDefault:u,gap:A,expanded:I,swipeDirections:e.swipeDirections})})):null}))}),FD="M147.692 55C178.28 55.0001 203.077 79.7968 203.077 110.385C203.077 140.089 179.692 164.331 150.327 165.706C126.508 171.901 108.924 193.549 108.924 219.308C108.924 222.879 109.261 226.372 109.907 229.755C109.903 229.756 109.898 229.755 109.894 229.756C110.468 232.955 110.77 236.25 110.77 239.615C110.77 242.98 110.468 246.274 109.894 249.474C109.898 249.474 109.903 249.475 109.907 249.476C109.261 252.859 108.924 256.351 108.924 259.923C108.924 285.68 126.507 307.329 150.325 313.524C179.691 314.899 203.077 339.14 203.077 368.846C203.077 399.434 178.28 424.23 147.692 424.23C117.104 424.23 92.3076 399.434 92.3076 368.846C92.3076 364.539 92.7986 360.348 93.7285 356.324C94.007 354.075 94.1543 351.785 94.1543 349.461C94.1541 321.662 73.6718 298.647 46.9756 294.682C46.9934 294.579 47.0138 294.477 47.0322 294.374C20.4072 290.347 2.80541e-05 267.364 0 239.615C0 211.866 20.4071 188.883 47.0322 184.855C47.0139 184.753 46.9934 184.651 46.9756 184.549C73.6719 180.584 94.1542 157.569 94.1543 129.77C94.1543 127.445 94.0063 125.154 93.7275 122.904C92.7979 118.881 92.3076 114.69 92.3076 110.385C92.3076 79.7967 117.104 55 147.692 55ZM332.308 55C362.896 55 387.692 79.7967 387.692 110.385C387.692 115.136 387.093 119.747 385.968 124.147C385.781 125.996 385.683 127.872 385.683 129.77C385.683 157.569 406.165 180.584 432.861 184.549C432.845 184.643 432.826 184.738 432.809 184.832C459.511 188.792 480 211.811 480 239.615C480 267.419 459.511 290.438 432.809 294.397C432.826 294.492 432.845 294.587 432.861 294.682C406.165 298.647 385.683 321.661 385.683 349.461C385.683 351.358 385.781 353.233 385.968 355.081C387.093 359.482 387.692 364.094 387.692 368.846C387.692 399.434 362.896 424.23 332.308 424.23C301.72 424.23 276.923 399.434 276.923 368.846C276.923 364.537 277.414 360.344 278.345 356.318C278.622 354.071 278.77 351.783 278.77 349.461C278.769 321.661 258.287 298.647 231.591 294.682C231.609 294.579 231.629 294.477 231.647 294.374C205.022 290.347 184.615 267.364 184.615 239.615C184.615 209.027 209.412 184.23 240 184.23C270.588 184.231 295.385 209.027 295.385 239.615C295.385 242.98 295.084 246.274 294.509 249.474C294.513 249.474 294.518 249.475 294.522 249.476C293.877 252.859 293.539 256.351 293.539 259.923C293.539 284.692 309.798 305.661 332.226 312.744C354.653 305.661 370.913 284.692 370.913 259.923C370.913 256.351 370.576 252.859 369.93 249.476C369.987 249.467 370.044 249.46 370.102 249.451C369.529 246.259 369.23 242.972 369.23 239.615C369.23 236.259 369.528 232.971 370.101 229.779C370.044 229.771 369.986 229.764 369.93 229.756C370.576 226.372 370.913 222.879 370.913 219.308C370.913 193.537 353.312 171.881 329.476 165.697C300.204 164.223 276.923 140.023 276.923 110.385C276.923 79.7967 301.72 55 332.308 55Z";function ta({height:t=32}){const e=Math.round(t*1);return v.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[v.jsx("path",{d:FD,fill:"url(#io-grad)"}),v.jsx("defs",{children:v.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[v.jsx("stop",{stopColor:"#D83333"}),v.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),v.jsx("stop",{offset:"1",stopColor:"#F041FF"})]})})]})}/**
52
- * @license lucide-react v0.487.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const HD=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),WD=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),lk=t=>{const e=WD(t);return e.charAt(0).toUpperCase()+e.slice(1)},dC=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
57
- * @license lucide-react v0.487.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */var VD={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
- * @license lucide-react v0.487.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const KD=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...u},c)=>N.createElement("svg",{ref:c,...VD,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:dC("lucide",i),...u},[...o.map(([f,p])=>N.createElement(f,p)),...Array.isArray(a)?a:[a]]));/**
67
- * @license lucide-react v0.487.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Re=(t,e)=>{const r=N.forwardRef(({className:n,...i},a)=>N.createElement(KD,{ref:a,iconNode:e,className:dC(`lucide-${HD(lk(t))}`,`lucide-${t}`,n),...i}));return r.displayName=lk(t),r};/**
72
- * @license lucide-react v0.487.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const GD=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],hC=Re("activity",GD);/**
77
- * @license lucide-react v0.487.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const XD=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],YD=Re("bell",XD);/**
82
- * @license lucide-react v0.487.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const JD=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],pC=Re("book-open",JD);/**
87
- * @license lucide-react v0.487.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const QD=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ZD=Re("bot",QD);/**
92
- * @license lucide-react v0.487.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const eL=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],tL=Re("bug",eL);/**
97
- * @license lucide-react v0.487.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const rL=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],nL=Re("calendar",rL);/**
102
- * @license lucide-react v0.487.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const iL=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],aL=Re("chart-no-axes-column",iL);/**
107
- * @license lucide-react v0.487.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const oL=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],sL=Re("chevron-down",oL);/**
112
- * @license lucide-react v0.487.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const lL=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Hx=Re("chevron-left",lL);/**
117
- * @license lucide-react v0.487.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const uL=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wx=Re("chevron-right",uL);/**
122
- * @license lucide-react v0.487.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const cL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],fL=Re("clock",cL);/**
127
- * @license lucide-react v0.487.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const dL=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],hL=Re("cpu",dL);/**
132
- * @license lucide-react v0.487.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const pL=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],mL=Re("crown",pL);/**
137
- * @license lucide-react v0.487.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const gL=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],yL=Re("download",gL);/**
142
- * @license lucide-react v0.487.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const vL=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],mC=Re("external-link",vL);/**
147
- * @license lucide-react v0.487.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const bL=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],xL=Re("eye-off",bL);/**
152
- * @license lucide-react v0.487.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const wL=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_L=Re("eye",wL);/**
157
- * @license lucide-react v0.487.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const SL=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kL=Re("file-text",SL);/**
162
- * @license lucide-react v0.487.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const EL=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],OL=Re("folder-open",EL);/**
167
- * @license lucide-react v0.487.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const AL=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],TL=Re("folder",AL);/**
172
- * @license lucide-react v0.487.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const jL=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],PL=Re("github",jL);/**
177
- * @license lucide-react v0.487.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const CL=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],gC=Re("inbox",CL);/**
182
- * @license lucide-react v0.487.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const NL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],El=Re("loader-circle",NL);/**
187
- * @license lucide-react v0.487.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const RL=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],$L=Re("log-out",RL);/**
192
- * @license lucide-react v0.487.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const IL=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],ML=Re("mail-open",IL);/**
197
- * @license lucide-react v0.487.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const DL=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],LL=Re("mail",DL);/**
202
- * @license lucide-react v0.487.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const zL=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],BL=Re("message-circle",zL);/**
207
- * @license lucide-react v0.487.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const qL=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],UL=Re("message-square",qL);/**
212
- * @license lucide-react v0.487.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const FL=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],yC=Re("paperclip",FL);/**
217
- * @license lucide-react v0.487.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const HL=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],WL=Re("pause",HL);/**
222
- * @license lucide-react v0.487.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const VL=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],KL=Re("pen",VL);/**
227
- * @license lucide-react v0.487.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const GL=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],X0=Re("pencil",GL);/**
232
- * @license lucide-react v0.487.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const XL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],YL=Re("play",XL);/**
237
- * @license lucide-react v0.487.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const JL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vC=Re("plus",JL);/**
242
- * @license lucide-react v0.487.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const QL=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Vx=Re("save",QL);/**
247
- * @license lucide-react v0.487.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const ZL=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],e5=Re("scroll-text",ZL);/**
252
- * @license lucide-react v0.487.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const t5=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],bC=Re("search",t5);/**
257
- * @license lucide-react v0.487.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const r5=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],xC=Re("send",r5);/**
262
- * @license lucide-react v0.487.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const n5=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],i5=Re("settings",n5);/**
267
- * @license lucide-react v0.487.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const a5=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],o5=Re("sparkles",a5);/**
272
- * @license lucide-react v0.487.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const s5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],wC=Re("square",s5);/**
277
- * @license lucide-react v0.487.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const l5=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Kx=Re("trash-2",l5);/**
282
- * @license lucide-react v0.487.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const u5=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],_C=Re("users",u5);/**
287
- * @license lucide-react v0.487.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const c5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],f5=Re("x",c5);/**
292
- * @license lucide-react v0.487.0 - ISC
293
- *
294
- * This source code is licensed under the ISC license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */const d5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Y0=Re("zap",d5);let Gf=[];const Xf=new Set;function SC(t){Gf=[t,...Gf].slice(0,50);for(const e of Xf)e()}function h5(){Gf=[];for(const t of Xf)t()}function p5(){const[,t]=N.useState(0);return N.useEffect(()=>{const e=()=>t(r=>r+1);return Xf.add(e),()=>{Xf.delete(e)}},[]),Gf}function m5(){const[t,e]=N.useState(!1),r=p5(),n=N.useRef(null),[i,a]=N.useState(0),o=r.length-i;N.useEffect(()=>{function c(f){n.current&&!n.current.contains(f.target)&&e(!1)}if(t)return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[t]);function u(){e(!t),t||a(r.length)}return v.jsxs("div",{className:"relative",ref:n,children:[v.jsxs("button",{type:"button",onClick:u,className:"relative p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Notifications",children:[v.jsx(YD,{className:"w-3.5 h-3.5"}),o>0&&v.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-[#E43A9C]"})]}),t&&v.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 max-h-96 overflow-y-auto rounded-xl border border-white/[0.07] bg-[#1a1a1a] shadow-2xl z-50",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07]",children:[v.jsx("span",{className:"text-xs font-mono text-zinc-300",children:"Notifications"}),r.length>0&&v.jsx("button",{type:"button",onClick:h5,className:"text-[10px] font-mono text-zinc-500 hover:text-zinc-300 cursor-pointer",children:"Clear all"})]}),r.length===0?v.jsx("div",{className:"px-4 py-8 text-center text-zinc-600 text-xs font-mono",children:"No notifications yet"}):v.jsx("div",{className:"divide-y divide-white/[0.04]",children:r.map(c=>v.jsxs("div",{className:"px-4 py-3 hover:bg-white/[0.03]",children:[v.jsx("p",{className:"text-xs text-zinc-300 leading-relaxed",children:c.message}),v.jsx("p",{className:"text-[10px] text-zinc-600 font-mono mt-1",children:new Date(c.timestamp).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Chicago"})})]},c.id))})]})]})}const g5="/api";let Va=null;function y5(t){Va=t}function Gx(){return(Va==null?void 0:Va())??null}async function Ol(t,e){const r=Va==null?void 0:Va(),n={"Content-Type":"application/json",...e==null?void 0:e.headers};r&&(n.Authorization=`Bearer ${r}`);const i=await fetch(`${g5}${t}`,{...e,headers:n});if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error??`Request failed: ${i.status}`)}return i.json()}const Xe={get:t=>Ol(t),post:(t,e)=>Ol(t,{method:"POST",body:e?JSON.stringify(e):void 0}),patch:(t,e)=>Ol(t,{method:"PATCH",body:JSON.stringify(e)}),put:(t,e)=>Ol(t,{method:"PUT",body:JSON.stringify(e)}),delete:t=>Ol(t,{method:"DELETE"})},v5=10,b5=1e3,x5=3e4;function kC(t={}){const[e,r]=N.useState(!1),[n,i]=N.useState(null),[a,o]=N.useState("connecting"),u=N.useRef(null),c=N.useRef(t),f=N.useRef(0),p=N.useRef(null),h=N.useRef(!0),g=N.useRef(!1);c.current=t,N.useEffect(()=>{let _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;const b=Gx();b&&(_+=`?token=${encodeURIComponent(b)}`);const k=()=>{if(!h.current)return;o(f.current>0?"reconnecting":"connecting");const O=new WebSocket(_);u.current=O,O.onopen=()=>{const A=f.current>0||g.current;f.current=0,g.current=!1,r(!0),o("connected"),A&&console.info("WebSocket reconnected")},O.onmessage=A=>{var j,E,T,C,R,D,X,$;try{const I=JSON.parse(A.data);switch(I.type){case"connected":i(I.connectionId??null);break;case"delta":(E=(j=c.current).onDelta)==null||E.call(j,I.content??"");break;case"message":(C=(T=c.current).onMessage)==null||C.call(T,I.content??"");break;case"event":(D=(R=c.current).onEvent)==null||D.call(R,I);break;case"error":($=(X=c.current).onError)==null||$.call(X,I.content??"Unknown error");break}}catch{}},O.onclose=()=>{if(u.current=null,r(!1),i(null),!h.current)return;if(g.current||(g.current=!0,console.warn("WebSocket disconnected; attempting to reconnect")),f.current>=v5){o("disconnected");return}const A=Math.min(b5*2**f.current,x5);f.current+=1,o("reconnecting"),p.current=setTimeout(k,A)},O.onerror=()=>{O.close()}};return k(),()=>{var O;h.current=!1,p.current&&clearTimeout(p.current),(O=u.current)==null||O.close()}},[]);const y=N.useCallback((w,_="web")=>{var b;((b=u.current)==null?void 0:b.readyState)===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"message",content:w,source:_}))},[]);return{connected:e,connectionId:n,connectionState:a,sendMessage:y}}function Xx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var to=Xx();function EC(t){to=t}var Ba={exec:()=>null};function No(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),i=e[n];return i||(i=t(n),e[n]=i),i}}function Ue(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(ur.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var w5=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ur={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:No(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:No(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:No(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:No(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:No(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:No(t=>new RegExp(`^ {0,${t}}>`))},_5=/^(?:[ \t]*(?:\n|$))+/,S5=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,k5=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,E5=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yx=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,OC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,AC=Ue(OC).replace(/bull/g,Yx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),O5=Ue(OC).replace(/bull/g,Yx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Jx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,A5=/^[^\n]+/,Qx=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,T5=Ue(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Qx).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j5=Ue(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Yx).getRegex(),ch="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zx=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,P5=Ue("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zx).replace("tag",ch).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),TC=Ue(Jx).replace("hr",Vu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ch).getRegex(),C5=Ue(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",TC).getRegex(),ew={blockquote:C5,code:S5,def:T5,fences:k5,heading:E5,hr:Vu,html:P5,lheading:AC,list:j5,newline:_5,paragraph:TC,table:Ba,text:A5},uk=Ue("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ch).getRegex(),N5={...ew,lheading:O5,table:uk,paragraph:Ue(Jx).replace("hr",Vu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",uk).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ch).getRegex()},R5={...ew,html:Ue(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zx).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ba,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ue(Jx).replace("hr",Vu).replace("heading",` *#{1,6} *[^
297
- ]`).replace("lheading",AC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},$5=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,I5=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,jC=/^( {2,}|\\)\n(?!\s*$)/,M5=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ts=/[\p{P}\p{S}]/u,fh=/[\s\p{P}\p{S}]/u,tw=/[^\s\p{P}\p{S}]/u,D5=Ue(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fh).getRegex(),PC=/(?!~)[\p{P}\p{S}]/u,L5=/(?!~)[\s\p{P}\p{S}]/u,z5=/(?:[^\s\p{P}\p{S}]|~)/u,B5=Ue(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",w5?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),CC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,q5=Ue(CC,"u").replace(/punct/g,Ts).getRegex(),U5=Ue(CC,"u").replace(/punct/g,PC).getRegex(),NC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F5=Ue(NC,"gu").replace(/notPunctSpace/g,tw).replace(/punctSpace/g,fh).replace(/punct/g,Ts).getRegex(),H5=Ue(NC,"gu").replace(/notPunctSpace/g,z5).replace(/punctSpace/g,L5).replace(/punct/g,PC).getRegex(),W5=Ue("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tw).replace(/punctSpace/g,fh).replace(/punct/g,Ts).getRegex(),V5=Ue(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ts).getRegex(),K5="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",G5=Ue(K5,"gu").replace(/notPunctSpace/g,tw).replace(/punctSpace/g,fh).replace(/punct/g,Ts).getRegex(),X5=Ue(/\\(punct)/,"gu").replace(/punct/g,Ts).getRegex(),Y5=Ue(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),J5=Ue(Zx).replace("(?:-->|$)","-->").getRegex(),Q5=Ue("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",J5).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Z5=Ue(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),RC=Ue(/^!?\[(label)\]\[(ref)\]/).replace("label",Yf).replace("ref",Qx).getRegex(),$C=Ue(/^!?\[(ref)\](?:\[\])?/).replace("ref",Qx).getRegex(),ez=Ue("reflink|nolink(?!\\()","g").replace("reflink",RC).replace("nolink",$C).getRegex(),ck=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rw={_backpedal:Ba,anyPunctuation:X5,autolink:Y5,blockSkip:B5,br:jC,code:I5,del:Ba,delLDelim:Ba,delRDelim:Ba,emStrongLDelim:q5,emStrongRDelimAst:F5,emStrongRDelimUnd:W5,escape:$5,link:Z5,nolink:$C,punctuation:D5,reflink:RC,reflinkSearch:ez,tag:Q5,text:M5,url:Ba},tz={...rw,link:Ue(/^!?\[(label)\]\((.*?)\)/).replace("label",Yf).getRegex(),reflink:Ue(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yf).getRegex()},J0={...rw,emStrongRDelimAst:H5,emStrongLDelim:U5,delLDelim:V5,delRDelim:G5,url:Ue(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ck).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ue(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ck).getRegex()},rz={...J0,br:Ue(jC).replace("{2,}","*").getRegex(),text:Ue(J0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},yf={normal:ew,gfm:N5,pedantic:R5},Al={normal:rw,gfm:J0,breaks:rz,pedantic:tz},nz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fk=t=>nz[t];function Ln(t,e){if(e){if(ur.escapeTest.test(t))return t.replace(ur.escapeReplace,fk)}else if(ur.escapeTestNoEncode.test(t))return t.replace(ur.escapeReplaceNoEncode,fk);return t}function dk(t){try{t=encodeURI(t).replace(ur.percentDecode,"%")}catch{return null}return t}function hk(t,e){var a;let r=t.replace(ur.findPipe,(o,u,c)=>{let f=!1,p=u;for(;--p>=0&&c[p]==="\\";)f=!f;return f?"|":" |"}),n=r.split(ur.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(ur.slashPipe,"|");return n}function Xi(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function pk(t){let e=t.split(`
298
- `),r=e.length-1;for(;r>=0&&ur.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
299
- `)}function iz(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function az(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function mk(t,e,r,n,i){let a=e.href,o=e.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:u,tokens:n.inlineTokens(u)};return n.state.inLink=!1,c}function oz(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
300
- `).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[u]=o;return u.length>=i.length?a.slice(i.length):a}).join(`
301
- `)}var Jf=class{constructor(t){Je(this,"options");Je(this,"rules");Je(this,"lexer");this.options=t||to}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:pk(e[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=oz(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=Xi(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:Xi(e[0],`
302
- `),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Xi(e[0],`
303
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Xi(e[0],`
304
- `).split(`
305
- `),n="",i="",a=[];for(;r.length>0;){let o=!1,u=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))u.push(r[c]),o=!0;else if(!o)u.push(r[c]);else break;r=r.slice(c);let f=u.join(`
306
- `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
307
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
308
- ${f}`:f,i=i?`${i}
309
- ${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=h,r.length===0)break;let g=a.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let y=g,w=y.raw+`
310
- `+r.join(`
311
- `),_=this.blockquote(w);a[a.length-1]=_,n=n.substring(0,n.length-y.raw.length)+_.raw,i=i.substring(0,i.length-y.text.length)+_.text;break}else if((g==null?void 0:g.type)==="list"){let y=g,w=y.raw+`
312
- `+r.join(`
313
- `),_=this.list(w);a[a.length-1]=_,n=n.substring(0,n.length-g.raw.length)+_.raw,i=i.substring(0,i.length-y.raw.length)+_.raw,r=w.substring(a.at(-1).raw.length).split(`
314
- `);continue}}return{type:"blockquote",raw:n,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let c=!1,f="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;f=e[0],t=t.substring(f.length);let h=az(e[2].split(`
315
- `,1)[0],e[1].length),g=t.split(`
316
- `,1)[0],y=!h.trim(),w=0;if(this.options.pedantic?(w=2,p=h.trimStart()):y?w=e[1].length+1:(w=h.search(this.rules.other.nonSpaceChar),w=w>4?1:w,p=h.slice(w),w+=e[1].length),y&&this.rules.other.blankLine.test(g)&&(f+=g+`
317
- `,t=t.substring(g.length+1),c=!0),!c){let _=this.rules.other.nextBulletRegex(w),b=this.rules.other.hrRegex(w),k=this.rules.other.fencesBeginRegex(w),O=this.rules.other.headingBeginRegex(w),A=this.rules.other.htmlBeginRegex(w),j=this.rules.other.blockquoteBeginRegex(w);for(;t;){let E=t.split(`
318
- `,1)[0],T;if(g=E,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),T=g):T=g.replace(this.rules.other.tabCharGlobal," "),k.test(g)||O.test(g)||A.test(g)||j.test(g)||_.test(g)||b.test(g))break;if(T.search(this.rules.other.nonSpaceChar)>=w||!g.trim())p+=`
319
- `+T.slice(w);else{if(y||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(h)||O.test(h)||b.test(h))break;p+=`
320
- `+g}y=!g.trim(),f+=E+`
321
- `,t=t.substring(E.length+1),h=T.slice(w)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(o=!0)),i.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=f}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c of i.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let f=c.tokens[0];if(c.task&&((f==null?void 0:f.type)==="text"||(f==null?void 0:f.type)==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(c.raw);if(p){let h={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};c.checked=h.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=h.raw+c.tokens[0].raw,c.tokens[0].text=h.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(h)):c.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):c.tokens.unshift(h)}}else c.task&&(c.task=!1);if(!i.loose){let p=c.tokens.filter(g=>g.type==="space"),h=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=h}}if(i.loose)for(let c of i.items){c.loose=!0;for(let f of c.tokens)f.type==="text"&&(f.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=pk(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:Xi(e[0],`
322
- `),href:n,title:i}}}table(t){var o;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=hk(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
323
- `):[],a={type:"table",raw:Xi(e[0],`
324
- `),header:[],align:[],rows:[]};if(r.length===n.length){for(let u of n)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<r.length;u++)a.header.push({text:r[u],tokens:this.lexer.inline(r[u]),header:!0,align:a.align[u]});for(let u of i)a.rows.push(hk(u,a.header.length).map((c,f)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[f]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:Xi(e[0],`
325
- `),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
326
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=Xi(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=iz(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),mk(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[n.toLowerCase()];if(!i){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return mk(r,i,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,u=i,c=0,f=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,e=e.slice(-1*t.length+i);(n=f.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(o=[...a].length,n[3]||n[4]){u+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){c+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+c);let p=[...n[0]][0].length,h=t.slice(0,i+n.index+p+o);if(Math.min(i,o)%2){let y=h.slice(1,-1);return{type:"em",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}let g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,u=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+i);(n=c.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a||(o=[...a].length,o!==i))continue;if(n[3]||n[4]){u+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u);let f=[...n[0]][0].length,p=t.slice(0,i+n.index+f+o),h=p.slice(i,-i);return{type:"del",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let a;do a=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(a!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},bn=class Q0{constructor(e){Je(this,"tokens");Je(this,"options");Je(this,"state");Je(this,"inlineQueue");Je(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||to,this.options.tokenizer=this.options.tokenizer||new Jf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ur,block:yf.normal,inline:Al.normal};this.options.pedantic?(r.block=yf.pedantic,r.inline=Al.pedantic):this.options.gfm&&(r.block=yf.gfm,this.options.breaks?r.inline=Al.breaks:r.inline=Al.gfm),this.tokenizer.rules=r}static get rules(){return{block:yf,inline:Al}}static lex(e,r){return new Q0(r).lex(e)}static lexInline(e,r){return new Q0(r).inlineTokens(e)}lex(e){e=e.replace(ur.carriageReturn,`
327
- `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var a,o,u;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ur.tabCharGlobal," ").replace(ur.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let c;if((o=(a=this.options.extensions)==null?void 0:a.block)!=null&&o.some(p=>(c=p.call({lexer:this},e,r))?(e=e.substring(c.raw.length),r.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let p=r.at(-1);c.raw.length===1&&p!==void 0?p.raw+=`
328
- `:r.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
329
- `)?"":`
330
- `)+c.raw,p.text+=`
331
- `+c.text,this.inlineQueue.at(-1).src=p.text):r.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
332
- `)?"":`
333
- `)+c.raw,p.text+=`
334
- `+c.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},r.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),r.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),r.push(c);continue}let f=e;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,h=e.slice(1),g;this.options.extensions.startBlock.forEach(y=>{g=y.call({lexer:this},h),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(f=e.substring(0,p+1))}if(this.state.top&&(c=this.tokenizer.paragraph(f))){let p=r.at(-1);n&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
335
- `)?"":`
336
- `)+c.raw,p.text+=`
337
- `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(c),n=f.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
338
- `)?"":`
339
- `)+c.raw,p.text+=`
340
- `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(c);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var f,p,h,g,y;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let w=Object.keys(this.tokens.links);if(w.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)w.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((p=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:p.call({lexer:this},n))??n;let o=!1,u="",c=1/0;for(;e;){if(e.length<c)c=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(u=""),o=!1;let w;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(b=>(w=b.call({lexer:this},e,r))?(e=e.substring(w.raw.length),r.push(w),!0):!1))continue;if(w=this.tokenizer.escape(e)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.tag(e)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.link(e)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(w.raw.length);let b=r.at(-1);w.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=w.raw,b.text+=w.text):r.push(w);continue}if(w=this.tokenizer.emStrong(e,n,u)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.codespan(e)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.br(e)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.del(e,n,u)){e=e.substring(w.raw.length),r.push(w);continue}if(w=this.tokenizer.autolink(e)){e=e.substring(w.raw.length),r.push(w);continue}if(!this.state.inLink&&(w=this.tokenizer.url(e))){e=e.substring(w.raw.length),r.push(w);continue}let _=e;if((y=this.options.extensions)!=null&&y.startInline){let b=1/0,k=e.slice(1),O;this.options.extensions.startInline.forEach(A=>{O=A.call({lexer:this},k),typeof O=="number"&&O>=0&&(b=Math.min(b,O))}),b<1/0&&b>=0&&(_=e.substring(0,b+1))}if(w=this.tokenizer.inlineText(_)){e=e.substring(w.raw.length),w.raw.slice(-1)!=="_"&&(u=w.raw.slice(-1)),o=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=w.raw,b.text+=w.text):r.push(w);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},Qf=class{constructor(e){Je(this,"options");Je(this,"parser");this.options=e||to}space(e){return""}code({text:e,lang:r,escaped:n}){var o;let i=(o=(r||"").match(ur.notSpaceStart))==null?void 0:o[0],a=e.replace(ur.endingNewline,"")+`
341
- `;return i?'<pre><code class="language-'+Ln(i)+'">'+(n?a:Ln(a,!0))+`</code></pre>
342
- `:"<pre><code>"+(n?a:Ln(a,!0))+`</code></pre>
343
- `}blockquote({tokens:e}){return`<blockquote>
344
- ${this.parser.parse(e)}</blockquote>
345
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
346
- `}hr(e){return`<hr>
347
- `}list(e){let r=e.ordered,n=e.start,i="";for(let u=0;u<e.items.length;u++){let c=e.items[u];i+=this.listitem(c)}let a=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+a+o+`>
348
- `+i+"</"+a+`>
349
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
350
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
351
- `}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];n="";for(let u=0;u<o.length;u++)n+=this.tablecell(o[u]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
352
- <thead>
353
- `+r+`</thead>
354
- `+i+`</table>
355
- `}tablerow({text:e}){return`<tr>
356
- ${e}</tr>
357
- `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
358
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ln(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=dk(e);if(a===null)return i;e=a;let o='<a href="'+e+'"';return r&&(o+=' title="'+Ln(r)+'"'),o+=">"+i+"</a>",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=dk(e);if(a===null)return Ln(n);e=a;let o=`<img src="${e}" alt="${Ln(n)}"`;return r&&(o+=` title="${Ln(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ln(e.text)}},nw=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},xn=class Z0{constructor(e){Je(this,"options");Je(this,"renderer");Je(this,"textRenderer");this.options=e||to,this.options.renderer=this.options.renderer||new Qf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nw}static parse(e,r){return new Z0(r).parse(e)}static parseInline(e,r){return new Z0(r).parseInline(e)}parse(e){var n,i;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let o=e[a];if((i=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&i[o.type]){let c=o,f=this.options.extensions.renderers[c.type].call({parser:this},c);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){r+=f||"";continue}}let u=o;switch(u.type){case"space":{r+=this.renderer.space(u);break}case"hr":{r+=this.renderer.hr(u);break}case"heading":{r+=this.renderer.heading(u);break}case"code":{r+=this.renderer.code(u);break}case"table":{r+=this.renderer.table(u);break}case"blockquote":{r+=this.renderer.blockquote(u);break}case"list":{r+=this.renderer.list(u);break}case"checkbox":{r+=this.renderer.checkbox(u);break}case"html":{r+=this.renderer.html(u);break}case"def":{r+=this.renderer.def(u);break}case"paragraph":{r+=this.renderer.paragraph(u);break}case"text":{r+=this.renderer.text(u);break}default:{let c='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(e,r=this.renderer){var i,a;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let u=e[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[u.type]){let f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){n+=f||"";continue}}let c=u;switch(c.type){case"escape":{n+=r.text(c);break}case"html":{n+=r.html(c);break}case"link":{n+=r.link(c);break}case"image":{n+=r.image(c);break}case"checkbox":{n+=r.checkbox(c);break}case"strong":{n+=r.strong(c);break}case"em":{n+=r.em(c);break}case"codespan":{n+=r.codespan(c);break}case"br":{n+=r.br(c);break}case"del":{n+=r.del(c);break}case"text":{n+=r.text(c);break}default:{let f='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return n}},qf,Bl=(qf=class{constructor(e){Je(this,"options");Je(this,"block");this.options=e||to}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?bn.lex:bn.lexInline}provideParser(e=this.block){return e?xn.parse:xn.parseInline}},Je(qf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Je(qf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),qf),sz=class{constructor(...t){Je(this,"defaults",Xx());Je(this,"options",this.setOptions);Je(this,"parse",this.parseMarkdown(!0));Je(this,"parseInline",this.parseMarkdown(!1));Je(this,"Parser",xn);Je(this,"Renderer",Qf);Je(this,"TextRenderer",nw);Je(this,"Lexer",bn);Je(this,"Tokenizer",Jf);Je(this,"Hooks",Bl);this.use(...t)}walkTokens(t,e){var n,i;let r=[];for(let a of t)switch(r=r.concat(e.call(this,a)),a.type){case"table":{let o=a;for(let u of o.header)r=r.concat(this.walkTokens(u.tokens,e));for(let u of o.rows)for(let c of u)r=r.concat(this.walkTokens(c.tokens,e));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,e));break}default:{let o=a;(i=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{let c=o[u].flat(1/0);r=r.concat(this.walkTokens(c,e))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...o){let u=i.renderer.apply(this,o);return u===!1&&(u=a.apply(this,o)),u}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),r.renderer){let i=this.defaults.renderer||new Qf(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,u=r.renderer[o],c=i[o];i[o]=(...f)=>{let p=u.apply(i,f);return p===!1&&(p=c.apply(i,f)),p||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Jf(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,u=r.tokenizer[o],c=i[o];i[o]=(...f)=>{let p=u.apply(i,f);return p===!1&&(p=c.apply(i,f)),p}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new Bl;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,u=r.hooks[o],c=i[o];Bl.passThroughHooks.has(a)?i[o]=f=>{if(this.defaults.async&&Bl.passThroughHooksRespectAsync.has(a))return(async()=>{let h=await u.call(i,f);return c.call(i,h)})();let p=u.call(i,f);return c.call(i,p)}:i[o]=(...f)=>{if(this.defaults.async)return(async()=>{let h=await u.apply(i,f);return h===!1&&(h=await c.apply(i,f)),h})();let p=u.apply(i,f);return p===!1&&(p=c.apply(i,f)),p}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(o){let u=[];return u.push(a.call(this,o)),i&&(u=u.concat(i.call(this,o))),u}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return bn.lex(t,e??this.defaults)}parser(t,e){return xn.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,u=await(i.hooks?await i.hooks.provideLexer(t):t?bn.lex:bn.lexInline)(o,i),c=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let f=await(i.hooks?await i.hooks.provideParser(t):t?xn.parse:xn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(f):f})().catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?bn.lex:bn.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?xn.parse:xn.parseInline)(o,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
359
- Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+Ln(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Xa=new sz;function ze(t,e){return Xa.parse(t,e)}ze.options=ze.setOptions=function(t){return Xa.setOptions(t),ze.defaults=Xa.defaults,EC(ze.defaults),ze};ze.getDefaults=Xx;ze.defaults=to;ze.use=function(...t){return Xa.use(...t),ze.defaults=Xa.defaults,EC(ze.defaults),ze};ze.walkTokens=function(t,e){return Xa.walkTokens(t,e)};ze.parseInline=Xa.parseInline;ze.Parser=xn;ze.parser=xn.parse;ze.Renderer=Qf;ze.TextRenderer=nw;ze.Lexer=bn;ze.lexer=bn.lex;ze.Tokenizer=Jf;ze.Hooks=Bl;ze.parse=ze;ze.options;ze.setOptions;ze.use;ze.walkTokens;ze.parseInline;xn.parse;bn.lex;function Dm(t){return new Date(t).toISOString()}function lz(){const[t,e]=N.useState(!1),[r,n]=N.useState([]),[i,a]=N.useState(""),[o,u]=N.useState(!1),[c,f]=N.useState(""),[p,h]=N.useState(null),g=N.useRef(null),y=N.useRef(null),w=N.useRef(null),_=N.useMemo(()=>r.slice(-10),[r]),b=N.useCallback(async()=>{try{const $=await Xe.get("/conversations?limit=10");n($.messages.map(I=>({...I,timestamp:Dm(I.timestamp)})))}catch{}},[]);N.useEffect(()=>{b()},[b]),N.useEffect(()=>{t&&b()},[b,t]);const k=N.useCallback($=>{u(!0),f($)},[]),O=N.useCallback($=>{u(!1),f(""),n(I=>[...I,{id:crypto.randomUUID(),role:"assistant",content:$,timestamp:Dm(new Date)}])},[]),A=N.useCallback($=>{var I,q,U;$.notification&&SC({id:((I=$.event)==null?void 0:I.id)??crypto.randomUUID(),message:$.notification,timestamp:((q=$.event)==null?void 0:q.timestamp)??new Date().toISOString(),eventType:((U=$.event)==null?void 0:U.type)??"unknown"})},[]),j=N.useCallback(()=>{u(!1),f("")},[]),{connected:E,sendMessage:T}=kC({onDelta:k,onMessage:O,onEvent:A,onError:j});N.useLayoutEffect(()=>{const $=g.current;$&&($.scrollTop=$.scrollHeight)},[_,c,o,t]);async function C($,I){const q=new FormData;q.append("file",$),q.append("messageId",I);const U=Gx();if(!(await fetch("/api/attachments",{method:"POST",body:q,headers:U?{Authorization:`Bearer ${U}`}:void 0})).ok)throw new Error("Failed to upload attachment")}async function R(){const $=i.trim();if(!$&&!p||o)return;const I=crypto.randomUUID(),q=p==null?void 0:p.name,U=[$,q?`Attachment: ${q}`:""].filter(Boolean).join(`
360
-
361
- `);n(V=>[...V,{id:I,role:"user",content:$,timestamp:Dm(new Date),attachmentName:q}]),a(""),h(null),u(!0),f(""),w.current&&(w.current.value=""),y.current&&(y.current.style.height="auto");try{p&&await C(p,I),T(U),e(!0)}catch{u(!1)}}function D($){a($.target.value),y.current&&(y.current.style.height="auto",y.current.style.height=`${Math.min(y.current.scrollHeight,96)}px`)}function X($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),R())}return v.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",children:[t&&v.jsxs("div",{className:"w-[340px] h-[460px] rounded-2xl bg-[#222] border border-white/[0.07] shadow-2xl overflow-hidden flex flex-col",children:[v.jsxs("div",{className:"bg-gradient-to-r from-[#E43A9C] to-[#9333ea] p-3 rounded-t-2xl flex items-center justify-between gap-3",children:[v.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[v.jsx("div",{className:"w-8 h-8 rounded-xl bg-black/15 border border-white/10 flex items-center justify-center flex-shrink-0",children:v.jsx(ta,{height:16})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:"text-sm font-medium text-white leading-none",children:"Quick Chat"}),v.jsx("p",{className:"text-[10px] font-mono text-white/70 mt-1",children:E?"live session":"reconnecting..."})]})]}),v.jsx("button",{type:"button",onClick:()=>e(!1),className:"text-xs font-mono text-white/80 hover:text-white transition-colors",children:"Close"})]}),v.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto p-3 space-y-2",children:[_.length===0&&!o?v.jsx("div",{className:"h-full flex items-center justify-center text-center px-6",children:v.jsx("p",{className:"text-xs text-zinc-500",children:"Ask IO anything without leaving this page."})}):_.map($=>v.jsx("div",{className:`flex ${$.role==="user"?"justify-end":"justify-start"}`,title:$.timestamp,children:v.jsxs("div",{className:`max-w-[85%] ${$.role==="user"?"ml-8":"mr-8"}`,children:[$.attachmentName&&v.jsx("div",{className:"mb-1 rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:$.attachmentName}),$.content&&v.jsx("div",{className:$.role==="user"?"bg-gradient-to-br from-[#E43A9C] to-[#D83333] rounded-xl px-3 py-2 text-xs text-white whitespace-pre-wrap":"bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:$.role==="user"?$.content:v.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:ze.parse($.content)}})})]})},$.id)),o&&v.jsx("div",{className:"flex justify-start",children:v.jsx("div",{className:"max-w-[85%] mr-8 bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:c?v.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:ze.parse(c)}}):v.jsx("div",{className:"flex items-center gap-1.5 py-1",children:[0,120,240].map($=>v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${$}ms`}},$))})})})]}),v.jsx("div",{className:"p-3 border-t border-white/[0.07]",children:v.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[v.jsx("input",{ref:w,type:"file",className:"hidden",onChange:$=>{var I;return h(((I=$.target.files)==null?void 0:I[0])??null)}}),p&&v.jsxs("div",{className:"px-3 pt-2 text-[10px] font-mono text-zinc-400",children:["Attached: ",p.name]}),v.jsxs("div",{className:"flex items-end gap-2 px-2.5 py-2",children:[v.jsx("button",{type:"button",onClick:()=>{var $;return($=w.current)==null?void 0:$.click()},className:"p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors flex-shrink-0",children:v.jsx(yC,{className:"w-4 h-4"})}),v.jsx("textarea",{ref:y,value:i,onChange:D,onKeyDown:X,placeholder:"Message IO…",rows:1,className:"flex-1 bg-transparent py-1 text-sm text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none",style:{minHeight:"36px",maxHeight:"96px",fontFamily:"Inter, sans-serif"}}),v.jsx("button",{type:"button",onClick:()=>{if(o){u(!1),f("");return}R()},disabled:!i.trim()&&!p||!E&&!o,className:"w-9 h-9 rounded-xl text-white disabled:opacity-30 disabled:cursor-not-allowed transition-opacity hover:opacity-90 primary-btn flex items-center justify-center flex-shrink-0 shadow-lg",children:o?v.jsx(wC,{className:"w-3.5 h-3.5"}):v.jsx(xC,{className:"w-3.5 h-3.5"})})]})]})})]}),v.jsx("button",{type:"button",onClick:()=>e($=>!$),className:"w-12 h-12 rounded-full primary-btn shadow-lg text-white flex items-center justify-center hover:opacity-95 transition-opacity","aria-label":t?"Close quick chat":"Open quick chat",children:v.jsx(BL,{className:"w-5 h-5"})})]})}function IC(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=IC(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function qe(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=IC(t))&&(n&&(n+=" "),n+=e);return n}const uz=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},cz=(t,e)=>({classGroupId:t,validator:e}),MC=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),Zf="-",gk=[],fz="arbitrary..",dz=t=>{const e=pz(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return hz(o);const u=o.split(Zf),c=u[0]===""&&u.length>1?1:0;return DC(u,c,e)},getConflictingClassGroupIds:(o,u)=>{if(u){const c=n[o],f=r[o];return c?f?uz(f,c):c:f||gk}return r[o]||gk}}},DC=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const i=t[e],a=r.nextPart.get(i);if(a){const f=DC(t,e+1,a);if(f)return f}const o=r.validators;if(o===null)return;const u=e===0?t.join(Zf):t.slice(e).join(Zf),c=o.length;for(let f=0;f<c;f++){const p=o[f];if(p.validator(u))return p.classGroupId}},hz=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?fz+n:void 0})(),pz=t=>{const{theme:e,classGroups:r}=t;return mz(r,e)},mz=(t,e)=>{const r=MC();for(const n in t){const i=t[n];iw(i,r,n,e)}return r},iw=(t,e,r,n)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];gz(o,e,r,n)}},gz=(t,e,r,n)=>{if(typeof t=="string"){yz(t,e,r);return}if(typeof t=="function"){vz(t,e,r,n);return}bz(t,e,r,n)},yz=(t,e,r)=>{const n=t===""?e:LC(e,t);n.classGroupId=r},vz=(t,e,r,n)=>{if(xz(t)){iw(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(cz(r,t))},bz=(t,e,r,n)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[u,c]=i[o];iw(c,LC(e,u),r,n)}},LC=(t,e)=>{let r=t;const n=e.split(Zf),i=n.length;for(let a=0;a<i;a++){const o=n[a];let u=r.nextPart.get(o);u||(u=MC(),r.nextPart.set(o,u)),r=u}return r},xz=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,wz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const i=(a,o)=>{r[a]=o,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(a){let o=r[a];if(o!==void 0)return o;if((o=n[a])!==void 0)return i(a,o),o},set(a,o){a in r?r[a]=o:i(a,o)}}},eb="!",yk=":",_z=[],vk=(t,e,r,n,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),Sz=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=i=>{const a=[];let o=0,u=0,c=0,f;const p=i.length;for(let _=0;_<p;_++){const b=i[_];if(o===0&&u===0){if(b===yk){a.push(i.slice(c,_)),c=_+1;continue}if(b==="/"){f=_;continue}}b==="["?o++:b==="]"?o--:b==="("?u++:b===")"&&u--}const h=a.length===0?i:i.slice(c);let g=h,y=!1;h.endsWith(eb)?(g=h.slice(0,-1),y=!0):h.startsWith(eb)&&(g=h.slice(1),y=!0);const w=f&&f>c?f-c:void 0;return vk(a,y,g,w)};if(e){const i=e+yk,a=n;n=o=>o.startsWith(i)?a(o.slice(i.length)):vk(_z,!1,o,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},kz=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const o=r[a],u=o[0]==="[",c=e.has(o);u||c?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},Ez=t=>({cache:wz(t.cacheSize),parseClassName:Sz(t),sortModifiers:kz(t),postfixLookupClassGroupIds:Oz(t),...dz(t)}),Oz=t=>{const e=Object.create(null),r=t.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)e[r[n]]=!0;return e},Az=/\s+/,Tz=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=e,u=[],c=t.trim().split(Az);let f="";for(let p=c.length-1;p>=0;p-=1){const h=c[p],{isExternal:g,modifiers:y,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:b}=r(h);if(g){f=h+(f.length>0?" "+f:f);continue}let k=!!b,O;if(k){const C=_.substring(0,b);O=n(C);const R=O&&o[O]?n(_):void 0;R&&R!==O&&(O=R,k=!1)}else O=n(_);if(!O){if(!k){f=h+(f.length>0?" "+f:f);continue}if(O=n(_),!O){f=h+(f.length>0?" "+f:f);continue}k=!1}const A=y.length===0?"":y.length===1?y[0]:a(y).join(":"),j=w?A+eb:A,E=j+O;if(u.indexOf(E)>-1)continue;u.push(E);const T=i(O,k);for(let C=0;C<T.length;++C){const R=T[C];u.push(j+R)}f=h+(f.length>0?" "+f:f)}return f},jz=(...t)=>{let e=0,r,n,i="";for(;e<t.length;)(r=t[e++])&&(n=zC(r))&&(i&&(i+=" "),i+=n);return i},zC=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=zC(t[n]))&&(r&&(r+=" "),r+=e);return r},Pz=(t,...e)=>{let r,n,i,a;const o=c=>{const f=e.reduce((p,h)=>h(p),t());return r=Ez(f),n=r.cache.get,i=r.cache.set,a=u,u(c)},u=c=>{const f=n(c);if(f)return f;const p=Tz(c,r);return i(c,p),p};return a=o,(...c)=>a(jz(...c))},Cz=[],$t=t=>{const e=r=>r[t]||Cz;return e.isThemeGetter=!0,e},BC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$z=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Iz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yi=t=>Nz.test(t),Ie=t=>!!t&&!Number.isNaN(Number(t)),Mn=t=>!!t&&Number.isInteger(Number(t)),Lm=t=>t.endsWith("%")&&Ie(t.slice(0,-1)),ti=t=>Rz.test(t),UC=()=>!0,Lz=t=>$z.test(t)&&!Iz.test(t),aw=()=>!1,zz=t=>Mz.test(t),Bz=t=>Dz.test(t),qz=t=>!ge(t)&&!ve(t),Uz=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),Fz=t=>ua(t,WC,aw),ge=t=>BC.test(t),Ra=t=>ua(t,VC,Lz),bk=t=>ua(t,Jz,Ie),Hz=t=>ua(t,GC,UC),Wz=t=>ua(t,KC,aw),xk=t=>ua(t,FC,aw),Vz=t=>ua(t,HC,Bz),vf=t=>ua(t,XC,zz),ve=t=>qC.test(t),Tl=t=>ro(t,VC),Kz=t=>ro(t,KC),wk=t=>ro(t,FC),Gz=t=>ro(t,WC),Xz=t=>ro(t,HC),bf=t=>ro(t,XC,!0),Yz=t=>ro(t,GC,!0),ua=(t,e,r)=>{const n=BC.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},ro=(t,e,r=!1)=>{const n=qC.exec(t);return n?n[1]?e(n[1]):r:!1},FC=t=>t==="position"||t==="percentage",HC=t=>t==="image"||t==="url",WC=t=>t==="length"||t==="size"||t==="bg-size",VC=t=>t==="length",Jz=t=>t==="number",KC=t=>t==="family-name",GC=t=>t==="number"||t==="weight",XC=t=>t==="shadow",Qz=()=>{const t=$t("color"),e=$t("font"),r=$t("text"),n=$t("font-weight"),i=$t("tracking"),a=$t("leading"),o=$t("breakpoint"),u=$t("container"),c=$t("spacing"),f=$t("radius"),p=$t("shadow"),h=$t("inset-shadow"),g=$t("text-shadow"),y=$t("drop-shadow"),w=$t("blur"),_=$t("perspective"),b=$t("aspect"),k=$t("ease"),O=$t("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...j(),ve,ge],T=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],R=()=>[ve,ge,c],D=()=>[Yi,"full","auto",...R()],X=()=>[Mn,"none","subgrid",ve,ge],$=()=>["auto",{span:["full",Mn,ve,ge]},Mn,ve,ge],I=()=>[Mn,"auto",ve,ge],q=()=>["auto","min","max","fr",ve,ge],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],Z=()=>[Yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],K=()=>[Yi,"screen","full","dvw","lvw","svw","min","max","fit",...R()],te=()=>[Yi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],H=()=>[t,ve,ge],B=()=>[...j(),wk,xk,{position:[ve,ge]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",Gz,Fz,{size:[ve,ge]}],ae=()=>[Lm,Tl,Ra],se=()=>["","none","full",f,ve,ge],de=()=>["",Ie,Tl,Ra],Ce=()=>["solid","dashed","dotted","double"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Ie,Lm,wk,xk],_e=()=>["","none",w,ve,ge],Ee=()=>["none",Ie,ve,ge],ie=()=>["none",Ie,ve,ge],Fe=()=>[Ie,ve,ge],Ne=()=>[Yi,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ti],breakpoint:[ti],color:[UC],container:[ti],"drop-shadow":[ti],ease:["in","out","in-out"],font:[qz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ti],shadow:[ti],spacing:["px",Ie],text:[ti],"text-shadow":[ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Yi,ge,ve,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ve,ge]}],"container-named":[Uz],columns:[{columns:[Ie,ge,ve,u]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Mn,"auto",ve,ge]}],basis:[{basis:[Yi,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,Yi,"auto","initial","none",ge]}],grow:[{grow:["",Ie,ve,ge]}],shrink:[{shrink:["",Ie,ve,ge]}],order:[{order:[Mn,"first","last","none",ve,ge]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[u,"screen",...Z()]}],"min-w":[{"min-w":[u,"screen","none",...Z()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",r,Tl,Ra]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Yz,Hz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lm,ge]}],"font-family":[{font:[Kz,Wz,e]}],"font-features":[{"font-features":[ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ve,ge]}],"line-clamp":[{"line-clamp":[Ie,"none",ve,bk]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",ve,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ve,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",ve,Ra]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ie,"auto",ve,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[Mn,ve,ge]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ve,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ve,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Mn,ve,ge],radial:["",ve,ge],conic:[Mn,ve,ge]},Xz,Vz]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,ve,ge]}],"outline-w":[{outline:["",Ie,Tl,Ra]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,bf,vf]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,bf,vf]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ie,Ra]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,bf,vf]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ie,ve,ge]}],"mix-blend":[{"mix-blend":[...pe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[ve,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ve,ge]}],filter:[{filter:["","none",ve,ge]}],blur:[{blur:_e()}],brightness:[{brightness:[Ie,ve,ge]}],contrast:[{contrast:[Ie,ve,ge]}],"drop-shadow":[{"drop-shadow":["","none",y,bf,vf]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ie,ve,ge]}],"hue-rotate":[{"hue-rotate":[Ie,ve,ge]}],invert:[{invert:["",Ie,ve,ge]}],saturate:[{saturate:[Ie,ve,ge]}],sepia:[{sepia:["",Ie,ve,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ve,ge]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,ve,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,ve,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,ve,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,ve,ge]}],"backdrop-invert":[{"backdrop-invert":["",Ie,ve,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,ve,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,ve,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,ve,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ve,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",ve,ge]}],ease:[{ease:["linear","initial",k,ve,ge]}],delay:[{delay:[Ie,ve,ge]}],animate:[{animate:["none",O,ve,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,ve,ge]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[ve,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ne()}],"translate-x":[{"translate-x":Ne()}],"translate-y":[{"translate-y":Ne()}],"translate-z":[{"translate-z":Ne()}],"translate-none":["translate-none"],zoom:[{zoom:[Mn,ve,ge]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ve,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ve,ge]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Ie,Tl,Ra,bk]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Zz=Pz(Qz);function ql(...t){return Zz(qe(t))}function e8({status:t}){const e={connected:"bg-green-500",idle:"bg-green-500",disconnected:"bg-zinc-600",error:"bg-red-500",working:"bg-amber-400",reviewing:"bg-blue-400"}[t],r=t==="connected"||t==="working";return v.jsxs("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[r&&v.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${e} opacity-40 animate-ping`}),v.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${e}`})]})}function Qt({children:t,variant:e="muted",className:r=""}){const n={default:"bg-[#E43A9C]/15 text-[#F041FF] border-[#E43A9C]/20",success:"bg-green-500/15 text-green-400 border-green-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",error:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-blue-500/15 text-blue-400 border-blue-500/20",muted:"bg-white/5 text-zinc-400 border-white/10"}[e];return v.jsx("span",{className:`inline-flex items-center px-2 py-px rounded-full text-[10px] font-mono border ${n} ${r}`,children:t})}function t8({name:t,color:e}){return e?v.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${e}15`,color:e,borderColor:`${e}30`},children:t}):v.jsx(Qt,{variant:"muted",children:t})}function oa({children:t,onClick:e,className:r="",type:n="button",disabled:i=!1}){return v.jsx("button",{type:n,onClick:e,disabled:i,className:`flex items-center gap-1.5 font-mono text-[11px] text-white rounded-lg active:opacity-80 primary-btn cursor-pointer disabled:opacity-50 ${r}`,children:t})}function ci({children:t,onClick:e,className:r=""}){return v.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-[#2e2e2e] hover:text-zinc-100 transition-colors cursor-pointer ${r}`,children:t})}function ow({children:t,onClick:e,className:r=""}){return v.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer ${r}`,children:t})}function r8({children:t,onClick:e,className:r=""}){return v.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-amber-500/10 hover:text-amber-400 transition-colors cursor-pointer ${r}`,children:t})}function Hf(t){return t==="connected"||t==="idle"?"success":t==="active"||t==="working"?"warning":t==="reviewing"?"info":t==="error"?"error":"muted"}function dh(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function n8(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function u(p){try{f(n.next(p))}catch(h){o(h)}}function c(p){try{f(n.throw(p))}catch(h){o(h)}}function f(p){p.done?a(p.value):i(p.value).then(u,c)}f((n=n.apply(t,e||[])).next())})}const i8=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class sw extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class a8 extends sw{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class _k extends sw{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Sk extends sw{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var tb;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(tb||(tb={}));class o8{constructor(e,{headers:r={},customFetch:n,region:i=tb.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=i8(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return n8(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:u,method:c,body:f,signal:p,timeout:h}=n;let g={},{region:y}=n;y||(y=this.region);const w=new URL(`${this.url}/${r}`);y&&y!=="any"&&(g["x-region"]=y,w.searchParams.set("forceFunctionRegion",y));let _;f&&(u&&!Object.prototype.hasOwnProperty.call(u,"Content-Type")||!u)?typeof Blob<"u"&&f instanceof Blob||f instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",_=f):typeof f=="string"?(g["Content-Type"]="text/plain",_=f):typeof FormData<"u"&&f instanceof FormData?_=f:(g["Content-Type"]="application/json",_=JSON.stringify(f)):f&&typeof f!="string"&&!(typeof Blob<"u"&&f instanceof Blob)&&!(f instanceof ArrayBuffer)&&!(typeof FormData<"u"&&f instanceof FormData)?_=JSON.stringify(f):_=f;let b=p;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),p?(b=o.signal,p.addEventListener("abort",()=>o.abort())):b=o.signal);const k=yield this.fetch(w.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),u),body:_,signal:b}).catch(E=>{throw new a8(E)}),O=k.headers.get("x-relay-error");if(O&&O==="true")throw new _k(k);if(!k.ok)throw new Sk(k);let A=((i=k.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),j;return A==="application/json"?j=yield k.json():A==="application/octet-stream"||A==="application/pdf"?j=yield k.blob():A==="text/event-stream"?j=k:A==="multipart/form-data"?j=yield k.formData():j=yield k.text(),{data:j,error:null,response:k}}catch(u){return{data:null,error:u,response:u instanceof Sk||u instanceof _k?u.context:void 0}}finally{a&&clearTimeout(a)}})}}const YC=3,kk=t=>Math.min(1e3*2**t,3e4),s8=[520,503],JC=["GET","HEAD","OPTIONS"];var l8=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Ek(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",i),r()},t);function i(){clearTimeout(n),r()}e==null||e.addEventListener("abort",i)})}function u8(t,e,r,n){return!(!n||r>=YC||!JC.includes(t)||!s8.includes(e))}var c8=class{constructor(t){var e,r,n,i,a;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(i=t.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(a=t.retry)!==null&&a!==void 0?a:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let a=(async()=>{let o=0;for(;;){const f=new Headers(r.headers);o>0&&f.set("X-Retry-Count",String(o));let p;try{p=await n(r.url.toString(),{method:r.method,headers:f,body:JSON.stringify(r.body,(h,g)=>typeof g=="bigint"?g.toString():g),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!JC.includes(r.method))throw h;if(r.retryEnabled&&o<YC){const g=kk(o);o++,await Ek(g,r.signal);continue}throw h}if(u8(r.method,p.status,o,r.retryEnabled)){var u,c;const h=(u=(c=p.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&u!==void 0?u:null,g=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:kk(o);await p.text(),o++,await Ek(g,r.signal);continue}return await r.processResponse(p)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var u;let c="",f="",p="";const h=o==null?void 0:o.cause;if(h){var g,y,w,_;const O=(g=h==null?void 0:h.message)!==null&&g!==void 0?g:"",A=(y=h==null?void 0:h.code)!==null&&y!==void 0?y:"";c=`${(w=o==null?void 0:o.name)!==null&&w!==void 0?w:"FetchError"}: ${o==null?void 0:o.message}`,c+=`
362
-
363
- Caused by: ${(_=h==null?void 0:h.name)!==null&&_!==void 0?_:"Error"}: ${O}`,A&&(c+=` (${A})`),h!=null&&h.stack&&(c+=`
364
- ${h.stack}`)}else{var b;c=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const k=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(p="",f="Request was aborted (timeout or manual cancellation)",k>this.urlLengthLimit&&(f+=`. Note: Your request URL is ${k} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(p="",f="HTTP headers exceeded server limits (typically 16KB)",k>this.urlLengthLimit&&(f+=`. Your request URL is ${k} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(u=o==null?void 0:o.name)!==null&&u!==void 0?u:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:f,code:p},data:null,count:null,status:0,statusText:""}})),a.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,i=null,a=t.status,o=t.statusText;if(t.ok){var u,c;if(e.method!=="HEAD"){var f;const g=await t.text();g===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((f=e.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?n=g:n=JSON.parse(g))}const p=(u=e.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),h=(c=t.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");p&&h&&h.length>1&&(i=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,a=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const p=await t.text();try{r=JSON.parse(p),Array.isArray(r)&&t.status===404&&(n=[],r=null,a=200,o="OK")}catch{t.status===404&&p===""?(a=204,o="No Content"):r={message:p}}if(r&&e.shouldThrowOnError)throw new l8(r)}return{success:r===null,error:r,data:n,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},f8=class extends c8{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(a,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:a="text"}={}){var o;const u=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${u};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Ok=new RegExp("[,()]");var Uo=class extends f8{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Ok.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Ok.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${a}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},d8=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:a}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},i=r?"HEAD":"GET";let a=!1;const o=(t??"*").split("").map(f=>/\s/.test(f)&&!a?"":(f==='"'&&(a=!a),f)).join(""),{url:u,headers:c}=this.cloneRequestState();return u.searchParams.set("select",o),n&&c.append("Prefer",`count=${n}`),new Uo({method:i,url:u,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,f)=>c.concat(Object.keys(f)),[]);if(u.length>0){const c=[...new Set(u)].map(f=>`"${f}"`);a.searchParams.set("columns",c.join(","))}}return new Uo({method:i,url:a,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var a;const o="POST",{url:u,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&u.searchParams.set("on_conflict",e),n&&c.append("Prefer",`count=${n}`),i||c.append("Prefer","missing=default"),Array.isArray(t)){const f=t.reduce((p,h)=>p.concat(Object.keys(h)),[]);if(f.length>0){const p=[...new Set(f)].map(h=>`"${h}"`);u.searchParams.set("columns",p.join(","))}}return new Uo({method:o,url:u,headers:c,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:i,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new Uo({method:n,url:i,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Uo({method:r,url:n,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function ru(t){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ru(t)}function h8(t,e){if(ru(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ru(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p8(t){var e=h8(t,"string");return ru(e)=="symbol"?e:e+""}function m8(t,e,r){return(e=p8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ak(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ak(Object(r),!0).forEach(function(n){m8(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ak(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var g8=class QC{constructor(e,{headers:r={},schema:n,fetch:i,timeout:a,urlLengthLimit:o=8e3,retry:u}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const c=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(f,p)=>{const h=new AbortController,g=setTimeout(()=>h.abort(),a),y=p==null?void 0:p.signal;if(y){if(y.aborted)return clearTimeout(g),c(f,p);const w=()=>{clearTimeout(g),h.abort()};return y.addEventListener("abort",w,{once:!0}),c(f,xf(xf({},p),{},{signal:h.signal})).finally(()=>{clearTimeout(g),y.removeEventListener("abort",w)})}return c(f,xf(xf({},p),{},{signal:h.signal})).finally(()=>clearTimeout(g))}:this.fetch=c,this.retry=u}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new d8(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new QC(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:i=!1,count:a}={}){var o;let u;const c=new URL(`${this.url}/rpc/${e}`);let f;const p=y=>y!==null&&typeof y=="object"&&(!Array.isArray(y)||y.some(p)),h=n&&Object.values(r).some(p);h?(u="POST",f=r):n||i?(u=n?"HEAD":"GET",Object.entries(r).filter(([y,w])=>w!==void 0).map(([y,w])=>[y,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([y,w])=>{c.searchParams.append(y,w)})):(u="POST",f=r);const g=new Headers(this.headers);return h?g.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&g.set("Prefer",`count=${a}`),new Uo({method:u,url:c,headers:g,schema:this.schemaName,body:f,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class y8{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const i=globalThis.process;if(i){const a=i.versions;if(a&&a.node){const o=a.node,u=parseInt(o.replace(/^v/,"").split(".")[0]);return u>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${u} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${u} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
365
- import ws from "ws"
366
- new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
367
-
368
- Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const v8="2.106.2",b8=`realtime-js/${v8}`,x8="1.0.0",ZC="2.0.0",w8=ZC,_8=1e4,S8=100,Qi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},eN={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},rb={connecting:"connecting",closing:"closing",closed:"closed"};class k8{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,r,n){var i,a;const o=e.topic,u=(i=e.ref)!==null&&i!==void 0?i:"",c=(a=e.join_ref)!==null&&a!==void 0?a:"",f=e.payload.event,p=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(p).length===0?"":JSON.stringify(p);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`ref length ${u.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`userEvent length ${f.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+u.length+o.length+f.length+h.length,y=new ArrayBuffer(this.HEADER_LENGTH+g);let w=new DataView(y),_=0;w.setUint8(_++,this.KINDS.userBroadcastPush),w.setUint8(_++,c.length),w.setUint8(_++,u.length),w.setUint8(_++,o.length),w.setUint8(_++,f.length),w.setUint8(_++,h.length),w.setUint8(_++,r),Array.from(c,k=>w.setUint8(_++,k.charCodeAt(0))),Array.from(u,k=>w.setUint8(_++,k.charCodeAt(0))),Array.from(o,k=>w.setUint8(_++,k.charCodeAt(0))),Array.from(f,k=>w.setUint8(_++,k.charCodeAt(0))),Array.from(h,k=>w.setUint8(_++,k.charCodeAt(0)));var b=new Uint8Array(y.byteLength+n.byteLength);return b.set(new Uint8Array(y),0),b.set(new Uint8Array(n),y.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[i,a,o,u,c]=n;return r({join_ref:i,ref:a,topic:o,event:u,payload:c})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,i)}}_decodeUserBroadcast(e,r,n){const i=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),u=r.getUint8(4);let c=this.HEADER_LENGTH+4;const f=n.decode(e.slice(c,c+i));c=c+i;const p=n.decode(e.slice(c,c+a));c=c+a;const h=n.decode(e.slice(c,c+o));c=c+o;const g=e.slice(c,e.byteLength),y=u===this.JSON_ENCODING?JSON.parse(n.decode(g)):g,w={type:this.BROADCAST_EVENT,event:p,payload:y};return o>0&&(w.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:f,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var nt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(nt||(nt={}));const Tk=(t,e,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((a,o)=>(a[o]=E8(o,t,e,i),a),{}):{}},E8=(t,e,r,n)=>{const i=e.find(u=>u.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?tN(a,o):nb(o)},tN=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return j8(e,r)}switch(t){case nt.bool:return O8(e);case nt.float4:case nt.float8:case nt.int2:case nt.int4:case nt.int8:case nt.numeric:case nt.oid:return A8(e);case nt.json:case nt.jsonb:return T8(e);case nt.timestamp:return P8(e);case nt.abstime:case nt.date:case nt.daterange:case nt.int4range:case nt.int8range:case nt.money:case nt.reltime:case nt.text:case nt.time:case nt.timestamptz:case nt.timetz:case nt.tsrange:case nt.tstzrange:return nb(e);default:return nb(e)}},nb=t=>t,O8=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},A8=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},T8=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},j8=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let a;const o=t.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(u=>tN(e,u))}return t},P8=t=>typeof t=="string"?t.replace(" ","T"):t,rN=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Kl=t=>typeof t=="function"?t:function(){return t},C8=typeof self<"u"?self:null,Fo=typeof window<"u"?window:null,zn=C8||Fo||globalThis,N8="2.0.0",R8=1e4,$8=1e3,Bn={connecting:0,open:1,closing:2,closed:3},xr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ii={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},ib={longpoll:"longpoll",websocket:"websocket"},I8={complete:4},ab="base64url.bearer.phx.",wf=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},nN=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},M8=class{constructor(t,e,r){this.state=xr.closed,this.topic=t,this.params=Kl(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new wf(this,ii.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new nN(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=xr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=xr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=xr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=xr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new wf(this,ii.leave,Kl({}),this.timeout).send(),this.state=xr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ii.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=xr.closed,this.bindings=[]}onClose(t){this.on(ii.close,t)}onError(t){return this.on(ii.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new wf(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=xr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ii.close,"leave")},r=new wf(this,ii.leave,Kl({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=xr.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let i=this.onMessage(t,e,r,n);if(e&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,r));for(let o=0;o<a.length;o++)a[o].callback(i,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===xr.closed}isErrored(){return this.state===xr.errored}isJoined(){return this.state===xr.joined}isJoining(){return this.state===xr.joining}isLeaving(){return this.state===xr.leaving}},ed=class{static request(t,e,r,n,i,a,o){if(zn.XDomainRequest){let u=new zn.XDomainRequest;return this.xdomainRequest(u,t,e,n,i,a,o)}else if(zn.XMLHttpRequest){let u=new zn.XMLHttpRequest;return this.xhrRequest(u,t,e,r,n,i,a,o)}else{if(zn.fetch&&zn.AbortController)return this.fetchRequest(t,e,r,n,i,a,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,i,a,o){let u={method:t,headers:r,body:n},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),u.signal=c.signal),zn.fetch(e,u).then(f=>f.text()).then(f=>this.parseJSON(f)).then(f=>o&&o(f)).catch(f=>{f.name==="AbortError"&&a?a():o&&o(null)}),c}static xdomainRequest(t,e,r,n,i,a,o){return t.timeout=i,t.open(e,r),t.onload=()=>{let u=this.parseJSON(t.responseText);o&&o(u)},a&&(t.ontimeout=a),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,i,a,o,u){t.open(e,r,!0),t.timeout=a;for(let[c,f]of Object.entries(n))t.setRequestHeader(c,f);return t.onerror=()=>u&&u(null),t.onreadystatechange=()=>{if(t.readyState===I8.complete&&u){let c=this.parseJSON(t.responseText);u(c)}},o&&(t.ontimeout=o),t.send(i),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=e?`${e}[${n}]`:n,a=t[n];typeof a=="object"?r.push(this.serialize(a,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(a))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},D8=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return btoa(e)},Ro=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(ab)&&(this.authToken=atob(e[1].slice(ab.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Bn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+ib.websocket),"$1/"+ib.longpoll)}endpointURL(){return ed.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=Bn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Bn.open||this.readyState===Bn.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:i}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:i.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Bn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=D8(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
369
- `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let i of this.reqs)i.abort();this.readyState=Bn.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,i){let a,o=()=>{this.reqs.delete(a),n()};a=ed.request(t,this.endpointURL(),e,r,this.timeout,o,u=>{this.reqs.delete(a),this.isActive()&&i(u)}),this.reqs.add(a)}},L8=class Ul{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:a,onLeave:o,onSync:u}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Ul.syncState(this.state,i,a,o),this.pendingDiffs.forEach(c=>{this.state=Ul.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],u()}),this.channel.on(n.diff,i=>{let{onJoin:a,onLeave:o,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Ul.syncDiff(this.state,i,a,o),u())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Ul.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,i){let a=this.clone(e),o={},u={};return this.map(a,(c,f)=>{r[c]||(u[c]=f)}),this.map(r,(c,f)=>{let p=a[c];if(p){let h=f.metas.map(_=>_.phx_ref),g=p.metas.map(_=>_.phx_ref),y=f.metas.filter(_=>g.indexOf(_.phx_ref)<0),w=p.metas.filter(_=>h.indexOf(_.phx_ref)<0);y.length>0&&(o[c]=f,o[c].metas=y),w.length>0&&(u[c]=this.clone(p),u[c].metas=w)}else o[c]=f}),this.syncDiff(a,{joins:o,leaves:u},n,i)}static syncDiff(e,r,n,i){let{joins:a,leaves:o}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(a,(u,c)=>{let f=e[u];if(e[u]=this.clone(c),f){let p=e[u].metas.map(g=>g.phx_ref),h=f.metas.filter(g=>p.indexOf(g.phx_ref)<0);e[u].metas.unshift(...h)}n(u,f,c)}),this.map(o,(u,c)=>{let f=e[u];if(!f)return;let p=c.metas.map(h=>h.phx_ref);f.metas=f.metas.filter(h=>p.indexOf(h.phx_ref)<0),i(u,f,c),f.metas.length===0&&delete e[u]}),e}static list(e,r){return r||(r=function(n,i){return i}),this.map(e,(n,i)=>r(n,i))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},_f={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,i,a,o]=JSON.parse(t);return e({join_ref:r,ref:n,topic:i,event:a,payload:o})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:i,payload:a}=t,o=this.META_LENGTH+e.length+r.length+i.length+n.length,u=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(u),f=0;c.setUint8(f++,this.KINDS.push),c.setUint8(f++,e.length),c.setUint8(f++,r.length),c.setUint8(f++,i.length),c.setUint8(f++,n.length),Array.from(e,h=>c.setUint8(f++,h.charCodeAt(0))),Array.from(r,h=>c.setUint8(f++,h.charCodeAt(0))),Array.from(i,h=>c.setUint8(f++,h.charCodeAt(0))),Array.from(n,h=>c.setUint8(f++,h.charCodeAt(0)));var p=new Uint8Array(u.byteLength+a.byteLength);return p.set(new Uint8Array(u),0),p.set(new Uint8Array(a),u.byteLength),p.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,u=r.decode(t.slice(o,o+n));o=o+n;let c=r.decode(t.slice(o,o+i));o=o+i;let f=r.decode(t.slice(o,o+a));o=o+a;let p=t.slice(o,t.byteLength);return{join_ref:u,ref:null,topic:c,event:f,payload:p}},decodeReply(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=e.getUint8(4),u=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(t.slice(u,u+n));u=u+n;let f=r.decode(t.slice(u,u+i));u=u+i;let p=r.decode(t.slice(u,u+a));u=u+a;let h=r.decode(t.slice(u,u+o));u=u+o;let g=t.slice(u,t.byteLength),y={status:h,response:g};return{join_ref:c,ref:f,topic:p,event:ii.reply,payload:y}},decodeBroadcast(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=this.HEADER_LENGTH+2,o=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+i));a=a+i;let c=t.slice(a,t.byteLength);return{join_ref:null,ref:null,topic:o,event:u,payload:c}}},z8=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||R8,this.transport=e.transport||zn.WebSocket||Ro,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=zn&&zn.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=_f.encode.bind(_f),this.defaultDecoder=_f.decode.bind(_f),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Ro?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Fo&&Fo.addEventListener&&(Fo.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Fo.addEventListener("pageshow",i=>{n===this.connectClock&&(n=null,this.connect())}),Fo.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=i=>e.rejoinAfterMs?e.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>e.reconnectAfterMs?e.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(i,a,o)=>{console.log(`${i}: ${a}`,o)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Kl(e.params||{}),this.endPoint=`${t}/${ib.websocket}`,this.vsn=e.vsn||N8,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new nN(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Ro}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=ed.appendParams(ed.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Kl(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ro?this.connectWithFallback(Ro,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(i=>{i.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case Ro:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${ab}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,a,o=this.transportName(t),u=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([i,a]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return u("memorized");this.fallbackTimer=setTimeout(u,e),a=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),u(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,e),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),$8,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===Bn.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(ii.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case Bn.connecting:return"connecting";case Bn.open:return"open";case Bn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new M8(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:i,join_ref:a}=t;this.log("push",`${e} ${r} (${a}, ${i})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:i,ref:a,join_ref:o}=e;if(a&&a===this.pendingHeartbeatRef){const u=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${a&&"("+a+")"||""}`.trim(),i);for(let u=0;u<this.channels.length;u++){const c=this.channels[u];c.isMember(r,n,i,o)&&c.trigger(n,i,a,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class Gl{constructor(e,r){const n=q8(r);this.presence=new L8(e.getChannel(),n),this.presence.onJoin((i,a,o)=>{const u=Gl.onJoinPayload(i,a,o);e.getChannel().trigger("presence",u)}),this.presence.onLeave((i,a,o)=>{const u=Gl.onLeavePayload(i,a,o);e.getChannel().trigger("presence",u)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Gl.transformState(this.presence.state)}static transformState(e){return e=B8(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return r[n]=Wf(i),r},{})}static onJoinPayload(e,r,n){const i=jk(r),a=Wf(n);return{event:"join",key:e,currentPresences:i,newPresences:a}}static onLeavePayload(e,r,n){const i=jk(r),a=Wf(n);return{event:"leave",key:e,currentPresences:i,leftPresences:a}}}function Wf(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function B8(t){return JSON.parse(JSON.stringify(t))}function q8(t){return(t==null?void 0:t.events)&&{events:t.events}}function jk(t){return t!=null&&t.metas?Wf(t):[]}var Pk;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Pk||(Pk={}));class U8{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new Gl(this.channel.channelAdapter,r)}}function F8(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class H8{constructor(e,r,n){const i=W8(n);this.channel=e.getSocket().channel(r,i),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let i;try{i=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>S8){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return i}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===Qi.joined}isJoined(){return this.state===Qi.joined}isJoining(){return this.state===Qi.joining}isClosed(){return this.state===Qi.closed}isLeaving(){return this.state===Qi.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function W8(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Ck;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Ck||(Ck={}));var Vo;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Vo||(Vo={}));var ai;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(ai||(ai={}));class Xl{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var i,a;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new H8(this.socket.socketAdapter,e,this.params),this.presence=new U8(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=rN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,i,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:u,private:c}}=this.params,f=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(y=>y.filter))!==null&&i!==void 0?i:[],p=!!this.bindings[Vo.PRESENCE]&&this.bindings[Vo.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},g={broadcast:o,presence:Object.assign(Object.assign({},u),{enabled:p}),postgres_changes:f,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(y=>{e==null||e(ai.CHANNEL_ERROR,F8(y))}),this._onClose(()=>e==null?void 0:e(ai.CLOSED)),this.updateJoinPayload(Object.assign({config:g},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:y})=>{if(this.socket._isManualToken()||this.socket.setAuth(),y===void 0){e==null||e(ai.SUBSCRIBED);return}this._updatePostgresBindings(y,e)}).receive("error",y=>{this.state=Qi.errored;const w=Object.values(y).join(", ")||"error";e==null||e(ai.CHANNEL_ERROR,new Error(w,{cause:y}))}).receive("timeout",()=>{e==null||e(ai.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const i=this.bindings.postgres_changes,a=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,o=[];for(let u=0;u<a;u++){const c=i[u],{filter:{event:f,schema:p,table:h,filter:g}}=c,y=e&&e[u];if(y&&y.event===f&&Xl.isFilterValueEqual(y.schema,p)&&Xl.isFilterValueEqual(y.table,h)&&Xl.isFilterValueEqual(y.filter,g))o.push(Object.assign(Object.assign({},c),{id:y.id}));else{this.unsubscribe(),this.state=Qi.errored,r==null||r(ai.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Qi.errored&&r&&r(ai.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=e===Vo.PRESENCE||e===Vo.POSTGRES_CHANGES;if(i&&a)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var i;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},u=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(u.status===202)return{success:!0};let c=u.statusText;try{const f=await u.json();c=f.error||f.message||c}catch{}return Promise.reject(new Error(c))}async send(e,r={}){var n,i;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=e,u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const f=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=f.body)===null||i===void 0?void 0:i.cancel()),f.ok?"ok":"error"}catch(f){return f instanceof Error&&f.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,u,c;const f=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(u=(o=this.params)===null||o===void 0?void 0:o.config)===null||u===void 0?void 0:u.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),f.receive("ok",()=>a("ok")),f.receive("error",()=>a("error")),f.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(a),o}_on(e,r,n){const i=e.toLocaleLowerCase(),a=this.channelAdapter.on(e,n),o={type:i,filter:r,callback:n,ref:a};return this.bindings[i]?this.bindings[i].push(o):this.bindings[i]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var i,a,o,u,c,f,p;const h=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,n))return!1;const g=(i=this.bindings[h])===null||i===void 0?void 0:i.find(y=>y.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in g){const y=g.id,w=(a=g.filter)===null||a===void 0?void 0:a.event;return y&&((o=r.ids)===null||o===void 0?void 0:o.includes(y))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((u=r.data)===null||u===void 0?void 0:u.type.toLocaleLowerCase()))}else{const y=(f=(c=g==null?void 0:g.filter)===null||c===void 0?void 0:c.event)===null||f===void 0?void 0:f.toLocaleLowerCase();return y==="*"||y===((p=r==null?void 0:r.event)===null||p===void 0?void 0:p.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===h})}_notThisChannelEvent(e,r){const{close:n,error:i,leave:a,join:o}=eN;return r&&[n,i,a,o].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:a,table:o,commit_timestamp:u,type:c,errors:f}=i;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:u,eventType:c,new:{},old:{},errors:f}),this._getPayloadRecords(i))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Tk(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Tk(e.columns,e.old_record)),r}}class V8{constructor(e,r){this.socket=new z8(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,i=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),i),this.socket.disconnect(()=>{e(),a("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==rb.connecting}isDisconnecting(){return this.socket.connectionState()==rb.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Nk={HEARTBEAT_INTERVAL:25e3},K8=[1e3,2e3,5e3,1e4],G8=1e4;function X8(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function Y8(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return X8()}const J8=`
370
- addEventListener("message", (e) => {
371
- if (e.data.event === "start") {
372
- setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
373
- }
374
- });`;class Q8{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new k8,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new V8(e,i),this.httpEndpoint=rN(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
375
-
376
- To use Realtime in Node.js, you need to provide a WebSocket implementation:
377
-
378
- Option 1: Use Node.js 22+ which has native WebSocket support
379
- Option 2: Install and provide the "ws" package:
380
-
381
- npm install ws
382
-
383
- import ws from "ws"
384
- const client = new RealtimeClient(url, {
385
- ...options,
386
- transport: ws
387
- })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||rb.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new Xl(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(a),a}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const a={access_token:r,version:b8};r&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(eN.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([J8],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,i,a,o,u,c,f,p,h,g,y;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const w={};w.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:_8,w.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:Nk.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((u=e==null?void 0:e.heartbeatIntervalMs)!==null&&u!==void 0?u:Nk.HEARTBEAT_INTERVAL),w.transport=(c=e==null?void 0:e.transport)!==null&&c!==void 0?c:y8.getWebSocketConstructor(),w.params=e==null?void 0:e.params,w.logger=e==null?void 0:e.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),w.sessionStorage=(f=e==null?void 0:e.sessionStorage)!==null&&f!==void 0?f:Y8(),w.reconnectAfterMs=(p=e==null?void 0:e.reconnectAfterMs)!==null&&p!==void 0?p:(O=>K8[O-1]||G8);let _,b;const k=(h=e==null?void 0:e.vsn)!==null&&h!==void 0?h:w8;switch(k){case x8:_=(O,A)=>A(JSON.stringify(O)),b=(O,A)=>A(JSON.parse(O));break;case ZC:_=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=k,w.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:_,w.decode=(y=e==null?void 0:e.decode)!==null&&y!==void 0?y:b,w.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var nu=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Z8(t,e,r){const n=new URL(e,t);if(r)for(const[i,a]of Object.entries(r))a!==void 0&&n.searchParams.set(i,a);return n.toString()}async function e6(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function t6(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const u=Z8(t.baseUrl,n,i),c=await e6(t.auth),f=await e(u,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),p=await f.text(),h=(f.headers.get("content-type")||"").includes("application/json"),g=h&&p?JSON.parse(p):p;if(!f.ok){const y=h?g:void 0,w=y==null?void 0:y.error;throw new nu((w==null?void 0:w.message)??`Request failed with status ${f.status}`,{status:f.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:y})}return{status:f.status,headers:f.headers,data:g}}}}function Sf(t){return t.join("")}var r6=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Sf(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Sf(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Sf(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Sf(t.namespace)}`}),!0}catch(e){if(e instanceof nu&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof nu&&r.status===409)return;throw r}}};function $o(t){return t.join("")}var n6=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${$o(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof nu&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof nu&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},i6=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=t6({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new r6(this.client,e),this.tableOps=new n6(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function iu(t){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iu(t)}function a6(t,e){if(iu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function o6(t){var e=a6(t,"string");return iu(e)=="symbol"?e:e+""}function s6(t,e,r){return(e=o6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function je(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Rk(Object(r),!0).forEach(function(n){s6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var hh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ph(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var ob=class extends hh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return je({},super.toJSON())}},iN=class extends hh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function td(t,e,r){const n=je({},t),i=e.toLowerCase();for(const a of Object.keys(n))a.toLowerCase()===i&&delete n[a];return n[i]=r,n}function l6(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const u6=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),c6=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},sb=t=>{if(Array.isArray(t))return t.map(r=>sb(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));e[i]=sb(n)}),e},f6=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),$k=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},d6=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const i=t;let a=parseInt(String(i.status),10);Number.isFinite(a)||(a=500),i.json().then(o=>{const u=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";e(new ob($k(o),a,u,n))}).catch(()=>{const o=a+"";e(new ob(i.statusText||`HTTP ${a} error`,a,o,n))})}else e(new iN($k(t),t,n))},h6=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return je(je({},i),r);if(c6(n)){var a;const o=(e==null?void 0:e.headers)||{};let u;for(const[c,f]of Object.entries(o))c.toLowerCase()==="content-type"&&(u=f);i.headers=td(o,"Content-Type",(a=u)!==null&&a!==void 0?a:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return e!=null&&e.duplex&&(i.duplex=e.duplex),je(je({},i),r)};async function jl(t,e,r,n,i,a,o){return new Promise((u,c)=>{t(r,h6(e,n,i,a)).then(f=>{if(!f.ok)throw f;if(n!=null&&n.noResolveJson)return f;if(o==="vectors"){const p=f.headers.get("content-type");if(f.headers.get("content-length")==="0"||f.status===204)return{};if(!p||!p.includes("application/json"))return{}}return f.json()}).then(f=>u(f)).catch(f=>d6(f,c,n,o))})}function aN(t="storage"){return{get:async(e,r,n,i)=>jl(e,"GET",r,n,i,void 0,t),post:async(e,r,n,i,a)=>jl(e,"POST",r,i,a,n,t),put:async(e,r,n,i,a)=>jl(e,"PUT",r,i,a,n,t),head:async(e,r,n,i)=>jl(e,"HEAD",r,je(je({},n),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,r,n,i,a)=>jl(e,"DELETE",r,i,a,n,t)}}const p6=aN("storage"),{get:au,post:gn,put:lb,head:m6,remove:lw}=p6,$r=aN("vectors");var js=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=l6(e),this.fetch=u6(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=td(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(ph(r))return{data:null,error:r};throw r}}};let oN;oN=Symbol.toStringTag;var g6=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[oN]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ph(e))return{data:null,error:e};throw e}}};let sN;sN=Symbol.toStringTag;var y6=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[sN]="BlobDownloadBuilder",this.promise=null}asStream(){return new g6(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ph(e))return{data:null,error:e};throw e}}};const v6={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ik={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var b6=class extends js{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var i=this;return i.handleOperation(async()=>{let a;const o=je(je({},Ik),n);let u=je(je({},i.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",i.encodeMetadata(c)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(c))):(a=r,u["cache-control"]=`max-age=${o.cacheControl}`,u["content-type"]=o.contentType,c&&(u["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers)for(const[g,y]of Object.entries(n.headers))u=td(u,g,y);const f=i._removeEmptyFolders(e),p=i._getFinalPath(f),h=await(t=="PUT"?lb:gn)(i.fetch,`${i.url}/object/${p}`,a,je({headers:u},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:f,id:h.Id,fullPath:h.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var i=this;const a=i._removeEmptyFolders(t),o=i._getFinalPath(a),u=new URL(i.url+`/object/upload/sign/${o}`);return u.searchParams.set("token",e),i.handleOperation(async()=>{let c;const f=je(je({},Ik),n);let p=je(je({},i.headers),{"x-upsert":String(f.upsert)});const h=f.metadata;if(typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",f.cacheControl),h&&c.append("metadata",i.encodeMetadata(h)),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.has("cacheControl")||c.append("cacheControl",f.cacheControl),h&&!c.has("metadata")&&c.append("metadata",i.encodeMetadata(h))):(c=r,p["cache-control"]=`max-age=${f.cacheControl}`,p["content-type"]=f.contentType,h&&(p["x-metadata"]=i.toBase64(i.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!f.duplex&&(f.duplex="half")),n!=null&&n.headers)for(const[g,y]of Object.entries(n.headers))p=td(p,g,y);return{path:a,fullPath:(await lb(i.fetch,u.toString(),c,je({headers:p},f!=null&&f.duplex?{duplex:f.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const i=je({},r.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const a=await gn(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),u=o.searchParams.get("token");if(!u)throw new hh("No token returned by API");return{signedUrl:o.toString(),path:t,token:u}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await gn(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await gn(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(t);const a=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await gn(n.fetch,`${n.url}/object/sign/${i}`,je({expiresIn:e},a?{transform:r.transform}:{}),{headers:n.headers});const u=new URLSearchParams;r!=null&&r.download&&u.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&u.set("cacheNonce",String(r.cacheNonce));const c=u.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const i=await gn(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const o=a.toString();return i.map(u=>je(je({},u),{},{signedUrl:u.signedURL?encodeURI(`${n.url}${u.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(i,e.transform),(e==null?void 0:e.cacheNonce)!=null&&i.set("cacheNonce",String(e.cacheNonce));const a=i.toString(),o=this._getFinalPath(t),u=()=>au(this.fetch,`${this.url}/${n}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new y6(u,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>sb(await au(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await m6(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;if(ph(i)){var n;const a=i instanceof ob?i.status:i instanceof iN?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:i}}throw i}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const i=n.toString(),a=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}`)+(i?`?${i}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await lw(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const i=je(je(je({},v6),e),{},{prefix:t||""});return await gn(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=je({},t);return await gn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const x6="2.106.2",Ku={"X-Client-Info":`storage-js/${x6}`};var w6=class extends js{constructor(t,e={},r,n){const i=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=je(je({},Ku),e);super(a,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await au(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await au(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await gn(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await lb(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await gn(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await lw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},_6=class extends js{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=je(je({},Ku),e);super(n,i,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await gn(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),i=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await au(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await lw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!f6(t))throw new hh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new i6({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...u)=>{try{return{data:await o.apply(i,u),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},S6=class extends js{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=je(je({},Ku),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await $r.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await $r.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},k6=class extends js{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=je(je({},Ku),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},E6=class extends js{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=je(je({},Ku),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await $r.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},O6=class extends E6{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new A6(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},A6=class extends S6{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new T6(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},T6=class extends k6{constructor(t,e,r,n,i){super(t,e,i),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,je(je({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},j6=class extends w6{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new b6(this.url,this.headers,t,this.fetch)}get vectors(){return new O6(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new _6(this.url+"/iceberg",this.headers,this.fetch)}};const lN="2.106.2",Ho=30*1e3,ub=3,zm=ub*Ho,P6="http://localhost:9999",C6="supabase.auth.token",N6={"X-Client-Info":`gotrue-js/${lN}`},cb="X-Supabase-Api-Version",uN={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},R6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,$6=600*1e3;class rs extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function he(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class I6 extends rs{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function M6(t){return he(t)&&t.name==="AuthApiError"}class _n extends rs{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class xi extends rs{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class Ft extends xi{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function kf(t){return he(t)&&t.name==="AuthSessionMissingError"}class Io extends xi{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ef extends xi{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Of extends xi{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function D6(t){return he(t)&&t.name==="AuthImplicitGrantRedirectError"}class Mk extends xi{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class L6 extends xi{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class fb extends xi{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Bm(t){return he(t)&&t.name==="AuthRetryableFetchError"}class Dk extends xi{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class db extends xi{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const rd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Lk=`
388
- \r=`.split(""),z6=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Lk.length;e+=1)t[Lk[e].charCodeAt(0)]=-2;for(let e=0;e<rd.length;e+=1)t[rd[e].charCodeAt(0)]=e;return t})();function zk(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(rd[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(rd[n]),e.queuedBits-=6}}function cN(t,e,r){const n=z6[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function Bk(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{U6(o,n,r)};for(let o=0;o<t.length;o+=1)cN(t.charCodeAt(o),i,a);return e.join("")}function B6(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function q6(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}B6(n,e)}}function U6(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if((t>>7-n&1)===0){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Yo(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)cN(t.charCodeAt(i),r,n);return new Uint8Array(e)}function F6(t){const e=[];return q6(t,r=>e.push(r)),new Uint8Array(e)}function qa(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>zk(i,r,n)),zk(null,r,n),e.join("")}function H6(t){return Math.round(Date.now()/1e3)+t}function W6(){return Symbol("auth-callback")}const Yt=()=>typeof window<"u"&&typeof document<"u",$a={tested:!1,writable:!1},fN=()=>{if(!Yt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if($a.tested)return $a.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),$a.tested=!0,$a.writable=!0}catch{$a.tested=!0,$a.writable=!1}return $a.writable};function V6(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,a)=>{e[a]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}const dN=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),K6=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Wo=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Ia=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},Xt=async(t,e)=>{await t.removeItem(e)};class mh{constructor(){this.promise=new mh.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}mh.promiseConstructor=Promise;function Af(t){const e=t.split(".");if(e.length!==3)throw new db("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!R6.test(e[n]))throw new db("JWT not in base64url format");return{header:JSON.parse(Bk(e[0])),payload:JSON.parse(Bk(e[1])),signature:Yo(e[2]),raw:{header:e[0],payload:e[1]}}}async function G6(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function X6(t,e){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await t(a);if(!e(a,null,o)){n(o);return}}catch(o){if(!e(a,o)){i(o);return}}})()})}function Y6(t){return("0"+t.toString(16)).substr(-2)}function J6(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let a=0;a<56;a++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,Y6).join("")}async function Q6(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function Z6(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await Q6(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Mo(t,e,r=!1){const n=J6();let i=n;r&&(i+="/recovery"),await Wo(t,`${e}-code-verifier`,i);const a=await Z6(n);return[a,n===a?"plain":"s256"]}const eB=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function tB(t){const e=t.headers.get(cb);if(!e||!e.match(eB))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function rB(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function nB(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const iB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ri(t){if(!iB.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function mn(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function qm(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function aB(t,e){return new Proxy(t,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,i)}})}function qk(t){return JSON.parse(JSON.stringify(t))}const Da=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},oB=[502,503,504,520,521,522,523,524,530];async function Uk(t){var e;if(!K6(t))throw new fb(Da(t),0);if(oB.includes(t.status))throw new fb(Da(t),t.status);let r;try{r=await t.json()}catch(a){throw new _n(Da(a),a)}let n;const i=tB(t);if(i&&i.getTime()>=uN["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Dk(Da(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Ft}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new Dk(Da(r),t.status,r.weak_password.reasons);throw new I6(Da(r),t.status||500,n)}const sB=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function we(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[cb]||(a[cb]=uN["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const u=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await lB(t,e,r+u,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function lB(t,e,r,n,i,a){const o=sB(e,n,i,a);let u;try{u=await t(r,Object.assign({},o))}catch(c){throw console.error(c),new fb(Da(c),0)}if(u.ok||await Uk(u),n!=null&&n.noResolveJson)return u;try{return await u.json()}catch(c){await Uk(c)}}function Qr(t){var e;let r=null;fB(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=H6(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function Fk(t){const e=Qr(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Zi(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function uB(t){return{data:t,error:null}}function cB(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=dh(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},c=Object.assign({},o);return{data:{properties:u,user:c},error:null}}function Hk(t){return t}function fB(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Um=["global","local","others"];class dB{_encodePathSegment(e){if(e==="."||e==="..")throw new rs("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:r={},fetch:n,experimental:i}){this.url=e,this.headers=r,this.fetch=dN(n),this.experimental=i??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Um[0]){if(Um.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Um.join(", ")}`);try{return await we(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(he(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await we(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Zi})}catch(n){if(he(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=dh(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await we(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:cB,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(he(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await we(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Zi})}catch(r){if(he(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,u,c;try{const f={nextPage:null,lastPage:0,total:0},p=await we(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:Hk});if(p.error)throw p.error;const h=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,y=(c=(u=p.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return y.length>0&&(y.forEach(w=>{const _=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);f[`${b}Page`]=_}),f.total=parseInt(g)),{data:Object.assign(Object.assign({},h),f),error:null}}catch(f){if(he(f))return{data:{users:[]},error:f};throw f}}async getUserById(e){ri(e);try{return await we(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Zi})}catch(r){if(he(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){ri(e);try{return await we(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Zi})}catch(n){if(he(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){ri(e);try{return await we(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Zi})}catch(n){if(he(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){ri(e.userId);try{const{data:r,error:n}=await we(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(he(r))return{data:null,error:r};throw r}}async _deleteFactor(e){ri(e.userId),ri(e.id);try{return{data:await we(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(he(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,u,c;try{const f={nextPage:null,lastPage:0,total:0},p=await we(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:Hk});if(p.error)throw p.error;const h=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,y=(c=(u=p.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return y.length>0&&(y.forEach(w=>{const _=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);f[`${b}Page`]=_}),f.total=parseInt(g)),{data:Object.assign(Object.assign({},h),f),error:null}}catch(f){if(he(f))return{data:{clients:[]},error:f};throw f}}async _createOAuthClient(e){try{return await we(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{const r=this._encodePathSegment(e);return await we(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{const n=this._encodePathSegment(e);return await we(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(he(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{const r=this._encodePathSegment(e);return await we(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(he(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{const r=this._encodePathSegment(e);return await we(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await we(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(he(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await we(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{const r=this._encodePathSegment(e);return await we(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{const n=this._encodePathSegment(e);return await we(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(he(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{const r=this._encodePathSegment(e);return await we(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(he(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){mn(this.experimental),ri(e.userId);try{return await we(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(he(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){mn(this.experimental),ri(e.userId),ri(e.passkeyId);try{return await we(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(he(r))return{data:null,error:r};throw r}}}function Wk(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Dn={debug:!!(globalThis&&fN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class hN extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Vk extends hN{}async function hB(t,e,r){Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{n.abort(),Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){clearTimeout(i),Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await r()}finally{Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new Vk(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Dn.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(a){if(e>0&&clearTimeout(i),a!==null&&typeof a=="object"&&"name"in a&&a.name==="AbortError"&&e>0){if(n.signal.aborted)return Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new Vk(`Lock "${t}" was released because another request stole it`)}throw a}}function pB(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function pN(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function mB(t){return parseInt(t,16)}function gB(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function yB(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:u,requestId:c,resources:f,scheme:p,uri:h,version:g}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(g!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${g}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
389
- `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const y=pN(t.address),w=p?`${p}://${n}`:n,_=t.statement?`${t.statement}
390
- `:"",b=`${w} wants you to sign in with your Ethereum account:
391
- ${y}
392
-
393
- ${_}`;let k=`URI: ${h}
394
- Version: ${g}
395
- Chain ID: ${r}${o?`
396
- Nonce: ${o}`:""}
397
- Issued At: ${a.toISOString()}`;if(i&&(k+=`
398
- Expiration Time: ${i.toISOString()}`),u&&(k+=`
399
- Not Before: ${u.toISOString()}`),c&&(k+=`
400
- Request ID: ${c}`),f){let O=`
401
- Resources:`;for(const A of f){if(!A||typeof A!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${A}`);O+=`
402
- - ${A}`}k+=O}return`${b}
403
- ${k}`}class jt extends Error{constructor({message:e,code:r,cause:n,name:i}){var a;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=i??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class nd extends jt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function vB({error:t,options:e}){var r,n,i;const{publicKey:a}=e;if(!a)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new jt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new jt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new jt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new jt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new jt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new jt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new jt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new jt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(mN(o)){if(a.rp.id!==o)return new jt({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new jt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new jt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new jt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new jt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function bB({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new jt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new jt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(mN(n)){if(r.rpId!==n)return new jt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new jt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new jt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new jt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class xB{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const hb=new xB;function Kk(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,i=dh(t,["challenge","user","excludeCredentials"]),a=Yo(e).buffer,o=Object.assign(Object.assign({},r),{id:Yo(r.id).buffer}),u=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){u.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const f=n[c];u.excludeCredentials[c]=Object.assign(Object.assign({},f),{id:Yo(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return u}function Gk(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=dh(t,["challenge","allowCredentials"]),i=Yo(e).buffer,a=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const u=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},u),{id:Yo(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function Xk(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:qa(new Uint8Array(t.response.attestationObject)),clientDataJSON:qa(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Yk(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:qa(new Uint8Array(i.authenticatorData)),clientDataJSON:qa(new Uint8Array(i.clientDataJSON)),signature:qa(new Uint8Array(i.signature)),userHandle:i.userHandle?qa(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function mN(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function id(){var t,e;return!!(Yt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function gN(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new nd("Browser returned unexpected credential type",e)}:{data:null,error:new nd("Empty credential response",e)}}catch(e){return{data:null,error:vB({error:e,options:t})}}}async function yN(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new nd("Browser returned unexpected credential type",e)}:{data:null,error:new nd("Empty credential response",e)}}catch(e){return{data:null,error:bB({error:e,options:t})}}}const wB={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},_B={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ad(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of t)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(e(o)){const u=n[a];e(u)?n[a]=ad(u,o):n[a]=ad(o)}else n[a]=o}return n}function SB(t,e){return ad(wB,t,e||{})}function kB(t,e){return ad(_B,t,e||{})}class EB{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:i},a){var o;try{const{data:u,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!u)return{data:null,error:c};const f=i??hb.createNewAbortSignal();if(u.webauthn.type==="create"){const{user:p}=u.webauthn.credential_options.publicKey;if(!p.name){const h=n;if(h)p.name=`${p.id}:${h}`;else{const y=(await this.client.getUser()).data.user,w=((o=y==null?void 0:y.user_metadata)===null||o===void 0?void 0:o.name)||(y==null?void 0:y.email)||(y==null?void 0:y.id)||"User";p.name=`${p.id}:${w}`}}p.displayName||(p.displayName=p.name)}switch(u.webauthn.type){case"create":{const p=SB(u.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:h,error:g}=await gN({publicKey:p,signal:f});return h?{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:h}},error:null}:{data:null,error:g}}case"request":{const p=kB(u.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:h,error:g}=await yN(Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:p,signal:f}));return h?{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:h}},error:null}:{data:null,error:g}}}}catch(u){return he(u)?{data:null,error:u}:{data:null,error:new _n("Unexpected error in challenge",u)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new rs("rpId is required for WebAuthn authentication")};try{if(!id())return{data:null,error:new _n("Browser does not support WebAuthn",null)};const{data:o,error:u}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:u};const{webauthn:c}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return he(o)?{data:null,error:o}:{data:null,error:new _n("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new rs("rpId is required for WebAuthn registration")};try{if(!id())return{data:null,error:new _n("Browser does not support WebAuthn",null)};const{data:o,error:u}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(p=>{var h;return(h=p.data)===null||h===void 0?void 0:h.all.find(g=>g.factor_type==="webauthn"&&g.friendly_name===e&&g.status!=="unverified")}).then(p=>p?this.client.mfa.unenroll({factorId:p==null?void 0:p.id}):void 0),{data:null,error:u};const{data:c,error:f}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:f}}catch(o){return he(o)?{data:null,error:o}:{data:null,error:new _n("Unexpected error in register",o)}}}}pB();const OB={url:P6,storageKey:C6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:N6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function Jk(t,e,r){return await r()}const Do={};class ou{get jwks(){var e,r;return(r=(e=Do[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Do[this.storageKey]=Object.assign(Object.assign({},Do[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Do[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Do[this.storageKey]=Object.assign(Object.assign({},Do[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,i,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},OB),e);if(this.storageKey=o.storageKey,this.instanceID=(r=ou.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,ou.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Yt()){const u=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(u),this.logDebugMessages&&console.trace(u)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new dB({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=dN(o.fetch),this.lock=o.lock||Jk,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&Yt()&&(!((i=globalThis==null?void 0:globalThis.navigator)===null||i===void 0)&&i.locks)?this.lock=hB:this.lock=Jk,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new EB(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:fN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Wk(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Wk(this.memoryStorage)),Yt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(u){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",u)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async u=>{this._debug("received broadcast notification from other tab or client",u);try{await this._notifyAllSubscribers(u.data.event,u.data.session,!1)}catch(c){this._debug("#broadcastChannel","error",c)}})}o.skipAutoInitialize||this.initialize().catch(u=>{this._debug("#initialize()","error",u)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${lN}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Yt()&&(r=V6(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Yt()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),D6(a)){const c=(e=a.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:u}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",u),await this._saveSession(o),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return he(r)?this._returnResult({error:r}):this._returnResult({error:new _n("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await we(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:Qr}),{data:o,error:u}=a;if(u||!o)return this._returnResult({data:{user:null,session:null},error:u});const c=o.session,f=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:f,session:c},error:null})}catch(a){if(he(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(e){var r,n,i;try{let a;if("email"in e){const{email:p,password:h,options:g}=e;let y=null,w=null;this.flowType==="pkce"&&([y,w]=await Mo(this.storage,this.storageKey)),a=await we(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:p,password:h,data:(r=g==null?void 0:g.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken},code_challenge:y,code_challenge_method:w},xform:Qr})}else if("phone"in e){const{phone:p,password:h,options:g}=e;a=await we(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:h,data:(n=g==null?void 0:g.data)!==null&&n!==void 0?n:{},channel:(i=g==null?void 0:g.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken}},xform:Qr})}else throw new Ef("You must provide either an email or phone number and a password");const{data:o,error:u}=a;if(u||!o)return await Xt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:u});const c=o.session,f=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:f,session:c},error:null})}catch(a){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(e){try{let r;if("email"in e){const{email:a,password:o,options:u}=e;r=await we(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:Fk})}else if("phone"in e){const{phone:a,password:o,options:u}=e;r=await we(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:Fk})}else throw new Ef("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const a=new Io;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(he(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,i,a;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=e.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,i,a,o,u,c,f,p,h,g;let y,w;if("message"in e)y=e.message,w=e.signature;else{const{chain:_,wallet:b,statement:k,options:O}=e;let A;if(Yt())if(typeof b=="object")A=b;else{const D=window;if("ethereum"in D&&typeof D.ethereum=="object"&&"request"in D.ethereum&&typeof D.ethereum.request=="function")A=D.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=b}const j=new URL((r=O==null?void 0:O.url)!==null&&r!==void 0?r:window.location.href),E=await A.request({method:"eth_requestAccounts"}).then(D=>D).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=pN(E[0]);let C=(n=O==null?void 0:O.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!C){const D=await A.request({method:"eth_chainId"});C=mB(D)}const R={domain:j.host,address:T,statement:k,uri:j.href,version:"1",chainId:C,nonce:(i=O==null?void 0:O.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=O==null?void 0:O.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(u=O==null?void 0:O.signInWithEthereum)===null||u===void 0?void 0:u.expirationTime,notBefore:(c=O==null?void 0:O.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(f=O==null?void 0:O.signInWithEthereum)===null||f===void 0?void 0:f.requestId,resources:(p=O==null?void 0:O.signInWithEthereum)===null||p===void 0?void 0:p.resources};y=yB(R),w=await A.request({method:"personal_sign",params:[gB(y),T]})}try{const{data:_,error:b}=await we(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:y,signature:w},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:Qr});if(b)throw b;if(!_||!_.session||!_.user){const k=new Io;return this._returnResult({data:{user:null,session:null},error:k})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:b})}catch(_){if(he(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async signInWithSolana(e){var r,n,i,a,o,u,c,f,p,h,g,y;let w,_;if("message"in e)w=e.message,_=e.signature;else{const{chain:b,wallet:k,statement:O,options:A}=e;let j;if(Yt())if(typeof k=="object")j=k;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))j=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=k}const E=new URL((r=A==null?void 0:A.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in j&&j.signIn){const T=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},A==null?void 0:A.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),O?{statement:O}:null));let C;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")C=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)C=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)w=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),_=C.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${E.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...O?["",O,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(i=(n=A==null?void 0:A.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=A==null?void 0:A.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${A.signInWithSolana.notBefore}`]:[],...!((o=A==null?void 0:A.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${A.signInWithSolana.expirationTime}`]:[],...!((u=A==null?void 0:A.signInWithSolana)===null||u===void 0)&&u.chainId?[`Chain ID: ${A.signInWithSolana.chainId}`]:[],...!((c=A==null?void 0:A.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${A.signInWithSolana.nonce}`]:[],...!((f=A==null?void 0:A.signInWithSolana)===null||f===void 0)&&f.requestId?[`Request ID: ${A.signInWithSolana.requestId}`]:[],...!((h=(p=A==null?void 0:A.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||h===void 0)&&h.length?["Resources",...A.signInWithSolana.resources.map(C=>`- ${C}`)]:[]].join(`
404
- `);const T=await j.signMessage(new TextEncoder().encode(w),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");_=T}}try{const{data:b,error:k}=await we(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:qa(_)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:Qr});if(k)throw k;if(!b||!b.session||!b.user){const O=new Io;return this._returnResult({data:{user:null,session:null},error:O})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:k})}catch(b){if(he(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await Ia(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new L6;const{data:a,error:o}=await we(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Qr});if(await Xt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const u=new Io;return this._returnResult({data:{user:null,session:null,redirectType:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(i==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(e){try{const{options:r,provider:n,token:i,access_token:a,nonce:o}=e,u=await we(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Qr}),{data:c,error:f}=u;if(f)return this._returnResult({data:{user:null,session:null},error:f});if(!c||!c.session||!c.user){const p=new Io;return this._returnResult({data:{user:null,session:null},error:p})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:f})}catch(r){if(he(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,a,o;try{if("email"in e){const{email:u,options:c}=e;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await Mo(this.storage,this.storageKey));const{error:h}=await we(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:f,code_challenge_method:p},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:u,options:c}=e,{data:f,error:p}=await we(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:f==null?void 0:f.message_id},error:p})}throw new Ef("You must provide either an email or phone number.")}catch(u){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async verifyOtp(e){var r,n;try{let i,a;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,a=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:u}=await we(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:Qr});if(u)throw u;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,f=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:f,session:c},error:null})}catch(i){if(he(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i,a,o;try{let u=null,c=null;this.flowType==="pkce"&&([u,c]=await Mo(this.storage,this.storageKey));const f=await we(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:u,code_challenge_method:c}),headers:this.headers,xform:uB});return!((a=f.data)===null||a===void 0)&&a.url&&Yt()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(f.data.url),this._returnResult(f)}catch(u){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(u))return this._returnResult({data:null,error:u});throw u}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Ft;const{error:i}=await we(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(he(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:i,options:a}=e,{error:o}=await we(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:i,options:a}=e,{data:o,error:u}=await we(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:u})}throw new Ef("You must provide either an email or phone number and a type")}catch(r){if(he(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await Ia(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<zm:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Ia(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=qm()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=aB(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await we(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Zi}):await this._useSession(async r=>{var n,i,a;const{data:o,error:u}=r;if(u)throw u;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ft}:await we(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Zi})})}catch(r){if(he(r))return kf(r)&&(await this._removeSession(),await Xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new Ft;const o=i.session;let u=null,c=null;this.flowType==="pkce"&&e.email!=null&&([u,c]=await Mo(this.storage,this.storageKey));const{data:f,error:p}=await we(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:u,code_challenge_method:c}),jwt:o.access_token,xform:Zi});if(p)throw p;return o.user=f.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Ft;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=Af(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:u,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u)return{data:{user:null,session:null},error:null};a=u}else{const{data:u,error:c}=await this._getUser(e.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});a={access_token:e.access_token,refresh_token:e.refresh_token,user:u.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(he(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:u}=r;if(u)throw u;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Ft;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(he(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!Yt())throw new Of("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Of(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Mk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Of("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Mk("No code detected.");const{data:A,error:j}=await this._exchangeCodeForSession(e.code);if(j)throw j;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:A.session,redirectType:(n=A.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:i,provider_refresh_token:a,access_token:o,refresh_token:u,expires_in:c,expires_at:f,token_type:p}=e;if(!o||!c||!u||!p)throw new Of("No session defined in URL");const h=Math.round(Date.now()/1e3),g=parseInt(c);let y=h+g;f&&(y=parseInt(f));const w=y-h;w*1e3<=Ho&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${g}s`);const _=y-g;h-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,y,h):h-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,y,h);const{data:b,error:k}=await this._getUser(o);if(k)throw k;const O={provider_token:i,provider_refresh_token:a,access_token:o,expires_in:g,expires_at:y,refresh_token:u,token_type:p,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:O,redirectType:e.type},error:null})}catch(i){if(he(i))return this._returnResult({data:{session:null,redirectType:null},error:i});throw i}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Ia(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a&&!kf(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:u}=await this.admin.signOut(o,e);if(u&&!(M6(u)&&(u.status===404||u.status===401||u.status===403)||kf(u)))return this._returnResult({error:u})}return e!=="others"&&(await this._removeSession(),await Xt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=W6(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",e,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",a),kf(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await Mo(this.storage,this.storageKey,!0));try{return await we(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:i}=await this._useSession(async a=>{var o,u,c,f,p;const{data:h,error:g}=a;if(g)throw g;const y=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(u=e.options)===null||u===void 0?void 0:u.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await we(this.fetch,"GET",y,{headers:this.headers,jwt:(p=(f=h.session)===null||f===void 0?void 0:f.access_token)!==null&&p!==void 0?p:void 0})});if(i)throw i;return Yt()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(he(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:a}}=r;if(i)throw i;const{options:o,provider:u,token:c,access_token:f,nonce:p}=e,h=await we(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:u,id_token:c,access_token:f,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Qr}),{data:g,error:y}=h;return y?this._returnResult({data:{user:null,session:null},error:y}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new Io}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:y}))}catch(i){if(await Xt(this.storage,`${this.storageKey}-code-verifier`),he(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)throw o;return await we(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await X6(async i=>(i>0&&await G6(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await we(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Qr})),(i,a)=>{const o=200*Math.pow(2,i);return a&&Bm(a)&&Date.now()+o-n<Ho})}catch(n){if(this._debug(r,"error",n),he(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Yt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await Ia(this.storage,this.storageKey);if(i&&this.userStorage){let o=await Ia(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await Wo(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:qm()}else if(i&&!i.user&&!i.user){const o=await Ia(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await Xt(this.storage,this.storageKey+"-user"),await Wo(this.storage,this.storageKey,i)):i.user=qm()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const a=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<zm;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${zm}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),Bm(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:u}=await this._getUser(i.access_token);!u&&(o!=null&&o.user)?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Ft;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new mh;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new Ft;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const u={data:a.session,error:null};return this.refreshingDeferred.resolve(u),u}catch(a){if(this._debug(i,"error",a),he(a)){const o={data:null,error:a};return Bm(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(e,r)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let u=0;u<a.length;u+=1)console.error(a[u]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Xt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Wo(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=qk(i);await Wo(this.storage,this.storageKey,a)}else{const i=qk(r);await Wo(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Xt(this.storage,this.storageKey),await Xt(this.storage,this.storageKey+"-code-verifier"),await Xt(this.storage,this.storageKey+"-user"),this.userStorage&&await Xt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Yt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Ho);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-e)/Ho);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ho}ms, refresh threshold is ${ub} ticks`),i<=ub&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof hN)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Yt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await Mo(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(u.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;return a?this._returnResult({data:null,error:a}):await we(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const u=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:f}=await we(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return f?this._returnResult({data:null,error:f}):(e.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Xk(e.webauthn.credential_response):Yk(e.webauthn.credential_response)})}:{code:e.code}),{data:u,error:c}=await we(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+u.expires_in},u)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",u),this._returnResult({data:u,error:c}))})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await we(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:u}=o;if(u.type!=="webauthn")return{data:u,error:null};switch(u.webauthn.type){case"create":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:Kk(u.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:Gk(u.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,i,a;if(e)try{const{payload:y}=Af(e);let w=null;y.aal&&(w=y.aal);let _=w;const{data:{user:b},error:k}=await this.getUser(e);if(k)return this._returnResult({data:null,error:k});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(j=>j.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(_="aal2");const A=y.amr||[];return{data:{currentLevel:w,nextLevel:_,currentAuthenticationMethods:A},error:null}}catch(y){if(he(y))return this._returnResult({data:null,error:y});throw y}const{data:{session:o},error:u}=await this.getSession();if(u)return this._returnResult({data:null,error:u});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Af(o.access_token);let f=null;c.aal&&(f=c.aal);let p=f;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(y=>y.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(p="aal2");const g=c.amr||[];return{data:{currentLevel:f,nextLevel:p,currentAuthenticationMethods:g},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await we(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Ft})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Ft});const o=await we(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:u=>({data:u,error:null})});return o.data&&o.data.redirect_url&&Yt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(he(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Ft});const o=await we(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:u=>({data:u,error:null})});return o.data&&o.data.redirect_url&&Yt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(he(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await we(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Ft})})}catch(e){if(he(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await we(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ft})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(u=>u.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(u=>u.kid===e),n&&this.jwks_cached_at+$6>i)return n;const{data:a,error:o}=await we(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,n=a.keys.find(u=>u.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:y,error:w}=await this.getSession();if(w||!y.session)return this._returnResult({data:null,error:w});n=y.session.access_token}const{header:i,payload:a,signature:o,raw:{header:u,payload:c}}=Af(n);r!=null&&r.allowExpired||rB(a.exp);const f=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!f){const{error:y}=await this.getUser(n);if(y)throw y;return{data:{claims:a,header:i,signature:o},error:null}}const p=nB(i.alg),h=await crypto.subtle.importKey("jwk",f,p,!0,["verify"]);if(!await crypto.subtle.verify(p,h,o,F6(`${u}.${c}`)))throw new db("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(he(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,i;mn(this.experimental);try{if(!id())return this._returnResult({data:null,error:new _n("Browser does not support WebAuthn",null)});const{data:a,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(o||!a)return this._returnResult({data:null,error:o});const u=Gk(a.options),c=(i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&i!==void 0?i:hb.createNewAbortSignal(),{data:f,error:p}=await yN({publicKey:u,signal:c});if(p||!f)return this._returnResult({data:null,error:p??new _n("WebAuthn ceremony failed",null)});const h=Yk(f);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:h})}catch(a){if(he(a))return this._returnResult({data:null,error:a});throw a}}async registerPasskey(e){var r,n;mn(this.experimental);try{if(!id())return this._returnResult({data:null,error:new _n("Browser does not support WebAuthn",null)});const{data:i,error:a}=await this._startPasskeyRegistration();if(a||!i)return this._returnResult({data:null,error:a});const o=Kk(i.options),u=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:hb.createNewAbortSignal(),{data:c,error:f}=await gN({publicKey:o,signal:u});if(f||!c)return this._returnResult({data:null,error:f??new _n("WebAuthn ceremony failed",null)});const p=Xk(c);return this._verifyPasskeyRegistration({challengeId:i.challenge_id,credential:p})}catch(i){if(he(i))return this._returnResult({data:null,error:i});throw i}}async _startPasskeyRegistration(){mn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Ft});const{data:i,error:a}=await we(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(he(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new Ft});const{data:a,error:o}=await we(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;mn(this.experimental);try{const{data:n,error:i}=await we(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:n,error:null})}catch(n){if(he(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){mn(this.experimental);try{const{data:r,error:n}=await we(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:Qr});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){mn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Ft});const{data:i,error:a}=await we(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(he(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new Ft});const{data:a,error:o}=await we(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){mn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new Ft});const{error:a}=await we(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return a?this._returnResult({data:null,error:a}):this._returnResult({data:null,error:null})})}catch(r){if(he(r))return this._returnResult({data:null,error:r});throw r}}}ou.nextInstanceID={};const AB=ou,TB="2.106.2";let Fl="";typeof Deno<"u"?Fl="deno":typeof document<"u"?Fl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Fl="react-native":Fl="node";const jB={"X-Client-Info":`supabase-js-${Fl}/${TB}`},PB={headers:jB},CB={schema:"public"},NB={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},RB={},$B={enabled:!1,respectSamplingDecision:!0};function IB(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function u(p){try{f(n.next(p))}catch(h){o(h)}}function c(p){try{f(n.throw(p))}catch(h){o(h)}}function f(p){p.done?a(p.value):i(p.value).then(u,c)}f((n=n.apply(t,[])).next())})}let Fm=null;const MB="@opentelemetry/api";function DB(){return Fm===null&&(Fm=import(MB).catch(()=>null)),Fm}function LB(){return IB(this,void 0,void 0,function*(){try{const t=yield DB();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function zB(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,i,a]=e;if(r.length!==2||n.length!==32||i.length!==16||a.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(r)||!o.test(n)||!o.test(i)||!o.test(a)||n==="00000000000000000000000000000000"||i==="0000000000000000"?null:{version:r,traceId:n,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)===1}}function BB(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(qB(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function qB(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function UB(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function su(t){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},su(t)}function FB(t,e){if(su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function HB(t){var e=FB(t,"string");return su(e)=="symbol"?e:e+""}function WB(t,e,r){return(e=HB(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qk(Object(r),!0).forEach(function(n){WB(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const VB=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),KB=()=>Headers,GB=(t,e,r,n,i)=>{const a=VB(n),o=KB(),u=(i==null?void 0:i.enabled)===!0,c=(i==null?void 0:i.respectSamplingDecision)!==!1,f=u?UB(e):null;return async(p,h)=>{var g;const y=(g=await r())!==null&&g!==void 0?g:t;let w=new o(h==null?void 0:h.headers);if(w.has("apikey")||w.set("apikey",t),w.has("Authorization")||w.set("Authorization",`Bearer ${y}`),f){const _=await XB(p,f,c);_&&(_.traceparent&&!w.has("traceparent")&&w.set("traceparent",_.traceparent),_.tracestate&&!w.has("tracestate")&&w.set("tracestate",_.tracestate),_.baggage&&!w.has("baggage")&&w.set("baggage",_.baggage))}return a(p,bt(bt({},h),{},{headers:w}))}};async function XB(t,e,r){if(!BB(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await LB();if(!n||!n.traceparent)return null;if(r){const i=zB(n.traceparent);if(i&&!i.isSampled)return null}return n}function Zk(t){return typeof t=="boolean"?{enabled:t}:t}function YB(t){return t.endsWith("/")?t:t+"/"}function JB(t,e){var r,n,i,a,o,u;const{db:c,auth:f,realtime:p,global:h}=t,{db:g,auth:y,realtime:w,global:_}=e,b=Zk(t.tracePropagation),k=Zk(e.tracePropagation),O={db:bt(bt({},g),c),auth:bt(bt({},y),f),realtime:bt(bt({},w),p),storage:{},global:bt(bt(bt({},_),h),{},{headers:bt(bt({},(r=_==null?void 0:_.headers)!==null&&r!==void 0?r:{}),(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(i=(a=b==null?void 0:b.enabled)!==null&&a!==void 0?a:k==null?void 0:k.enabled)!==null&&i!==void 0?i:!1,respectSamplingDecision:(o=(u=b==null?void 0:b.respectSamplingDecision)!==null&&u!==void 0?u:k==null?void 0:k.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return t.accessToken?O.accessToken=t.accessToken:delete O.accessToken,O}function QB(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(YB(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var ZB=class extends AB{constructor(t){super(t)}},eq=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const a=QB(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,u={db:CB,realtime:RB,auth:bt(bt({},NB),{},{storageKey:o}),global:PB,tracePropagation:$B},c=JB(r??{},u);if(this.settings=c,this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(p,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var f;this.auth=this._initSupabaseAuthClient((f=c.auth)!==null&&f!==void 0?f:{},this.headers,c.global.fetch)}this.fetch=GB(e,t,this._getAccessToken.bind(this),c.global.fetch,c.tracePropagation),this.realtime=this._initRealtimeClient(bt({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(p=>this.realtime.setAuth(p)).catch(p=>console.warn("Failed to set initial Realtime auth token:",p)),this.rest=new g8(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new j6(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new o8(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:a,flowType:o,lock:u,debug:c,throwOnError:f,experimental:p,lockAcquireTimeout:h,skipAutoInitialize:g},y,w){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ZB({url:this.authUrl.href,headers:bt(bt({},_),y),storageKey:a,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:u,debug:c,throwOnError:f,experimental:p,fetch:w,lockAcquireTimeout:h,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Q8(this.realtimeUrl.href,bt(bt({},t),{},{params:bt(bt({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const tq=(t,e,r)=>new eq(t,e,r);function rq(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}rq()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const vN=N.createContext({session:null,supabase:null,loading:!0,signIn:async()=>({error:"Not initialized"}),signOut:async()=>{}});function gh(){return N.useContext(vN)}function nq({children:t}){const[e,r]=N.useState(null),[n,i]=N.useState(null),[a,o]=N.useState(!0),u=N.useRef(null);N.useEffect(()=>{y5(()=>{var p;return((p=u.current)==null?void 0:p.access_token)??null})},[]),N.useEffect(()=>{Xe.get("/config").then(({config:p})=>{if(p.supabase.projectUrl&&p.supabase.anonKey){const h=tq(p.supabase.projectUrl,p.supabase.anonKey);r(h),h.auth.getSession().then(({data:y})=>{u.current=y.session,i(y.session),o(!1)});const{data:{subscription:g}}=h.auth.onAuthStateChange((y,w)=>{u.current=w,i(w)});return()=>g.unsubscribe()}o(!1)}).catch(()=>{o(!1)})},[]);async function c(p,h){if(!e)return{error:"Supabase not configured"};const{error:g}=await e.auth.signInWithPassword({email:p,password:h});return{error:(g==null?void 0:g.message)??null}}async function f(){e&&(await e.auth.signOut(),u.current=null,i(null))}return v.jsx(vN.Provider,{value:{session:n,supabase:e,loading:a,signIn:c,signOut:f},children:t})}const iq=[{to:"/squads",icon:_C,label:"Squads"},{to:"/skills",icon:Y0,label:"Skills"},{to:"/schedules",icon:nL,label:"Schedules"},{to:"/wiki",icon:pC,label:"Wiki"},{to:"/usage",icon:aL,label:"Usage"}],aq=[{to:"/",icon:UL,label:"Chat"},{to:"/feed",icon:gC,label:"Inbox"},{to:"/settings",icon:i5,label:"Settings"}];function eE({to:t,icon:e,label:r,collapsed:n}){return v.jsxs(cC,{to:t,end:t==="/",title:n?r:void 0,className:({isActive:i})=>ql("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono transition-colors cursor-pointer",n?"justify-center":"",i?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"),style:({isActive:i})=>i?{background:"rgba(228,58,156,0.1)"}:void 0,children:[v.jsx(e,{className:"w-3.5 h-3.5 flex-shrink-0"}),!n&&r]})}function oq(){const[t,e]=N.useState(!1),[r,n]=N.useState("..."),{supabase:i}=gh();return N.useEffect(()=>{let a=!0;return Xe.get("/version").then(({version:o})=>{a&&n(o)}).catch(()=>{a&&n("unknown")}),()=>{a=!1}},[]),v.jsxs("div",{className:"flex h-screen overflow-hidden bg-background relative",children:[v.jsxs("div",{className:ql("flex-shrink-0 flex flex-col border-r border-white/[0.06] bg-[#181818] transition-all duration-200",t?"w-[52px]":"w-[210px]"),children:[v.jsx("div",{className:ql("h-[52px] flex items-center border-b border-white/[0.06] flex-shrink-0",t?"justify-center px-3":"justify-between pl-4 pr-3"),children:t?v.jsx(ta,{height:26}):v.jsxs("div",{className:"flex items-center gap-2.5",children:[v.jsx(ta,{height:26}),v.jsx("span",{className:"text-2xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"})]})}),v.jsx("nav",{className:"flex-1 py-2 px-1.5 space-y-0.5 overflow-y-auto",children:iq.map(a=>v.jsx(eE,{collapsed:t,...a},a.to))}),v.jsxs("div",{className:"flex-shrink-0 border-t border-white/[0.06]",children:[v.jsx("div",{className:"py-1.5 px-1.5 space-y-0.5",children:aq.map(a=>v.jsx(eE,{collapsed:t,...a},a.to))}),v.jsxs("div",{className:"border-t border-white/[0.05] py-1.5 px-1.5 space-y-0.5",children:[v.jsxs("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noreferrer",title:"GitHub",className:ql("flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:[v.jsx(PL,{className:"w-3.5 h-3.5 flex-shrink-0"}),!t&&v.jsxs("span",{className:"text-zinc-700",children:["v",r]})]}),v.jsx("button",{type:"button",onClick:()=>e(!t),title:t?"Expand sidebar":"Collapse sidebar",className:ql("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:t?v.jsx(Wx,{className:"w-3.5 h-3.5 flex-shrink-0"}):v.jsx(Hx,{className:"w-3.5 h-3.5 flex-shrink-0"})})]})]})]}),v.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[v.jsxs("div",{className:"h-[52px] flex-shrink-0 flex items-center justify-between px-4 border-b border-white/[0.06] bg-[#181818]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(e8,{status:"connected"}),v.jsx("span",{className:"text-[11px] font-mono text-green-400",children:"connected"})]}),v.jsxs("div",{className:"flex items-center gap-1.5",children:[v.jsx(m5,{}),i&&v.jsx("button",{type:"button",onClick:()=>i.auth.signOut(),className:"p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Sign out",children:v.jsx($L,{className:"w-3.5 h-3.5"})})]})]}),v.jsxs("main",{className:"flex-1 overflow-hidden flex flex-col min-h-0 relative",children:[v.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{zIndex:0},children:[v.jsx("div",{className:"orb orb-pink"}),v.jsx("div",{className:"orb orb-gray"})]}),v.jsx(R4,{})]})]})]})}function Hm(t){return new Date(t).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,timeZone:"America/Chicago"})}function sq(){const{session:t}=gh(),[e,r]=N.useState([]),[n,i]=N.useState(""),[a,o]=N.useState(""),[u,c]=N.useState(!1),[f,p]=N.useState(!1),[h,g]=N.useState(null),[y,w]=N.useState(null),_=N.useRef(null),b=N.useRef(null),k=N.useRef(null);N.useEffect(()=>{Xe.get("/conversations?limit=50").then($=>r($.messages.map(I=>({...I,timestamp:Hm(I.timestamp)})))).catch(()=>{})},[]);const O=N.useCallback($=>{p(!1),c(!0),o($)},[]),A=N.useCallback($=>{p(!1),c(!1),o(""),r(I=>[...I,{id:crypto.randomUUID(),role:"assistant",content:$,timestamp:Hm(new Date)}])},[]),j=N.useCallback($=>{var I,q,U;$.notification&&SC({id:((I=$.event)==null?void 0:I.id)??crypto.randomUUID(),message:$.notification,timestamp:((q=$.event)==null?void 0:q.timestamp)??new Date().toISOString(),eventType:((U=$.event)==null?void 0:U.type)??"unknown"})},[]),E=N.useCallback(()=>{p(!1),c(!1),o("")},[]),{sendMessage:T}=kC({onDelta:O,onMessage:A,onEvent:j,onError:E});N.useLayoutEffect(()=>{const $=_.current;$&&($.scrollTop=$.scrollHeight)},[e,a,f]);async function C($,I){const q=new FormData;q.append("file",$),q.append("messageId",I);const U=Gx();if(!(await fetch("/api/attachments",{method:"POST",body:q,headers:U?{Authorization:`Bearer ${U}`}:void 0})).ok)throw new Error("Failed to upload attachment")}async function R(){const $=n.trim();if(!$&&!h||u||f)return;const I=crypto.randomUUID(),q=h==null?void 0:h.name,U=[$,q?`Attachment: ${q}`:""].filter(Boolean).join(`
405
-
406
- `);r(V=>[...V,{id:I,role:"user",content:$,timestamp:Hm(new Date),attachmentName:q}]),i(""),g(null),p(!0),k.current&&(k.current.value=""),b.current&&(b.current.style.height="auto");try{h&&await C(h,I),T(U)}catch{p(!1)}}function D($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),R())}function X($){i($.target.value),b.current&&(b.current.style.height="auto",b.current.style.height=`${Math.min(b.current.scrollHeight,160)}px`)}return v.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[v.jsxs("div",{ref:_,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[e.map($=>{var I,q;return v.jsxs("div",{className:`flex gap-3 ${$.role==="user"?"flex-row-reverse":""}`,children:[v.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${$.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:$.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:$.role==="user"?((q=(I=t==null?void 0:t.user)==null?void 0:I.email)==null?void 0:q.charAt(0).toUpperCase())??"U":v.jsx(ta,{height:12})}),v.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${$.role==="user"?"items-end":"items-start"}`,children:[$.toolCall&&v.jsxs("button",{type:"button",onClick:()=>w(y===$.id?null:$.id),className:"w-full text-left border border-white/[0.07] bg-[#1e1e1e] rounded-xl px-3 py-2 flex items-center gap-2 hover:border-[#E43A9C]/25 transition-colors",children:[v.jsx(hC,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),v.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:$.toolCall.name}),v.jsx(Qt,{variant:$.toolCall.status==="done"?"success":$.toolCall.status==="error"?"error":"warning",children:$.toolCall.status}),v.jsx(sL,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${y===$.id?"rotate-180":""}`})]}),$.toolCall&&y===$.id&&v.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:v.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:$.toolCall.result})}),$.attachmentName&&v.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:$.attachmentName}),$.content&&v.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${$.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:$.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:$.role==="user"?v.jsx("p",{className:"whitespace-pre-wrap",children:$.content}):v.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:ze.parse($.content)}})}),v.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:$.timestamp})]})]},$.id)}),f&&v.jsxs("div",{className:"flex gap-3",children:[v.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:v.jsx(ta,{height:12})}),v.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map($=>v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${$}ms`}},$))})]}),u&&a&&v.jsxs("div",{className:"flex gap-3",children:[v.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:v.jsx(ta,{height:12})}),v.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:v.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:ze.parse(a)}})})]}),u&&!a&&v.jsxs("div",{className:"flex gap-3",children:[v.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:v.jsx(ta,{height:12})}),v.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map($=>v.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${$}ms`}},$))})]})]}),v.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[v.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[v.jsx("input",{ref:k,type:"file",className:"hidden",onChange:$=>{var I;return g(((I=$.target.files)==null?void 0:I[0])??null)}}),h&&v.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",h.name]}),v.jsx("textarea",{ref:b,value:n,onChange:X,onKeyDown:D,placeholder:"Message IO…",rows:1,className:"w-full bg-transparent px-4 pt-3 pb-1 text-sm text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none",style:{minHeight:"42px",maxHeight:"160px",fontFamily:"Inter, sans-serif"}}),v.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[v.jsx("button",{type:"button",onClick:()=>{var $;return($=k.current)==null?void 0:$.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:v.jsx(yC,{className:"w-4 h-4"})}),v.jsx("div",{className:"flex items-center gap-2",children:u?v.jsxs("button",{type:"button",onClick:()=>c(!1),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-zinc-800 hover:bg-zinc-700 text-[11px] font-mono text-zinc-300 transition-colors",children:[v.jsx(wC,{className:"w-3 h-3"})," Stop"]}):v.jsx("button",{type:"button",onClick:R,disabled:!n.trim()&&!h||f,className:"p-2 rounded-xl text-white disabled:opacity-30 disabled:cursor-not-allowed transition-opacity hover:opacity-90",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:v.jsx(xC,{className:"w-3.5 h-3.5"})})})]})]}),v.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}function lq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState("all");N.useEffect(()=>{Xe.get("/inbox").then(f=>e(f.entries)).catch(()=>{})},[]);function o(f){n(f),f.status==="unread"&&Xe.post(`/inbox/${f.id}/read`).then(()=>{e(p=>p.map(h=>h.id===f.id?{...h,status:"read"}:h))}).catch(()=>{})}const u=t.filter(f=>i==="all"||f.status==="unread"),c=t.filter(f=>f.status==="unread").length;return v.jsxs("div",{className:"flex h-full",children:[v.jsxs("div",{className:"w-80 border-r border-white/[0.07] flex flex-col h-full bg-[#181818]",children:[v.jsxs("div",{className:"p-3 border-b border-white/[0.07]",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsx("h2",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),c>0&&v.jsx(Qt,{variant:"default",children:c})]}),v.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-white/[0.03] border border-white/[0.07]",children:["all","unread"].map(f=>v.jsx("button",{type:"button",onClick:()=>a(f),className:`flex-1 px-2 py-1 rounded-lg text-[11px] font-mono transition-colors ${i===f?"bg-[#E43A9C]/15 text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400"}`,children:f==="all"?"All":"Unread"},f))})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto",children:[u.map(f=>v.jsxs("button",{onClick:()=>o(f),type:"button",className:`w-full text-left px-4 py-3 border-b border-white/[0.05] transition-colors ${(r==null?void 0:r.id)===f.id?"bg-white/[0.06]":"hover:bg-white/[0.03]"} ${f.status==="unread"?"border-l-2 border-l-[#E43A9C]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[f.status==="unread"?v.jsx(LL,{size:12,className:"text-[#E43A9C] flex-shrink-0"}):v.jsx(ML,{size:12,className:"text-zinc-700 flex-shrink-0"}),v.jsx("span",{className:"text-[10px] text-zinc-600 font-mono uppercase",children:f.kind})]}),v.jsx("p",{className:`text-sm mt-1 truncate ${f.status==="unread"?"text-zinc-200 font-medium":"text-zinc-400"}`,children:f.title}),v.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-0.5",children:new Date(f.createdAt).toLocaleString()})]},f.id)),u.length===0&&v.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[v.jsx(gC,{size:32,className:"text-zinc-800 mb-2"}),v.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:i==="unread"?"All caught up":"No items yet"})]})]})]}),v.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:r?v.jsxs("div",{children:[v.jsx("h2",{className:"text-lg text-zinc-100 font-medium mb-1",children:r.title}),v.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mb-5",children:[r.kind," · ",new Date(r.createdAt).toLocaleString()]}),v.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:ze.parse(r.content)}})]}):v.jsx("div",{className:"h-full flex items-center justify-center",children:v.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:"Select an item to view details"})})})]})}function uq(){const{signIn:t}=gh(),[e,r]=N.useState(""),[n,i]=N.useState(""),[a,o]=N.useState(null),[u,c]=N.useState(!1);async function f(p){p.preventDefault(),o(null),c(!0);const{error:h}=await t(e,n);h&&o(h),c(!1)}return v.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[v.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),v.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-[60%] w-[400px] h-[300px] rounded-full blur-3xl pointer-events-none",style:{background:"radial-gradient(ellipse, rgba(228,58,156,0.12) 0%, transparent 70%)"}}),v.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[v.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[v.jsx(ta,{height:52}),v.jsx("div",{className:"text-center",children:v.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),v.jsxs("form",{onSubmit:f,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),v.jsx("input",{type:"email",value:e,onChange:p=>r(p.target.value),required:!0,className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),v.jsx("input",{type:"password",value:n,onChange:p=>i(p.target.value),required:!0,placeholder:"••••••••",className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),a&&v.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),v.jsx("button",{type:"submit",disabled:u,className:"w-full text-white font-mono text-sm rounded-xl py-3 mt-1 transition-opacity hover:opacity-90 disabled:opacity-50 flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, #D83333 0%, #E43A9C 55%, #F041FF 100%)"},children:u?v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),v.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const bN="w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors",Jo="bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors";function oi({label:t,hint:e,align:r="center",children:n}){const i=r==="start"?"flex-1 min-w-0":"flex-1 flex justify-end items-center";return v.jsxs("div",{className:`glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex gap-4 ${r==="start"?"items-start":"items-center"}`,children:[v.jsxs("div",{className:"w-[140px] shrink-0",children:[v.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&v.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),v.jsx("div",{className:i,children:n})]})}function cq({onSave:t,onCancel:e,squads:r}){var w;const[n,i]=N.useState("io"),[a,o]=N.useState(((w=r[0])==null?void 0:w.id)??""),[u,c]=N.useState(""),[f,p]=N.useState(""),[h,g]=N.useState(""),y=()=>{!f.trim()||!h.trim()||!u.trim()||t({name:u.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:f.trim(),prompt:h.trim()})};return v.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)"},children:v.jsxs("div",{className:"glass-card border border-white/[0.09] rounded-2xl w-full max-w-lg shadow-2xl flex flex-col",style:{maxHeight:"90vh"},children:[v.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[v.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),v.jsx("button",{type:"button",onClick:e,className:"p-1.5 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors cursor-pointer",children:v.jsx(f5,{className:"w-4 h-4"})})]}),v.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[v.jsx(oi,{label:"Name",children:v.jsx("input",{value:u,onChange:_=>c(_.target.value),placeholder:"Daily triage",className:`${Jo} w-48`})}),v.jsx(oi,{label:"Type",children:v.jsx("div",{className:"flex gap-2",children:["io","squad"].map(_=>v.jsx("button",{type:"button",onClick:()=>i(_),className:`px-4 py-1.5 rounded-xl text-[11px] font-mono capitalize transition-colors border cursor-pointer ${n===_?"text-[#E43A9C] border-[#E43A9C]/30":"text-zinc-500 border-white/[0.08] hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:n===_?{background:"rgba(228,58,156,0.08)"}:void 0,children:_==="io"?"IO Schedule":"Squad Schedule"},_))})}),n==="squad"&&v.jsx(oi,{label:"Squad",children:v.jsx("select",{value:a,onChange:_=>o(_.target.value),className:`${Jo} w-48`,children:r.map(_=>v.jsx("option",{value:_.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:_.name},_.id))})}),v.jsx(oi,{label:"Cron Expression",children:v.jsx("input",{value:f,onChange:_=>p(_.target.value),placeholder:"0 9 * * 1-5",className:`${Jo} w-40`})}),v.jsx(oi,{label:"Prompt",hint:"supports Markdown",align:"start",children:v.jsx("textarea",{value:h,onChange:_=>g(_.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${bN} resize-none leading-relaxed`})})]}),v.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-white/[0.06] flex-shrink-0",children:[v.jsx(ci,{onClick:e,children:"Cancel"}),v.jsxs(oa,{onClick:y,className:"px-4 py-1.5",children:[v.jsx(Vx,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function fq({sched:t,squads:e,onSave:r,onBack:n}){var w,_;const[i,a]=N.useState(t.name),[o,u]=N.useState(t.cron),[c,f]=N.useState(t.prompt),[p,h]=N.useState(t.targetId??((w=e[0])==null?void 0:w.id)??""),g=()=>{!o.trim()||!c.trim()||!i.trim()||r({name:i.trim(),cron:o.trim(),prompt:c.trim(),targetId:t.targetType==="squad"?p:void 0})},y=t.targetType==="orchestrator"?"IO Schedule":`Squad — ${((_=e.find(b=>b.id===t.targetId))==null?void 0:_.name)??"Unknown"}`;return v.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[v.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[v.jsx(Hx,{className:"w-3.5 h-3.5"}),"Schedules"]}),v.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),v.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),v.jsxs("div",{className:"flex items-start justify-between mb-6",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),v.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:y})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(ci,{onClick:n,children:"Cancel"}),v.jsxs(oa,{onClick:g,className:"px-4 py-1.5",children:[v.jsx(Vx,{className:"w-3 h-3"}),"Save Changes"]})]})]}),v.jsxs("div",{className:"space-y-3",children:[v.jsx(oi,{label:"Name",children:v.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${Jo} w-48`})}),t.targetType==="squad"&&v.jsx(oi,{label:"Squad",children:v.jsx("select",{value:p,onChange:b=>h(b.target.value),className:`${Jo} w-48`,children:e.map(b=>v.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),v.jsx(oi,{label:"Cron Expression",children:v.jsx("input",{value:o,onChange:b=>u(b.target.value),placeholder:"0 9 * * 1-5",className:`${Jo} w-40`})}),v.jsx(oi,{label:"Prompt",hint:"supports Markdown",align:"start",children:v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("textarea",{value:c,onChange:b=>f(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${bN} leading-relaxed resize-y`,style:{minHeight:"360px"}}),v.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function dq(){const[t,e]=N.useState("squad"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,u]=N.useState(!1),[c,f]=N.useState(null);N.useEffect(()=>{p(),h()},[]);function p(){Xe.get("/schedules").then(E=>n(E.schedules)).catch(()=>{})}function h(){Xe.get("/squads").then(E=>a(E.squads)).catch(()=>{})}const g=r.filter(E=>E.targetType==="squad"),y=r.filter(E=>E.targetType==="orchestrator"),w=t==="squad"?g:y;async function _(E){try{await Xe.post("/schedules",E),et.success("Schedule created"),u(!1),p()}catch(T){et.error(T instanceof Error?T.message:"Failed to create")}}async function b(E){if(c)try{await Xe.patch(`/schedules/${c.id}`,E),et.success("Schedule saved"),f(null),p()}catch{et.error("Failed to save schedule")}}async function k(E,T){try{await Xe.patch(`/schedules/${E}`,{enabled:!T}),p()}catch{et.error("Failed to toggle schedule")}}async function O(E){try{await Xe.post(`/schedules/${E}/run`,{}),et.success("Schedule triggered")}catch{et.success("Schedule triggered")}}async function A(E){try{await Xe.delete(`/schedules/${E}`),et.success("Schedule deleted"),p()}catch{et.error("Failed to delete")}}if(c)return v.jsx(fq,{sched:c,squads:i,onSave:b,onBack:()=>f(null)});const j=t==="squad"?["Squad","Schedule","Next Run","Status",""]:["Prompt","Schedule","Next Run","Status",""];return v.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&v.jsx(cq,{onSave:_,onCancel:()=>u(!1),squads:i}),v.jsxs("div",{className:"flex items-center justify-between mb-5",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),v.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(E=>E.enabled).length," active · ",r.filter(E=>!E.enabled).length," paused"]})]}),v.jsxs(oa,{onClick:()=>u(!0),className:"px-3 py-1.5",children:[v.jsx(vC,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),v.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([E,T])=>v.jsx("button",{type:"button",onClick:()=>e(E),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===E?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===E?{background:"rgba(228,58,156,0.12)"}:void 0,children:T},E))}),v.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:w.length===0?v.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:j.map(E=>v.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:E},E))})}),v.jsx("tbody",{children:w.map(E=>{var T;return v.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${E.enabled?"":"opacity-50"}`,children:[t==="squad"?v.jsx("td",{className:"px-4 py-3",children:v.jsx(t8,{name:((T=i.find(C=>C.id===E.targetId))==null?void 0:T.name)??"Unknown"})}):v.jsx("td",{className:"px-4 py-3 text-zinc-300 max-w-[220px]",children:v.jsx("p",{className:"truncate",children:E.prompt})}),v.jsxs("td",{className:"px-4 py-3",children:[v.jsx("div",{className:"text-zinc-300",children:E.name}),v.jsx("div",{className:"text-zinc-700 text-[10px] mt-0.5",children:E.cron})]}),v.jsx("td",{className:"px-4 py-3 text-zinc-600",children:v.jsxs("span",{className:"flex items-center gap-1",children:[v.jsx(fL,{className:"w-3 h-3"}),E.enabled&&E.nextRun?new Date(E.nextRun).toLocaleString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0,month:"short",day:"numeric",timeZone:"America/Chicago"}):"—"]})}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(Qt,{variant:E.enabled?"success":"muted",children:E.enabled?"active":"paused"})}),v.jsx("td",{className:"px-4 py-3",children:v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsxs(ci,{onClick:()=>O(E.id),children:[v.jsx(YL,{className:"w-3 h-3"}),"Run now"]}),v.jsx(r8,{onClick:()=>k(E.id,E.enabled),children:E.enabled?v.jsxs(v.Fragment,{children:[v.jsx(WL,{className:"w-3 h-3"}),"Pause"]}):v.jsxs(v.Fragment,{children:[v.jsx(hC,{className:"w-3 h-3"}),"Resume"]})}),v.jsxs(ci,{onClick:()=>f(E),children:[v.jsx(KL,{className:"w-3 h-3"}),"Edit"]}),v.jsxs(ow,{onClick:()=>A(E.id),children:[v.jsx(Kx,{className:"w-3 h-3"}),"Delete"]})]})})]},E.id)})})]})})]})}const hq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],Ps="rounded-xl border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-sm font-mono text-zinc-300 outline-none focus:border-[#E43A9C]/50",tE=`${Ps} w-[72px]`,pq=`${Ps} w-[100px]`,rE=`${Ps} w-[200px]`,nE=`${Ps} w-[320px]`,mq=`${Ps} w-[140px] appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2371717a%22%20d%3D%22M3%204.5L6%208l3-3.5H3z%22%2F%3E%3C%2Fsvg%3E')] bg-[position:right_10px_center] bg-no-repeat pr-8`;function gq(){const[t,e]=N.useState(null),[r,n]=N.useState("general");N.useEffect(()=>{Xe.get("/config").then(o=>e(o.config)).catch(()=>{})},[]);function i(o){t&&e({...t,...o})}async function a(){if(t)try{const{dataDir:o,...u}=t;await Xe.patch("/config",u),et.success("Settings saved")}catch{et.error("Failed to save settings")}}return t?v.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-3xl",children:[v.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),v.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:hq.map(o=>v.jsx("button",{type:"button",onClick:()=>n(o.id),className:`-mb-px border-b-2 px-1 pb-3 text-[11px] font-mono transition-colors ${r===o.id?"border-[#E43A9C] text-[#E43A9C]":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:o.label},o.id))}),v.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&v.jsxs(v.Fragment,{children:[v.jsx(hn,{label:"Log Level",children:v.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:mq,children:["trace","debug","info","warn","error","fatal"].map(o=>v.jsx("option",{value:o,children:o},o))})}),v.jsx(hn,{label:"Default Model",children:v.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:rE})}),v.jsx(hn,{label:"Max Instances",children:v.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:tE,min:1,max:10})}),v.jsx(hn,{label:"API Port",children:v.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:tE})}),v.jsx(hn,{label:"Pricing Refresh (hrs)",children:v.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:pq,min:1})}),v.jsx(hn,{label:"Data Dir",children:v.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${nE} cursor-default text-zinc-500`})})]}),r==="telegram"&&v.jsxs(v.Fragment,{children:[v.jsx(hn,{label:"Bot Token",children:v.jsx(Wm,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),v.jsx(hn,{label:"Allowed Chat IDs",children:v.jsx("input",{type:"text",value:t.telegram.allowedChatIds.join(", "),onChange:o=>i({telegram:{...t.telegram,allowedChatIds:o.target.value.split(",").map(u=>Number(u.trim())).filter(u=>!Number.isNaN(u))}}),className:rE})})]}),r==="auth"&&v.jsxs(v.Fragment,{children:[v.jsx(hn,{label:"Project URL",children:v.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:nE})}),v.jsx(hn,{label:"Anon Key",children:v.jsx(Wm,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),v.jsx(hn,{label:"JWT Secret",children:v.jsx(Wm,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),v.jsx("div",{className:"flex justify-end pt-6",children:v.jsx(oa,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):v.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function hn({label:t,children:e}){return v.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[v.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),v.jsx("div",{className:"flex justify-end",children:e})]})}function Wm({value:t,onChange:e,size:r="lg"}){const[n,i]=N.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return v.jsxs("div",{className:"relative",children:[v.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${Ps} ${a} pr-9`}),v.jsx("button",{type:"button",onClick:()=>i(o=>!o),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-zinc-600 transition-colors hover:text-zinc-400","aria-label":n?"Hide value":"Show value",children:n?v.jsx(xL,{size:14}):v.jsx(_L,{size:14})})]})}const yq="linear-gradient(135deg, #D83333 0%, #E43A9C 50%, #F041FF 100%)";ze.use({renderer:{heading({tokens:t,depth:e}){const r=t.map(a=>a.raw).join(""),n=`h${e}`;return`<${n} style="background:${yq};-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;font-size:${{1:"1.35em",2:"1.15em",3:"1em",4:"0.9em"}[e]??"1em"};font-weight:600;margin:1.1em 0 0.4em;">${r}</${n}>`}}});function vq({content:t,className:e=""}){const r=N.useMemo(()=>ze.parse(t),[t]);return v.jsx("div",{className:`prose-io ${e}`,style:{color:"#d4d4d8",fontSize:"0.875rem",lineHeight:"1.7"},dangerouslySetInnerHTML:{__html:r}})}const bq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function iE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function aE(t){return t?t>=1e6?`${(t/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${t} installs`:null}function xq(t){const e=t.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!e)return{frontMatter:{},body:t};const r=e[1]??"",n=e[2]??"",i={};let a="",o=null;for(const u of r.split(`
407
- `)){const c=u.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(c){a&&o&&(i[a]=o,o=null),a=c[1]??"";const f=(c[2]??"").trim();f===""||f==="[]"?o=[]:f.startsWith("[")&&f.endsWith("]")?i[a]=f.slice(1,-1).split(",").map(p=>p.trim().replace(/^["']|["']$/g,"")):i[a]=f.replace(/^["']|["']$/g,"")}else u.match(/^\s+-\s+(.+)/)&&a&&(o||(o=[]),o.push(u.replace(/^\s+-\s+/,"").trim()))}return a&&o&&(i[a]=o),{frontMatter:i,body:n}}const oE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function wq({content:t}){const{frontMatter:e,body:r}=xq(t),n=oE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!oE.includes(o)),a=[...n,...i];return v.jsxs("div",{children:[a.length>0&&v.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[v.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),v.jsx("div",{className:"space-y-2",children:a.map(o=>{const u=e[o];return u==null||Array.isArray(u)&&u.length===0?null:v.jsxs("div",{className:"flex gap-3 items-start",children:[v.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),v.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(u)?v.jsx("div",{className:"flex flex-wrap gap-1",children:u.map((c,f)=>v.jsx(Qt,{variant:"muted",children:c},f))}):typeof u=="object"?v.jsx("div",{className:"space-y-0.5",children:Object.entries(u).map(([c,f])=>v.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[v.jsxs("span",{className:"text-zinc-600",children:[c,":"]})," ",f]},c))}):o==="use_when"||o==="use-when"?v.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:u}):o==="argument_hint"||o==="argument-hint"?v.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:u}):v.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:u})})]},o)})})]}),r.trim()&&v.jsxs("div",{children:[v.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),v.jsx(vq,{content:r})]})]})}function _q(){const[t,e]=N.useState("installed"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,u]=N.useState(null);function c(z){return"url"in z&&z.url?z.url:z.name}const[f,p]=N.useState(null),[h,g]=N.useState(""),[y,w]=N.useState(!1),[_,b]=N.useState(!1),[k,O]=N.useState(!1),[A,j]=N.useState(""),[E,T]=N.useState(null),[C,R]=N.useState(null),D=N.useCallback(async()=>{try{const z=await Xe.get("/skills"),J=new Set(z.skills.map(ae=>ae.name.toLowerCase()));n(z.skills),a(ae=>ae.map(se=>({...se,installed:J.has(se.name.toLowerCase())})))}catch(z){et.error(z instanceof Error?z.message:"Failed to load skills")}},[]),X=N.useCallback(async z=>{b(!0);try{const J=await Xe.get(`/skills/${encodeURIComponent(z)}`);p(J),j(J.content)}catch(J){et.error(J instanceof Error?J.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);N.useEffect(()=>{D()},[D]),N.useEffect(()=>{if(t==="installed"){R(null);return}const z=h.trim();if(t==="skillssh"&&!z){a([]),R(null),w(!1);return}let J=!1;w(!0);const ae=window.setTimeout(async()=>{try{const se=await Xe.get(`/skills/discover?source=${t}&q=${encodeURIComponent(z)}`);if(J)return;a(se.skills),R(null)}catch(se){if(J)return;a([]),R(se instanceof Error?se.message:"Discovery failed")}finally{J||w(!1)}},250);return()=>{J=!0,window.clearTimeout(ae)}},[h,t]);const $=N.useMemo(()=>{const z=h.trim().toLowerCase();return z?r.filter(J=>[J.name,J.description,J.preview].some(ae=>ae.toLowerCase().includes(z))):r},[r,h]),I=t==="installed"?$:i,q=$.find(z=>z.name===o)??null,U=i.find(z=>c(z)===o)??null,V=(q==null?void 0:q.name)??(U==null?void 0:U.name)??null;N.useEffect(()=>{if(O(!1),!I.length){u(null),t!=="installed"&&p(null);return}if(!o||!I.some(z=>c(z)===o)){const z=I[0];z&&u(c(z))}},[o,t,I]),N.useEffect(()=>{if(t!=="installed"||!V){p(null);return}X(V)},[X,V,t]);async function G(z){if(!z.url&&!z.registrySource){et.error("Install source is not available for this skill yet");return}T(z.name);try{await Xe.post("/skills/install",{name:z.name,source:z.source,url:z.url,registrySource:z.registrySource,skillId:z.skillId}),et.success(`Installed ${z.title||z.name}`),await D(),a(J=>J.map(ae=>ae.name===z.name?{...ae,installed:!0}:ae))}catch(J){et.error(J instanceof Error?J.message:"Install failed")}finally{T(null)}}async function Z(z){T(z);try{await Xe.delete(`/skills/${encodeURIComponent(z)}`),et.success(`Removed ${z}`),await D(),a(J=>J.map(ae=>ae.name===z?{...ae,installed:!1}:ae))}catch(J){et.error(J instanceof Error?J.message:"Failed to remove skill")}finally{T(null)}}async function K(){if(f){T(f.name);try{await Xe.put(`/skills/${encodeURIComponent(f.name)}`,{content:A}),et.success(`Updated ${f.name}`),O(!1),await Promise.all([D(),X(f.name)])}catch(z){et.error(z instanceof Error?z.message:"Failed to save skill")}finally{T(null)}}}const te=!!(q!=null&&q.activatedForOrchestrator),H=E===(f==null?void 0:f.name),B=E===(U==null?void 0:U.name);return v.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[v.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[v.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(bC,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),v.jsx("input",{type:"text",value:h,onChange:z=>g(z.target.value),placeholder:"Search skills…",className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl pl-7 pr-2 py-1.5 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/30 transition-colors"})]}),v.jsx("div",{className:"flex flex-col gap-0.5",children:bq.map(z=>v.jsxs("button",{type:"button",onClick:()=>e(z.id),className:`w-full text-left px-2.5 py-1.5 rounded-lg text-[11px] font-mono transition-colors flex items-center justify-between cursor-pointer ${t===z.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===z.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[v.jsx("span",{children:z.label}),z.id==="installed"&&v.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},z.id))})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[y&&t!=="installed"?v.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-white/[0.08] bg-white/[0.03] px-3 py-3 font-mono text-[11px] text-zinc-500",children:[v.jsx(El,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,I.map(z=>{const J=c(z),ae=o===J,se=z.description||("preview"in z?z.preview:"No description available.");return v.jsxs("button",{type:"button",onClick:()=>{O(!1),u(J)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${ae?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[v.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[v.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:z.name}),"installed"in z&&z.installed?v.jsx(Qt,{variant:"success",children:"installed"}):null]}),v.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:se})]},`${t}:${J}`)}),!y&&I.length===0?v.jsx("div",{className:"rounded-2xl border border-dashed border-white/[0.08] bg-white/[0.02] px-4 py-8 text-center",children:v.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:C||(t==="skillssh"&&!h.trim()?"Start typing to search the skills.sh registry.":h.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),v.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&q?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[v.jsxs("div",{className:"flex min-w-0 gap-4",children:[v.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:v.jsx(Y0,{className:"h-6 w-6"})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:q.name}),v.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[v.jsx(Qt,{variant:"success",children:"installed"}),te?v.jsx(Qt,{variant:"warning",children:"active"}):v.jsx(Qt,{variant:"muted",children:"inactive"}),v.jsx(Qt,{variant:"muted",children:"local skill"})]}),v.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[v.jsxs("p",{children:["path: ",q.filePath]}),v.jsxs("p",{children:["orchestrator: ",te?"enabled":"disabled"]})]})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[k?v.jsxs(oa,{onClick:K,disabled:H||A===(f==null?void 0:f.content),className:"px-3 py-2",children:[H?v.jsx(El,{className:"h-3.5 w-3.5 animate-spin"}):v.jsx(X0,{className:"h-3.5 w-3.5"}),"Save"]}):v.jsxs(ci,{onClick:()=>O(!0),className:"px-3 py-2",children:[v.jsx(X0,{className:"h-3.5 w-3.5"})," Edit"]}),v.jsxs(ow,{onClick:()=>Z(q.name),className:"px-3 py-2",children:[H?v.jsx(El,{className:"h-3.5 w-3.5 animate-spin"}):v.jsx(Kx,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:_&&!f?v.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[v.jsx(El,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):k?v.jsxs("div",{className:"space-y-3",children:[v.jsx("textarea",{value:A,onChange:z=>j(z.target.value),className:"min-h-[440px] w-full rounded-2xl border border-white/[0.08] bg-black/30 p-4 font-mono text-[12px] leading-6 text-zinc-200 outline-none transition-colors focus:border-[#E43A9C]/50"}),v.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[v.jsx("span",{children:"Editing raw SKILL.md"}),v.jsx(ci,{onClick:()=>{O(!1),j((f==null?void 0:f.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):f?v.jsx(wq,{content:f.content}):v.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&U?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[v.jsxs("div",{className:"flex min-w-0 gap-4",children:[v.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:v.jsx(o5,{className:"h-6 w-6"})}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:U.title||U.name}),v.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[v.jsx(Qt,{variant:U.installed?"success":"default",children:U.installed?"installed":"available"}),v.jsx(Qt,{variant:"muted",children:iE(U.source)}),aE(U.installs)?v.jsx(Qt,{variant:"info",children:aE(U.installs)}):null]}),v.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[v.jsxs("p",{children:["registry: ",iE(U.source)]}),U.registrySource?v.jsxs("p",{children:["source: ",U.registrySource]}):null,U.url?v.jsxs("p",{children:["url: ",U.url]}):null]})]})]}),v.jsx("div",{className:"flex items-center gap-2",children:U.installed?v.jsx(ci,{onClick:()=>{e("installed"),u(U.name)},className:"px-3 py-2",children:"Open installed"}):v.jsxs(oa,{onClick:()=>G(U),disabled:B||!U.url&&!U.registrySource,className:"px-3 py-2",children:[B?v.jsx(El,{className:"h-3.5 w-3.5 animate-spin"}):v.jsx(yL,{className:"h-3.5 w-3.5"}),"Install"]})})]}),v.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[v.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:v.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:U.description||"No registry description is available for this skill yet."})}),v.jsx("div",{className:"mt-4 rounded-2xl border border-dashed border-white/[0.08] bg-black/20 p-4 font-mono text-[11px] leading-6 text-zinc-500",children:"Install will fetch the skill definition from the selected registry source and add it to your local skills library."})]})]}):v.jsx("div",{className:"flex h-full items-center justify-center rounded-2xl border border-dashed border-white/[0.08] bg-white/[0.02] p-8 text-center",children:v.jsxs("div",{children:[v.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:v.jsx(Y0,{className:"h-6 w-6"})}),v.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),v.jsx("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-zinc-500",children:"Choose a skill from the left panel to inspect details, install registry entries, or edit local definitions."})]})})})]})}const pb=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function Sq(t){return pb[t%pb.length]}function sE(){const{name:t}=v4();return t?v.jsx(Oq,{name:t}):v.jsx(kq,{})}function kq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),i=lh();return N.useEffect(()=>{Promise.all([Xe.get("/squads"),Xe.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),v.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[v.jsx("div",{className:"mb-6",children:v.jsxs("div",{children:[v.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),v.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[t.length," squads · ",t.reduce((a,o)=>a+(o.activeInstances||0),0)," ","active instances"]})]})}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map((a,o)=>{const u=Sq(o);return v.jsxs("button",{type:"button",onClick:()=>i(`/squads/${a.name}`),className:"text-left rounded-2xl p-5 transition-all group cursor-pointer",style:{border:`1px solid ${u}30`,background:`${u}08`,backdropFilter:"blur(20px)"},onMouseEnter:c=>{c.currentTarget.style.borderColor=`${u}70`,c.currentTarget.style.background=`${u}12`},onMouseLeave:c=>{c.currentTarget.style.borderColor=`${u}30`,c.currentTarget.style.background=`${u}08`},children:[v.jsxs("div",{className:"flex items-start justify-between mb-1",children:[v.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:u},children:a.name}),v.jsx(Qt,{variant:Hf(a.status),children:a.status})]}),v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),v.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[v.jsx(hL,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&v.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono",children:[v.jsx(mC,{className:"w-3 h-3 flex-shrink-0"}),v.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]})]},a.id)}),t.length===0&&v.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[v.jsx(_C,{size:48,className:"mx-auto mb-3 opacity-30"}),v.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function Eq(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?v.jsx(mL,{className:r,style:n}):i.includes("qa")||i.includes("test")?v.jsx(tL,{className:r,style:n}):i.includes("scribe")?v.jsx(e5,{className:r,style:n}):v.jsx(ZD,{className:r,style:n})}function Oq({name:t}){const[e,r]=N.useState(null),n=lh();if(N.useEffect(()=>{Xe.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),!e)return v.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const i=pb[0];return v.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[v.jsxs("button",{type:"button",onClick:()=>n("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[v.jsx(Hx,{className:"w-3.5 h-3.5"})," Back to Squads"]}),v.jsxs("div",{className:"flex items-start justify-between mb-6",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:i},children:e.squad.name}),v.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&v.jsxs("a",{href:e.squad.repoUrl,target:"_blank",rel:"noreferrer",className:"text-[11px] font-mono text-zinc-700 hover:text-zinc-400 flex items-center gap-1 mt-1 transition-colors",children:[v.jsx(mC,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),v.jsx(Qt,{variant:Hf(e.squad.status),children:e.squad.status})]}),v.jsx("div",{className:"space-y-2 mb-8",children:e.members.map(a=>v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[v.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${i}30`,background:`${i}12`},children:Eq(a.roleName||a.role,i)}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-sm font-mono text-zinc-200",children:a.displayName}),v.jsx(Qt,{variant:Hf(a.status),children:a.status})]}),v.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:a.role}),a.currentTask&&v.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:a.currentTask})]})]},a.id))}),e.instances.length>0&&v.jsxs("section",{children:[v.jsx("h3",{className:"text-lg tracking-wide mb-3",style:{fontFamily:"'Bebas Neue', sans-serif",color:i},children:"Instances"}),v.jsx("div",{className:"space-y-2",children:e.instances.map(a=>v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:a.id.slice(0,8)}),v.jsx(Qt,{variant:Hf(a.status),children:a.status})]}),v.jsxs("div",{className:"mt-2 text-[11px] text-zinc-600 font-mono flex gap-4",children:[v.jsxs("span",{children:["Tasks: ",a.tasksComplete,"/",a.taskCount]}),a.branch&&v.jsxs("span",{children:["Branch: ",a.branch]})]})]},a.id))})]})]})}var Vm,lE;function Sr(){if(lE)return Vm;lE=1;var t=Array.isArray;return Vm=t,Vm}var Km,uE;function xN(){if(uE)return Km;uE=1;var t=typeof hf=="object"&&hf&&hf.Object===Object&&hf;return Km=t,Km}var Gm,cE;function Wn(){if(cE)return Gm;cE=1;var t=xN(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Gm=r,Gm}var Xm,fE;function Gu(){if(fE)return Xm;fE=1;var t=Wn(),e=t.Symbol;return Xm=e,Xm}var Ym,dE;function Aq(){if(dE)return Ym;dE=1;var t=Gu(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var u=r.call(o,i),c=o[i];try{o[i]=void 0;var f=!0}catch{}var p=n.call(o);return f&&(u?o[i]=c:delete o[i]),p}return Ym=a,Ym}var Jm,hE;function Tq(){if(hE)return Jm;hE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Jm=r,Jm}var Qm,pE;function wi(){if(pE)return Qm;pE=1;var t=Gu(),e=Aq(),r=Tq(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(u){return u==null?u===void 0?i:n:a&&a in Object(u)?e(u):r(u)}return Qm=o,Qm}var Zm,mE;function _i(){if(mE)return Zm;mE=1;function t(e){return e!=null&&typeof e=="object"}return Zm=t,Zm}var eg,gE;function Cs(){if(gE)return eg;gE=1;var t=wi(),e=_i(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return eg=n,eg}var tg,yE;function uw(){if(yE)return tg;yE=1;var t=Sr(),e=Cs(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var u=typeof a;return u=="number"||u=="symbol"||u=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return tg=i,tg}var rg,vE;function ca(){if(vE)return rg;vE=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return rg=t,rg}var ng,bE;function cw(){if(bE)return ng;bE=1;var t=wi(),e=ca(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(u){if(!e(u))return!1;var c=t(u);return c==n||c==i||c==r||c==a}return ng=o,ng}var ig,xE;function jq(){if(xE)return ig;xE=1;var t=Wn(),e=t["__core-js_shared__"];return ig=e,ig}var ag,wE;function Pq(){if(wE)return ag;wE=1;var t=jq(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return ag=r,ag}var og,_E;function wN(){if(_E)return og;_E=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return og=r,og}var sg,SE;function Cq(){if(SE)return sg;SE=1;var t=cw(),e=Pq(),r=ca(),n=wN(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,c=o.toString,f=u.hasOwnProperty,p=RegExp("^"+c.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(g){if(!r(g)||e(g))return!1;var y=t(g)?p:a;return y.test(n(g))}return sg=h,sg}var lg,kE;function Nq(){if(kE)return lg;kE=1;function t(e,r){return e==null?void 0:e[r]}return lg=t,lg}var ug,EE;function no(){if(EE)return ug;EE=1;var t=Cq(),e=Nq();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return ug=r,ug}var cg,OE;function yh(){if(OE)return cg;OE=1;var t=no(),e=t(Object,"create");return cg=e,cg}var fg,AE;function Rq(){if(AE)return fg;AE=1;var t=yh();function e(){this.__data__=t?t(null):{},this.size=0}return fg=e,fg}var dg,TE;function $q(){if(TE)return dg;TE=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return dg=t,dg}var hg,jE;function Iq(){if(jE)return hg;jE=1;var t=yh(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var u=o[a];return u===e?void 0:u}return n.call(o,a)?o[a]:void 0}return hg=i,hg}var pg,PE;function Mq(){if(PE)return pg;PE=1;var t=yh(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return pg=n,pg}var mg,CE;function Dq(){if(CE)return mg;CE=1;var t=yh(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return mg=r,mg}var gg,NE;function Lq(){if(NE)return gg;NE=1;var t=Rq(),e=$q(),r=Iq(),n=Mq(),i=Dq();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var f=o[u];this.set(f[0],f[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,gg=a,gg}var yg,RE;function zq(){if(RE)return yg;RE=1;function t(){this.__data__=[],this.size=0}return yg=t,yg}var vg,$E;function fw(){if($E)return vg;$E=1;function t(e,r){return e===r||e!==e&&r!==r}return vg=t,vg}var bg,IE;function vh(){if(IE)return bg;IE=1;var t=fw();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return bg=e,bg}var xg,ME;function Bq(){if(ME)return xg;ME=1;var t=vh(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():r.call(a,o,1),--this.size,!0}return xg=n,xg}var wg,DE;function qq(){if(DE)return wg;DE=1;var t=vh();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return wg=e,wg}var _g,LE;function Uq(){if(LE)return _g;LE=1;var t=vh();function e(r){return t(this.__data__,r)>-1}return _g=e,_g}var Sg,zE;function Fq(){if(zE)return Sg;zE=1;var t=vh();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return Sg=e,Sg}var kg,BE;function bh(){if(BE)return kg;BE=1;var t=zq(),e=Bq(),r=qq(),n=Uq(),i=Fq();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var f=o[u];this.set(f[0],f[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,kg=a,kg}var Eg,qE;function dw(){if(qE)return Eg;qE=1;var t=no(),e=Wn(),r=t(e,"Map");return Eg=r,Eg}var Og,UE;function Hq(){if(UE)return Og;UE=1;var t=Lq(),e=bh(),r=dw();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return Og=n,Og}var Ag,FE;function Wq(){if(FE)return Ag;FE=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return Ag=t,Ag}var Tg,HE;function xh(){if(HE)return Tg;HE=1;var t=Wq();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Tg=e,Tg}var jg,WE;function Vq(){if(WE)return jg;WE=1;var t=xh();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return jg=e,jg}var Pg,VE;function Kq(){if(VE)return Pg;VE=1;var t=xh();function e(r){return t(this,r).get(r)}return Pg=e,Pg}var Cg,KE;function Gq(){if(KE)return Cg;KE=1;var t=xh();function e(r){return t(this,r).has(r)}return Cg=e,Cg}var Ng,GE;function Xq(){if(GE)return Ng;GE=1;var t=xh();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return Ng=e,Ng}var Rg,XE;function hw(){if(XE)return Rg;XE=1;var t=Hq(),e=Vq(),r=Kq(),n=Gq(),i=Xq();function a(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u<c;){var f=o[u];this.set(f[0],f[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Rg=a,Rg}var $g,YE;function _N(){if(YE)return $g;YE=1;var t=hw(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,u=i?i.apply(this,o):o[0],c=a.cache;if(c.has(u))return c.get(u);var f=n.apply(this,o);return a.cache=c.set(u,f)||c,f};return a.cache=new(r.Cache||t),a}return r.Cache=t,$g=r,$g}var Ig,JE;function Yq(){if(JE)return Ig;JE=1;var t=_N(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return Ig=r,Ig}var Mg,QE;function Jq(){if(QE)return Mg;QE=1;var t=Yq(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,u,c,f){a.push(c?f.replace(r,"$1"):u||o)}),a});return Mg=n,Mg}var Dg,ZE;function pw(){if(ZE)return Dg;ZE=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return Dg=t,Dg}var Lg,eO;function Qq(){if(eO)return Lg;eO=1;var t=Gu(),e=pw(),r=Sr(),n=Cs(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(u){if(typeof u=="string")return u;if(r(u))return e(u,o)+"";if(n(u))return a?a.call(u):"";var c=u+"";return c=="0"&&1/u==-1/0?"-0":c}return Lg=o,Lg}var zg,tO;function SN(){if(tO)return zg;tO=1;var t=Qq();function e(r){return r==null?"":t(r)}return zg=e,zg}var Bg,rO;function kN(){if(rO)return Bg;rO=1;var t=Sr(),e=uw(),r=Jq(),n=SN();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Bg=i,Bg}var qg,nO;function wh(){if(nO)return qg;nO=1;var t=Cs();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return qg=e,qg}var Ug,iO;function mw(){if(iO)return Ug;iO=1;var t=kN(),e=wh();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return Ug=r,Ug}var Fg,aO;function EN(){if(aO)return Fg;aO=1;var t=mw();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Fg=e,Fg}var Zq=EN();const en=Ze(Zq);var Hg,oO;function eU(){if(oO)return Hg;oO=1;function t(e){return e==null}return Hg=t,Hg}var tU=eU();const Le=Ze(tU);var Wg,sO;function rU(){if(sO)return Wg;sO=1;var t=wi(),e=Sr(),r=_i(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return Wg=i,Wg}var nU=rU();const Ya=Ze(nU);var iU=cw();const Me=Ze(iU);var aU=ca();const Ns=Ze(aU);var Vg={exports:{}},Ke={};/**
408
- * @license React
409
- * react-is.production.min.js
410
- *
411
- * Copyright (c) Facebook, Inc. and its affiliates.
412
- *
413
- * This source code is licensed under the MIT license found in the
414
- * LICENSE file in the root directory of this source tree.
415
- */var lO;function oU(){if(lO)return Ke;lO=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w;w=Symbol.for("react.module.reference");function _(b){if(typeof b=="object"&&b!==null){var k=b.$$typeof;switch(k){case t:switch(b=b.type,b){case r:case i:case n:case f:case p:return b;default:switch(b=b&&b.$$typeof,b){case u:case o:case c:case g:case h:case a:return b;default:return k}}case e:return k}}}return Ke.ContextConsumer=o,Ke.ContextProvider=a,Ke.Element=t,Ke.ForwardRef=c,Ke.Fragment=r,Ke.Lazy=g,Ke.Memo=h,Ke.Portal=e,Ke.Profiler=i,Ke.StrictMode=n,Ke.Suspense=f,Ke.SuspenseList=p,Ke.isAsyncMode=function(){return!1},Ke.isConcurrentMode=function(){return!1},Ke.isContextConsumer=function(b){return _(b)===o},Ke.isContextProvider=function(b){return _(b)===a},Ke.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},Ke.isForwardRef=function(b){return _(b)===c},Ke.isFragment=function(b){return _(b)===r},Ke.isLazy=function(b){return _(b)===g},Ke.isMemo=function(b){return _(b)===h},Ke.isPortal=function(b){return _(b)===e},Ke.isProfiler=function(b){return _(b)===i},Ke.isStrictMode=function(b){return _(b)===n},Ke.isSuspense=function(b){return _(b)===f},Ke.isSuspenseList=function(b){return _(b)===p},Ke.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===i||b===n||b===f||b===p||b===y||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===h||b.$$typeof===a||b.$$typeof===o||b.$$typeof===c||b.$$typeof===w||b.getModuleId!==void 0)},Ke.typeOf=_,Ke}var uO;function sU(){return uO||(uO=1,Vg.exports=oU()),Vg.exports}var lU=sU(),Kg,cO;function ON(){if(cO)return Kg;cO=1;var t=wi(),e=_i(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return Kg=n,Kg}var Gg,fO;function uU(){if(fO)return Gg;fO=1;var t=ON();function e(r){return t(r)&&r!=+r}return Gg=e,Gg}var cU=uU();const Xu=Ze(cU);var fU=ON();const dU=Ze(fU);var kn=function(e){return e===0?0:e>0?1:-1},Ua=function(e){return Ya(e)&&e.indexOf("%")===e.length-1},fe=function(e){return dU(e)&&!Xu(e)},hU=function(e){return Le(e)},Dt=function(e){return fe(e)||Ya(e)},pU=0,Yu=function(e){var r=++pU;return"".concat(e||"").concat(r)},Ja=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!fe(e)&&!Ya(e))return n;var a;if(Ua(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Xu(a)&&(a=n),i&&a>r&&(a=r),a},ea=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},mU=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},i=0;i<r;i++)if(!n[e[i]])n[e[i]]=!0;else return!0;return!1},wn=function(e,r){return fe(e)&&fe(r)?function(n){return e+n*(r-e)}:function(){return r}};function od(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):en(n,e))===r})}var gU=function(e,r){return fe(e)&&fe(r)?e-r:Ya(e)&&Ya(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Qo(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function mb(t){"@babel/helpers - typeof";return mb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mb(t)}var yU=["viewBox","children"],vU=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],dO=["points","pathLength"],Xg={svg:yU,polygon:dO,polyline:dO},gw=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],sd=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(N.isValidElement(e)&&(n=e.props),!Ns(n))return null;var i={};return Object.keys(n).forEach(function(a){gw.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},bU=function(e,r,n){return function(i){return e(r,n,i),null}},ld=function(e,r,n){if(!Ns(e)||mb(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];gw.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=bU(o,r,n))}),i},xU=["children"],wU=["children"];function hO(t,e){if(t==null)return{};var r=_U(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function _U(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function gb(t){"@babel/helpers - typeof";return gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gb(t)}var pO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},fi=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},mO=null,Yg=null,yw=function t(e){if(e===mO&&Array.isArray(Yg))return Yg;var r=[];return N.Children.forEach(e,function(n){Le(n)||(lU.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),Yg=r,mO=e,r};function tn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return fi(i)}):n=[fi(e)],yw(t).forEach(function(i){var a=en(i,"type.displayName")||en(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Nr(t,e){var r=tn(t,e);return r&&r[0]}var gO=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!fe(n)||n<=0||!fe(i)||i<=0)},SU=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],kU=function(e){return e&&e.type&&Ya(e.type)&&SU.indexOf(e.type)>=0},EU=function(e){return e&&gb(e)==="object"&&"clipDot"in e},OU=function(e,r,n,i){var a,o=(a=Xg==null?void 0:Xg[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Me(e)&&(i&&o.includes(r)||vU.includes(r))||n&&gw.includes(r)},Be=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(N.isValidElement(e)&&(i=e.props),!Ns(i))return null;var a={};return Object.keys(i).forEach(function(o){var u;OU((u=i)===null||u===void 0?void 0:u[o],o,r,n)&&(a[o]=i[o])}),a},yb=function t(e,r){if(e===r)return!0;var n=N.Children.count(e);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return yO(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var a=e[i],o=r[i];if(Array.isArray(a)||Array.isArray(o)){if(!t(a,o))return!1}else if(!yO(a,o))return!1}return!0},yO=function(e,r){if(Le(e)&&Le(r))return!0;if(!Le(e)&&!Le(r)){var n=e.props||{},i=n.children,a=hO(n,xU),o=r.props||{},u=o.children,c=hO(o,wU);return i&&u?Qo(a,c)&&yb(i,u):!i&&!u?Qo(a,c):!1}return!1},vO=function(e,r){var n=[],i={};return yw(e).forEach(function(a,o){if(kU(a))n.push(a);else if(a){var u=fi(a.type),c=r[u]||{},f=c.handler,p=c.once;if(f&&(!p||!i[u])){var h=f(a,u,o);n.push(h),i[u]=!0}}}),n},AU=function(e){var r=e&&e.type;return r&&pO[r]?pO[r]:null},TU=function(e,r){return yw(r).indexOf(e)},jU=["children","width","height","viewBox","className","style","title","desc"];function vb(){return vb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},vb.apply(this,arguments)}function PU(t,e){if(t==null)return{};var r=CU(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function CU(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function bb(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,u=t.title,c=t.desc,f=PU(t,jU),p=i||{width:r,height:n,x:0,y:0},h=qe("recharts-surface",a);return M.createElement("svg",vb({},Be(f,!0,"svg"),{className:h,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),M.createElement("title",null,u),M.createElement("desc",null,c),e)}var NU=["children","className"];function xb(){return xb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},xb.apply(this,arguments)}function RU(t,e){if(t==null)return{};var r=$U(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $U(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var kt=M.forwardRef(function(t,e){var r=t.children,n=t.className,i=RU(t,NU),a=qe("recharts-layer",n);return M.createElement("g",xb({className:a},Be(i,!0),{ref:e}),r)}),di=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a]},Jg,bO;function IU(){if(bO)return Jg;bO=1;function t(e,r,n){var i=-1,a=e.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i<a;)o[i]=e[i+r];return o}return Jg=t,Jg}var Qg,xO;function MU(){if(xO)return Qg;xO=1;var t=IU();function e(r,n,i){var a=r.length;return i=i===void 0?a:i,!n&&i>=a?r:t(r,n,i)}return Qg=e,Qg}var Zg,wO;function AN(){if(wO)return Zg;wO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+t+i+a+"]");function c(f){return u.test(f)}return Zg=c,Zg}var ey,_O;function DU(){if(_O)return ey;_O=1;function t(e){return e.split("")}return ey=t,ey}var ty,SO;function LU(){if(SO)return ty;SO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="["+t+"]",u="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+c+")",p="[^"+t+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",w=f+"?",_="["+a+"]?",b="(?:"+y+"(?:"+[p,h,g].join("|")+")"+_+w+")*",k=_+w+b,O="(?:"+[p+u+"?",u,h,g,o].join("|")+")",A=RegExp(c+"(?="+c+")|"+O+k,"g");function j(E){return E.match(A)||[]}return ty=j,ty}var ry,kO;function zU(){if(kO)return ry;kO=1;var t=DU(),e=AN(),r=LU();function n(i){return e(i)?r(i):t(i)}return ry=n,ry}var ny,EO;function BU(){if(EO)return ny;EO=1;var t=MU(),e=AN(),r=zU(),n=SN();function i(a){return function(o){o=n(o);var u=e(o)?r(o):void 0,c=u?u[0]:o.charAt(0),f=u?t(u,1).join(""):o.slice(1);return c[a]()+f}}return ny=i,ny}var iy,OO;function qU(){if(OO)return iy;OO=1;var t=BU(),e=t("toUpperCase");return iy=e,iy}var UU=qU();const _h=Ze(UU);function it(t){return function(){return t}}const TN=Math.cos,ud=Math.sin,jn=Math.sqrt,cd=Math.PI,Sh=2*cd,wb=Math.PI,_b=2*wb,La=1e-6,FU=_b-La;function jN(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function HU(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return jN;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class WU{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?jN:HU(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,o){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,u=this._y1,c=n-e,f=i-r,p=o-e,h=u-r,g=p*p+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(g>La)if(!(Math.abs(h*c-f*p)>La)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let y=n-o,w=i-u,_=c*c+f*f,b=y*y+w*w,k=Math.sqrt(_),O=Math.sqrt(g),A=a*Math.tan((wb-Math.acos((_+g-b)/(2*k*O)))/2),j=A/O,E=A/k;Math.abs(j-1)>La&&this._append`L${e+j*p},${r+j*h}`,this._append`A${a},${a},0,0,${+(h*y>p*w)},${this._x1=e+E*c},${this._y1=r+E*f}`}}arc(e,r,n,i,a,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),c=n*Math.sin(i),f=e+u,p=r+c,h=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>La||Math.abs(this._y1-p)>La)&&this._append`L${f},${p}`,n&&(g<0&&(g=g%_b+_b),g>FU?this._append`A${n},${n},0,1,${h},${e-u},${r-c}A${n},${n},0,1,${h},${this._x1=f},${this._y1=p}`:g>La&&this._append`A${n},${n},0,${+(g>=wb)},${h},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function vw(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new WU(e)}function bw(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function PN(t){this._context=t}PN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function kh(t){return new PN(t)}function CN(t){return t[0]}function NN(t){return t[1]}function RN(t,e){var r=it(!0),n=null,i=kh,a=null,o=vw(u);t=typeof t=="function"?t:t===void 0?CN:it(t),e=typeof e=="function"?e:e===void 0?NN:it(e);function u(c){var f,p=(c=bw(c)).length,h,g=!1,y;for(n==null&&(a=i(y=o())),f=0;f<=p;++f)!(f<p&&r(h=c[f],f,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+t(h,f,c),+e(h,f,c));if(y)return a=null,y+""||null}return u.x=function(c){return arguments.length?(t=typeof c=="function"?c:it(+c),u):t},u.y=function(c){return arguments.length?(e=typeof c=="function"?c:it(+c),u):e},u.defined=function(c){return arguments.length?(r=typeof c=="function"?c:it(!!c),u):r},u.curve=function(c){return arguments.length?(i=c,n!=null&&(a=i(n)),u):i},u.context=function(c){return arguments.length?(c==null?n=a=null:a=i(n=c),u):n},u}function Tf(t,e,r){var n=null,i=it(!0),a=null,o=kh,u=null,c=vw(f);t=typeof t=="function"?t:t===void 0?CN:it(+t),e=typeof e=="function"?e:it(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?NN:it(+r);function f(h){var g,y,w,_=(h=bw(h)).length,b,k=!1,O,A=new Array(_),j=new Array(_);for(a==null&&(u=o(O=c())),g=0;g<=_;++g){if(!(g<_&&i(b=h[g],g,h))===k)if(k=!k)y=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=g-1;w>=y;--w)u.point(A[w],j[w]);u.lineEnd(),u.areaEnd()}k&&(A[g]=+t(b,g,h),j[g]=+e(b,g,h),u.point(n?+n(b,g,h):A[g],r?+r(b,g,h):j[g]))}if(O)return u=null,O+""||null}function p(){return RN().defined(i).curve(o).context(a)}return f.x=function(h){return arguments.length?(t=typeof h=="function"?h:it(+h),n=null,f):t},f.x0=function(h){return arguments.length?(t=typeof h=="function"?h:it(+h),f):t},f.x1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:it(+h),f):n},f.y=function(h){return arguments.length?(e=typeof h=="function"?h:it(+h),r=null,f):e},f.y0=function(h){return arguments.length?(e=typeof h=="function"?h:it(+h),f):e},f.y1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:it(+h),f):r},f.lineX0=f.lineY0=function(){return p().x(t).y(e)},f.lineY1=function(){return p().x(t).y(r)},f.lineX1=function(){return p().x(n).y(e)},f.defined=function(h){return arguments.length?(i=typeof h=="function"?h:it(!!h),f):i},f.curve=function(h){return arguments.length?(o=h,a!=null&&(u=o(a)),f):o},f.context=function(h){return arguments.length?(h==null?a=u=null:u=o(a=h),f):a},f}class $N{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function VU(t){return new $N(t,!0)}function KU(t){return new $N(t,!1)}const xw={draw(t,e){const r=jn(e/cd);t.moveTo(r,0),t.arc(0,0,r,0,Sh)}},GU={draw(t,e){const r=jn(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},IN=jn(1/3),XU=IN*2,YU={draw(t,e){const r=jn(e/XU),n=r*IN;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},JU={draw(t,e){const r=jn(e),n=-r/2;t.rect(n,n,r,r)}},QU=.8908130915292852,MN=ud(cd/10)/ud(7*cd/10),ZU=ud(Sh/10)*MN,eF=-TN(Sh/10)*MN,tF={draw(t,e){const r=jn(e*QU),n=ZU*r,i=eF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=Sh*a/5,u=TN(o),c=ud(o);t.lineTo(c*r,-u*r),t.lineTo(u*n-c*i,c*n+u*i)}t.closePath()}},ay=jn(3),rF={draw(t,e){const r=-jn(e/(ay*3));t.moveTo(0,r*2),t.lineTo(-ay*r,-r),t.lineTo(ay*r,-r),t.closePath()}},Gr=-.5,Xr=jn(3)/2,Sb=1/jn(12),nF=(Sb/2+1)*3,iF={draw(t,e){const r=jn(e/nF),n=r/2,i=r*Sb,a=n,o=r*Sb+r,u=-a,c=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(u,c),t.lineTo(Gr*n-Xr*i,Xr*n+Gr*i),t.lineTo(Gr*a-Xr*o,Xr*a+Gr*o),t.lineTo(Gr*u-Xr*c,Xr*u+Gr*c),t.lineTo(Gr*n+Xr*i,Gr*i-Xr*n),t.lineTo(Gr*a+Xr*o,Gr*o-Xr*a),t.lineTo(Gr*u+Xr*c,Gr*c-Xr*u),t.closePath()}};function aF(t,e){let r=null,n=vw(i);t=typeof t=="function"?t:it(t||xw),e=typeof e=="function"?e:it(e===void 0?64:+e);function i(){let a;if(r||(r=a=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:it(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:it(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function fd(){}function dd(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function DN(t){this._context=t}DN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:dd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:dd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function oF(t){return new DN(t)}function LN(t){this._context=t}LN.prototype={areaStart:fd,areaEnd:fd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:dd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function sF(t){return new LN(t)}function zN(t){this._context=t}zN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:dd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function lF(t){return new zN(t)}function BN(t){this._context=t}BN.prototype={areaStart:fd,areaEnd:fd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function uF(t){return new BN(t)}function AO(t){return t<0?-1:1}function TO(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(AO(a)+AO(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function jO(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function oy(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,u=(a-n)/3;t._context.bezierCurveTo(n+u,i+u*e,a-u,o-u*r,a,o)}function hd(t){this._context=t}hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:oy(this,this._t0,jO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,oy(this,jO(this,r=TO(this,t,e)),r);break;default:oy(this,this._t0,r=TO(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function qN(t){this._context=new UN(t)}(qN.prototype=Object.create(hd.prototype)).point=function(t,e){hd.prototype.point.call(this,e,t)};function UN(t){this._context=t}UN.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function cF(t){return new hd(t)}function fF(t){return new qN(t)}function FN(t){this._context=t}FN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=PO(t),i=PO(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function PO(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function dF(t){return new FN(t)}function Eh(t,e){this._context=t,this._t=e}Eh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function hF(t){return new Eh(t,.5)}function pF(t){return new Eh(t,0)}function mF(t){return new Eh(t,1)}function ns(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,u=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<u;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function kb(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function gF(t,e){return t[e]}function yF(t){const e=[];return e.key=t,e}function vF(){var t=it([]),e=kb,r=ns,n=gF;function i(a){var o=Array.from(t.apply(this,arguments),yF),u,c=o.length,f=-1,p;for(const h of a)for(u=0,++f;u<c;++u)(o[u][f]=[0,+n(h,o[u].key,f,a)]).data=h;for(u=0,p=bw(e(o));u<c;++u)o[p[u]].index=u;return r(o,p),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:it(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:it(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?kb:typeof a=="function"?a:it(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??ns,i):r},i}function bF(t,e){if((n=t.length)>0){for(var r,n,i=0,a=t[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=t[r][i][1]||0;if(o)for(r=0;r<n;++r)t[r][i][1]/=o}ns(t,e)}}function xF(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,a=n.length;r<a;++r){for(var o=0,u=0;o<i;++o)u+=t[o][r][1]||0;n[r][1]+=n[r][0]=-u/2}ns(t,e)}}function wF(t,e){if(!(!((o=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var u=0,c=0,f=0;u<o;++u){for(var p=t[e[u]],h=p[n][1]||0,g=p[n-1][1]||0,y=(h-g)/2,w=0;w<u;++w){var _=t[e[w]],b=_[n][1]||0,k=_[n-1][1]||0;y+=b-k}c+=h,f+=y*h}i[n-1][1]+=i[n-1][0]=r,c&&(r-=f/c)}i[n-1][1]+=i[n-1][0]=r,ns(t,e)}}function lu(t){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(t)}var _F=["type","size","sizeType"];function Eb(){return Eb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Eb.apply(this,arguments)}function CO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function NO(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CO(Object(r),!0).forEach(function(n){SF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CO(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function SF(t,e,r){return e=kF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kF(t){var e=EF(t,"string");return lu(e)=="symbol"?e:e+""}function EF(t,e){if(lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function OF(t,e){if(t==null)return{};var r=AF(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function AF(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var HN={symbolCircle:xw,symbolCross:GU,symbolDiamond:YU,symbolSquare:JU,symbolStar:tF,symbolTriangle:rF,symbolWye:iF},TF=Math.PI/180,jF=function(e){var r="symbol".concat(_h(e));return HN[r]||xw},PF=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var i=18*TF;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},CF=function(e,r){HN["symbol".concat(_h(e))]=r},ww=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,u=o===void 0?"area":o,c=OF(e,_F),f=NO(NO({},c),{},{type:n,size:a,sizeType:u}),p=function(){var b=jF(n),k=aF().type(b).size(PF(a,u,n));return k()},h=f.className,g=f.cx,y=f.cy,w=Be(f,!0);return g===+g&&y===+y&&a===+a?M.createElement("path",Eb({},w,{className:qe("recharts-symbols",h),transform:"translate(".concat(g,", ").concat(y,")"),d:p()})):null};ww.registerSymbol=CF;function is(t){"@babel/helpers - typeof";return is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},is(t)}function Ob(){return Ob=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ob.apply(this,arguments)}function RO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function NF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RO(Object(r),!0).forEach(function(n){uu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RO(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,VN(n.key),n)}}function IF(t,e,r){return e&&$F(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function MF(t,e,r){return e=pd(e),DF(t,WN()?Reflect.construct(e,r||[],pd(t).constructor):e.apply(t,r))}function DF(t,e){if(e&&(is(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LF(t)}function LF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function WN(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WN=function(){return!!t})()}function pd(t){return pd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pd(t)}function zF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ab(t,e)}function Ab(t,e){return Ab=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ab(t,e)}function uu(t,e,r){return e=VN(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VN(t){var e=BF(t,"string");return is(e)=="symbol"?e:e+""}function BF(t,e){if(is(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(is(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Yr=32,_w=(function(t){function e(){return RF(this,e),MF(this,e,arguments)}return zF(e,t),IF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=Yr/2,o=Yr/6,u=Yr/3,c=n.inactive?i:n.color;if(n.type==="plainline")return M.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:Yr,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return M.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(u,`
416
- A`).concat(o,",").concat(o,",0,1,1,").concat(2*u,",").concat(a,`
417
- H`).concat(Yr,"M").concat(2*u,",").concat(a,`
418
- A`).concat(o,",").concat(o,",0,1,1,").concat(u,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return M.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Yr/8,"h").concat(Yr,"v").concat(Yr*3/4,"h").concat(-Yr,"z"),className:"recharts-legend-icon"});if(M.isValidElement(n.legendIcon)){var f=NF({},n);return delete f.legendIcon,M.cloneElement(n.legendIcon,f)}return M.createElement(ww,{fill:c,cx:a,cy:a,size:Yr,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,u=i.layout,c=i.formatter,f=i.inactiveColor,p={x:0,y:0,width:Yr,height:Yr},h={display:u==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(y,w){var _=y.formatter||c,b=qe(uu(uu({"recharts-legend-item":!0},"legend-item-".concat(w),!0),"inactive",y.inactive));if(y.type==="none")return null;var k=Me(y.value)?null:y.value;di(!Me(y.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var O=y.inactive?f:y.color;return M.createElement("li",Ob({className:b,style:h,key:"legend-item-".concat(w)},ld(n.props,y,w)),M.createElement(bb,{width:o,height:o,viewBox:p,style:g},n.renderIcon(y)),M.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},_?_(k,y,w):k))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return M.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(N.PureComponent);uu(_w,"displayName","Legend");uu(_w,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var sy,$O;function qF(){if($O)return sy;$O=1;var t=bh();function e(){this.__data__=new t,this.size=0}return sy=e,sy}var ly,IO;function UF(){if(IO)return ly;IO=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return ly=t,ly}var uy,MO;function FF(){if(MO)return uy;MO=1;function t(e){return this.__data__.get(e)}return uy=t,uy}var cy,DO;function HF(){if(DO)return cy;DO=1;function t(e){return this.__data__.has(e)}return cy=t,cy}var fy,LO;function WF(){if(LO)return fy;LO=1;var t=bh(),e=dw(),r=hw(),n=200;function i(a,o){var u=this.__data__;if(u instanceof t){var c=u.__data__;if(!e||c.length<n-1)return c.push([a,o]),this.size=++u.size,this;u=this.__data__=new r(c)}return u.set(a,o),this.size=u.size,this}return fy=i,fy}var dy,zO;function KN(){if(zO)return dy;zO=1;var t=bh(),e=qF(),r=UF(),n=FF(),i=HF(),a=WF();function o(u){var c=this.__data__=new t(u);this.size=c.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,dy=o,dy}var hy,BO;function VF(){if(BO)return hy;BO=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return hy=e,hy}var py,qO;function KF(){if(qO)return py;qO=1;function t(e){return this.__data__.has(e)}return py=t,py}var my,UO;function GN(){if(UO)return my;UO=1;var t=hw(),e=VF(),r=KF();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new t;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,my=n,my}var gy,FO;function XN(){if(FO)return gy;FO=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return gy=t,gy}var yy,HO;function YN(){if(HO)return yy;HO=1;function t(e,r){return e.has(r)}return yy=t,yy}var vy,WO;function JN(){if(WO)return vy;WO=1;var t=GN(),e=XN(),r=YN(),n=1,i=2;function a(o,u,c,f,p,h){var g=c&n,y=o.length,w=u.length;if(y!=w&&!(g&&w>y))return!1;var _=h.get(o),b=h.get(u);if(_&&b)return _==u&&b==o;var k=-1,O=!0,A=c&i?new t:void 0;for(h.set(o,u),h.set(u,o);++k<y;){var j=o[k],E=u[k];if(f)var T=g?f(E,j,k,u,o,h):f(j,E,k,o,u,h);if(T!==void 0){if(T)continue;O=!1;break}if(A){if(!e(u,function(C,R){if(!r(A,R)&&(j===C||p(j,C,c,f,h)))return A.push(R)})){O=!1;break}}else if(!(j===E||p(j,E,c,f,h))){O=!1;break}}return h.delete(o),h.delete(u),O}return vy=a,vy}var by,VO;function GF(){if(VO)return by;VO=1;var t=Wn(),e=t.Uint8Array;return by=e,by}var xy,KO;function XF(){if(KO)return xy;KO=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return xy=t,xy}var wy,GO;function Sw(){if(GO)return wy;GO=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return wy=t,wy}var _y,XO;function YF(){if(XO)return _y;XO=1;var t=Gu(),e=GF(),r=fw(),n=JN(),i=XF(),a=Sw(),o=1,u=2,c="[object Boolean]",f="[object Date]",p="[object Error]",h="[object Map]",g="[object Number]",y="[object RegExp]",w="[object Set]",_="[object String]",b="[object Symbol]",k="[object ArrayBuffer]",O="[object DataView]",A=t?t.prototype:void 0,j=A?A.valueOf:void 0;function E(T,C,R,D,X,$,I){switch(R){case O:if(T.byteLength!=C.byteLength||T.byteOffset!=C.byteOffset)return!1;T=T.buffer,C=C.buffer;case k:return!(T.byteLength!=C.byteLength||!$(new e(T),new e(C)));case c:case f:case g:return r(+T,+C);case p:return T.name==C.name&&T.message==C.message;case y:case _:return T==C+"";case h:var q=i;case w:var U=D&o;if(q||(q=a),T.size!=C.size&&!U)return!1;var V=I.get(T);if(V)return V==C;D|=u,I.set(T,C);var G=n(q(T),q(C),D,X,$,I);return I.delete(T),G;case b:if(j)return j.call(T)==j.call(C)}return!1}return _y=E,_y}var Sy,YO;function QN(){if(YO)return Sy;YO=1;function t(e,r){for(var n=-1,i=r.length,a=e.length;++n<i;)e[a+n]=r[n];return e}return Sy=t,Sy}var ky,JO;function JF(){if(JO)return ky;JO=1;var t=QN(),e=Sr();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return ky=r,ky}var Ey,QO;function QF(){if(QO)return Ey;QO=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var u=e[n];r(u,n,e)&&(o[a++]=u)}return o}return Ey=t,Ey}var Oy,ZO;function ZF(){if(ZO)return Oy;ZO=1;function t(){return[]}return Oy=t,Oy}var Ay,eA;function e9(){if(eA)return Ay;eA=1;var t=QF(),e=ZF(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(u){return n.call(o,u)}))}:e;return Ay=a,Ay}var Ty,tA;function t9(){if(tA)return Ty;tA=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return Ty=t,Ty}var jy,rA;function r9(){if(rA)return jy;rA=1;var t=wi(),e=_i(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return jy=n,jy}var Py,nA;function kw(){if(nA)return Py;nA=1;var t=r9(),e=_i(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return Py=a,Py}var Hl={exports:{}},Cy,iA;function n9(){if(iA)return Cy;iA=1;function t(){return!1}return Cy=t,Cy}Hl.exports;var aA;function ZN(){return aA||(aA=1,(function(t,e){var r=Wn(),n=n9(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,u=o?r.Buffer:void 0,c=u?u.isBuffer:void 0,f=c||n;t.exports=f})(Hl,Hl.exports)),Hl.exports}var Ny,oA;function Ew(){if(oA)return Ny;oA=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return Ny=r,Ny}var Ry,sA;function Ow(){if(sA)return Ry;sA=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Ry=e,Ry}var $y,lA;function i9(){if(lA)return $y;lA=1;var t=wi(),e=Ow(),r=_i(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",f="[object Map]",p="[object Number]",h="[object Object]",g="[object RegExp]",y="[object Set]",w="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",k="[object DataView]",O="[object Float32Array]",A="[object Float64Array]",j="[object Int8Array]",E="[object Int16Array]",T="[object Int32Array]",C="[object Uint8Array]",R="[object Uint8ClampedArray]",D="[object Uint16Array]",X="[object Uint32Array]",$={};$[O]=$[A]=$[j]=$[E]=$[T]=$[C]=$[R]=$[D]=$[X]=!0,$[n]=$[i]=$[b]=$[a]=$[k]=$[o]=$[u]=$[c]=$[f]=$[p]=$[h]=$[g]=$[y]=$[w]=$[_]=!1;function I(q){return r(q)&&e(q.length)&&!!$[t(q)]}return $y=I,$y}var Iy,uA;function eR(){if(uA)return Iy;uA=1;function t(e){return function(r){return e(r)}}return Iy=t,Iy}var Wl={exports:{}};Wl.exports;var cA;function a9(){return cA||(cA=1,(function(t,e){var r=xN(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,u=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();t.exports=u})(Wl,Wl.exports)),Wl.exports}var My,fA;function tR(){if(fA)return My;fA=1;var t=i9(),e=eR(),r=a9(),n=r&&r.isTypedArray,i=n?e(n):t;return My=i,My}var Dy,dA;function o9(){if(dA)return Dy;dA=1;var t=t9(),e=kw(),r=Sr(),n=ZN(),i=Ew(),a=tR(),o=Object.prototype,u=o.hasOwnProperty;function c(f,p){var h=r(f),g=!h&&e(f),y=!h&&!g&&n(f),w=!h&&!g&&!y&&a(f),_=h||g||y||w,b=_?t(f.length,String):[],k=b.length;for(var O in f)(p||u.call(f,O))&&!(_&&(O=="length"||y&&(O=="offset"||O=="parent")||w&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,k)))&&b.push(O);return b}return Dy=c,Dy}var Ly,hA;function s9(){if(hA)return Ly;hA=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return Ly=e,Ly}var zy,pA;function rR(){if(pA)return zy;pA=1;function t(e,r){return function(n){return e(r(n))}}return zy=t,zy}var By,mA;function l9(){if(mA)return By;mA=1;var t=rR(),e=t(Object.keys,Object);return By=e,By}var qy,gA;function u9(){if(gA)return qy;gA=1;var t=s9(),e=l9(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var u in Object(a))n.call(a,u)&&u!="constructor"&&o.push(u);return o}return qy=i,qy}var Uy,yA;function Ju(){if(yA)return Uy;yA=1;var t=cw(),e=Ow();function r(n){return n!=null&&e(n.length)&&!t(n)}return Uy=r,Uy}var Fy,vA;function Oh(){if(vA)return Fy;vA=1;var t=o9(),e=u9(),r=Ju();function n(i){return r(i)?t(i):e(i)}return Fy=n,Fy}var Hy,bA;function c9(){if(bA)return Hy;bA=1;var t=JF(),e=e9(),r=Oh();function n(i){return t(i,r,e)}return Hy=n,Hy}var Wy,xA;function f9(){if(xA)return Wy;xA=1;var t=c9(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,u,c,f,p){var h=u&e,g=t(a),y=g.length,w=t(o),_=w.length;if(y!=_&&!h)return!1;for(var b=y;b--;){var k=g[b];if(!(h?k in o:n.call(o,k)))return!1}var O=p.get(a),A=p.get(o);if(O&&A)return O==o&&A==a;var j=!0;p.set(a,o),p.set(o,a);for(var E=h;++b<y;){k=g[b];var T=a[k],C=o[k];if(c)var R=h?c(C,T,k,o,a,p):c(T,C,k,a,o,p);if(!(R===void 0?T===C||f(T,C,u,c,p):R)){j=!1;break}E||(E=k=="constructor")}if(j&&!E){var D=a.constructor,X=o.constructor;D!=X&&"constructor"in a&&"constructor"in o&&!(typeof D=="function"&&D instanceof D&&typeof X=="function"&&X instanceof X)&&(j=!1)}return p.delete(a),p.delete(o),j}return Wy=i,Wy}var Vy,wA;function d9(){if(wA)return Vy;wA=1;var t=no(),e=Wn(),r=t(e,"DataView");return Vy=r,Vy}var Ky,_A;function h9(){if(_A)return Ky;_A=1;var t=no(),e=Wn(),r=t(e,"Promise");return Ky=r,Ky}var Gy,SA;function nR(){if(SA)return Gy;SA=1;var t=no(),e=Wn(),r=t(e,"Set");return Gy=r,Gy}var Xy,kA;function p9(){if(kA)return Xy;kA=1;var t=no(),e=Wn(),r=t(e,"WeakMap");return Xy=r,Xy}var Yy,EA;function m9(){if(EA)return Yy;EA=1;var t=d9(),e=dw(),r=h9(),n=nR(),i=p9(),a=wi(),o=wN(),u="[object Map]",c="[object Object]",f="[object Promise]",p="[object Set]",h="[object WeakMap]",g="[object DataView]",y=o(t),w=o(e),_=o(r),b=o(n),k=o(i),O=a;return(t&&O(new t(new ArrayBuffer(1)))!=g||e&&O(new e)!=u||r&&O(r.resolve())!=f||n&&O(new n)!=p||i&&O(new i)!=h)&&(O=function(A){var j=a(A),E=j==c?A.constructor:void 0,T=E?o(E):"";if(T)switch(T){case y:return g;case w:return u;case _:return f;case b:return p;case k:return h}return j}),Yy=O,Yy}var Jy,OA;function g9(){if(OA)return Jy;OA=1;var t=KN(),e=JN(),r=YF(),n=f9(),i=m9(),a=Sr(),o=ZN(),u=tR(),c=1,f="[object Arguments]",p="[object Array]",h="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function w(_,b,k,O,A,j){var E=a(_),T=a(b),C=E?p:i(_),R=T?p:i(b);C=C==f?h:C,R=R==f?h:R;var D=C==h,X=R==h,$=C==R;if($&&o(_)){if(!o(b))return!1;E=!0,D=!1}if($&&!D)return j||(j=new t),E||u(_)?e(_,b,k,O,A,j):r(_,b,C,k,O,A,j);if(!(k&c)){var I=D&&y.call(_,"__wrapped__"),q=X&&y.call(b,"__wrapped__");if(I||q){var U=I?_.value():_,V=q?b.value():b;return j||(j=new t),A(U,V,k,O,j)}}return $?(j||(j=new t),n(_,b,k,O,A,j)):!1}return Jy=w,Jy}var Qy,AA;function Aw(){if(AA)return Qy;AA=1;var t=g9(),e=_i();function r(n,i,a,o,u){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,u)}return Qy=r,Qy}var Zy,TA;function y9(){if(TA)return Zy;TA=1;var t=KN(),e=Aw(),r=1,n=2;function i(a,o,u,c){var f=u.length,p=f,h=!c;if(a==null)return!p;for(a=Object(a);f--;){var g=u[f];if(h&&g[2]?g[1]!==a[g[0]]:!(g[0]in a))return!1}for(;++f<p;){g=u[f];var y=g[0],w=a[y],_=g[1];if(h&&g[2]){if(w===void 0&&!(y in a))return!1}else{var b=new t;if(c)var k=c(w,_,y,a,o,b);if(!(k===void 0?e(_,w,r|n,c,b):k))return!1}}return!0}return Zy=i,Zy}var ev,jA;function iR(){if(jA)return ev;jA=1;var t=ca();function e(r){return r===r&&!t(r)}return ev=e,ev}var tv,PA;function v9(){if(PA)return tv;PA=1;var t=iR(),e=Oh();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],u=n[o];i[a]=[o,u,t(u)]}return i}return tv=r,tv}var rv,CA;function aR(){if(CA)return rv;CA=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return rv=t,rv}var nv,NA;function b9(){if(NA)return nv;NA=1;var t=y9(),e=v9(),r=aR();function n(i){var a=e(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||t(o,i,a)}}return nv=n,nv}var iv,RA;function x9(){if(RA)return iv;RA=1;function t(e,r){return e!=null&&r in Object(e)}return iv=t,iv}var av,$A;function w9(){if($A)return av;$A=1;var t=kN(),e=kw(),r=Sr(),n=Ew(),i=Ow(),a=wh();function o(u,c,f){c=t(c,u);for(var p=-1,h=c.length,g=!1;++p<h;){var y=a(c[p]);if(!(g=u!=null&&f(u,y)))break;u=u[y]}return g||++p!=h?g:(h=u==null?0:u.length,!!h&&i(h)&&n(y,h)&&(r(u)||e(u)))}return av=o,av}var ov,IA;function _9(){if(IA)return ov;IA=1;var t=x9(),e=w9();function r(n,i){return n!=null&&e(n,i,t)}return ov=r,ov}var sv,MA;function S9(){if(MA)return sv;MA=1;var t=Aw(),e=EN(),r=_9(),n=uw(),i=iR(),a=aR(),o=wh(),u=1,c=2;function f(p,h){return n(p)&&i(h)?a(o(p),h):function(g){var y=e(g,p);return y===void 0&&y===h?r(g,p):t(h,y,u|c)}}return sv=f,sv}var lv,DA;function Rs(){if(DA)return lv;DA=1;function t(e){return e}return lv=t,lv}var uv,LA;function k9(){if(LA)return uv;LA=1;function t(e){return function(r){return r==null?void 0:r[e]}}return uv=t,uv}var cv,zA;function E9(){if(zA)return cv;zA=1;var t=mw();function e(r){return function(n){return t(n,r)}}return cv=e,cv}var fv,BA;function O9(){if(BA)return fv;BA=1;var t=k9(),e=E9(),r=uw(),n=wh();function i(a){return r(a)?t(n(a)):e(a)}return fv=i,fv}var dv,qA;function fa(){if(qA)return dv;qA=1;var t=b9(),e=S9(),r=Rs(),n=Sr(),i=O9();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):i(o)}return dv=a,dv}var hv,UA;function oR(){if(UA)return hv;UA=1;function t(e,r,n,i){for(var a=e.length,o=n+(i?1:-1);i?o--:++o<a;)if(r(e[o],o,e))return o;return-1}return hv=t,hv}var pv,FA;function A9(){if(FA)return pv;FA=1;function t(e){return e!==e}return pv=t,pv}var mv,HA;function T9(){if(HA)return mv;HA=1;function t(e,r,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===r)return i;return-1}return mv=t,mv}var gv,WA;function j9(){if(WA)return gv;WA=1;var t=oR(),e=A9(),r=T9();function n(i,a,o){return a===a?r(i,a,o):t(i,e,o)}return gv=n,gv}var yv,VA;function P9(){if(VA)return yv;VA=1;var t=j9();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return yv=e,yv}var vv,KA;function C9(){if(KA)return vv;KA=1;function t(e,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;)if(n(r,e[i]))return!0;return!1}return vv=t,vv}var bv,GA;function N9(){if(GA)return bv;GA=1;function t(){}return bv=t,bv}var xv,XA;function R9(){if(XA)return xv;XA=1;var t=nR(),e=N9(),r=Sw(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(a){return new t(a)}:e;return xv=i,xv}var wv,YA;function $9(){if(YA)return wv;YA=1;var t=GN(),e=P9(),r=C9(),n=YN(),i=R9(),a=Sw(),o=200;function u(c,f,p){var h=-1,g=e,y=c.length,w=!0,_=[],b=_;if(p)w=!1,g=r;else if(y>=o){var k=f?null:i(c);if(k)return a(k);w=!1,g=n,b=new t}else b=f?[]:_;e:for(;++h<y;){var O=c[h],A=f?f(O):O;if(O=p||O!==0?O:0,w&&A===A){for(var j=b.length;j--;)if(b[j]===A)continue e;f&&b.push(A),_.push(O)}else g(b,A,p)||(b!==_&&b.push(A),_.push(O))}return _}return wv=u,wv}var _v,JA;function I9(){if(JA)return _v;JA=1;var t=fa(),e=$9();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return _v=r,_v}var M9=I9();const QA=Ze(M9);function sR(t,e,r){return e===!0?QA(t,r):Me(e)?QA(t,e):t}function as(t){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},as(t)}var D9=["ref"];function ZA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ni(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZA(Object(r),!0).forEach(function(n){Ah(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function L9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e2(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uR(n.key),n)}}function z9(t,e,r){return e&&e2(t.prototype,e),r&&e2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function B9(t,e,r){return e=md(e),q9(t,lR()?Reflect.construct(e,r||[],md(t).constructor):e.apply(t,r))}function q9(t,e){if(e&&(as(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U9(t)}function U9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lR=function(){return!!t})()}function md(t){return md=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},md(t)}function F9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tb(t,e)}function Tb(t,e){return Tb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Tb(t,e)}function Ah(t,e,r){return e=uR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uR(t){var e=H9(t,"string");return as(e)=="symbol"?e:e+""}function H9(t,e){if(as(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(as(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function W9(t,e){if(t==null)return{};var r=V9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function V9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function K9(t){return t.value}function G9(t,e){if(M.isValidElement(t))return M.cloneElement(t,e);if(typeof t=="function")return M.createElement(t,e);e.ref;var r=W9(e,D9);return M.createElement(_w,r)}var t2=1,Zo=(function(t){function e(){var r;L9(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=B9(this,e,[].concat(i)),Ah(r,"lastBoundingBox",{width:-1,height:-1}),r}return F9(e,t),z9(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>t2||Math.abs(i.height-this.lastBoundingBox.height)>t2)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ni({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,u=i.verticalAlign,c=i.margin,f=i.chartWidth,p=i.chartHeight,h,g;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var y=this.getBBoxSnapshot();h={left:((f||0)-y.width)/2}}else h=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var w=this.getBBoxSnapshot();g={top:((p||0)-w.height)/2}}else g=u==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return ni(ni({},h),g)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,u=i.height,c=i.wrapperStyle,f=i.payloadUniqBy,p=i.payload,h=ni(ni({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(c)),c);return M.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(y){n.wrapperNode=y}},G9(a,ni(ni({},this.props),{},{payload:sR(p,f,K9)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ni(ni({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&fe(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);Ah(Zo,"displayName","Legend");Ah(Zo,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Sv,r2;function X9(){if(r2)return Sv;r2=1;var t=Gu(),e=kw(),r=Sr(),n=t?t.isConcatSpreadable:void 0;function i(a){return r(a)||e(a)||!!(n&&a&&a[n])}return Sv=i,Sv}var kv,n2;function cR(){if(n2)return kv;n2=1;var t=QN(),e=X9();function r(n,i,a,o,u){var c=-1,f=n.length;for(a||(a=e),u||(u=[]);++c<f;){var p=n[c];i>0&&a(p)?i>1?r(p,i-1,a,o,u):t(u,p):o||(u[u.length]=p)}return u}return kv=r,kv}var Ev,i2;function Y9(){if(i2)return Ev;i2=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),u=i(r),c=u.length;c--;){var f=u[e?c:++a];if(n(o[f],f,o)===!1)break}return r}}return Ev=t,Ev}var Ov,a2;function J9(){if(a2)return Ov;a2=1;var t=Y9(),e=t();return Ov=e,Ov}var Av,o2;function fR(){if(o2)return Av;o2=1;var t=J9(),e=Oh();function r(n,i){return n&&t(n,i,e)}return Av=r,Av}var Tv,s2;function Q9(){if(s2)return Tv;s2=1;var t=Ju();function e(r,n){return function(i,a){if(i==null)return i;if(!t(i))return r(i,a);for(var o=i.length,u=n?o:-1,c=Object(i);(n?u--:++u<o)&&a(c[u],u,c)!==!1;);return i}}return Tv=e,Tv}var jv,l2;function Tw(){if(l2)return jv;l2=1;var t=fR(),e=Q9(),r=e(t);return jv=r,jv}var Pv,u2;function dR(){if(u2)return Pv;u2=1;var t=Tw(),e=Ju();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(u,c,f){o[++a]=i(u,c,f)}),o}return Pv=r,Pv}var Cv,c2;function Z9(){if(c2)return Cv;c2=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return Cv=t,Cv}var Nv,f2;function e7(){if(f2)return Nv;f2=1;var t=Cs();function e(r,n){if(r!==n){var i=r!==void 0,a=r===null,o=r===r,u=t(r),c=n!==void 0,f=n===null,p=n===n,h=t(n);if(!f&&!h&&!u&&r>n||u&&c&&p&&!f&&!h||a&&c&&p||!i&&p||!o)return 1;if(!a&&!u&&!h&&r<n||h&&i&&o&&!a&&!u||f&&i&&o||!c&&o||!p)return-1}return 0}return Nv=e,Nv}var Rv,d2;function t7(){if(d2)return Rv;d2=1;var t=e7();function e(r,n,i){for(var a=-1,o=r.criteria,u=n.criteria,c=o.length,f=i.length;++a<c;){var p=t(o[a],u[a]);if(p){if(a>=f)return p;var h=i[a];return p*(h=="desc"?-1:1)}}return r.index-n.index}return Rv=e,Rv}var $v,h2;function r7(){if(h2)return $v;h2=1;var t=pw(),e=mw(),r=fa(),n=dR(),i=Z9(),a=eR(),o=t7(),u=Rs(),c=Sr();function f(p,h,g){h.length?h=t(h,function(_){return c(_)?function(b){return e(b,_.length===1?_[0]:_)}:_}):h=[u];var y=-1;h=t(h,a(r));var w=n(p,function(_,b,k){var O=t(h,function(A){return A(_)});return{criteria:O,index:++y,value:_}});return i(w,function(_,b){return o(_,b,g)})}return $v=f,$v}var Iv,p2;function n7(){if(p2)return Iv;p2=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return Iv=t,Iv}var Mv,m2;function i7(){if(m2)return Mv;m2=1;var t=n7(),e=Math.max;function r(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var o=arguments,u=-1,c=e(o.length-i,0),f=Array(c);++u<c;)f[u]=o[i+u];u=-1;for(var p=Array(i+1);++u<i;)p[u]=o[u];return p[i]=a(f),t(n,this,p)}}return Mv=r,Mv}var Dv,g2;function a7(){if(g2)return Dv;g2=1;function t(e){return function(){return e}}return Dv=t,Dv}var Lv,y2;function hR(){if(y2)return Lv;y2=1;var t=no(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Lv=e,Lv}var zv,v2;function o7(){if(v2)return zv;v2=1;var t=a7(),e=hR(),r=Rs(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return zv=n,zv}var Bv,b2;function s7(){if(b2)return Bv;b2=1;var t=800,e=16,r=Date.now;function n(i){var a=0,o=0;return function(){var u=r(),c=e-(u-o);if(o=u,c>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return Bv=n,Bv}var qv,x2;function l7(){if(x2)return qv;x2=1;var t=o7(),e=s7(),r=e(t);return qv=r,qv}var Uv,w2;function u7(){if(w2)return Uv;w2=1;var t=Rs(),e=i7(),r=l7();function n(i,a){return r(e(i,a,t),i+"")}return Uv=n,Uv}var Fv,_2;function Th(){if(_2)return Fv;_2=1;var t=fw(),e=Ju(),r=Ew(),n=ca();function i(a,o,u){if(!n(u))return!1;var c=typeof o;return(c=="number"?e(u)&&r(o,u.length):c=="string"&&o in u)?t(u[o],a):!1}return Fv=i,Fv}var Hv,S2;function c7(){if(S2)return Hv;S2=1;var t=cR(),e=r7(),r=u7(),n=Th(),i=r(function(a,o){if(a==null)return[];var u=o.length;return u>1&&n(a,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(a,t(o,1),[])});return Hv=i,Hv}var f7=c7();const jw=Ze(f7);function cu(t){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cu(t)}function jb(){return jb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jb.apply(this,arguments)}function d7(t,e){return g7(t)||m7(t,e)||p7(t,e)||h7()}function h7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
419
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p7(t,e){if(t){if(typeof t=="string")return k2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k2(t,e)}}function k2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m7(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function g7(t){if(Array.isArray(t))return t}function E2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Wv(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E2(Object(r),!0).forEach(function(n){y7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function y7(t,e,r){return e=v7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v7(t){var e=b7(t,"string");return cu(e)=="symbol"?e:e+""}function b7(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function x7(t){return Array.isArray(t)&&Dt(t[0])&&Dt(t[1])?t.join(" ~ "):t}var w7=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,u=o===void 0?{}:o,c=e.labelStyle,f=c===void 0?{}:c,p=e.payload,h=e.formatter,g=e.itemSorter,y=e.wrapperClassName,w=e.labelClassName,_=e.label,b=e.labelFormatter,k=e.accessibilityLayer,O=k===void 0?!1:k,A=function(){if(p&&p.length){var I={padding:0,margin:0},q=(g?jw(p,g):p).map(function(U,V){if(U.type==="none")return null;var G=Wv({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},u),Z=U.formatter||h||x7,K=U.value,te=U.name,H=K,B=te;if(Z&&H!=null&&B!=null){var z=Z(K,te,U,V,p);if(Array.isArray(z)){var J=d7(z,2);H=J[0],B=J[1]}else H=z}return M.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(V),style:G},Dt(B)?M.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Dt(B)?M.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,M.createElement("span",{className:"recharts-tooltip-item-value"},H),M.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return M.createElement("ul",{className:"recharts-tooltip-item-list",style:I},q)}return null},j=Wv({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),E=Wv({margin:0},f),T=!Le(_),C=T?_:"",R=qe("recharts-default-tooltip",y),D=qe("recharts-tooltip-label",w);T&&b&&p!==void 0&&p!==null&&(C=b(_,p));var X=O?{role:"status","aria-live":"assertive"}:{};return M.createElement("div",jb({className:R,style:j},X),M.createElement("p",{className:D,style:E},M.isValidElement(C)?C:"".concat(C)),A())};function fu(t){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fu(t)}function jf(t,e,r){return e=_7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _7(t){var e=S7(t,"string");return fu(e)=="symbol"?e:e+""}function S7(t,e){if(fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Pl="recharts-tooltip-wrapper",k7={visibility:"hidden"};function E7(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return qe(Pl,jf(jf(jf(jf({},"".concat(Pl,"-right"),fe(r)&&e&&fe(e.x)&&r>=e.x),"".concat(Pl,"-left"),fe(r)&&e&&fe(e.x)&&r<e.x),"".concat(Pl,"-bottom"),fe(n)&&e&&fe(e.y)&&n>=e.y),"".concat(Pl,"-top"),fe(n)&&e&&fe(e.y)&&n<e.y))}function O2(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,a=t.position,o=t.reverseDirection,u=t.tooltipDimension,c=t.viewBox,f=t.viewBoxDimension;if(a&&fe(a[n]))return a[n];var p=r[n]-u-i,h=r[n]+i;if(e[n])return o[n]?p:h;if(o[n]){var g=p,y=c[n];return g<y?Math.max(h,c[n]):Math.max(p,c[n])}var w=h+u,_=c[n]+f;return w>_?Math.max(p,c[n]):Math.max(h,c[n])}function O7(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function A7(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,u=t.useTranslate3d,c=t.viewBox,f,p,h;return o.height>0&&o.width>0&&r?(p=O2({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),h=O2({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),f=O7({translateX:p,translateY:h,useTranslate3d:u})):f=k7,{cssProperties:f,cssClasses:E7({translateX:p,translateY:h,coordinate:r})}}function os(t){"@babel/helpers - typeof";return os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},os(t)}function A2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function T2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?A2(Object(r),!0).forEach(function(n){Cb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function T7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j7(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mR(n.key),n)}}function P7(t,e,r){return e&&j7(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function C7(t,e,r){return e=gd(e),N7(t,pR()?Reflect.construct(e,r||[],gd(t).constructor):e.apply(t,r))}function N7(t,e){if(e&&(os(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R7(t)}function R7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pR=function(){return!!t})()}function gd(t){return gd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gd(t)}function $7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pb(t,e)}function Pb(t,e){return Pb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Pb(t,e)}function Cb(t,e,r){return e=mR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mR(t){var e=I7(t,"string");return os(e)=="symbol"?e:e+""}function I7(t,e){if(os(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var j2=1,M7=(function(t){function e(){var r;T7(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=C7(this,e,[].concat(i)),Cb(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Cb(r,"handleKeyDown",function(o){if(o.key==="Escape"){var u,c,f,p;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(u=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&u!==void 0?u:0,y:(f=(p=r.props.coordinate)===null||p===void 0?void 0:p.y)!==null&&f!==void 0?f:0}})}}),r}return $7(e,t),P7(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>j2||Math.abs(n.height-this.state.lastBoundingBox.height)>j2)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,f=i.children,p=i.coordinate,h=i.hasPayload,g=i.isAnimationActive,y=i.offset,w=i.position,_=i.reverseDirection,b=i.useTranslate3d,k=i.viewBox,O=i.wrapperStyle,A=A7({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:y,position:w,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:k}),j=A.cssClasses,E=A.cssProperties,T=T2(T2({transition:g&&a?"transform ".concat(u,"ms ").concat(c):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},O);return M.createElement("div",{tabIndex:-1,className:j,style:T,ref:function(R){n.wrapperNode=R}},f)}}])})(N.PureComponent),D7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},$s={isSsr:D7()};function ss(t){"@babel/helpers - typeof";return ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ss(t)}function P2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function C2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?P2(Object(r),!0).forEach(function(n){Pw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):P2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function L7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z7(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yR(n.key),n)}}function B7(t,e,r){return e&&z7(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function q7(t,e,r){return e=yd(e),U7(t,gR()?Reflect.construct(e,r||[],yd(t).constructor):e.apply(t,r))}function U7(t,e){if(e&&(ss(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return F7(t)}function F7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gR=function(){return!!t})()}function yd(t){return yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yd(t)}function H7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nb(t,e)}function Nb(t,e){return Nb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Nb(t,e)}function Pw(t,e,r){return e=yR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yR(t){var e=W7(t,"string");return ss(e)=="symbol"?e:e+""}function W7(t,e){if(ss(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function V7(t){return t.dataKey}function K7(t,e){return M.isValidElement(t)?M.cloneElement(t,e):typeof t=="function"?M.createElement(t,e):M.createElement(w7,e)}var Rr=(function(t){function e(){return L7(this,e),q7(this,e,arguments)}return H7(e,t),B7(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,u=i.animationDuration,c=i.animationEasing,f=i.content,p=i.coordinate,h=i.filterNull,g=i.isAnimationActive,y=i.offset,w=i.payload,_=i.payloadUniqBy,b=i.position,k=i.reverseDirection,O=i.useTranslate3d,A=i.viewBox,j=i.wrapperStyle,E=w??[];h&&E.length&&(E=sR(w.filter(function(C){return C.value!=null&&(C.hide!==!0||n.props.includeHidden)}),_,V7));var T=E.length>0;return M.createElement(M7,{allowEscapeViewBox:o,animationDuration:u,animationEasing:c,isAnimationActive:g,active:a,coordinate:p,hasPayload:T,offset:y,position:b,reverseDirection:k,useTranslate3d:O,viewBox:A,wrapperStyle:j},K7(f,C2(C2({},this.props),{},{payload:E})))}}])})(N.PureComponent);Pw(Rr,"displayName","Tooltip");Pw(Rr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!$s.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Vv,N2;function G7(){if(N2)return Vv;N2=1;var t=Wn(),e=function(){return t.Date.now()};return Vv=e,Vv}var Kv,R2;function X7(){if(R2)return Kv;R2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return Kv=e,Kv}var Gv,$2;function Y7(){if($2)return Gv;$2=1;var t=X7(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return Gv=r,Gv}var Xv,I2;function vR(){if(I2)return Xv;I2=1;var t=Y7(),e=ca(),r=Cs(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function c(f){if(typeof f=="number")return f;if(r(f))return n;if(e(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=e(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=t(f);var h=a.test(f);return h||o.test(f)?u(f.slice(2),h?2:8):i.test(f)?n:+f}return Xv=c,Xv}var Yv,M2;function J7(){if(M2)return Yv;M2=1;var t=ca(),e=G7(),r=vR(),n="Expected a function",i=Math.max,a=Math.min;function o(u,c,f){var p,h,g,y,w,_,b=0,k=!1,O=!1,A=!0;if(typeof u!="function")throw new TypeError(n);c=r(c)||0,t(f)&&(k=!!f.leading,O="maxWait"in f,g=O?i(r(f.maxWait)||0,c):g,A="trailing"in f?!!f.trailing:A);function j(q){var U=p,V=h;return p=h=void 0,b=q,y=u.apply(V,U),y}function E(q){return b=q,w=setTimeout(R,c),k?j(q):y}function T(q){var U=q-_,V=q-b,G=c-U;return O?a(G,g-V):G}function C(q){var U=q-_,V=q-b;return _===void 0||U>=c||U<0||O&&V>=g}function R(){var q=e();if(C(q))return D(q);w=setTimeout(R,T(q))}function D(q){return w=void 0,A&&p?j(q):(p=h=void 0,y)}function X(){w!==void 0&&clearTimeout(w),b=0,p=_=h=w=void 0}function $(){return w===void 0?y:D(e())}function I(){var q=e(),U=C(q);if(p=arguments,h=this,_=q,U){if(w===void 0)return E(_);if(O)return clearTimeout(w),w=setTimeout(R,c),j(_)}return w===void 0&&(w=setTimeout(R,c)),y}return I.cancel=X,I.flush=$,I}return Yv=o,Yv}var Jv,D2;function Q7(){if(D2)return Jv;D2=1;var t=J7(),e=ca(),r="Expected a function";function n(i,a,o){var u=!0,c=!0;if(typeof i!="function")throw new TypeError(r);return e(o)&&(u="leading"in o?!!o.leading:u,c="trailing"in o?!!o.trailing:c),t(i,a,{leading:u,maxWait:a,trailing:c})}return Jv=n,Jv}var Z7=Q7();const bR=Ze(Z7);function du(t){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},du(t)}function L2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?L2(Object(r),!0).forEach(function(n){eH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function eH(t,e,r){return e=tH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tH(t){var e=rH(t,"string");return du(e)=="symbol"?e:e+""}function rH(t,e){if(du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nH(t,e){return sH(t)||oH(t,e)||aH(t,e)||iH()}function iH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
420
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aH(t,e){if(t){if(typeof t=="string")return z2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z2(t,e)}}function z2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function sH(t){if(Array.isArray(t))return t}var vd=N.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,i=n===void 0?{width:-1,height:-1}:n,a=t.width,o=a===void 0?"100%":a,u=t.height,c=u===void 0?"100%":u,f=t.minWidth,p=f===void 0?0:f,h=t.minHeight,g=t.maxHeight,y=t.children,w=t.debounce,_=w===void 0?0:w,b=t.id,k=t.className,O=t.onResize,A=t.style,j=A===void 0?{}:A,E=N.useRef(null),T=N.useRef();T.current=O,N.useImperativeHandle(e,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var C=N.useState({containerWidth:i.width,containerHeight:i.height}),R=nH(C,2),D=R[0],X=R[1],$=N.useCallback(function(q,U){X(function(V){var G=Math.round(q),Z=Math.round(U);return V.containerWidth===G&&V.containerHeight===Z?V:{containerWidth:G,containerHeight:Z}})},[]);N.useEffect(function(){var q=function(te){var H,B=te[0].contentRect,z=B.width,J=B.height;$(z,J),(H=T.current)===null||H===void 0||H.call(T,z,J)};_>0&&(q=bR(q,_,{trailing:!0,leading:!1}));var U=new ResizeObserver(q),V=E.current.getBoundingClientRect(),G=V.width,Z=V.height;return $(G,Z),U.observe(E.current),function(){U.disconnect()}},[$,_]);var I=N.useMemo(function(){var q=D.containerWidth,U=D.containerHeight;if(q<0||U<0)return null;di(Ua(o)||Ua(c),`The width(%s) and height(%s) are both fixed numbers,
421
- maybe you don't need to use a ResponsiveContainer.`,o,c),di(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=Ua(o)?q:o,G=Ua(c)?U:c;r&&r>0&&(V?G=V/r:G&&(V=G*r),g&&G>g&&(G=g)),di(V>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0,
422
- please check the style of container, or the props width(%s) and height(%s),
423
- or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
424
- height and width.`,V,G,o,c,p,h,r);var Z=!Array.isArray(y)&&fi(y.type).endsWith("Chart");return M.Children.map(y,function(K){return M.isValidElement(K)?N.cloneElement(K,Pf({width:V,height:G},Z?{style:Pf({height:"100%",width:"100%",maxHeight:G,maxWidth:V},K.props.style)}:{})):K})},[r,y,c,g,h,p,D,o]);return M.createElement("div",{id:b?"".concat(b):void 0,className:qe("recharts-responsive-container",k),style:Pf(Pf({},j),{},{width:o,height:c,minWidth:p,minHeight:h,maxHeight:g}),ref:E},I)}),xR=function(e){return null};xR.displayName="Cell";function hu(t){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(t)}function B2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Rb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?B2(Object(r),!0).forEach(function(n){lH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lH(t,e,r){return e=uH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uH(t){var e=cH(t,"string");return hu(e)=="symbol"?e:e+""}function cH(t,e){if(hu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lo={widthCache:{},cacheCount:0},fH=2e3,dH={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},q2="recharts_measurement_span";function hH(t){var e=Rb({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Yl=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||$s.isSsr)return{width:0,height:0};var n=hH(r),i=JSON.stringify({text:e,copyStyle:n});if(Lo.widthCache[i])return Lo.widthCache[i];try{var a=document.getElementById(q2);a||(a=document.createElement("span"),a.setAttribute("id",q2),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Rb(Rb({},dH),n);Object.assign(a.style,o),a.textContent="".concat(e);var u=a.getBoundingClientRect(),c={width:u.width,height:u.height};return Lo.widthCache[i]=c,++Lo.cacheCount>fH&&(Lo.cacheCount=0,Lo.widthCache={}),c}catch{return{width:0,height:0}}},pH=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function pu(t){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pu(t)}function bd(t,e){return vH(t)||yH(t,e)||gH(t,e)||mH()}function mH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
425
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gH(t,e){if(t){if(typeof t=="string")return U2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return U2(t,e)}}function U2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function yH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function vH(t){if(Array.isArray(t))return t}function bH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F2(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wH(n.key),n)}}function xH(t,e,r){return e&&F2(t.prototype,e),r&&F2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wH(t){var e=_H(t,"string");return pu(e)=="symbol"?e:e+""}function _H(t,e){if(pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var H2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,W2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,SH=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,kH=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,wR={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},EH=Object.keys(wR),Ko="NaN";function OH(t,e){return t*wR[e]}var Cf=(function(){function t(e,r){bH(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!SH.test(r)&&(this.num=NaN,this.unit=""),EH.includes(r)&&(this.num=OH(e,r),this.unit="px")}return xH(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=kH.exec(r))!==null&&n!==void 0?n:[],a=bd(i,3),o=a[1],u=a[2];return new t(parseFloat(o),u??"")}}])})();function _R(t){if(t.includes(Ko))return Ko;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=H2.exec(e))!==null&&r!==void 0?r:[],i=bd(n,4),a=i[1],o=i[2],u=i[3],c=Cf.parse(a??""),f=Cf.parse(u??""),p=o==="*"?c.multiply(f):c.divide(f);if(p.isNaN())return Ko;e=e.replace(H2,p.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var h,g=(h=W2.exec(e))!==null&&h!==void 0?h:[],y=bd(g,4),w=y[1],_=y[2],b=y[3],k=Cf.parse(w??""),O=Cf.parse(b??""),A=_==="+"?k.add(O):k.subtract(O);if(A.isNaN())return Ko;e=e.replace(W2,A.toString())}return e}var V2=/\(([^()]*)\)/;function AH(t){for(var e=t;e.includes("(");){var r=V2.exec(e),n=bd(r,2),i=n[1];e=e.replace(V2,_R(i))}return e}function TH(t){var e=t.replace(/\s+/g,"");return e=AH(e),e=_R(e),e}function jH(t){try{return TH(t)}catch{return Ko}}function Qv(t){var e=jH(t.slice(5,-1));return e===Ko?"":e}var PH=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],CH=["dx","dy","angle","className","breakAll"];function $b(){return $b=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$b.apply(this,arguments)}function K2(t,e){if(t==null)return{};var r=NH(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function NH(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function G2(t,e){return MH(t)||IH(t,e)||$H(t,e)||RH()}function RH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
426
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $H(t,e){if(t){if(typeof t=="string")return X2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X2(t,e)}}function X2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function IH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function MH(t){if(Array.isArray(t))return t}var SR=/[ \f\n\r\t\v\u2028\u2029]+/,kR=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];Le(r)||(n?a=r.toString().split(""):a=r.toString().split(SR));var o=a.map(function(c){return{word:c,width:Yl(c,i).width}}),u=n?0:Yl(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:u}}catch{return null}},DH=function(e,r,n,i,a){var o=e.maxLines,u=e.children,c=e.style,f=e.breakAll,p=fe(o),h=u,g=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(G,Z){var K=Z.word,te=Z.width,H=G[G.length-1];if(H&&(i==null||a||H.width+te+n<Number(i)))H.words.push(K),H.width+=te+n;else{var B={words:[K],width:te};G.push(B)}return G},[])},y=g(r),w=function(V){return V.reduce(function(G,Z){return G.width>Z.width?G:Z})};if(!p)return y;for(var _="…",b=function(V){var G=h.slice(0,V),Z=kR({breakAll:f,style:c,children:G+_}).wordsWithComputedWidth,K=g(Z),te=K.length>o||w(K).width>Number(i);return[te,K]},k=0,O=h.length-1,A=0,j;k<=O&&A<=h.length-1;){var E=Math.floor((k+O)/2),T=E-1,C=b(T),R=G2(C,2),D=R[0],X=R[1],$=b(E),I=G2($,1),q=I[0];if(!D&&!q&&(k=E+1),D&&q&&(O=E-1),!D&&q){j=X;break}A++}return j||y},Y2=function(e){var r=Le(e)?[]:e.toString().split(SR);return[{words:r}]},LH=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,u=e.maxLines;if((r||n)&&!$s.isSsr){var c,f,p=kR({breakAll:o,children:i,style:a});if(p){var h=p.wordsWithComputedWidth,g=p.spaceWidth;c=h,f=g}else return Y2(i);return DH({breakAll:o,children:i,maxLines:u,style:a},c,f,r,n)}return Y2(i)},J2="#808080",xd=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,u=o===void 0?"1em":o,c=e.capHeight,f=c===void 0?"0.71em":c,p=e.scaleToFit,h=p===void 0?!1:p,g=e.textAnchor,y=g===void 0?"start":g,w=e.verticalAnchor,_=w===void 0?"end":w,b=e.fill,k=b===void 0?J2:b,O=K2(e,PH),A=N.useMemo(function(){return LH({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:h,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,h,O.style,O.width]),j=O.dx,E=O.dy,T=O.angle,C=O.className,R=O.breakAll,D=K2(O,CH);if(!Dt(n)||!Dt(a))return null;var X=n+(fe(j)?j:0),$=a+(fe(E)?E:0),I;switch(_){case"start":I=Qv("calc(".concat(f,")"));break;case"middle":I=Qv("calc(".concat((A.length-1)/2," * -").concat(u," + (").concat(f," / 2))"));break;default:I=Qv("calc(".concat(A.length-1," * -").concat(u,")"));break}var q=[];if(h){var U=A[0].width,V=O.width;q.push("scale(".concat((fe(V)?V/U:1)/U,")"))}return T&&q.push("rotate(".concat(T,", ").concat(X,", ").concat($,")")),q.length&&(D.transform=q.join(" ")),M.createElement("text",$b({},Be(D,!0),{x:X,y:$,className:qe("recharts-text",C),textAnchor:y,fill:k.includes("url")?J2:k}),A.map(function(G,Z){var K=G.words.join(R?"":" ");return M.createElement("tspan",{x:X,dy:Z===0?I:u,key:"".concat(K,"-").concat(Z)},K)}))};function ia(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zH(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Cw(t){let e,r,n;t.length!==2?(e=ia,r=(u,c)=>ia(t(u),c),n=(u,c)=>t(u)-c):(e=t===ia||t===zH?t:BH,r=t,n=t);function i(u,c,f=0,p=u.length){if(f<p){if(e(c,c)!==0)return p;do{const h=f+p>>>1;r(u[h],c)<0?f=h+1:p=h}while(f<p)}return f}function a(u,c,f=0,p=u.length){if(f<p){if(e(c,c)!==0)return p;do{const h=f+p>>>1;r(u[h],c)<=0?f=h+1:p=h}while(f<p)}return f}function o(u,c,f=0,p=u.length){const h=i(u,c,f,p-1);return h>f&&n(u[h-1],c)>-n(u[h],c)?h-1:h}return{left:i,center:o,right:a}}function BH(){return 0}function ER(t){return t===null?NaN:+t}function*qH(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const UH=Cw(ia),Qu=UH.right;Cw(ER).center;class Q2 extends Map{constructor(e,r=WH){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(Z2(this,e))}has(e){return super.has(Z2(this,e))}set(e,r){return super.set(FH(this,e),r)}delete(e){return super.delete(HH(this,e))}}function Z2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function FH({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function HH({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function WH(t){return t!==null&&typeof t=="object"?t.valueOf():t}function VH(t=ia){if(t===ia)return OR;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function OR(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const KH=Math.sqrt(50),GH=Math.sqrt(10),XH=Math.sqrt(2);function wd(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=KH?10:a>=GH?5:a>=XH?2:1;let u,c,f;return i<0?(f=Math.pow(10,-i)/o,u=Math.round(t*f),c=Math.round(e*f),u/f<t&&++u,c/f>e&&--c,f=-f):(f=Math.pow(10,i)*o,u=Math.round(t/f),c=Math.round(e/f),u*f<t&&++u,c*f>e&&--c),c<u&&.5<=r&&r<2?wd(t,e,r*2):[u,c,f]}function Ib(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,a,o]=n?wd(e,t,r):wd(t,e,r);if(!(a>=i))return[];const u=a-i+1,c=new Array(u);if(n)if(o<0)for(let f=0;f<u;++f)c[f]=(a-f)/-o;else for(let f=0;f<u;++f)c[f]=(a-f)*o;else if(o<0)for(let f=0;f<u;++f)c[f]=(i+f)/-o;else for(let f=0;f<u;++f)c[f]=(i+f)*o;return c}function Mb(t,e,r){return e=+e,t=+t,r=+r,wd(t,e,r)[2]}function Db(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Mb(e,t,r):Mb(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function eT(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function tT(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function AR(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=i===void 0?OR:VH(i);n>r;){if(n-r>600){const c=n-r+1,f=e-r+1,p=Math.log(c),h=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*h*(c-h)/c)*(f-c/2<0?-1:1),y=Math.max(r,Math.floor(e-f*h/c+g)),w=Math.min(n,Math.floor(e+(c-f)*h/c+g));AR(t,e,y,w,i)}const a=t[e];let o=r,u=n;for(Cl(t,r,e),i(t[n],a)>0&&Cl(t,r,n);o<u;){for(Cl(t,o,u),++o,--u;i(t[o],a)<0;)++o;for(;i(t[u],a)>0;)--u}i(t[r],a)===0?Cl(t,r,u):(++u,Cl(t,u,n)),u<=e&&(r=u+1),e<=u&&(n=u-1)}return t}function Cl(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function YH(t,e,r){if(t=Float64Array.from(qH(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return tT(t);if(e>=1)return eT(t);var n,i=(n-1)*e,a=Math.floor(i),o=eT(AR(t,a).subarray(0,a+1)),u=tT(t.subarray(a+1));return o+(u-o)*(i-a)}}function JH(t,e,r=ER){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t),u=+r(t[a+1],a+1,t);return o+(u-o)*(i-a)}}function QH(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n<i;)a[n]=t+n*r;return a}function an(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Si(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Lb=Symbol("implicit");function Nw(){var t=new Q2,e=[],r=[],n=Lb;function i(a){let o=t.get(a);if(o===void 0){if(n!==Lb)return n;t.set(a,o=e.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Q2;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Nw(e,r).unknown(n)},an.apply(i,arguments),i}function mu(){var t=Nw().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,u=!1,c=0,f=0,p=.5;delete t.unknown;function h(){var g=e().length,y=i<n,w=y?i:n,_=y?n:i;a=(_-w)/Math.max(1,g-c+f*2),u&&(a=Math.floor(a)),w+=(_-w-a*(g-c))*p,o=a*(1-c),u&&(w=Math.round(w),o=Math.round(o));var b=QH(g).map(function(k){return w+a*k});return r(y?b.reverse():b)}return t.domain=function(g){return arguments.length?(e(g),h()):e()},t.range=function(g){return arguments.length?([n,i]=g,n=+n,i=+i,h()):[n,i]},t.rangeRound=function(g){return[n,i]=g,n=+n,i=+i,u=!0,h()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(g){return arguments.length?(u=!!g,h()):u},t.padding=function(g){return arguments.length?(c=Math.min(1,f=+g),h()):c},t.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),h()):c},t.paddingOuter=function(g){return arguments.length?(f=+g,h()):f},t.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),h()):p},t.copy=function(){return mu(e(),[n,i]).round(u).paddingInner(c).paddingOuter(f).align(p)},an.apply(h(),arguments)}function TR(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return TR(e())},t}function Jl(){return TR(mu.apply(null,arguments).paddingInner(1))}function Rw(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function jR(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Zu(){}var gu=.7,_d=1/gu,es="\\s*([+-]?\\d+)\\s*",yu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ZH=/^#([0-9a-f]{3,8})$/,eW=new RegExp(`^rgb\\(${es},${es},${es}\\)$`),tW=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),rW=new RegExp(`^rgba\\(${es},${es},${es},${yu}\\)$`),nW=new RegExp(`^rgba\\(${Un},${Un},${Un},${yu}\\)$`),iW=new RegExp(`^hsl\\(${yu},${Un},${Un}\\)$`),aW=new RegExp(`^hsla\\(${yu},${Un},${Un},${yu}\\)$`),rT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Rw(Zu,vu,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nT,formatHex:nT,formatHex8:oW,formatHsl:sW,formatRgb:iT,toString:iT});function nT(){return this.rgb().formatHex()}function oW(){return this.rgb().formatHex8()}function sW(){return PR(this).formatHsl()}function iT(){return this.rgb().formatRgb()}function vu(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ZH.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?aT(e):r===3?new _r(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Nf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Nf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=eW.exec(t))?new _r(e[1],e[2],e[3],1):(e=tW.exec(t))?new _r(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=rW.exec(t))?Nf(e[1],e[2],e[3],e[4]):(e=nW.exec(t))?Nf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=iW.exec(t))?lT(e[1],e[2]/100,e[3]/100,1):(e=aW.exec(t))?lT(e[1],e[2]/100,e[3]/100,e[4]):rT.hasOwnProperty(t)?aT(rT[t]):t==="transparent"?new _r(NaN,NaN,NaN,0):null}function aT(t){return new _r(t>>16&255,t>>8&255,t&255,1)}function Nf(t,e,r,n){return n<=0&&(t=e=r=NaN),new _r(t,e,r,n)}function lW(t){return t instanceof Zu||(t=vu(t)),t?(t=t.rgb(),new _r(t.r,t.g,t.b,t.opacity)):new _r}function zb(t,e,r,n){return arguments.length===1?lW(t):new _r(t,e,r,n??1)}function _r(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Rw(_r,zb,jR(Zu,{brighter(t){return t=t==null?_d:Math.pow(_d,t),new _r(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?gu:Math.pow(gu,t),new _r(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new _r(Ka(this.r),Ka(this.g),Ka(this.b),Sd(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oT,formatHex:oT,formatHex8:uW,formatRgb:sT,toString:sT}));function oT(){return`#${Fa(this.r)}${Fa(this.g)}${Fa(this.b)}`}function uW(){return`#${Fa(this.r)}${Fa(this.g)}${Fa(this.b)}${Fa((isNaN(this.opacity)?1:this.opacity)*255)}`}function sT(){const t=Sd(this.opacity);return`${t===1?"rgb(":"rgba("}${Ka(this.r)}, ${Ka(this.g)}, ${Ka(this.b)}${t===1?")":`, ${t})`}`}function Sd(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ka(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fa(t){return t=Ka(t),(t<16?"0":"")+t.toString(16)}function lT(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Sn(t,e,r,n)}function PR(t){if(t instanceof Sn)return new Sn(t.h,t.s,t.l,t.opacity);if(t instanceof Zu||(t=vu(t)),!t)return new Sn;if(t instanceof Sn)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,u=a-i,c=(a+i)/2;return u?(e===a?o=(r-n)/u+(r<n)*6:r===a?o=(n-e)/u+2:o=(e-r)/u+4,u/=c<.5?a+i:2-a-i,o*=60):u=c>0&&c<1?0:o,new Sn(o,u,c,t.opacity)}function cW(t,e,r,n){return arguments.length===1?PR(t):new Sn(t,e,r,n??1)}function Sn(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Rw(Sn,cW,jR(Zu,{brighter(t){return t=t==null?_d:Math.pow(_d,t),new Sn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?gu:Math.pow(gu,t),new Sn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new _r(Zv(t>=240?t-240:t+120,i,n),Zv(t,i,n),Zv(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Sn(uT(this.h),Rf(this.s),Rf(this.l),Sd(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Sd(this.opacity);return`${t===1?"hsl(":"hsla("}${uT(this.h)}, ${Rf(this.s)*100}%, ${Rf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function uT(t){return t=(t||0)%360,t<0?t+360:t}function Rf(t){return Math.max(0,Math.min(1,t||0))}function Zv(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const $w=t=>()=>t;function fW(t,e){return function(r){return t+r*e}}function dW(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function hW(t){return(t=+t)==1?CR:function(e,r){return r-e?dW(e,r,t):$w(isNaN(e)?r:e)}}function CR(t,e){var r=e-t;return r?fW(t,r):$w(isNaN(t)?e:t)}const cT=(function t(e){var r=hW(e);function n(i,a){var o=r((i=zb(i)).r,(a=zb(a)).r),u=r(i.g,a.g),c=r(i.b,a.b),f=CR(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=u(p),i.b=c(p),i.opacity=f(p),i+""}}return n.gamma=t,n})(1);function pW(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function mW(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function gW(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=Is(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(u){for(o=0;o<n;++o)a[o]=i[o](u);return a}}function yW(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function kd(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function vW(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=Is(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Bb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,e0=new RegExp(Bb.source,"g");function bW(t){return function(){return t}}function xW(t){return function(e){return t(e)+""}}function wW(t,e){var r=Bb.lastIndex=e0.lastIndex=0,n,i,a,o=-1,u=[],c=[];for(t=t+"",e=e+"";(n=Bb.exec(t))&&(i=e0.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:kd(n,i)})),r=e0.lastIndex;return r<e.length&&(a=e.slice(r),u[o]?u[o]+=a:u[++o]=a),u.length<2?c[0]?xW(c[0].x):bW(e):(e=c.length,function(f){for(var p=0,h;p<e;++p)u[(h=c[p]).i]=h.x(f);return u.join("")})}function Is(t,e){var r=typeof e,n;return e==null||r==="boolean"?$w(e):(r==="number"?kd:r==="string"?(n=vu(e))?(e=n,cT):wW:e instanceof vu?cT:e instanceof Date?yW:mW(e)?pW:Array.isArray(e)?gW:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?vW:kd)(t,e)}function Iw(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function _W(t,e){e===void 0&&(e=t,t=Is);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(o){var u=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[u](o-u)}}function SW(t){return function(){return t}}function Ed(t){return+t}var fT=[0,1];function dr(t){return t}function qb(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:SW(isNaN(e)?NaN:.5)}function kW(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function EW(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=qb(i,n),a=r(o,a)):(n=qb(n,i),a=r(a,o)),function(u){return a(n(u))}}function OW(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)i[o]=qb(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(u){var c=Qu(t,u,1,n)-1;return a[c](i[c](u))}}function ec(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function jh(){var t=fT,e=fT,r=Is,n,i,a,o=dr,u,c,f;function p(){var g=Math.min(t.length,e.length);return o!==dr&&(o=kW(t[0],t[g-1])),u=g>2?OW:EW,c=f=null,h}function h(g){return g==null||isNaN(g=+g)?a:(c||(c=u(t.map(n),e,r)))(n(o(g)))}return h.invert=function(g){return o(i((f||(f=u(e,t.map(n),kd)))(g)))},h.domain=function(g){return arguments.length?(t=Array.from(g,Ed),p()):t.slice()},h.range=function(g){return arguments.length?(e=Array.from(g),p()):e.slice()},h.rangeRound=function(g){return e=Array.from(g),r=Iw,p()},h.clamp=function(g){return arguments.length?(o=g?!0:dr,p()):o!==dr},h.interpolate=function(g){return arguments.length?(r=g,p()):r},h.unknown=function(g){return arguments.length?(a=g,h):a},function(g,y){return n=g,i=y,p()}}function Mw(){return jh()(dr,dr)}function AW(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Od(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function ls(t){return t=Od(Math.abs(t)),t?t[1]:NaN}function TW(t,e){return function(r,n){for(var i=r.length,a=[],o=0,u=t[0],c=0;i>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),a.push(r.substring(i-=u,i+u)),!((c+=u+1)>n));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function jW(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var PW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bu(t){if(!(e=PW.exec(t)))throw new Error("invalid format: "+t);var e;return new Dw({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}bu.prototype=Dw.prototype;function Dw(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Dw.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function CW(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var Ad;function NW(t,e){var r=Od(t,e);if(!r)return Ad=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(Ad=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Od(t,Math.max(0,e+a-1))[0]}function dT(t,e){var r=Od(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const hT={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:AW,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>dT(t*100,e),r:dT,s:NW,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pT(t){return t}var mT=Array.prototype.map,gT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function RW(t){var e=t.grouping===void 0||t.thousands===void 0?pT:TW(mT.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?pT:jW(mT.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function f(h,g){h=bu(h);var y=h.fill,w=h.align,_=h.sign,b=h.symbol,k=h.zero,O=h.width,A=h.comma,j=h.precision,E=h.trim,T=h.type;T==="n"?(A=!0,T="g"):hT[T]||(j===void 0&&(j=12),E=!0,T="g"),(k||y==="0"&&w==="=")&&(k=!0,y="0",w="=");var C=(g&&g.prefix!==void 0?g.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?n:/[%p]/.test(T)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),D=hT[T],X=/[defgprs%]/.test(T);j=j===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function $(I){var q=C,U=R,V,G,Z;if(T==="c")U=D(I)+U,I="";else{I=+I;var K=I<0||1/I<0;if(I=isNaN(I)?c:D(Math.abs(I),j),E&&(I=CW(I)),K&&+I==0&&_!=="+"&&(K=!1),q=(K?_==="("?_:u:_==="-"||_==="("?"":_)+q,U=(T==="s"&&!isNaN(I)&&Ad!==void 0?gT[8+Ad/3]:"")+U+(K&&_==="("?")":""),X){for(V=-1,G=I.length;++V<G;)if(Z=I.charCodeAt(V),48>Z||Z>57){U=(Z===46?i+I.slice(V+1):I.slice(V))+U,I=I.slice(0,V);break}}}A&&!k&&(I=e(I,1/0));var te=q.length+I.length+U.length,H=te<O?new Array(O-te+1).join(y):"";switch(A&&k&&(I=e(H+I,H.length?O-U.length:1/0),H=""),w){case"<":I=q+I+U+H;break;case"=":I=q+H+I+U;break;case"^":I=H.slice(0,te=H.length>>1)+q+I+U+H.slice(te);break;default:I=H+q+I+U;break}return a(I)}return $.toString=function(){return h+""},$}function p(h,g){var y=Math.max(-8,Math.min(8,Math.floor(ls(g)/3)))*3,w=Math.pow(10,-y),_=f((h=bu(h),h.type="f",h),{suffix:gT[8+y/3]});return function(b){return _(w*b)}}return{format:f,formatPrefix:p}}var $f,Lw,NR;$W({thousands:",",grouping:[3],currency:["$",""]});function $W(t){return $f=RW(t),Lw=$f.format,NR=$f.formatPrefix,$f}function IW(t){return Math.max(0,-ls(Math.abs(t)))}function MW(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ls(e)/3)))*3-ls(Math.abs(t)))}function DW(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ls(e)-ls(t))+1}function RR(t,e,r,n){var i=Db(t,e,r),a;switch(n=bu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=MW(i,o))&&(n.precision=a),NR(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=DW(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=IW(i))&&(n.precision=a-(n.type==="%")*2);break}}return Lw(n)}function da(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ib(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return RR(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,o=n[i],u=n[a],c,f,p=10;for(u<o&&(f=o,o=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=Mb(o,u,r),f===c)return n[i]=o,n[a]=u,e(n);if(f>0)o=Math.floor(o/f)*f,u=Math.ceil(u/f)*f;else if(f<0)o=Math.ceil(o*f)/f,u=Math.floor(u*f)/f;else break;c=f}return t},t}function Td(){var t=Mw();return t.copy=function(){return ec(t,Td())},an.apply(t,arguments),da(t)}function $R(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,Ed),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return $R(t).unknown(e)},t=arguments.length?Array.from(t,Ed):[0,1],da(r)}function IR(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),t[r]=e.floor(i),t[n]=e.ceil(a),t}function yT(t){return Math.log(t)}function vT(t){return Math.exp(t)}function LW(t){return-Math.log(-t)}function zW(t){return-Math.exp(-t)}function BW(t){return isFinite(t)?+("1e"+t):t<0?0:t}function qW(t){return t===10?BW:t===Math.E?Math.exp:e=>Math.pow(t,e)}function UW(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function bT(t){return(e,r)=>-t(-e,r)}function zw(t){const e=t(yT,vT),r=e.domain;let n=10,i,a;function o(){return i=UW(n),a=qW(n),r()[0]<0?(i=bT(i),a=bT(a),t(LW,zW)):t(yT,vT),e}return e.base=function(u){return arguments.length?(n=+u,o()):n},e.domain=function(u){return arguments.length?(r(u),o()):r()},e.ticks=u=>{const c=r();let f=c[0],p=c[c.length-1];const h=p<f;h&&([f,p]=[p,f]);let g=i(f),y=i(p),w,_;const b=u==null?10:+u;let k=[];if(!(n%1)&&y-g<b){if(g=Math.floor(g),y=Math.ceil(y),f>0){for(;g<=y;++g)for(w=1;w<n;++w)if(_=g<0?w/a(-g):w*a(g),!(_<f)){if(_>p)break;k.push(_)}}else for(;g<=y;++g)for(w=n-1;w>=1;--w)if(_=g>0?w/a(-g):w*a(g),!(_<f)){if(_>p)break;k.push(_)}k.length*2<b&&(k=Ib(f,p,b))}else k=Ib(g,y,Math.min(y-g,b)).map(a);return h?k.reverse():k},e.tickFormat=(u,c)=>{if(u==null&&(u=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=bu(c)).precision==null&&(c.trim=!0),c=Lw(c)),u===1/0)return c;const f=Math.max(1,n*u/e.ticks().length);return p=>{let h=p/a(Math.round(i(p)));return h*n<n-.5&&(h*=n),h<=f?c(p):""}},e.nice=()=>r(IR(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),e}function MR(){const t=zw(jh()).domain([1,10]);return t.copy=()=>ec(t,MR()).base(t.base()),an.apply(t,arguments),t}function xT(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function wT(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Bw(t){var e=1,r=t(xT(e),wT(e));return r.constant=function(n){return arguments.length?t(xT(e=+n),wT(e)):e},da(r)}function DR(){var t=Bw(jh());return t.copy=function(){return ec(t,DR()).constant(t.constant())},an.apply(t,arguments)}function _T(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function FW(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function HW(t){return t<0?-t*t:t*t}function qw(t){var e=t(dr,dr),r=1;function n(){return r===1?t(dr,dr):r===.5?t(FW,HW):t(_T(r),_T(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},da(e)}function Uw(){var t=qw(jh());return t.copy=function(){return ec(t,Uw()).exponent(t.exponent())},an.apply(t,arguments),t}function WW(){return Uw.apply(null,arguments).exponent(.5)}function ST(t){return Math.sign(t)*t*t}function VW(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function LR(){var t=Mw(),e=[0,1],r=!1,n;function i(a){var o=VW(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(ST(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,Ed)).map(ST)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return LR(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},an.apply(i,arguments),da(i)}function zR(){var t=[],e=[],r=[],n;function i(){var o=0,u=Math.max(1,e.length);for(r=new Array(u-1);++o<u;)r[o-1]=JH(t,o/u);return a}function a(o){return o==null||isNaN(o=+o)?n:e[Qu(r,o)]}return a.invertExtent=function(o){var u=e.indexOf(o);return u<0?[NaN,NaN]:[u>0?r[u-1]:t[0],u<r.length?r[u]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let u of o)u!=null&&!isNaN(u=+u)&&t.push(u);return t.sort(ia),i()},a.range=function(o){return arguments.length?(e=Array.from(o),i()):e.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return zR().domain(t).range(e).unknown(n)},an.apply(a,arguments)}function BR(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Qu(n,c,0,r)]:a}function u(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*e-(c-r)*t)/(r+1);return o}return o.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,u()):[t,e]},o.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,u()):i.slice()},o.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[t,n[0]]:f>=r?[n[r-1],e]:[n[f-1],n[f]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return BR().domain([t,e]).range(i).unknown(a)},an.apply(da(o),arguments)}function qR(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[Qu(t,a,0,n)]:r}return i.domain=function(a){return arguments.length?(t=Array.from(a),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return qR().domain(t).range(e).unknown(r)},an.apply(i,arguments)}const t0=new Date,r0=new Date;function Lt(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o<u-a?o:u},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const c=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<o)||!(u>0))return c;let f;do c.push(f=new Date(+a)),e(a,u),t(a);while(f<a&&a<o);return c},i.filter=a=>Lt(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;e(o,-1),!a(o););else for(;--u>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(t0.setTime(+a),r0.setTime(+o),t(t0),t(r0),Math.floor(r(t0,r0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const jd=Lt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);jd.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Lt(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):jd);jd.range;const si=1e3,Zr=si*60,li=Zr*60,mi=li*24,Fw=mi*7,kT=mi*30,n0=mi*365,Ha=Lt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*si)},(t,e)=>(e-t)/si,t=>t.getUTCSeconds());Ha.range;const Hw=Lt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*si)},(t,e)=>{t.setTime(+t+e*Zr)},(t,e)=>(e-t)/Zr,t=>t.getMinutes());Hw.range;const Ww=Lt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Zr)},(t,e)=>(e-t)/Zr,t=>t.getUTCMinutes());Ww.range;const Vw=Lt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*si-t.getMinutes()*Zr)},(t,e)=>{t.setTime(+t+e*li)},(t,e)=>(e-t)/li,t=>t.getHours());Vw.range;const Kw=Lt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*li)},(t,e)=>(e-t)/li,t=>t.getUTCHours());Kw.range;const tc=Lt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/mi,t=>t.getDate()-1);tc.range;const Ph=Lt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mi,t=>t.getUTCDate()-1);Ph.range;const UR=Lt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/mi,t=>Math.floor(t/mi));UR.range;function io(t){return Lt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/Fw)}const Ch=io(0),Pd=io(1),KW=io(2),GW=io(3),us=io(4),XW=io(5),YW=io(6);Ch.range;Pd.range;KW.range;GW.range;us.range;XW.range;YW.range;function ao(t){return Lt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Fw)}const Nh=ao(0),Cd=ao(1),JW=ao(2),QW=ao(3),cs=ao(4),ZW=ao(5),eV=ao(6);Nh.range;Cd.range;JW.range;QW.range;cs.range;ZW.range;eV.range;const Gw=Lt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Gw.range;const Xw=Lt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Xw.range;const gi=Lt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());gi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});gi.range;const yi=Lt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());yi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Lt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});yi.range;function FR(t,e,r,n,i,a){const o=[[Ha,1,si],[Ha,5,5*si],[Ha,15,15*si],[Ha,30,30*si],[a,1,Zr],[a,5,5*Zr],[a,15,15*Zr],[a,30,30*Zr],[i,1,li],[i,3,3*li],[i,6,6*li],[i,12,12*li],[n,1,mi],[n,2,2*mi],[r,1,Fw],[e,1,kT],[e,3,3*kT],[t,1,n0]];function u(f,p,h){const g=p<f;g&&([f,p]=[p,f]);const y=h&&typeof h.range=="function"?h:c(f,p,h),w=y?y.range(f,+p+1):[];return g?w.reverse():w}function c(f,p,h){const g=Math.abs(p-f)/h,y=Cw(([,,b])=>b).right(o,g);if(y===o.length)return t.every(Db(f/n0,p/n0,h));if(y===0)return jd.every(Math.max(Db(f,p,h),1));const[w,_]=o[g/o[y-1][2]<o[y][2]/g?y-1:y];return w.every(_)}return[u,c]}const[tV,rV]=FR(yi,Xw,Nh,UR,Kw,Ww),[nV,iV]=FR(gi,Gw,Ch,tc,Vw,Hw);function i0(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function a0(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Nl(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function aV(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,u=t.months,c=t.shortMonths,f=Rl(i),p=$l(i),h=Rl(a),g=$l(a),y=Rl(o),w=$l(o),_=Rl(u),b=$l(u),k=Rl(c),O=$l(c),A={a:Z,A:K,b:te,B:H,c:null,d:PT,e:PT,f:TV,g:LV,G:BV,H:EV,I:OV,j:AV,L:HR,m:jV,M:PV,p:B,q:z,Q:RT,s:$T,S:CV,u:NV,U:RV,V:$V,w:IV,W:MV,x:null,X:null,y:DV,Y:zV,Z:qV,"%":NT},j={a:J,A:ae,b:se,B:de,c:null,d:CT,e:CT,f:WV,g:tK,G:nK,H:UV,I:FV,j:HV,L:VR,m:VV,M:KV,p:Ce,q:pe,Q:RT,s:$T,S:GV,u:XV,U:YV,V:JV,w:QV,W:ZV,x:null,X:null,y:eK,Y:rK,Z:iK,"%":NT},E={a:X,A:$,b:I,B:q,c:U,d:TT,e:TT,f:wV,g:AT,G:OT,H:jT,I:jT,j:yV,L:xV,m:gV,M:vV,p:D,q:mV,Q:SV,s:kV,S:bV,u:cV,U:fV,V:dV,w:uV,W:hV,x:V,X:G,y:AT,Y:OT,Z:pV,"%":_V};A.x=T(r,A),A.X=T(n,A),A.c=T(e,A),j.x=T(r,j),j.X=T(n,j),j.c=T(e,j);function T(ne,_e){return function(Ee){var ie=[],Fe=-1,Ne=0,ct=ne.length,at,ft,hr;for(Ee instanceof Date||(Ee=new Date(+Ee));++Fe<ct;)ne.charCodeAt(Fe)===37&&(ie.push(ne.slice(Ne,Fe)),(ft=ET[at=ne.charAt(++Fe)])!=null?at=ne.charAt(++Fe):ft=at==="e"?" ":"0",(hr=_e[at])&&(at=hr(Ee,ft)),ie.push(at),Ne=Fe+1);return ie.push(ne.slice(Ne,Fe)),ie.join("")}}function C(ne,_e){return function(Ee){var ie=Nl(1900,void 0,1),Fe=R(ie,ne,Ee+="",0),Ne,ct;if(Fe!=Ee.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(_e&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Ne=a0(Nl(ie.y,0,1)),ct=Ne.getUTCDay(),Ne=ct>4||ct===0?Cd.ceil(Ne):Cd(Ne),Ne=Ph.offset(Ne,(ie.V-1)*7),ie.y=Ne.getUTCFullYear(),ie.m=Ne.getUTCMonth(),ie.d=Ne.getUTCDate()+(ie.w+6)%7):(Ne=i0(Nl(ie.y,0,1)),ct=Ne.getDay(),Ne=ct>4||ct===0?Pd.ceil(Ne):Pd(Ne),Ne=tc.offset(Ne,(ie.V-1)*7),ie.y=Ne.getFullYear(),ie.m=Ne.getMonth(),ie.d=Ne.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),ct="Z"in ie?a0(Nl(ie.y,0,1)).getUTCDay():i0(Nl(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(ct+5)%7:ie.w+ie.U*7-(ct+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,a0(ie)):i0(ie)}}function R(ne,_e,Ee,ie){for(var Fe=0,Ne=_e.length,ct=Ee.length,at,ft;Fe<Ne;){if(ie>=ct)return-1;if(at=_e.charCodeAt(Fe++),at===37){if(at=_e.charAt(Fe++),ft=E[at in ET?_e.charAt(Fe++):at],!ft||(ie=ft(ne,Ee,ie))<0)return-1}else if(at!=Ee.charCodeAt(ie++))return-1}return ie}function D(ne,_e,Ee){var ie=f.exec(_e.slice(Ee));return ie?(ne.p=p.get(ie[0].toLowerCase()),Ee+ie[0].length):-1}function X(ne,_e,Ee){var ie=y.exec(_e.slice(Ee));return ie?(ne.w=w.get(ie[0].toLowerCase()),Ee+ie[0].length):-1}function $(ne,_e,Ee){var ie=h.exec(_e.slice(Ee));return ie?(ne.w=g.get(ie[0].toLowerCase()),Ee+ie[0].length):-1}function I(ne,_e,Ee){var ie=k.exec(_e.slice(Ee));return ie?(ne.m=O.get(ie[0].toLowerCase()),Ee+ie[0].length):-1}function q(ne,_e,Ee){var ie=_.exec(_e.slice(Ee));return ie?(ne.m=b.get(ie[0].toLowerCase()),Ee+ie[0].length):-1}function U(ne,_e,Ee){return R(ne,e,_e,Ee)}function V(ne,_e,Ee){return R(ne,r,_e,Ee)}function G(ne,_e,Ee){return R(ne,n,_e,Ee)}function Z(ne){return o[ne.getDay()]}function K(ne){return a[ne.getDay()]}function te(ne){return c[ne.getMonth()]}function H(ne){return u[ne.getMonth()]}function B(ne){return i[+(ne.getHours()>=12)]}function z(ne){return 1+~~(ne.getMonth()/3)}function J(ne){return o[ne.getUTCDay()]}function ae(ne){return a[ne.getUTCDay()]}function se(ne){return c[ne.getUTCMonth()]}function de(ne){return u[ne.getUTCMonth()]}function Ce(ne){return i[+(ne.getUTCHours()>=12)]}function pe(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var _e=T(ne+="",A);return _e.toString=function(){return ne},_e},parse:function(ne){var _e=C(ne+="",!1);return _e.toString=function(){return ne},_e},utcFormat:function(ne){var _e=T(ne+="",j);return _e.toString=function(){return ne},_e},utcParse:function(ne){var _e=C(ne+="",!0);return _e.toString=function(){return ne},_e}}}var ET={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,oV=/^%/,sV=/[\\^$*+?|[\]().{}]/g;function Ve(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function lV(t){return t.replace(sV,"\\$&")}function Rl(t){return new RegExp("^(?:"+t.map(lV).join("|")+")","i")}function $l(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function uV(t,e,r){var n=Wt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function cV(t,e,r){var n=Wt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function fV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function dV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function hV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function OT(t,e,r){var n=Wt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function AT(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function pV(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function mV(t,e,r){var n=Wt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function gV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function TT(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function yV(t,e,r){var n=Wt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function jT(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function vV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function bV(t,e,r){var n=Wt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function xV(t,e,r){var n=Wt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function wV(t,e,r){var n=Wt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function _V(t,e,r){var n=oV.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function SV(t,e,r){var n=Wt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function kV(t,e,r){var n=Wt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function PT(t,e){return Ve(t.getDate(),e,2)}function EV(t,e){return Ve(t.getHours(),e,2)}function OV(t,e){return Ve(t.getHours()%12||12,e,2)}function AV(t,e){return Ve(1+tc.count(gi(t),t),e,3)}function HR(t,e){return Ve(t.getMilliseconds(),e,3)}function TV(t,e){return HR(t,e)+"000"}function jV(t,e){return Ve(t.getMonth()+1,e,2)}function PV(t,e){return Ve(t.getMinutes(),e,2)}function CV(t,e){return Ve(t.getSeconds(),e,2)}function NV(t){var e=t.getDay();return e===0?7:e}function RV(t,e){return Ve(Ch.count(gi(t)-1,t),e,2)}function WR(t){var e=t.getDay();return e>=4||e===0?us(t):us.ceil(t)}function $V(t,e){return t=WR(t),Ve(us.count(gi(t),t)+(gi(t).getDay()===4),e,2)}function IV(t){return t.getDay()}function MV(t,e){return Ve(Pd.count(gi(t)-1,t),e,2)}function DV(t,e){return Ve(t.getFullYear()%100,e,2)}function LV(t,e){return t=WR(t),Ve(t.getFullYear()%100,e,2)}function zV(t,e){return Ve(t.getFullYear()%1e4,e,4)}function BV(t,e){var r=t.getDay();return t=r>=4||r===0?us(t):us.ceil(t),Ve(t.getFullYear()%1e4,e,4)}function qV(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ve(e/60|0,"0",2)+Ve(e%60,"0",2)}function CT(t,e){return Ve(t.getUTCDate(),e,2)}function UV(t,e){return Ve(t.getUTCHours(),e,2)}function FV(t,e){return Ve(t.getUTCHours()%12||12,e,2)}function HV(t,e){return Ve(1+Ph.count(yi(t),t),e,3)}function VR(t,e){return Ve(t.getUTCMilliseconds(),e,3)}function WV(t,e){return VR(t,e)+"000"}function VV(t,e){return Ve(t.getUTCMonth()+1,e,2)}function KV(t,e){return Ve(t.getUTCMinutes(),e,2)}function GV(t,e){return Ve(t.getUTCSeconds(),e,2)}function XV(t){var e=t.getUTCDay();return e===0?7:e}function YV(t,e){return Ve(Nh.count(yi(t)-1,t),e,2)}function KR(t){var e=t.getUTCDay();return e>=4||e===0?cs(t):cs.ceil(t)}function JV(t,e){return t=KR(t),Ve(cs.count(yi(t),t)+(yi(t).getUTCDay()===4),e,2)}function QV(t){return t.getUTCDay()}function ZV(t,e){return Ve(Cd.count(yi(t)-1,t),e,2)}function eK(t,e){return Ve(t.getUTCFullYear()%100,e,2)}function tK(t,e){return t=KR(t),Ve(t.getUTCFullYear()%100,e,2)}function rK(t,e){return Ve(t.getUTCFullYear()%1e4,e,4)}function nK(t,e){var r=t.getUTCDay();return t=r>=4||r===0?cs(t):cs.ceil(t),Ve(t.getUTCFullYear()%1e4,e,4)}function iK(){return"+0000"}function NT(){return"%"}function RT(t){return+t}function $T(t){return Math.floor(+t/1e3)}var zo,GR,XR;aK({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function aK(t){return zo=aV(t),GR=zo.format,zo.parse,XR=zo.utcFormat,zo.utcParse,zo}function oK(t){return new Date(t)}function sK(t){return t instanceof Date?+t:+new Date(+t)}function Yw(t,e,r,n,i,a,o,u,c,f){var p=Mw(),h=p.invert,g=p.domain,y=f(".%L"),w=f(":%S"),_=f("%I:%M"),b=f("%I %p"),k=f("%a %d"),O=f("%b %d"),A=f("%B"),j=f("%Y");function E(T){return(c(T)<T?y:u(T)<T?w:o(T)<T?_:a(T)<T?b:n(T)<T?i(T)<T?k:O:r(T)<T?A:j)(T)}return p.invert=function(T){return new Date(h(T))},p.domain=function(T){return arguments.length?g(Array.from(T,sK)):g().map(oK)},p.ticks=function(T){var C=g();return t(C[0],C[C.length-1],T??10)},p.tickFormat=function(T,C){return C==null?E:f(C)},p.nice=function(T){var C=g();return(!T||typeof T.range!="function")&&(T=e(C[0],C[C.length-1],T??10)),T?g(IR(C,T)):p},p.copy=function(){return ec(p,Yw(t,e,r,n,i,a,o,u,c,f))},p}function lK(){return an.apply(Yw(nV,iV,gi,Gw,Ch,tc,Vw,Hw,Ha,GR).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function uK(){return an.apply(Yw(tV,rV,yi,Xw,Nh,Ph,Kw,Ww,Ha,XR).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Rh(){var t=0,e=1,r,n,i,a,o=dr,u=!1,c;function f(h){return h==null||isNaN(h=+h)?c:o(i===0?.5:(h=(a(h)-r)*i,u?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([t,e]=h,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),f):[t,e]},f.clamp=function(h){return arguments.length?(u=!!h,f):u},f.interpolator=function(h){return arguments.length?(o=h,f):o};function p(h){return function(g){var y,w;return arguments.length?([y,w]=g,o=h(y,w),f):[o(0),o(1)]}}return f.range=p(Is),f.rangeRound=p(Iw),f.unknown=function(h){return arguments.length?(c=h,f):c},function(h){return a=h,r=h(t),n=h(e),i=r===n?0:1/(n-r),f}}function ha(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function YR(){var t=da(Rh()(dr));return t.copy=function(){return ha(t,YR())},Si.apply(t,arguments)}function JR(){var t=zw(Rh()).domain([1,10]);return t.copy=function(){return ha(t,JR()).base(t.base())},Si.apply(t,arguments)}function QR(){var t=Bw(Rh());return t.copy=function(){return ha(t,QR()).constant(t.constant())},Si.apply(t,arguments)}function Jw(){var t=qw(Rh());return t.copy=function(){return ha(t,Jw()).exponent(t.exponent())},Si.apply(t,arguments)}function cK(){return Jw.apply(null,arguments).exponent(.5)}function ZR(){var t=[],e=dr;function r(n){if(n!=null&&!isNaN(n=+n))return e((Qu(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let i of n)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(ia),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,i)=>e(i/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>YH(t,a/n))},r.copy=function(){return ZR(e).domain(t)},Si.apply(r,arguments)}function $h(){var t=0,e=.5,r=1,n=1,i,a,o,u,c,f=dr,p,h=!1,g;function y(_){return isNaN(_=+_)?g:(_=.5+((_=+p(_))-a)*(n*_<n*a?u:c),f(h?Math.max(0,Math.min(1,_)):_))}y.domain=function(_){return arguments.length?([t,e,r]=_,i=p(t=+t),a=p(e=+e),o=p(r=+r),u=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),n=a<i?-1:1,y):[t,e,r]},y.clamp=function(_){return arguments.length?(h=!!_,y):h},y.interpolator=function(_){return arguments.length?(f=_,y):f};function w(_){return function(b){var k,O,A;return arguments.length?([k,O,A]=b,f=_W(_,[k,O,A]),y):[f(0),f(.5),f(1)]}}return y.range=w(Is),y.rangeRound=w(Iw),y.unknown=function(_){return arguments.length?(g=_,y):g},function(_){return p=_,i=_(t),a=_(e),o=_(r),u=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),n=a<i?-1:1,y}}function e$(){var t=da($h()(dr));return t.copy=function(){return ha(t,e$())},Si.apply(t,arguments)}function t$(){var t=zw($h()).domain([.1,1,10]);return t.copy=function(){return ha(t,t$()).base(t.base())},Si.apply(t,arguments)}function r$(){var t=Bw($h());return t.copy=function(){return ha(t,r$()).constant(t.constant())},Si.apply(t,arguments)}function Qw(){var t=qw($h());return t.copy=function(){return ha(t,Qw()).exponent(t.exponent())},Si.apply(t,arguments)}function fK(){return Qw.apply(null,arguments).exponent(.5)}const IT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:mu,scaleDiverging:e$,scaleDivergingLog:t$,scaleDivergingPow:Qw,scaleDivergingSqrt:fK,scaleDivergingSymlog:r$,scaleIdentity:$R,scaleImplicit:Lb,scaleLinear:Td,scaleLog:MR,scaleOrdinal:Nw,scalePoint:Jl,scalePow:Uw,scaleQuantile:zR,scaleQuantize:BR,scaleRadial:LR,scaleSequential:YR,scaleSequentialLog:JR,scaleSequentialPow:Jw,scaleSequentialQuantile:ZR,scaleSequentialSqrt:cK,scaleSequentialSymlog:QR,scaleSqrt:WW,scaleSymlog:DR,scaleThreshold:qR,scaleTime:lK,scaleUtc:uK,tickFormat:RR},Symbol.toStringTag,{value:"Module"}));var o0,MT;function n$(){if(MT)return o0;MT=1;var t=Cs();function e(r,n,i){for(var a=-1,o=r.length;++a<o;){var u=r[a],c=n(u);if(c!=null&&(f===void 0?c===c&&!t(c):i(c,f)))var f=c,p=u}return p}return o0=e,o0}var s0,DT;function dK(){if(DT)return s0;DT=1;function t(e,r){return e>r}return s0=t,s0}var l0,LT;function hK(){if(LT)return l0;LT=1;var t=n$(),e=dK(),r=Rs();function n(i){return i&&i.length?t(i,r,e):void 0}return l0=n,l0}var pK=hK();const Ih=Ze(pK);var u0,zT;function mK(){if(zT)return u0;zT=1;function t(e,r){return e<r}return u0=t,u0}var c0,BT;function gK(){if(BT)return c0;BT=1;var t=n$(),e=mK(),r=Rs();function n(i){return i&&i.length?t(i,r,e):void 0}return c0=n,c0}var yK=gK();const Mh=Ze(yK);var f0,qT;function vK(){if(qT)return f0;qT=1;var t=pw(),e=fa(),r=dR(),n=Sr();function i(a,o){var u=n(a)?t:r;return u(a,e(o,3))}return f0=i,f0}var d0,UT;function bK(){if(UT)return d0;UT=1;var t=cR(),e=vK();function r(n,i){return t(e(n,i),1)}return d0=r,d0}var xK=bK();const wK=Ze(xK);var h0,FT;function _K(){if(FT)return h0;FT=1;var t=Aw();function e(r,n){return t(r,n)}return h0=e,h0}var SK=_K();const Dh=Ze(SK);var Ms=1e9,kK={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},e1,pt=!0,rn="[DecimalError] ",Ga=rn+"Invalid argument: ",Zw=rn+"Exponent out of range: ",Ds=Math.floor,za=Math.pow,EK=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ir,Ht=1e7,ut=7,i$=9007199254740991,Nd=Ds(i$/ut),be={};be.absoluteValue=be.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};be.comparedTo=be.cmp=function(t){var e,r,n,i,a=this;if(t=new a.constructor(t),a.s!==t.s)return a.s||-t.s;if(a.e!==t.e)return a.e>t.e^a.s<0?1:-1;for(n=a.d.length,i=t.d.length,e=0,r=n<i?n:i;e<r;++e)if(a.d[e]!==t.d[e])return a.d[e]>t.d[e]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};be.decimalPlaces=be.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*ut;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};be.dividedBy=be.div=function(t){return hi(this,new this.constructor(t))};be.dividedToIntegerBy=be.idiv=function(t){var e=this,r=e.constructor;return tt(hi(e,new r(t),0,1),r.precision)};be.equals=be.eq=function(t){return!this.cmp(t)};be.exponent=function(){return Pt(this)};be.greaterThan=be.gt=function(t){return this.cmp(t)>0};be.greaterThanOrEqualTo=be.gte=function(t){return this.cmp(t)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(t){return this.cmp(t)<0};be.lessThanOrEqualTo=be.lte=function(t){return this.cmp(t)<1};be.logarithm=be.log=function(t){var e,r=this,n=r.constructor,i=n.precision,a=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Ir))throw Error(rn+"NaN");if(r.s<1)throw Error(rn+(r.s?"NaN":"-Infinity"));return r.eq(Ir)?new n(0):(pt=!1,e=hi(xu(r,a),xu(t,a),a),pt=!0,tt(e,i))};be.minus=be.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?s$(e,t):a$(e,(t.s=-t.s,t))};be.modulo=be.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(rn+"NaN");return r.s?(pt=!1,e=hi(r,t,0,1).times(t),pt=!0,r.minus(e)):tt(new n(r),i)};be.naturalExponential=be.exp=function(){return o$(this)};be.naturalLogarithm=be.ln=function(){return xu(this)};be.negated=be.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};be.plus=be.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?a$(e,t):s$(e,(t.s=-t.s,t))};be.precision=be.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Ga+t);if(e=Pt(i)+1,n=i.d.length-1,r=n*ut+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};be.squareRoot=be.sqrt=function(){var t,e,r,n,i,a,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(rn+"NaN")}for(t=Pt(u),pt=!1,i=Math.sqrt(+u),i==0||i==1/0?(e=qn(u.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Ds((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new c(e)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(a=n,n=a.plus(hi(u,a,o+2)).times(.5),qn(a.d).slice(0,o)===(e=qn(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(tt(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(e!="9999")break;o+=4}return pt=!0,tt(n,r)};be.times=be.mul=function(t){var e,r,n,i,a,o,u,c,f,p=this,h=p.constructor,g=p.d,y=(t=new h(t)).d;if(!p.s||!t.s)return new h(0);for(t.s*=p.s,r=p.e+t.e,c=g.length,f=y.length,c<f&&(a=g,g=y,y=a,o=c,c=f,f=o),a=[],o=c+f,n=o;n--;)a.push(0);for(n=f;--n>=0;){for(e=0,i=c+n;i>n;)u=a[i]+y[n]*g[i-n-1]+e,a[i--]=u%Ht|0,e=u/Ht|0;a[i]=(a[i]+e)%Ht|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,pt?tt(t,h.precision):t};be.toDecimalPlaces=be.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Hn(t,0,Ms),e===void 0?e=n.rounding:Hn(e,0,8),tt(r,t+Pt(r)+1,e))};be.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Qa(n,!0):(Hn(t,0,Ms),e===void 0?e=i.rounding:Hn(e,0,8),n=tt(new i(n),t+1,e),r=Qa(n,!0,t+1)),r};be.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?Qa(i):(Hn(t,0,Ms),e===void 0?e=a.rounding:Hn(e,0,8),n=tt(new a(i),t+Pt(i)+1,e),r=Qa(n.abs(),!1,t+Pt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};be.toInteger=be.toint=function(){var t=this,e=t.constructor;return tt(new e(t),Pt(t)+1,e.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(t){var e,r,n,i,a,o,u=this,c=u.constructor,f=12,p=+(t=new c(t));if(!t.s)return new c(Ir);if(u=new c(u),!u.s){if(t.s<1)throw Error(rn+"Infinity");return u}if(u.eq(Ir))return u;if(n=c.precision,t.eq(Ir))return tt(u,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=u.s,o){if((r=p<0?-p:p)<=i$){for(i=new c(Ir),e=Math.ceil(n/ut+4),pt=!1;r%2&&(i=i.times(u),WT(i.d,e)),r=Ds(r/2),r!==0;)u=u.times(u),WT(u.d,e);return pt=!0,t.s<0?new c(Ir).div(i):tt(i,n)}}else if(a<0)throw Error(rn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,u.s=1,pt=!1,i=t.times(xu(u,n+f)),pt=!0,i=o$(i),i.s=a,i};be.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=Pt(i),n=Qa(i,r<=a.toExpNeg||r>=a.toExpPos)):(Hn(t,1,Ms),e===void 0?e=a.rounding:Hn(e,0,8),i=tt(new a(i),t,e),r=Pt(i),n=Qa(i,t<=r||r<=a.toExpNeg,t)),n};be.toSignificantDigits=be.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Hn(t,1,Ms),e===void 0?e=n.rounding:Hn(e,0,8)),tt(new n(r),t,e)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Pt(t),r=t.constructor;return Qa(t,e<=r.toExpNeg||e>=r.toExpPos)};function a$(t,e){var r,n,i,a,o,u,c,f,p=t.constructor,h=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),pt?tt(e,h):e;if(c=t.d,f=e.d,o=t.e,i=e.e,c=c.slice(),a=o-i,a){for(a<0?(n=c,a=-a,u=f.length):(n=f,i=o,u=c.length),o=Math.ceil(h/ut),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=c.length,a=f.length,u-a<0&&(a=u,n=f,f=c,c=n),r=0;a;)r=(c[--a]=c[a]+f[a]+r)/Ht|0,c[a]%=Ht;for(r&&(c.unshift(r),++i),u=c.length;c[--u]==0;)c.pop();return e.d=c,e.e=i,pt?tt(e,h):e}function Hn(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Ga+t)}function qn(t){var e,r,n,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;e<i;e++)n=t[e]+"",r=ut-n.length,r&&(a+=Ji(r)),a+=n;o=t[e],n=o+"",r=ut-n.length,r&&(a+=Ji(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var hi=(function(){function t(n,i){var a,o=0,u=n.length;for(n=n.slice();u--;)a=n[u]*i+o,n[u]=a%Ht|0,o=a/Ht|0;return o&&n.unshift(o),n}function e(n,i,a,o){var u,c;if(a!=o)c=a>o?1:-1;else for(u=c=0;u<a;u++)if(n[u]!=i[u]){c=n[u]>i[u]?1:-1;break}return c}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*Ht+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var u,c,f,p,h,g,y,w,_,b,k,O,A,j,E,T,C,R,D=n.constructor,X=n.s==i.s?1:-1,$=n.d,I=i.d;if(!n.s)return new D(n);if(!i.s)throw Error(rn+"Division by zero");for(c=n.e-i.e,C=I.length,E=$.length,y=new D(X),w=y.d=[],f=0;I[f]==($[f]||0);)++f;if(I[f]>($[f]||0)&&--c,a==null?O=a=D.precision:o?O=a+(Pt(n)-Pt(i))+1:O=a,O<0)return new D(0);if(O=O/ut+2|0,f=0,C==1)for(p=0,I=I[0],O++;(f<E||p)&&O--;f++)A=p*Ht+($[f]||0),w[f]=A/I|0,p=A%I|0;else{for(p=Ht/(I[0]+1)|0,p>1&&(I=t(I,p),$=t($,p),C=I.length,E=$.length),j=C,_=$.slice(0,C),b=_.length;b<C;)_[b++]=0;R=I.slice(),R.unshift(0),T=I[0],I[1]>=Ht/2&&++T;do p=0,u=e(I,_,C,b),u<0?(k=_[0],C!=b&&(k=k*Ht+(_[1]||0)),p=k/T|0,p>1?(p>=Ht&&(p=Ht-1),h=t(I,p),g=h.length,b=_.length,u=e(h,_,g,b),u==1&&(p--,r(h,C<g?R:I,g))):(p==0&&(u=p=1),h=I.slice()),g=h.length,g<b&&h.unshift(0),r(_,h,b),u==-1&&(b=_.length,u=e(I,_,C,b),u<1&&(p++,r(_,C<b?R:I,b))),b=_.length):u===0&&(p++,_=[0]),w[f++]=p,u&&_[0]?_[b++]=$[j]||0:(_=[$[j]],b=1);while((j++<E||_[0]!==void 0)&&O--)}return w[0]||w.shift(),y.e=c,tt(y,o?a+Pt(y)+1:a)}})();function o$(t,e){var r,n,i,a,o,u,c=0,f=0,p=t.constructor,h=p.precision;if(Pt(t)>16)throw Error(Zw+Pt(t));if(!t.s)return new p(Ir);for(pt=!1,u=h,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),f+=5;for(n=Math.log(za(2,f))/Math.LN10*2+5|0,u+=n,r=i=a=new p(Ir),p.precision=u;;){if(i=tt(i.times(t),u),r=r.times(++c),o=a.plus(hi(i,r,u)),qn(o.d).slice(0,u)===qn(a.d).slice(0,u)){for(;f--;)a=tt(a.times(a),u);return p.precision=h,e==null?(pt=!0,tt(a,h)):a}a=o}}function Pt(t){for(var e=t.e*ut,r=t.d[0];r>=10;r/=10)e++;return e}function p0(t,e,r){if(e>t.LN10.sd())throw pt=!0,r&&(t.precision=r),Error(rn+"LN10 precision limit exceeded");return tt(new t(t.LN10),e)}function Ji(t){for(var e="";t--;)e+="0";return e}function xu(t,e){var r,n,i,a,o,u,c,f,p,h=1,g=10,y=t,w=y.d,_=y.constructor,b=_.precision;if(y.s<1)throw Error(rn+(y.s?"NaN":"-Infinity"));if(y.eq(Ir))return new _(0);if(e==null?(pt=!1,f=b):f=e,y.eq(10))return e==null&&(pt=!0),p0(_,f);if(f+=g,_.precision=f,r=qn(w),n=r.charAt(0),a=Pt(y),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)y=y.times(t),r=qn(y.d),n=r.charAt(0),h++;a=Pt(y),n>1?(y=new _("0."+r),a++):y=new _(n+"."+r.slice(1))}else return c=p0(_,f+2,b).times(a+""),y=xu(new _(n+"."+r.slice(1)),f-g).plus(c),_.precision=b,e==null?(pt=!0,tt(y,b)):y;for(u=o=y=hi(y.minus(Ir),y.plus(Ir),f),p=tt(y.times(y),f),i=3;;){if(o=tt(o.times(p),f),c=u.plus(hi(o,new _(i),f)),qn(c.d).slice(0,f)===qn(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(p0(_,f+2,b).times(a+""))),u=hi(u,new _(h),f),_.precision=b,e==null?(pt=!0,tt(u,b)):u;u=c,i+=2}}function HT(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=Ds(r/ut),t.d=[],n=(r+1)%ut,r<0&&(n+=ut),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=ut;n<i;)t.d.push(+e.slice(n,n+=ut));e=e.slice(n),n=ut-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),pt&&(t.e>Nd||t.e<-Nd))throw Error(Zw+r)}else t.s=0,t.e=0,t.d=[0];return t}function tt(t,e,r){var n,i,a,o,u,c,f,p,h=t.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=ut,i=e,f=h[p=0];else{if(p=Math.ceil((n+1)/ut),a=h.length,p>=a)return t;for(f=a=h[p],o=1;a>=10;a/=10)o++;n%=ut,i=n-ut+o}if(r!==void 0&&(a=za(10,o-i-1),u=f/a%10|0,c=e<0||h[p+1]!==void 0||f%a,c=r<4?(u||c)&&(r==0||r==(t.s<0?3:2)):u>5||u==5&&(r==4||c||r==6&&(n>0?i>0?f/za(10,o-i):0:h[p-1])%10&1||r==(t.s<0?8:7))),e<1||!h[0])return c?(a=Pt(t),h.length=1,e=e-a-1,h[0]=za(10,(ut-e%ut)%ut),t.e=Ds(-e/ut)||0):(h.length=1,h[0]=t.e=t.s=0),t;if(n==0?(h.length=p,a=1,p--):(h.length=p+1,a=za(10,ut-n),h[p]=i>0?(f/za(10,o-i)%za(10,i)|0)*a:0),c)for(;;)if(p==0){(h[0]+=a)==Ht&&(h[0]=1,++t.e);break}else{if(h[p]+=a,h[p]!=Ht)break;h[p--]=0,a=1}for(n=h.length;h[--n]===0;)h.pop();if(pt&&(t.e>Nd||t.e<-Nd))throw Error(Zw+Pt(t));return t}function s$(t,e){var r,n,i,a,o,u,c,f,p,h,g=t.constructor,y=g.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new g(t),pt?tt(e,y):e;if(c=t.d,h=e.d,n=e.e,f=t.e,c=c.slice(),o=f-n,o){for(p=o<0,p?(r=c,o=-o,u=h.length):(r=h,n=f,u=c.length),i=Math.max(Math.ceil(y/ut),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,u=h.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(c[i]!=h[i]){p=c[i]<h[i];break}o=0}for(p&&(r=c,c=h,h=r,e.s=-e.s),u=c.length,i=h.length-u;i>0;--i)c[u++]=0;for(i=h.length;i>o;){if(c[--i]<h[i]){for(a=i;a&&c[--a]===0;)c[a]=Ht-1;--c[a],c[i]+=Ht}c[i]-=h[i]}for(;c[--u]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=n,pt?tt(e,y):e):new g(0)}function Qa(t,e,r){var n,i=Pt(t),a=qn(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ji(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ji(-i-1)+a,r&&(n=r-o)>0&&(a+=Ji(n))):i>=o?(a+=Ji(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ji(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Ji(n))),t.s<0?"-"+a:a}function WT(t,e){if(t.length>e)return t.length=e,!0}function l$(t){var e,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ga+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return HT(o,a.toString())}else if(typeof a!="string")throw Error(Ga+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,EK.test(a))HT(o,a);else throw Error(Ga+a)}if(i.prototype=be,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=l$,i.config=i.set=OK,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function OK(t){if(!t||typeof t!="object")throw Error(rn+"Object expected");var e,r,n,i=["precision",1,Ms,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((n=t[r=i[e]])!==void 0)if(Ds(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Ga+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ga+r+": "+n);return this}var e1=l$(kK);Ir=new e1(1);const Qe=e1;function AK(t){return CK(t)||PK(t)||jK(t)||TK()}function TK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
427
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jK(t,e){if(t){if(typeof t=="string")return Ub(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ub(t,e)}}function PK(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function CK(t){if(Array.isArray(t))return Ub(t)}function Ub(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var NK=function(e){return e},u$={},c$=function(e){return e===u$},VT=function(e){return function r(){return arguments.length===0||arguments.length===1&&c$(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},RK=function t(e,r){return e===1?r:VT(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(u){return u!==u$}).length;return o>=e?r.apply(void 0,i):t(e-o,VT(function(){for(var u=arguments.length,c=new Array(u),f=0;f<u;f++)c[f]=arguments[f];var p=i.map(function(h){return c$(h)?c.shift():h});return r.apply(void 0,AK(p).concat(c))}))})},Lh=function(e){return RK(e.length,e)},Fb=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},$K=Lh(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),IK=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return NK;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(u,c){return c(u)},a.apply(void 0,arguments))}},Hb=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},f$=function(e){var r=null,n=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r&&a.every(function(u,c){return u===r[c]})||(r=a,n=e.apply(void 0,a)),n}};function MK(t){var e;return t===0?e=1:e=Math.floor(new Qe(t).abs().log(10).toNumber())+1,e}function DK(t,e,r){for(var n=new Qe(t),i=0,a=[];n.lt(e)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var LK=Lh(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),zK=Lh(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),BK=Lh(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const zh={rangeStep:DK,getDigitCount:MK,interpolateNumber:LK,uninterpolateNumber:zK,uninterpolateTruncation:BK};function Wb(t){return FK(t)||UK(t)||d$(t)||qK()}function qK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
428
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UK(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function FK(t){if(Array.isArray(t))return Vb(t)}function wu(t,e){return VK(t)||WK(t,e)||d$(t,e)||HK()}function HK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
429
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d$(t,e){if(t){if(typeof t=="string")return Vb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vb(t,e)}}function Vb(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function WK(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(e&&r.length===e));n=!0);}catch(c){i=!0,a=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function VK(t){if(Array.isArray(t))return t}function h$(t){var e=wu(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function p$(t,e,r){if(t.lte(0))return new Qe(0);var n=zh.getDigitCount(t.toNumber()),i=new Qe(10).pow(n),a=t.div(i),o=n!==1?.05:.1,u=new Qe(Math.ceil(a.div(o).toNumber())).add(r).mul(o),c=u.mul(i);return e?c:new Qe(Math.ceil(c))}function KK(t,e,r){var n=1,i=new Qe(t);if(!i.isint()&&r){var a=Math.abs(t);a<1?(n=new Qe(10).pow(zh.getDigitCount(t)-1),i=new Qe(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Qe(Math.floor(t)))}else t===0?i=new Qe(Math.floor((e-1)/2)):r||(i=new Qe(Math.floor(t)));var o=Math.floor((e-1)/2),u=IK($K(function(c){return i.add(new Qe(c-o).mul(n)).toNumber()}),Fb);return u(0,e)}function m$(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new Qe(0),tickMin:new Qe(0),tickMax:new Qe(0)};var a=p$(new Qe(e).sub(t).div(r-1),n,i),o;t<=0&&e>=0?o=new Qe(0):(o=new Qe(t).add(e).div(2),o=o.sub(new Qe(o).mod(a)));var u=Math.ceil(o.sub(t).div(a).toNumber()),c=Math.ceil(new Qe(e).sub(o).div(a).toNumber()),f=u+c+1;return f>r?m$(t,e,r,n,i+1):(f<r&&(c=e>0?c+(r-f):c,u=e>0?u:u+(r-f)),{step:a,tickMin:o.sub(new Qe(u).mul(a)),tickMax:o.add(new Qe(c).mul(a))})}function GK(t){var e=wu(t,2),r=e[0],n=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),u=h$([r,n]),c=wu(u,2),f=c[0],p=c[1];if(f===-1/0||p===1/0){var h=p===1/0?[f].concat(Wb(Fb(0,i-1).map(function(){return 1/0}))):[].concat(Wb(Fb(0,i-1).map(function(){return-1/0})),[p]);return r>n?Hb(h):h}if(f===p)return KK(f,i,a);var g=m$(f,p,o,a),y=g.step,w=g.tickMin,_=g.tickMax,b=zh.rangeStep(w,_.add(new Qe(.1).mul(y)),y);return r>n?Hb(b):b}function XK(t,e){var r=wu(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=h$([n,i]),u=wu(o,2),c=u[0],f=u[1];if(c===-1/0||f===1/0)return[n,i];if(c===f)return[c];var p=Math.max(e,2),h=p$(new Qe(f).sub(c).div(p-1),a,0),g=[].concat(Wb(zh.rangeStep(new Qe(c),new Qe(f).sub(new Qe(.99).mul(h)),h)),[f]);return n>i?Hb(g):g}var YK=f$(GK),JK=f$(XK),QK="Invariant failed";function Za(t,e){throw new Error(QK)}var ZK=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function fs(t){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(t)}function Rd(){return Rd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rd.apply(this,arguments)}function eG(t,e){return iG(t)||nG(t,e)||rG(t,e)||tG()}function tG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
430
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rG(t,e){if(t){if(typeof t=="string")return KT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KT(t,e)}}function KT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nG(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function iG(t){if(Array.isArray(t))return t}function aG(t,e){if(t==null)return{};var r=oG(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function oG(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function sG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lG(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v$(n.key),n)}}function uG(t,e,r){return e&&lG(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function cG(t,e,r){return e=$d(e),fG(t,g$()?Reflect.construct(e,r||[],$d(t).constructor):e.apply(t,r))}function fG(t,e){if(e&&(fs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dG(t)}function dG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g$=function(){return!!t})()}function $d(t){return $d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$d(t)}function hG(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kb(t,e)}function Kb(t,e){return Kb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Kb(t,e)}function y$(t,e,r){return e=v$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v$(t){var e=pG(t,"string");return fs(e)=="symbol"?e:e+""}function pG(t,e){if(fs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var rc=(function(t){function e(){return sG(this,e),cG(this,e,arguments)}return hG(e,t),uG(e,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,u=n.dataKey,c=n.data,f=n.dataPointFormatter,p=n.xAxis,h=n.yAxis,g=aG(n,ZK),y=Be(g,!1);this.props.direction==="x"&&p.type!=="number"&&Za();var w=c.map(function(_){var b=f(_,u),k=b.x,O=b.y,A=b.value,j=b.errorVal;if(!j)return null;var E=[],T,C;if(Array.isArray(j)){var R=eG(j,2);T=R[0],C=R[1]}else T=C=j;if(a==="vertical"){var D=p.scale,X=O+i,$=X+o,I=X-o,q=D(A-T),U=D(A+C);E.push({x1:U,y1:$,x2:U,y2:I}),E.push({x1:q,y1:X,x2:U,y2:X}),E.push({x1:q,y1:$,x2:q,y2:I})}else if(a==="horizontal"){var V=h.scale,G=k+i,Z=G-o,K=G+o,te=V(A-T),H=V(A+C);E.push({x1:Z,y1:H,x2:K,y2:H}),E.push({x1:G,y1:te,x2:G,y2:H}),E.push({x1:Z,y1:te,x2:K,y2:te})}return M.createElement(kt,Rd({className:"recharts-errorBar",key:"bar-".concat(E.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},y),E.map(function(B){return M.createElement("line",Rd({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return M.createElement(kt,{className:"recharts-errorBars"},w)}}])})(M.Component);y$(rc,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});y$(rc,"displayName","ErrorBar");function _u(t){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_u(t)}function GT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ma(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?GT(Object(r),!0).forEach(function(n){mG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mG(t,e,r){return e=gG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gG(t){var e=yG(t,"string");return _u(e)=="symbol"?e:e+""}function yG(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var b$=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=Nr(r,Zo);if(!o)return null;var u=Zo.defaultProps,c=u!==void 0?Ma(Ma({},u),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:a==="children"?f=(n||[]).reduce(function(p,h){var g=h.item,y=h.props,w=y.sectors||y.data||[];return p.concat(w.map(function(_){return{type:o.props.iconType||g.props.legendType,value:_.name,color:_.fill,payload:_}}))},[]):f=(n||[]).map(function(p){var h=p.item,g=h.type.defaultProps,y=g!==void 0?Ma(Ma({},g),h.props):{},w=y.dataKey,_=y.name,b=y.legendType,k=y.hide;return{inactive:k,dataKey:w,type:c.iconType||b||"square",color:t1(h),value:_||w,payload:y}}),Ma(Ma(Ma({},c),Zo.getWithHeight(o,i)),{},{payload:f,item:o})};function Su(t){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(t)}function XT(t){return wG(t)||xG(t)||bG(t)||vG()}function vG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
431
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bG(t,e){if(t){if(typeof t=="string")return Gb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gb(t,e)}}function xG(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wG(t){if(Array.isArray(t))return Gb(t)}function Gb(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function YT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?YT(Object(r),!0).forEach(function(n){ts(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):YT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ts(t,e,r){return e=_G(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _G(t){var e=SG(t,"string");return Su(e)=="symbol"?e:e+""}function SG(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mr(t,e,r){return Le(t)||Le(e)?r:Dt(e)?en(t,e,r):Me(e)?e(t):r}function Ql(t,e,r,n){var i=wK(t,function(u){return Mr(u,e)});if(r==="number"){var a=i.filter(function(u){return fe(u)||parseFloat(u)});return a.length?[Mh(a),Ih(a)]:[1/0,-1/0]}var o=n?i.filter(function(u){return!Le(u)}):i;return o.map(function(u){return Dt(u)||u instanceof Date?u:""})}var kG=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,f=0;f<u;f++){var p=f>0?i[f-1].coordinate:i[u-1].coordinate,h=i[f].coordinate,g=f>=u-1?i[0].coordinate:i[f+1].coordinate,y=void 0;if(kn(h-p)!==kn(g-h)){var w=[];if(kn(g-h)===kn(c[1]-c[0])){y=g;var _=h+c[1]-c[0];w[0]=Math.min(_,(_+p)/2),w[1]=Math.max(_,(_+p)/2)}else{y=p;var b=g+c[1]-c[0];w[0]=Math.min(h,(b+h)/2),w[1]=Math.max(h,(b+h)/2)}var k=[Math.min(h,(y+h)/2),Math.max(h,(y+h)/2)];if(e>k[0]&&e<=k[1]||e>=w[0]&&e<=w[1]){o=i[f].index;break}}else{var O=Math.min(p,g),A=Math.max(p,g);if(e>(O+h)/2&&e<=(A+h)/2){o=i[f].index;break}}}else for(var j=0;j<u;j++)if(j===0&&e<=(n[j].coordinate+n[j+1].coordinate)/2||j>0&&j<u-1&&e>(n[j].coordinate+n[j-1].coordinate)/2&&e<=(n[j].coordinate+n[j+1].coordinate)/2||j===u-1&&e>(n[j].coordinate+n[j-1].coordinate)/2){o=n[j].index;break}return o},t1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?xt(xt({},e.type.defaultProps),e.props):e.props,o=a.stroke,u=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:u;break;default:c=u;break}return c},EG=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},u=Object.keys(a),c=0,f=u.length;c<f;c++)for(var p=a[u[c]].stackGroups,h=Object.keys(p),g=0,y=h.length;g<y;g++){var w=p[h[g]],_=w.items,b=w.cateAxisId,k=_.filter(function(C){return fi(C.type).indexOf("Bar")>=0});if(k&&k.length){var O=k[0].type.defaultProps,A=O!==void 0?xt(xt({},O),k[0].props):k[0].props,j=A.barSize,E=A[b];o[E]||(o[E]=[]);var T=Le(j)?r:j;o[E].push({item:k[0],stackList:k.slice(1),barSize:Le(T)?void 0:Ja(T,n,0)})}}return o},OG=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,u=e.maxBarSize,c=o.length;if(c<1)return null;var f=Ja(r,i,0,!0),p,h=[];if(o[0].barSize===+o[0].barSize){var g=!1,y=i/c,w=o.reduce(function(j,E){return j+E.barSize||0},0);w+=(c-1)*f,w>=i&&(w-=(c-1)*f,f=0),w>=i&&y>0&&(g=!0,y*=.9,w=c*y);var _=(i-w)/2>>0,b={offset:_-f,size:0};p=o.reduce(function(j,E){var T={item:E.item,position:{offset:b.offset+b.size+f,size:g?y:E.barSize}},C=[].concat(XT(j),[T]);return b=C[C.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){C.push({item:R,position:b})}),C},h)}else{var k=Ja(n,i,0,!0);i-2*k-(c-1)*f<=0&&(f=0);var O=(i-2*k-(c-1)*f)/c;O>1&&(O>>=0);var A=u===+u?Math.min(O,u):O;p=o.reduce(function(j,E,T){var C=[].concat(XT(j),[{item:E.item,position:{offset:k+(O+f)*T+(O-A)/2,size:A}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){C.push({item:R,position:C[C.length-1].position})}),C},h)}return p},AG=function(e,r,n,i){var a=n.children,o=n.width,u=n.margin,c=o-(u.left||0)-(u.right||0),f=b$({children:a,legendWidth:c});if(f){var p=i||{},h=p.width,g=p.height,y=f.align,w=f.verticalAlign,_=f.layout;if((_==="vertical"||_==="horizontal"&&w==="middle")&&y!=="center"&&fe(e[y]))return xt(xt({},e),{},ts({},y,e[y]+(h||0)));if((_==="horizontal"||_==="vertical"&&y==="center")&&w!=="middle"&&fe(e[w]))return xt(xt({},e),{},ts({},w,e[w]+(g||0)))}return e},TG=function(e,r,n){return Le(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},x$=function(e,r,n,i,a){var o=r.props.children,u=tn(o,rc).filter(function(f){return TG(i,a,f.props.direction)});if(u&&u.length){var c=u.map(function(f){return f.props.dataKey});return e.reduce(function(f,p){var h=Mr(p,n);if(Le(h))return f;var g=Array.isArray(h)?[Mh(h),Ih(h)]:[h,h],y=c.reduce(function(w,_){var b=Mr(p,_,0),k=g[0]-Math.abs(Array.isArray(b)?b[0]:b),O=g[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(k,w[0]),Math.max(O,w[1])]},[1/0,-1/0]);return[Math.min(y[0],f[0]),Math.max(y[1],f[1])]},[1/0,-1/0])}return null},jG=function(e,r,n,i,a){var o=r.map(function(u){return x$(e,u,n,a,i)}).filter(function(u){return!Le(u)});return o&&o.length?o.reduce(function(u,c){return[Math.min(u[0],c[0]),Math.max(u[1],c[1])]},[1/0,-1/0]):null},w$=function(e,r,n,i,a){var o=r.map(function(c){var f=c.props.dataKey;return n==="number"&&f&&x$(e,c,f,i)||Ql(e,f,n,a)});if(n==="number")return o.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);var u={};return o.reduce(function(c,f){for(var p=0,h=f.length;p<h;p++)u[f[p]]||(u[f[p]]=!0,c.push(f[p]));return c},[])},_$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},S$=function(e,r,n,i){if(i)return e.map(function(c){return c.coordinate});var a,o,u=e.map(function(c){return c.coordinate===r&&(a=!0),c.coordinate===n&&(o=!0),c.coordinate});return a||u.push(r),o||u.push(n),u},ui=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,u=e.range,c=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,f=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(f=e.axisType==="angleAxis"&&(u==null?void 0:u.length)>=2?kn(u[0]-u[1])*2*f:f,r&&(e.ticks||e.niceTicks)){var p=(e.ticks||e.niceTicks).map(function(h){var g=a?a.indexOf(h):h;return{coordinate:i(g)+f,value:h,offset:f}});return p.filter(function(h){return!Xu(h.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(h,g){return{coordinate:i(h)+f,value:h,index:g,offset:f}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(h){return{coordinate:i(h)+f,value:h,offset:f}}):i.domain().map(function(h,g){return{coordinate:i(h)+f,value:a?a[h]:h,index:g,offset:f}})},m0=new WeakMap,If=function(e,r){if(typeof r!="function")return e;m0.has(e)||m0.set(e,new WeakMap);var n=m0.get(e);if(n.has(r))return n.get(r);var i=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},PG=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,u=e.axisType;if(i==="auto")return o==="radial"&&u==="radiusAxis"?{scale:mu(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:Td(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Jl(),realScaleType:"point"}:a==="category"?{scale:mu(),realScaleType:"band"}:{scale:Td(),realScaleType:"linear"};if(Ya(i)){var c="scale".concat(_h(i));return{scale:(IT[c]||Jl)(),realScaleType:IT[c]?c:"point"}}return Me(i)?{scale:i}:{scale:Jl(),realScaleType:"point"}},JT=1e-4,CG=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,i=e.range(),a=Math.min(i[0],i[1])-JT,o=Math.max(i[0],i[1])+JT,u=e(r[0]),c=e(r[n-1]);(u<a||u>o||c<a||c>o)&&e.domain([r[0],r[n-1]])}},NG=function(e,r){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].item===r)return e[n].position;return null},RG=function(e,r){if(!r||r.length!==2||!fe(r[0])||!fe(r[1]))return e;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a=[e[0],e[1]];return(!fe(e[0])||e[0]<n)&&(a[0]=n),(!fe(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},$G=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0,u=0;u<r;++u){var c=Xu(e[u][n][1])?e[u][n][0]:e[u][n][1];c>=0?(e[u][n][0]=a,e[u][n][1]=a+c,a=e[u][n][1]):(e[u][n][0]=o,e[u][n][1]=o+c,o=e[u][n][1])}},IG=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0;o<r;++o){var u=Xu(e[o][n][1])?e[o][n][0]:e[o][n][1];u>=0?(e[o][n][0]=a,e[o][n][1]=a+u,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},MG={sign:$G,expand:bF,none:ns,silhouette:xF,wiggle:wF,positive:IG},DG=function(e,r,n){var i=r.map(function(u){return u.props.dataKey}),a=MG[n],o=vF().keys(i).value(function(u,c){return+Mr(u,c,0)}).order(kb).offset(a);return o(e)},LG=function(e,r,n,i,a,o){if(!e)return null;var u=o?r.reverse():r,c={},f=u.reduce(function(h,g){var y,w=(y=g.type)!==null&&y!==void 0&&y.defaultProps?xt(xt({},g.type.defaultProps),g.props):g.props,_=w.stackId,b=w.hide;if(b)return h;var k=w[n],O=h[k]||{hasStack:!1,stackGroups:{}};if(Dt(_)){var A=O.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};A.items.push(g),O.hasStack=!0,O.stackGroups[_]=A}else O.stackGroups[Yu("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[g]};return xt(xt({},h),{},ts({},k,O))},c),p={};return Object.keys(f).reduce(function(h,g){var y=f[g];if(y.hasStack){var w={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(_,b){var k=y.stackGroups[b];return xt(xt({},_),{},ts({},b,{numericAxisId:n,cateAxisId:i,items:k.items,stackedData:DG(e,k.items,a)}))},w)}return xt(xt({},h),{},ts({},g,y))},p)},zG=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,u=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=e.domain();if(!f.length)return null;var p=YK(f,a,u);return e.domain([Mh(p),Ih(p)]),{niceTicks:p}}if(a&&i==="number"){var h=e.domain(),g=JK(h,a,u);return{niceTicks:g}}return null};function QT(t){var e=t.axis,r=t.ticks,n=t.bandSize,i=t.entry,a=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Le(i[e.dataKey])){var u=od(r,"value",i[e.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=Mr(i,Le(o)?e.dataKey:o);return Le(c)?null:e.scale(c)}var ZT=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,u=e.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var c=Mr(o,r.dataKey,r.domain[u]);return Le(c)?null:r.scale(c)-a/2+i},BG=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},qG=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?xt(xt({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(Dt(a)){var o=r[a];if(o){var u=o.items.indexOf(e);return u>=0?o.stackedData[u]:null}}return null},UG=function(e){return e.reduce(function(r,n){return[Mh(n.concat([r[0]]).filter(fe)),Ih(n.concat([r[1]]).filter(fe))]},[1/0,-1/0])},k$=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],u=o.stackedData,c=u.reduce(function(f,p){var h=UG(p.slice(r,n+1));return[Math.min(f[0],h[0]),Math.max(f[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},ej=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Xb=function(e,r,n){if(Me(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(fe(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(ej.test(e[0])){var a=+ej.exec(e[0])[1];i[0]=r[0]-a}else Me(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(fe(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(tj.test(e[1])){var o=+tj.exec(e[1])[1];i[1]=r[1]+o}else Me(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Id=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!n||i>0)return i}if(e&&r&&r.length>=2){for(var a=jw(r,function(h){return h.coordinate}),o=1/0,u=1,c=a.length;u<c;u++){var f=a[u],p=a[u-1];o=Math.min((f.coordinate||0)-(p.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},rj=function(e,r,n){return!e||!e.length||Dh(e,en(n,"type.defaultProps.domain"))?r:e},E$=function(e,r){var n=e.type.defaultProps?xt(xt({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,u=n.formatter,c=n.tooltipType,f=n.chartType,p=n.hide;return xt(xt({},Be(e,!1)),{},{dataKey:i,unit:o,formatter:u,name:a||i,color:t1(e),value:Mr(r,i),type:c,payload:r,chartType:f,hide:p})};function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function nj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ij(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nj(Object(r),!0).forEach(function(n){FG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FG(t,e,r){return e=HG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HG(t){var e=WG(t,"string");return ku(e)=="symbol"?e:e+""}function WG(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Md=Math.PI/180,VG=function(e){return e*180/Math.PI},Zt=function(e,r,n,i){return{x:e+Math.cos(-Md*i)*n,y:r+Math.sin(-Md*i)*n}},KG=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},GG=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,u=KG({x:n,y:i},{x:a,y:o});if(u<=0)return{radius:u};var c=(n-a)/u,f=Math.acos(c);return i>o&&(f=2*Math.PI-f),{radius:u,angle:VG(f),angleInRadian:f}},XG=function(e){var r=e.startAngle,n=e.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},YG=function(e,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),u=Math.min(a,o);return e+u*360},aj=function(e,r){var n=e.x,i=e.y,a=GG({x:n,y:i},r),o=a.radius,u=a.angle,c=r.innerRadius,f=r.outerRadius;if(o<c||o>f)return!1;if(o===0)return!0;var p=XG(r),h=p.startAngle,g=p.endAngle,y=u,w;if(h<=g){for(;y>g;)y-=360;for(;y<h;)y+=360;w=y>=h&&y<=g}else{for(;y>h;)y-=360;for(;y<g;)y+=360;w=y>=g&&y<=h}return w?ij(ij({},r),{},{radius:o,angle:YG(y,r)}):null};function Eu(t){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(t)}var JG=["offset"];function QG(t){return rX(t)||tX(t)||eX(t)||ZG()}function ZG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
432
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eX(t,e){if(t){if(typeof t=="string")return Yb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yb(t,e)}}function tX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rX(t){if(Array.isArray(t))return Yb(t)}function Yb(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nX(t,e){if(t==null)return{};var r=iX(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function iX(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function oj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oj(Object(r),!0).forEach(function(n){aX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aX(t,e,r){return e=oX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oX(t){var e=sX(t,"string");return Eu(e)=="symbol"?e:e+""}function sX(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ou(){return Ou=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ou.apply(this,arguments)}var lX=function(e){var r=e.value,n=e.formatter,i=Le(e.children)?r:e.children;return Me(n)?n(i):i},uX=function(e,r){var n=kn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},cX=function(e,r,n){var i=e.position,a=e.viewBox,o=e.offset,u=e.className,c=a,f=c.cx,p=c.cy,h=c.innerRadius,g=c.outerRadius,y=c.startAngle,w=c.endAngle,_=c.clockWise,b=(h+g)/2,k=uX(y,w),O=k>=0?1:-1,A,j;i==="insideStart"?(A=y+O*o,j=_):i==="insideEnd"?(A=w-O*o,j=!_):i==="end"&&(A=w+O*o,j=_),j=k<=0?j:!j;var E=Zt(f,p,b,A),T=Zt(f,p,b,A+(j?1:-1)*359),C="M".concat(E.x,",").concat(E.y,`
433
- A`).concat(b,",").concat(b,",0,1,").concat(j?0:1,`,
434
- `).concat(T.x,",").concat(T.y),R=Le(e.id)?Yu("recharts-radial-line-"):e.id;return M.createElement("text",Ou({},n,{dominantBaseline:"central",className:qe("recharts-radial-bar-label",u)}),M.createElement("defs",null,M.createElement("path",{id:R,d:C})),M.createElement("textPath",{xlinkHref:"#".concat(R)},r))},fX=function(e){var r=e.viewBox,n=e.offset,i=e.position,a=r,o=a.cx,u=a.cy,c=a.innerRadius,f=a.outerRadius,p=a.startAngle,h=a.endAngle,g=(p+h)/2;if(i==="outside"){var y=Zt(o,u,f+n,g),w=y.x,_=y.y;return{x:w,y:_,textAnchor:w>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var b=(c+f)/2,k=Zt(o,u,b,g),O=k.x,A=k.y;return{x:O,y:A,textAnchor:"middle",verticalAnchor:"middle"}},dX=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,a=e.position,o=r,u=o.x,c=o.y,f=o.width,p=o.height,h=p>=0?1:-1,g=h*i,y=h>0?"end":"start",w=h>0?"start":"end",_=f>=0?1:-1,b=_*i,k=_>0?"end":"start",O=_>0?"start":"end";if(a==="top"){var A={x:u+f/2,y:c-h*i,textAnchor:"middle",verticalAnchor:y};return Mt(Mt({},A),n?{height:Math.max(c-n.y,0),width:f}:{})}if(a==="bottom"){var j={x:u+f/2,y:c+p+g,textAnchor:"middle",verticalAnchor:w};return Mt(Mt({},j),n?{height:Math.max(n.y+n.height-(c+p),0),width:f}:{})}if(a==="left"){var E={x:u-b,y:c+p/2,textAnchor:k,verticalAnchor:"middle"};return Mt(Mt({},E),n?{width:Math.max(E.x-n.x,0),height:p}:{})}if(a==="right"){var T={x:u+f+b,y:c+p/2,textAnchor:O,verticalAnchor:"middle"};return Mt(Mt({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:p}:{})}var C=n?{width:f,height:p}:{};return a==="insideLeft"?Mt({x:u+b,y:c+p/2,textAnchor:O,verticalAnchor:"middle"},C):a==="insideRight"?Mt({x:u+f-b,y:c+p/2,textAnchor:k,verticalAnchor:"middle"},C):a==="insideTop"?Mt({x:u+f/2,y:c+g,textAnchor:"middle",verticalAnchor:w},C):a==="insideBottom"?Mt({x:u+f/2,y:c+p-g,textAnchor:"middle",verticalAnchor:y},C):a==="insideTopLeft"?Mt({x:u+b,y:c+g,textAnchor:O,verticalAnchor:w},C):a==="insideTopRight"?Mt({x:u+f-b,y:c+g,textAnchor:k,verticalAnchor:w},C):a==="insideBottomLeft"?Mt({x:u+b,y:c+p-g,textAnchor:O,verticalAnchor:y},C):a==="insideBottomRight"?Mt({x:u+f-b,y:c+p-g,textAnchor:k,verticalAnchor:y},C):Ns(a)&&(fe(a.x)||Ua(a.x))&&(fe(a.y)||Ua(a.y))?Mt({x:u+Ja(a.x,f),y:c+Ja(a.y,p),textAnchor:"end",verticalAnchor:"end"},C):Mt({x:u+f/2,y:c+p/2,textAnchor:"middle",verticalAnchor:"middle"},C)},hX=function(e){return"cx"in e&&fe(e.cx)};function sr(t){var e=t.offset,r=e===void 0?5:e,n=nX(t,JG),i=Mt({offset:r},n),a=i.viewBox,o=i.position,u=i.value,c=i.children,f=i.content,p=i.className,h=p===void 0?"":p,g=i.textBreakAll;if(!a||Le(u)&&Le(c)&&!N.isValidElement(f)&&!Me(f))return null;if(N.isValidElement(f))return N.cloneElement(f,i);var y;if(Me(f)){if(y=N.createElement(f,i),N.isValidElement(y))return y}else y=lX(i);var w=hX(a),_=Be(i,!0);if(w&&(o==="insideStart"||o==="insideEnd"||o==="end"))return cX(i,y,_);var b=w?fX(i):dX(i);return M.createElement(xd,Ou({className:qe("recharts-label",h)},_,b,{breakAll:g}),y)}sr.displayName="Label";var O$=function(e){var r=e.cx,n=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,u=e.r,c=e.radius,f=e.innerRadius,p=e.outerRadius,h=e.x,g=e.y,y=e.top,w=e.left,_=e.width,b=e.height,k=e.clockWise,O=e.labelViewBox;if(O)return O;if(fe(_)&&fe(b)){if(fe(h)&&fe(g))return{x:h,y:g,width:_,height:b};if(fe(y)&&fe(w))return{x:y,y:w,width:_,height:b}}return fe(h)&&fe(g)?{x:h,y:g,width:0,height:0}:fe(r)&&fe(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:f||0,outerRadius:p||c||u||0,clockWise:k}:e.viewBox?e.viewBox:{}},pX=function(e,r){return e?e===!0?M.createElement(sr,{key:"label-implicit",viewBox:r}):Dt(e)?M.createElement(sr,{key:"label-implicit",viewBox:r,value:e}):N.isValidElement(e)?e.type===sr?N.cloneElement(e,{key:"label-implicit",viewBox:r}):M.createElement(sr,{key:"label-implicit",content:e,viewBox:r}):Me(e)?M.createElement(sr,{key:"label-implicit",content:e,viewBox:r}):Ns(e)?M.createElement(sr,Ou({viewBox:r},e,{key:"label-implicit"})):null:null},mX=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,a=O$(e),o=tn(i,sr).map(function(c,f){return N.cloneElement(c,{viewBox:r||a,key:"label-".concat(f)})});if(!n)return o;var u=pX(e.label,r||a);return[u].concat(QG(o))};sr.parseViewBox=O$;sr.renderCallByParent=mX;var g0,sj;function gX(){if(sj)return g0;sj=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return g0=t,g0}var yX=gX();const vX=Ze(yX);function Au(t){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Au(t)}var bX=["valueAccessor"],xX=["data","dataKey","clockWise","id","textBreakAll"];function wX(t){return EX(t)||kX(t)||SX(t)||_X()}function _X(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
435
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SX(t,e){if(t){if(typeof t=="string")return Jb(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jb(t,e)}}function kX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function EX(t){if(Array.isArray(t))return Jb(t)}function Jb(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Dd(){return Dd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Dd.apply(this,arguments)}function lj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function uj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lj(Object(r),!0).forEach(function(n){OX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function OX(t,e,r){return e=AX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AX(t){var e=TX(t,"string");return Au(e)=="symbol"?e:e+""}function TX(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cj(t,e){if(t==null)return{};var r=jX(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function jX(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var PX=function(e){return Array.isArray(e.value)?vX(e.value):e.value};function aa(t){var e=t.valueAccessor,r=e===void 0?PX:e,n=cj(t,bX),i=n.data,a=n.dataKey,o=n.clockWise,u=n.id,c=n.textBreakAll,f=cj(n,xX);return!i||!i.length?null:M.createElement(kt,{className:"recharts-label-list"},i.map(function(p,h){var g=Le(a)?r(p,h):Mr(p&&p.payload,a),y=Le(u)?{}:{id:"".concat(u,"-").concat(h)};return M.createElement(sr,Dd({},Be(p,!0),f,y,{parentViewBox:p.parentViewBox,value:g,textBreakAll:c,viewBox:sr.parseViewBox(Le(o)?p:uj(uj({},p),{},{clockWise:o})),key:"label-".concat(h),index:h}))}))}aa.displayName="LabelList";function CX(t,e){return t?t===!0?M.createElement(aa,{key:"labelList-implicit",data:e}):M.isValidElement(t)||Me(t)?M.createElement(aa,{key:"labelList-implicit",data:e,content:t}):Ns(t)?M.createElement(aa,Dd({data:e},t,{key:"labelList-implicit"})):null:null}function NX(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,i=tn(n,aa).map(function(o,u){return N.cloneElement(o,{data:e,key:"labelList-".concat(u)})});if(!r)return i;var a=CX(t.label,e);return[a].concat(wX(i))}aa.renderCallByParent=NX;function Tu(t){"@babel/helpers - typeof";return Tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tu(t)}function Qb(){return Qb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Qb.apply(this,arguments)}function fj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fj(Object(r),!0).forEach(function(n){RX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RX(t,e,r){return e=$X(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $X(t){var e=IX(t,"string");return Tu(e)=="symbol"?e:e+""}function IX(t,e){if(Tu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var MX=function(e,r){var n=kn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},Mf=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.angle,o=e.sign,u=e.isExternal,c=e.cornerRadius,f=e.cornerIsExternal,p=c*(u?1:-1)+i,h=Math.asin(c/p)/Md,g=f?a:a+o*h,y=Zt(r,n,p,g),w=Zt(r,n,i,g),_=f?a-o*h:a,b=Zt(r,n,p*Math.cos(h*Md),_);return{center:y,circleTangency:w,lineTangency:b,theta:h}},A$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,u=e.endAngle,c=MX(o,u),f=o+c,p=Zt(r,n,a,o),h=Zt(r,n,a,f),g="M ".concat(p.x,",").concat(p.y,`
436
- A `).concat(a,",").concat(a,`,0,
437
- `).concat(+(Math.abs(c)>180),",").concat(+(o>f),`,
438
- `).concat(h.x,",").concat(h.y,`
439
- `);if(i>0){var y=Zt(r,n,i,o),w=Zt(r,n,i,f);g+="L ".concat(w.x,",").concat(w.y,`
440
- A `).concat(i,",").concat(i,`,0,
441
- `).concat(+(Math.abs(c)>180),",").concat(+(o<=f),`,
442
- `).concat(y.x,",").concat(y.y," Z")}else g+="L ".concat(r,",").concat(n," Z");return g},DX=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,u=e.forceCornerRadius,c=e.cornerIsExternal,f=e.startAngle,p=e.endAngle,h=kn(p-f),g=Mf({cx:r,cy:n,radius:a,angle:f,sign:h,cornerRadius:o,cornerIsExternal:c}),y=g.circleTangency,w=g.lineTangency,_=g.theta,b=Mf({cx:r,cy:n,radius:a,angle:p,sign:-h,cornerRadius:o,cornerIsExternal:c}),k=b.circleTangency,O=b.lineTangency,A=b.theta,j=c?Math.abs(f-p):Math.abs(f-p)-_-A;if(j<0)return u?"M ".concat(w.x,",").concat(w.y,`
443
- a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
444
- a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
445
- `):A$({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p});var E="M ".concat(w.x,",").concat(w.y,`
446
- A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(y.x,",").concat(y.y,`
447
- A`).concat(a,",").concat(a,",0,").concat(+(j>180),",").concat(+(h<0),",").concat(k.x,",").concat(k.y,`
448
- A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(O.x,",").concat(O.y,`
449
- `);if(i>0){var T=Mf({cx:r,cy:n,radius:i,angle:f,sign:h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),C=T.circleTangency,R=T.lineTangency,D=T.theta,X=Mf({cx:r,cy:n,radius:i,angle:p,sign:-h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),$=X.circleTangency,I=X.lineTangency,q=X.theta,U=c?Math.abs(f-p):Math.abs(f-p)-D-q;if(U<0&&o===0)return"".concat(E,"L").concat(r,",").concat(n,"Z");E+="L".concat(I.x,",").concat(I.y,`
450
- A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat($.x,",").concat($.y,`
451
- A`).concat(i,",").concat(i,",0,").concat(+(U>180),",").concat(+(h>0),",").concat(C.x,",").concat(C.y,`
452
- A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(R.x,",").concat(R.y,"Z")}else E+="L".concat(r,",").concat(n,"Z");return E},LX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},T$=function(e){var r=dj(dj({},LX),e),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,c=r.forceCornerRadius,f=r.cornerIsExternal,p=r.startAngle,h=r.endAngle,g=r.className;if(o<a||p===h)return null;var y=qe("recharts-sector",g),w=o-a,_=Ja(u,w,0,!0),b;return _>0&&Math.abs(p-h)<360?b=DX({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,w/2),forceCornerRadius:c,cornerIsExternal:f,startAngle:p,endAngle:h}):b=A$({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:p,endAngle:h}),M.createElement("path",Qb({},Be(r,!0),{className:y,d:b,role:"img"}))};function ju(t){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ju(t)}function Zb(){return Zb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Zb.apply(this,arguments)}function hj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hj(Object(r),!0).forEach(function(n){zX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zX(t,e,r){return e=BX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BX(t){var e=qX(t,"string");return ju(e)=="symbol"?e:e+""}function qX(t,e){if(ju(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mj={curveBasisClosed:sF,curveBasisOpen:lF,curveBasis:oF,curveBumpX:VU,curveBumpY:KU,curveLinearClosed:uF,curveLinear:kh,curveMonotoneX:cF,curveMonotoneY:fF,curveNatural:dF,curveStep:hF,curveStepAfter:mF,curveStepBefore:pF},Df=function(e){return e.x===+e.x&&e.y===+e.y},Il=function(e){return e.x},Ml=function(e){return e.y},UX=function(e,r){if(Me(e))return e;var n="curve".concat(_h(e));return(n==="curveMonotone"||n==="curveBump")&&r?mj["".concat(n).concat(r==="vertical"?"Y":"X")]:mj[n]||kh},FX=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,a=i===void 0?[]:i,o=e.baseLine,u=e.layout,c=e.connectNulls,f=c===void 0?!1:c,p=UX(n,u),h=f?a.filter(function(_){return Df(_)}):a,g;if(Array.isArray(o)){var y=f?o.filter(function(_){return Df(_)}):o,w=h.map(function(_,b){return pj(pj({},_),{},{base:y[b]})});return u==="vertical"?g=Tf().y(Ml).x1(Il).x0(function(_){return _.base.x}):g=Tf().x(Il).y1(Ml).y0(function(_){return _.base.y}),g.defined(Df).curve(p),g(w)}return u==="vertical"&&fe(o)?g=Tf().y(Ml).x1(Il).x0(o):fe(o)?g=Tf().x(Il).y1(Ml).y0(o):g=RN().x(Il).y(Ml),g.defined(Df).curve(p),g(h)},ex=function(e){var r=e.className,n=e.points,i=e.path,a=e.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?FX(e):i;return N.createElement("path",Zb({},Be(e,!1),sd(e),{className:qe("recharts-curve",r),d:o,ref:a}))},y0={exports:{}},v0,gj;function HX(){if(gj)return v0;gj=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return v0=t,v0}var b0,yj;function WX(){if(yj)return b0;yj=1;var t=HX();function e(){}function r(){}return r.resetWarningCache=e,b0=function(){function n(o,u,c,f,p,h){if(h!==t){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},b0}var vj;function VX(){return vj||(vj=1,y0.exports=WX()()),y0.exports}var KX=VX();const Ge=Ze(KX),{getOwnPropertyNames:GX,getOwnPropertySymbols:XX}=Object,{hasOwnProperty:YX}=Object.prototype;function x0(t,e){return function(n,i,a){return t(n,i,a)&&e(n,i,a)}}function Lf(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);const{cache:a}=i,o=a.get(r),u=a.get(n);if(o&&u)return o===n&&u===r;a.set(r,n),a.set(n,r);const c=t(r,n,i);return a.delete(r),a.delete(n),c}}function JX(t){return t!=null?t[Symbol.toStringTag]:void 0}function bj(t){return GX(t).concat(XX(t))}const QX=Object.hasOwn||((t,e)=>YX.call(t,e));function oo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const ZX="__v",eY="__o",tY="_owner",{getOwnPropertyDescriptor:xj,keys:wj}=Object;function rY(t,e){return t.byteLength===e.byteLength&&Ld(new Uint8Array(t),new Uint8Array(e))}function nY(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function iY(t,e){return t.byteLength===e.byteLength&&Ld(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function aY(t,e){return oo(t.getTime(),e.getTime())}function oY(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function sY(t,e){return t===e}function _j(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.entries();let o,u,c=0;for(;(o=a.next())&&!o.done;){const f=e.entries();let p=!1,h=0;for(;(u=f.next())&&!u.done;){if(i[h]){h++;continue}const g=o.value,y=u.value;if(r.equals(g[0],y[0],c,h,t,e,r)&&r.equals(g[1],y[1],g[0],y[0],t,e,r)){p=i[h]=!0;break}h++}if(!p)return!1;c++}return!0}const lY=oo;function uY(t,e,r){const n=wj(t);let i=n.length;if(wj(e).length!==i)return!1;for(;i-- >0;)if(!j$(t,e,r,n[i]))return!1;return!0}function Dl(t,e,r){const n=bj(t);let i=n.length;if(bj(e).length!==i)return!1;let a,o,u;for(;i-- >0;)if(a=n[i],!j$(t,e,r,a)||(o=xj(t,a),u=xj(e,a),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function cY(t,e){return oo(t.valueOf(),e.valueOf())}function fY(t,e){return t.source===e.source&&t.flags===e.flags}function Sj(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.values();let o,u;for(;(o=a.next())&&!o.done;){const c=e.values();let f=!1,p=0;for(;(u=c.next())&&!u.done;){if(!i[p]&&r.equals(o.value,u.value,o.value,u.value,t,e,r)){f=i[p]=!0;break}p++}if(!f)return!1}return!0}function Ld(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function dY(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function j$(t,e,r,n){return(n===tY||n===eY||n===ZX)&&(t.$$typeof||e.$$typeof)?!0:QX(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}const hY="[object ArrayBuffer]",pY="[object Arguments]",mY="[object Boolean]",gY="[object DataView]",yY="[object Date]",vY="[object Error]",bY="[object Map]",xY="[object Number]",wY="[object Object]",_Y="[object RegExp]",SY="[object Set]",kY="[object String]",EY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},OY="[object URL]",AY=Object.prototype.toString;function TY({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:u,areObjectsEqual:c,arePrimitiveWrappersEqual:f,areRegExpsEqual:p,areSetsEqual:h,areTypedArraysEqual:g,areUrlsEqual:y,unknownTagComparators:w}){return function(b,k,O){if(b===k)return!0;if(b==null||k==null)return!1;const A=typeof b;if(A!==typeof k)return!1;if(A!=="object")return A==="number"?u(b,k,O):A==="function"?a(b,k,O):!1;const j=b.constructor;if(j!==k.constructor)return!1;if(j===Object)return c(b,k,O);if(Array.isArray(b))return e(b,k,O);if(j===Date)return n(b,k,O);if(j===RegExp)return p(b,k,O);if(j===Map)return o(b,k,O);if(j===Set)return h(b,k,O);const E=AY.call(b);if(E===yY)return n(b,k,O);if(E===_Y)return p(b,k,O);if(E===bY)return o(b,k,O);if(E===SY)return h(b,k,O);if(E===wY)return typeof b.then!="function"&&typeof k.then!="function"&&c(b,k,O);if(E===OY)return y(b,k,O);if(E===vY)return i(b,k,O);if(E===pY)return c(b,k,O);if(EY[E])return g(b,k,O);if(E===hY)return t(b,k,O);if(E===gY)return r(b,k,O);if(E===mY||E===xY||E===kY)return f(b,k,O);if(w){let T=w[E];if(!T){const C=JX(b);C&&(T=w[C])}if(T)return T(b,k,O)}return!1}}function jY({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:rY,areArraysEqual:r?Dl:nY,areDataViewsEqual:iY,areDatesEqual:aY,areErrorsEqual:oY,areFunctionsEqual:sY,areMapsEqual:r?x0(_j,Dl):_j,areNumbersEqual:lY,areObjectsEqual:r?Dl:uY,arePrimitiveWrappersEqual:cY,areRegExpsEqual:fY,areSetsEqual:r?x0(Sj,Dl):Sj,areTypedArraysEqual:r?x0(Ld,Dl):Ld,areUrlsEqual:dY,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const i=Lf(n.areArraysEqual),a=Lf(n.areMapsEqual),o=Lf(n.areObjectsEqual),u=Lf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:u})}return n}function PY(t){return function(e,r,n,i,a,o,u){return t(e,r,u)}}function CY({circular:t,comparator:e,createState:r,equals:n,strict:i}){if(r)return function(u,c){const{cache:f=t?new WeakMap:void 0,meta:p}=r();return e(u,c,{cache:f,equals:n,meta:p,strict:i})};if(t)return function(u,c){return e(u,c,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,c){return e(u,c,a)}}const NY=pa();pa({strict:!0});pa({circular:!0});pa({circular:!0,strict:!0});pa({createInternalComparator:()=>oo});pa({strict:!0,createInternalComparator:()=>oo});pa({circular:!0,createInternalComparator:()=>oo});pa({circular:!0,createInternalComparator:()=>oo,strict:!0});function pa(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:i=!1}=t,a=jY(t),o=TY(a),u=r?r(o):PY(o);return CY({circular:e,comparator:o,createState:n,equals:u,strict:i})}function RY(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function kj(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>e?(t(a),r=-1):RY(i)};requestAnimationFrame(n)}function tx(t){"@babel/helpers - typeof";return tx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tx(t)}function $Y(t){return LY(t)||DY(t)||MY(t)||IY()}function IY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
453
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MY(t,e){if(t){if(typeof t=="string")return Ej(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ej(t,e)}}function Ej(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function DY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function LY(t){if(Array.isArray(t))return t}function zY(){var t={},e=function(){return null},r=!1,n=function i(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var o=a,u=$Y(o),c=u[0],f=u.slice(1);if(typeof c=="number"){kj(i.bind(null,f),c);return}i(c),kj(i.bind(null,f));return}tx(a)==="object"&&(t=a,e(t)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return e=a,function(){e=function(){return null}}}}}function Pu(t){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pu(t)}function Oj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Aj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Oj(Object(r),!0).forEach(function(n){P$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Oj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function P$(t,e,r){return e=BY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BY(t){var e=qY(t,"string");return Pu(e)==="symbol"?e:String(e)}function qY(t,e){if(Pu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Pu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var UY=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},FY=function(e){return e},HY=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Zl=function(e,r){return Object.keys(r).reduce(function(n,i){return Aj(Aj({},n),{},P$({},i,e(i,r[i])))},{})},Tj=function(e,r,n){return e.map(function(i){return"".concat(HY(i)," ").concat(r,"ms ").concat(n)}).join(",")};function WY(t,e){return GY(t)||KY(t,e)||C$(t,e)||VY()}function VY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
454
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KY(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function GY(t){if(Array.isArray(t))return t}function XY(t){return QY(t)||JY(t)||C$(t)||YY()}function YY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
455
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C$(t,e){if(t){if(typeof t=="string")return rx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rx(t,e)}}function JY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function QY(t){if(Array.isArray(t))return rx(t)}function rx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var zd=1e-4,N$=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},R$=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},jj=function(e,r){return function(n){var i=N$(e,r);return R$(i,n)}},ZY=function(e,r){return function(n){var i=N$(e,r),a=[].concat(XY(i.map(function(o,u){return o*u}).slice(1)),[0]);return R$(a,n)}},Pj=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],a=r[1],o=r[2],u=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,u=1;break;case"ease":i=.25,a=.1,o=.25,u=1;break;case"ease-in":i=.42,a=0,o=1,u=1;break;case"ease-out":i=.42,a=0,o=.58,u=1;break;case"ease-in-out":i=0,a=0,o=.58,u=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var f=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),p=WY(f,4);i=p[0],a=p[1],o=p[2],u=p[3]}}}var h=jj(i,o),g=jj(a,u),y=ZY(i,o),w=function(k){return k>1?1:k<0?0:k},_=function(k){for(var O=k>1?1:k,A=O,j=0;j<8;++j){var E=h(A)-O,T=y(A);if(Math.abs(E-O)<zd||T<zd)return g(A);A=w(A-E/T)}return g(A)};return _.isStepper=!1,_},eJ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,i=e.damping,a=i===void 0?8:i,o=e.dt,u=o===void 0?17:o,c=function(p,h,g){var y=-(p-h)*n,w=g*a,_=g+(y-w)*u/1e3,b=g*u/1e3+p;return Math.abs(b-h)<zd&&Math.abs(_)<zd?[h,0]:[b,_]};return c.isStepper=!0,c.dt=u,c},tJ=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Pj(i);case"spring":return eJ();default:if(i.split("(")[0]==="cubic-bezier")return Pj(i)}return typeof i=="function"?i:null};function Cu(t){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(t)}function Cj(t){return iJ(t)||nJ(t)||$$(t)||rJ()}function rJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
456
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nJ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function iJ(t){if(Array.isArray(t))return ix(t)}function Nj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nj(Object(r),!0).forEach(function(n){nx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nx(t,e,r){return e=aJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aJ(t){var e=oJ(t,"string");return Cu(e)==="symbol"?e:String(e)}function oJ(t,e){if(Cu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Cu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sJ(t,e){return cJ(t)||uJ(t,e)||$$(t,e)||lJ()}function lJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
457
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $$(t,e){if(t){if(typeof t=="string")return ix(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ix(t,e)}}function ix(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function uJ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function cJ(t){if(Array.isArray(t))return t}var Bd=function(e,r,n){return e+(r-e)*n},ax=function(e){var r=e.from,n=e.to;return r!==n},fJ=function t(e,r,n){var i=Zl(function(a,o){if(ax(o)){var u=e(o.from,o.to,o.velocity),c=sJ(u,2),f=c[0],p=c[1];return Jt(Jt({},o),{},{from:f,velocity:p})}return o},r);return n<1?Zl(function(a,o){return ax(o)?Jt(Jt({},o),{},{velocity:Bd(o.velocity,i[a].velocity,n),from:Bd(o.from,i[a].from,n)}):o},r):t(e,i,n-1)};const dJ=(function(t,e,r,n,i){var a=UY(t,e),o=a.reduce(function(b,k){return Jt(Jt({},b),{},nx({},k,[t[k],e[k]]))},{}),u=a.reduce(function(b,k){return Jt(Jt({},b),{},nx({},k,{from:t[k],velocity:0,to:e[k]}))},{}),c=-1,f,p,h=function(){return null},g=function(){return Zl(function(k,O){return O.from},u)},y=function(){return!Object.values(u).filter(ax).length},w=function(k){f||(f=k);var O=k-f,A=O/r.dt;u=fJ(r,u,A),i(Jt(Jt(Jt({},t),e),g())),f=k,y()||(c=requestAnimationFrame(h))},_=function(k){p||(p=k);var O=(k-p)/n,A=Zl(function(E,T){return Bd.apply(void 0,Cj(T).concat([r(O)]))},o);if(i(Jt(Jt(Jt({},t),e),A)),O<1)c=requestAnimationFrame(h);else{var j=Zl(function(E,T){return Bd.apply(void 0,Cj(T).concat([r(1)]))},o);i(Jt(Jt(Jt({},t),e),j))}};return h=r.isStepper?w:_,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}});function ds(t){"@babel/helpers - typeof";return ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ds(t)}var hJ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function pJ(t,e){if(t==null)return{};var r=mJ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function mJ(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function w0(t){return bJ(t)||vJ(t)||yJ(t)||gJ()}function gJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
458
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yJ(t,e){if(t){if(typeof t=="string")return ox(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ox(t,e)}}function vJ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bJ(t){if(Array.isArray(t))return ox(t)}function ox(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Rj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Rj(Object(r),!0).forEach(function(n){Vl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Vl(t,e,r){return e=I$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xJ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wJ(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I$(n.key),n)}}function _J(t,e,r){return e&&wJ(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function I$(t){var e=SJ(t,"string");return ds(e)==="symbol"?e:String(e)}function SJ(t,e){if(ds(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ds(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kJ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sx(t,e)}function sx(t,e){return sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sx(t,e)}function EJ(t){var e=OJ();return function(){var n=qd(t),i;if(e){var a=qd(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return lx(this,i)}}function lx(t,e){if(e&&(ds(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ux(t)}function ux(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function qd(t){return qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qd(t)}var vi=(function(t){kJ(r,t);var e=EJ(r);function r(n,i){var a;xJ(this,r),a=e.call(this,n,i);var o=a.props,u=o.isActive,c=o.attributeName,f=o.from,p=o.to,h=o.steps,g=o.children,y=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(ux(a)),a.changeStyle=a.changeStyle.bind(ux(a)),!u||y<=0)return a.state={style:{}},typeof g=="function"&&(a.state={style:p}),lx(a);if(h&&h.length)a.state={style:h[0].style};else if(f){if(typeof g=="function")return a.state={style:f},lx(a);a.state={style:c?Vl({},c,f):f}}else a.state={style:{}};return a}return _J(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,u=a.canBegin,c=a.attributeName,f=a.shouldReAnimate,p=a.to,h=a.from,g=this.state.style;if(u){if(!o){var y={style:c?Vl({},c,p):p};this.state&&g&&(c&&g[c]!==p||!c&&g!==p)&&this.setState(y);return}if(!(NY(i.to,p)&&i.canBegin&&i.isActive)){var w=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=w||f?h:i.to;if(this.state&&g){var b={style:c?Vl({},c,_):_};(c&&g[c]!==_||!c&&g!==_)&&this.setState(b)}this.runAnimation(pn(pn({},this.props),{},{from:_,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,u=i.to,c=i.duration,f=i.easing,p=i.begin,h=i.onAnimationEnd,g=i.onAnimationStart,y=dJ(o,u,tJ(f),c,this.changeStyle),w=function(){a.stopJSAnimation=y()};this.manager.start([g,p,w,c,h])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,u=i.begin,c=i.onAnimationStart,f=o[0],p=f.style,h=f.duration,g=h===void 0?0:h,y=function(_,b,k){if(k===0)return _;var O=b.duration,A=b.easing,j=A===void 0?"ease":A,E=b.style,T=b.properties,C=b.onAnimationEnd,R=k>0?o[k-1]:b,D=T||Object.keys(E);if(typeof j=="function"||j==="spring")return[].concat(w0(_),[a.runJSAnimation.bind(a,{from:R.style,to:E,duration:O,easing:j}),O]);var X=Tj(D,O,j),$=pn(pn(pn({},R.style),E),{},{transition:X});return[].concat(w0(_),[$,O,C]).filter(FY)};return this.manager.start([c].concat(w0(o.reduce(y,[p,Math.max(g,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=zY());var a=i.begin,o=i.duration,u=i.attributeName,c=i.to,f=i.easing,p=i.onAnimationStart,h=i.onAnimationEnd,g=i.steps,y=i.children,w=this.manager;if(this.unSubscribe=w.subscribe(this.handleStyleChange),typeof f=="function"||typeof y=="function"||f==="spring"){this.runJSAnimation(i);return}if(g.length>1){this.runStepAnimation(i);return}var _=u?Vl({},u,c):c,b=Tj(Object.keys(_),o,f);w.start([p,a,pn(pn({},_),{},{transition:b}),o,h])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=pJ(i,hJ),f=N.Children.count(a),p=this.state.style;if(typeof a=="function")return a(p);if(!u||f===0||o<=0)return a;var h=function(y){var w=y.props,_=w.style,b=_===void 0?{}:_,k=w.className,O=N.cloneElement(y,pn(pn({},c),{},{style:pn(pn({},b),p),className:k}));return O};return f===1?h(N.Children.only(a)):M.createElement("div",null,N.Children.map(a,function(g){return h(g)}))}}]),r})(N.PureComponent);vi.displayName="Animate";vi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};vi.propTypes={from:Ge.oneOfType([Ge.object,Ge.string]),to:Ge.oneOfType([Ge.object,Ge.string]),attributeName:Ge.string,duration:Ge.number,begin:Ge.number,easing:Ge.oneOfType([Ge.string,Ge.func]),steps:Ge.arrayOf(Ge.shape({duration:Ge.number.isRequired,style:Ge.object.isRequired,easing:Ge.oneOfType([Ge.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ge.func]),properties:Ge.arrayOf("string"),onAnimationEnd:Ge.func})),children:Ge.oneOfType([Ge.node,Ge.func]),isActive:Ge.bool,canBegin:Ge.bool,onAnimationEnd:Ge.func,shouldReAnimate:Ge.bool,onAnimationStart:Ge.func,onAnimationReStart:Ge.func};function Nu(t){"@babel/helpers - typeof";return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nu(t)}function Ud(){return Ud=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ud.apply(this,arguments)}function AJ(t,e){return CJ(t)||PJ(t,e)||jJ(t,e)||TJ()}function TJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
459
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jJ(t,e){if(t){if(typeof t=="string")return $j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $j(t,e)}}function $j(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function PJ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function CJ(t){if(Array.isArray(t))return t}function Ij(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ij(Object(r),!0).forEach(function(n){NJ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ij(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function NJ(t,e,r){return e=RJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RJ(t){var e=$J(t,"string");return Nu(e)=="symbol"?e:e+""}function $J(t,e){if(Nu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Dj=function(e,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),u=i>=0?1:-1,c=n>=0?1:-1,f=i>=0&&n>=0||i<0&&n<0?1:0,p;if(o>0&&a instanceof Array){for(var h=[0,0,0,0],g=0,y=4;g<y;g++)h[g]=a[g]>o?o:a[g];p="M".concat(e,",").concat(r+u*h[0]),h[0]>0&&(p+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(f,",").concat(e+c*h[0],",").concat(r)),p+="L ".concat(e+n-c*h[1],",").concat(r),h[1]>0&&(p+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(f,`,
460
- `).concat(e+n,",").concat(r+u*h[1])),p+="L ".concat(e+n,",").concat(r+i-u*h[2]),h[2]>0&&(p+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(f,`,
461
- `).concat(e+n-c*h[2],",").concat(r+i)),p+="L ".concat(e+c*h[3],",").concat(r+i),h[3]>0&&(p+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(f,`,
462
- `).concat(e,",").concat(r+i-u*h[3])),p+="Z"}else if(o>0&&a===+a&&a>0){var w=Math.min(o,a);p="M ".concat(e,",").concat(r+u*w,`
463
- A `).concat(w,",").concat(w,",0,0,").concat(f,",").concat(e+c*w,",").concat(r,`
464
- L `).concat(e+n-c*w,",").concat(r,`
465
- A `).concat(w,",").concat(w,",0,0,").concat(f,",").concat(e+n,",").concat(r+u*w,`
466
- L `).concat(e+n,",").concat(r+i-u*w,`
467
- A `).concat(w,",").concat(w,",0,0,").concat(f,",").concat(e+n-c*w,",").concat(r+i,`
468
- L `).concat(e+c*w,",").concat(r+i,`
469
- A `).concat(w,",").concat(w,",0,0,").concat(f,",").concat(e,",").concat(r+i-u*w," Z")}else p="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return p},IJ=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,a=r.x,o=r.y,u=r.width,c=r.height;if(Math.abs(u)>0&&Math.abs(c)>0){var f=Math.min(a,a+u),p=Math.max(a,a+u),h=Math.min(o,o+c),g=Math.max(o,o+c);return n>=f&&n<=p&&i>=h&&i<=g}return!1},MJ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},r1=function(e){var r=Mj(Mj({},MJ),e),n=N.useRef(),i=N.useState(-1),a=AJ(i,2),o=a[0],u=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&u(j)}catch{}},[]);var c=r.x,f=r.y,p=r.width,h=r.height,g=r.radius,y=r.className,w=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isAnimationActive,O=r.isUpdateAnimationActive;if(c!==+c||f!==+f||p!==+p||h!==+h||p===0||h===0)return null;var A=qe("recharts-rectangle",y);return O?M.createElement(vi,{canBegin:o>0,from:{width:p,height:h,x:c,y:f},to:{width:p,height:h,x:c,y:f},duration:_,animationEasing:w,isActive:O},function(j){var E=j.width,T=j.height,C=j.x,R=j.y;return M.createElement(vi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,isActive:k,easing:w},M.createElement("path",Ud({},Be(r,!0),{className:A,d:Dj(C,R,E,T,g),ref:n})))}):M.createElement("path",Ud({},Be(r,!0),{className:A,d:Dj(c,f,p,h,g)}))};function cx(){return cx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},cx.apply(this,arguments)}var n1=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=qe("recharts-dot",a);return r===+r&&n===+n&&i===+i?N.createElement("circle",cx({},Be(e,!1),sd(e),{className:o,cx:r,cy:n,r:i})):null};function Ru(t){"@babel/helpers - typeof";return Ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ru(t)}var DJ=["x","y","top","left","width","height","className"];function fx(){return fx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fx.apply(this,arguments)}function Lj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function LJ(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Lj(Object(r),!0).forEach(function(n){zJ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zJ(t,e,r){return e=BJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BJ(t){var e=qJ(t,"string");return Ru(e)=="symbol"?e:e+""}function qJ(t,e){if(Ru(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ru(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UJ(t,e){if(t==null)return{};var r=FJ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function FJ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var HJ=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},WJ=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,u=o===void 0?0:o,c=e.left,f=c===void 0?0:c,p=e.width,h=p===void 0?0:p,g=e.height,y=g===void 0?0:g,w=e.className,_=UJ(e,DJ),b=LJ({x:n,y:a,top:u,left:f,width:h,height:y},_);return!fe(n)||!fe(a)||!fe(h)||!fe(y)||!fe(u)||!fe(f)?null:M.createElement("path",fx({},Be(b,!0),{className:qe("recharts-cross",w),d:HJ(n,a,h,y,u,f)}))},_0,zj;function VJ(){if(zj)return _0;zj=1;var t=rR(),e=t(Object.getPrototypeOf,Object);return _0=e,_0}var S0,Bj;function KJ(){if(Bj)return S0;Bj=1;var t=wi(),e=VJ(),r=_i(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,u=a.hasOwnProperty,c=o.call(Object);function f(p){if(!r(p)||t(p)!=n)return!1;var h=e(p);if(h===null)return!0;var g=u.call(h,"constructor")&&h.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==c}return S0=f,S0}var GJ=KJ();const XJ=Ze(GJ);var k0,qj;function YJ(){if(qj)return k0;qj=1;var t=wi(),e=_i(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return k0=n,k0}var JJ=YJ();const QJ=Ze(JJ);function $u(t){"@babel/helpers - typeof";return $u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$u(t)}function Fd(){return Fd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Fd.apply(this,arguments)}function ZJ(t,e){return nQ(t)||rQ(t,e)||tQ(t,e)||eQ()}function eQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
470
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tQ(t,e){if(t){if(typeof t=="string")return Uj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uj(t,e)}}function Uj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function rQ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function nQ(t){if(Array.isArray(t))return t}function Fj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fj(Object(r),!0).forEach(function(n){iQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function iQ(t,e,r){return e=aQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aQ(t){var e=oQ(t,"string");return $u(e)=="symbol"?e:e+""}function oQ(t,e){if($u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if($u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Wj=function(e,r,n,i,a){var o=n-i,u;return u="M ".concat(e,",").concat(r),u+="L ".concat(e+n,",").concat(r),u+="L ".concat(e+n-o/2,",").concat(r+a),u+="L ".concat(e+n-o/2-i,",").concat(r+a),u+="L ".concat(e,",").concat(r," Z"),u},sQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lQ=function(e){var r=Hj(Hj({},sQ),e),n=N.useRef(),i=N.useState(-1),a=ZJ(i,2),o=a[0],u=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&u(A)}catch{}},[]);var c=r.x,f=r.y,p=r.upperWidth,h=r.lowerWidth,g=r.height,y=r.className,w=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isUpdateAnimationActive;if(c!==+c||f!==+f||p!==+p||h!==+h||g!==+g||p===0&&h===0||g===0)return null;var O=qe("recharts-trapezoid",y);return k?M.createElement(vi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:c,y:f},to:{upperWidth:p,lowerWidth:h,height:g,x:c,y:f},duration:_,animationEasing:w,isActive:k},function(A){var j=A.upperWidth,E=A.lowerWidth,T=A.height,C=A.x,R=A.y;return M.createElement(vi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,easing:w},M.createElement("path",Fd({},Be(r,!0),{className:O,d:Wj(C,R,j,E,T),ref:n})))}):M.createElement("g",null,M.createElement("path",Fd({},Be(r,!0),{className:O,d:Wj(c,f,p,h,g)})))},uQ=["option","shapeType","propTransformer","activeClassName","isActive"];function Iu(t){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Iu(t)}function cQ(t,e){if(t==null)return{};var r=fQ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function fQ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Vj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vj(Object(r),!0).forEach(function(n){dQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dQ(t,e,r){return e=hQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hQ(t){var e=pQ(t,"string");return Iu(e)=="symbol"?e:e+""}function pQ(t,e){if(Iu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mQ(t,e){return Hd(Hd({},e),t)}function gQ(t,e){return t==="symbols"}function Kj(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return M.createElement(r1,r);case"trapezoid":return M.createElement(lQ,r);case"sector":return M.createElement(T$,r);case"symbols":if(gQ(e))return M.createElement(ww,r);break;default:return null}}function yQ(t){return N.isValidElement(t)?t.props:t}function vQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?mQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,u=t.isActive,c=cQ(t,uQ),f;if(N.isValidElement(e))f=N.cloneElement(e,Hd(Hd({},c),yQ(e)));else if(Me(e))f=e(c);else if(XJ(e)&&!QJ(e)){var p=i(e,c);f=M.createElement(Kj,{shapeType:r,elementProps:p})}else{var h=c;f=M.createElement(Kj,{shapeType:r,elementProps:h})}return u?M.createElement(kt,{className:o},f):f}function Bh(t,e){return e!=null&&"trapezoids"in t.props}function qh(t,e){return e!=null&&"sectors"in t.props}function Mu(t,e){return e!=null&&"points"in t.props}function bQ(t,e){var r,n,i=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,a=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return i&&a}function xQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function wQ(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function _Q(t,e){var r;return Bh(t,e)?r=bQ:qh(t,e)?r=xQ:Mu(t,e)&&(r=wQ),r}function SQ(t,e){var r;return Bh(t,e)?r="trapezoids":qh(t,e)?r="sectors":Mu(t,e)&&(r="points"),r}function kQ(t,e){if(Bh(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(qh(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Mu(t,e)?e.payload:{}}function EQ(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=SQ(r,e),a=kQ(r,e),o=n.filter(function(c,f){var p=Dh(a,c),h=r.props[i].filter(function(w){var _=_Q(r,e);return _(w,e)}),g=r.props[i].indexOf(h[h.length-1]),y=f===g;return p&&y}),u=n.indexOf(o[o.length-1]);return u}var E0,Gj;function OQ(){if(Gj)return E0;Gj=1;var t=Math.ceil,e=Math.max;function r(n,i,a,o){for(var u=-1,c=e(t((i-n)/(a||1)),0),f=Array(c);c--;)f[o?c:++u]=n,n+=a;return f}return E0=r,E0}var O0,Xj;function M$(){if(Xj)return O0;Xj=1;var t=vR(),e=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var a=i<0?-1:1;return a*r}return i===i?i:0}return O0=n,O0}var A0,Yj;function AQ(){if(Yj)return A0;Yj=1;var t=OQ(),e=Th(),r=M$();function n(i){return function(a,o,u){return u&&typeof u!="number"&&e(a,o,u)&&(o=u=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),u=u===void 0?a<o?1:-1:r(u),t(a,o,u,i)}}return A0=n,A0}var T0,Jj;function TQ(){if(Jj)return T0;Jj=1;var t=AQ(),e=t();return T0=e,T0}var jQ=TQ();const Wd=Ze(jQ);function Du(t){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Du(t)}function Qj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qj(Object(r),!0).forEach(function(n){D$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function D$(t,e,r){return e=PQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PQ(t){var e=CQ(t,"string");return Du(e)=="symbol"?e:e+""}function CQ(t,e){if(Du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var NQ=["Webkit","Moz","O","ms"],RQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=NQ.reduce(function(a,o){return Zj(Zj({},a),{},D$({},o+n,r))},{});return i[e]=r,i};function hs(t){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hs(t)}function Vd(){return Vd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Vd.apply(this,arguments)}function eP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function j0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?eP(Object(r),!0).forEach(function(n){Cr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z$(n.key),n)}}function IQ(t,e,r){return e&&tP(t.prototype,e),r&&tP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function MQ(t,e,r){return e=Kd(e),DQ(t,L$()?Reflect.construct(e,r||[],Kd(t).constructor):e.apply(t,r))}function DQ(t,e){if(e&&(hs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LQ(t)}function LQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L$=function(){return!!t})()}function Kd(t){return Kd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kd(t)}function zQ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dx(t,e)}function dx(t,e){return dx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dx(t,e)}function Cr(t,e,r){return e=z$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z$(t){var e=BQ(t,"string");return hs(e)=="symbol"?e:e+""}function BQ(t,e){if(hs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var qQ=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,u=e.travellerWidth;if(!r||!r.length)return{};var c=r.length,f=Jl().domain(Wd(0,c)).range([a,a+o-u]),p=f.domain().map(function(h){return f(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(n),endX:f(i),scale:f,scaleValues:p}},rP=function(e){return e.changedTouches&&!!e.changedTouches.length},ps=(function(t){function e(r){var n;return $Q(this,e),n=MQ(this,e,[r]),Cr(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Cr(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Cr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,u=i.startIndex;o==null||o({endIndex:a,startIndex:u})}),n.detachDragEndListener()}),Cr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Cr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Cr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Cr(n,"handleSlideDragStart",function(i){var a=rP(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return zQ(e,t),IQ(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,u=this.props,c=u.gap,f=u.data,p=f.length-1,h=Math.min(i,a),g=Math.max(i,a),y=e.getIndexInRange(o,h),w=e.getIndexInRange(o,g);return{startIndex:y-y%c,endIndex:w===p?p:w-w%c}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,u=i.dataKey,c=Mr(a[n],u,n);return Me(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,u=i.endX,c=this.props,f=c.x,p=c.width,h=c.travellerWidth,g=c.startIndex,y=c.endIndex,w=c.onChange,_=n.pageX-a;_>0?_=Math.min(_,f+p-h-u,f+p-h-o):_<0&&(_=Math.max(_,f-o,f-u));var b=this.getIndex({startX:o+_,endX:u+_});(b.startIndex!==g||b.endIndex!==y)&&w&&w(b),this.setState({startX:o+_,endX:u+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=rP(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,u=i.endX,c=i.startX,f=this.state[o],p=this.props,h=p.x,g=p.width,y=p.travellerWidth,w=p.onChange,_=p.gap,b=p.data,k={startX:this.state.startX,endX:this.state.endX},O=n.pageX-a;O>0?O=Math.min(O,h+g-y-f):O<0&&(O=Math.max(O,h-f)),k[o]=f+O;var A=this.getIndex(k),j=A.startIndex,E=A.endIndex,T=function(){var R=b.length-1;return o==="startX"&&(u>c?j%_===0:E%_===0)||u<c&&E===R||o==="endX"&&(u>c?E%_===0:j%_===0)||u>c&&E===R};this.setState(Cr(Cr({},o,f+O),"brushMoveStartX",n.pageX),function(){w&&T()&&w(A)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,u=o.scaleValues,c=o.startX,f=o.endX,p=this.state[i],h=u.indexOf(p);if(h!==-1){var g=h+n;if(!(g===-1||g>=u.length)){var y=u[g];i==="startX"&&y>=f||i==="endX"&&y<=c||this.setState(Cr({},i,y),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.fill,f=n.stroke;return M.createElement("rect",{stroke:f,fill:c,x:i,y:a,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.data,f=n.children,p=n.padding,h=N.Children.only(f);return h?M.cloneElement(h,{x:i,y:a,width:o,height:u,margin:p,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,u=this,c=this.props,f=c.y,p=c.travellerWidth,h=c.height,g=c.traveller,y=c.ariaLabel,w=c.data,_=c.startIndex,b=c.endIndex,k=Math.max(n,this.props.x),O=j0(j0({},Be(this.props,!1)),{},{x:k,y:f,width:p,height:h}),A=y||"Min value: ".concat((a=w[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=w[b])===null||o===void 0?void 0:o.name);return M.createElement(kt,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),u.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(g,O))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,u=a.height,c=a.stroke,f=a.travellerWidth,p=Math.min(n,i)+f,h=Math.max(Math.abs(i-n)-f,0);return M.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:p,y:o,width:h,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,u=n.height,c=n.travellerWidth,f=n.stroke,p=this.state,h=p.startX,g=p.endX,y=5,w={pointerEvents:"none",fill:f};return M.createElement(kt,{className:"recharts-brush-texts"},M.createElement(xd,Vd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,g)-y,y:o+u/2},w),this.getTextOfTick(i)),M.createElement(xd,Vd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,g)+c+y,y:o+u/2},w),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,u=n.x,c=n.y,f=n.width,p=n.height,h=n.alwaysShowText,g=this.state,y=g.startX,w=g.endX,_=g.isTextActive,b=g.isSlideMoving,k=g.isTravellerMoving,O=g.isTravellerFocused;if(!i||!i.length||!fe(u)||!fe(c)||!fe(f)||!fe(p)||f<=0||p<=0)return null;var A=qe("recharts-brush",a),j=M.Children.count(o)===1,E=RQ("userSelect","none");return M.createElement(kt,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(y,w),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(w,"endX"),(_||b||k||O||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,u=n.height,c=n.stroke,f=Math.floor(a+u/2)-1;return M.createElement(M.Fragment,null,M.createElement("rect",{x:i,y:a,width:o,height:u,fill:c,stroke:"none"}),M.createElement("line",{x1:i+1,y1:f,x2:i+o-1,y2:f,fill:"none",stroke:"#fff"}),M.createElement("line",{x1:i+1,y1:f+2,x2:i+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return M.isValidElement(n)?a=M.cloneElement(n,i):Me(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,u=n.x,c=n.travellerWidth,f=n.updateId,p=n.startIndex,h=n.endIndex;if(a!==i.prevData||f!==i.prevUpdateId)return j0({prevData:a,prevTravellerWidth:c,prevUpdateId:f,prevX:u,prevWidth:o},a&&a.length?qQ({data:a,width:o,x:u,travellerWidth:c,startIndex:p,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||u!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([u,u+o-c]);var g=i.scale.domain().map(function(y){return i.scale(y)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:f,prevX:u,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,u=a-1;u-o>1;){var c=Math.floor((o+u)/2);n[c]>i?u=c:o=c}return i>=n[u]?u:o}}])})(N.PureComponent);Cr(ps,"displayName","Brush");Cr(ps,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var P0,nP;function UQ(){if(nP)return P0;nP=1;var t=Tw();function e(r,n){var i;return t(r,function(a,o,u){return i=n(a,o,u),!i}),!!i}return P0=e,P0}var C0,iP;function FQ(){if(iP)return C0;iP=1;var t=XN(),e=fa(),r=UQ(),n=Sr(),i=Th();function a(o,u,c){var f=n(o)?t:r;return c&&i(o,u,c)&&(u=void 0),f(o,e(u,3))}return C0=a,C0}var HQ=FQ();const WQ=Ze(HQ);var Fn=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},N0,aP;function VQ(){if(aP)return N0;aP=1;var t=hR();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return N0=e,N0}var R0,oP;function KQ(){if(oP)return R0;oP=1;var t=VQ(),e=fR(),r=fa();function n(i,a){var o={};return a=r(a,3),e(i,function(u,c,f){t(o,c,a(u,c,f))}),o}return R0=n,R0}var GQ=KQ();const XQ=Ze(GQ);var $0,sP;function YQ(){if(sP)return $0;sP=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(!r(e[n],n,e))return!1;return!0}return $0=t,$0}var I0,lP;function JQ(){if(lP)return I0;lP=1;var t=Tw();function e(r,n){var i=!0;return t(r,function(a,o,u){return i=!!n(a,o,u),i}),i}return I0=e,I0}var M0,uP;function QQ(){if(uP)return M0;uP=1;var t=YQ(),e=JQ(),r=fa(),n=Sr(),i=Th();function a(o,u,c){var f=n(o)?t:e;return c&&i(o,u,c)&&(u=void 0),f(o,r(u,3))}return M0=a,M0}var ZQ=QQ();const B$=Ze(ZQ);var eZ=["x","y"];function Lu(t){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lu(t)}function hx(){return hx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hx.apply(this,arguments)}function cP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ll(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cP(Object(r),!0).forEach(function(n){tZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tZ(t,e,r){return e=rZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rZ(t){var e=nZ(t,"string");return Lu(e)=="symbol"?e:e+""}function nZ(t,e){if(Lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function iZ(t,e){if(t==null)return{};var r=aZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function aZ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function oZ(t,e){var r=t.x,n=t.y,i=iZ(t,eZ),a="".concat(r),o=parseInt(a,10),u="".concat(n),c=parseInt(u,10),f="".concat(e.height||i.height),p=parseInt(f,10),h="".concat(e.width||i.width),g=parseInt(h,10);return Ll(Ll(Ll(Ll(Ll({},e),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:p,width:g,name:e.name,radius:e.radius})}function fP(t){return M.createElement(vQ,hx({shapeType:"rectangle",propTransformer:oZ,activeClassName:"recharts-active-bar"},t))}var sZ=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof e=="number")return e;var a=fe(n)||hU(n);return a?e(n,i):(a||Za(),r)}},lZ=["value","background"],q$;function ms(t){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(t)}function uZ(t,e){if(t==null)return{};var r=cZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cZ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Gd(){return Gd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Gd.apply(this,arguments)}function dP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Tt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dP(Object(r),!0).forEach(function(n){ra(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,F$(n.key),n)}}function dZ(t,e,r){return e&&hP(t.prototype,e),r&&hP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function hZ(t,e,r){return e=Xd(e),pZ(t,U$()?Reflect.construct(e,r||[],Xd(t).constructor):e.apply(t,r))}function pZ(t,e){if(e&&(ms(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mZ(t)}function mZ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function U$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U$=function(){return!!t})()}function Xd(t){return Xd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xd(t)}function gZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&px(t,e)}function px(t,e){return px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},px(t,e)}function ra(t,e,r){return e=F$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F$(t){var e=yZ(t,"string");return ms(e)=="symbol"?e:e+""}function yZ(t,e){if(ms(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ms(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var bi=(function(t){function e(){var r;fZ(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=hZ(this,e,[].concat(i)),ra(r,"state",{isAnimationFinished:!1}),ra(r,"id",Yu("recharts-bar-")),ra(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),ra(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return gZ(e,t),dZ(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,u=a.dataKey,c=a.activeIndex,f=a.activeBar,p=Be(this.props,!1);return n&&n.map(function(h,g){var y=g===c,w=y?f:o,_=Tt(Tt(Tt({},p),h),{},{isActive:y,option:w,index:g,dataKey:u,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return M.createElement(kt,Gd({className:"recharts-bar-rectangle"},ld(i.props,h,g),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value,"-").concat(g)}),M.createElement(fP,_))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,u=i.isAnimationActive,c=i.animationBegin,f=i.animationDuration,p=i.animationEasing,h=i.animationId,g=this.state.prevData;return M.createElement(vi,{begin:c,duration:f,isActive:u,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var w=y.t,_=a.map(function(b,k){var O=g&&g[k];if(O){var A=wn(O.x,b.x),j=wn(O.y,b.y),E=wn(O.width,b.width),T=wn(O.height,b.height);return Tt(Tt({},b),{},{x:A(w),y:j(w),width:E(w),height:T(w)})}if(o==="horizontal"){var C=wn(0,b.height),R=C(w);return Tt(Tt({},b),{},{y:b.y+b.height-R,height:R})}var D=wn(0,b.width),X=D(w);return Tt(Tt({},b),{},{width:X})});return M.createElement(kt,null,n.renderRectanglesStatically(_))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Dh(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,u=i.activeIndex,c=Be(this.props.background,!1);return a.map(function(f,p){f.value;var h=f.background,g=uZ(f,lZ);if(!h)return null;var y=Tt(Tt(Tt(Tt(Tt({},g),{},{fill:"#eee"},h),c),ld(n.props,f,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return M.createElement(fP,Gd({key:"background-bar-".concat(p),option:n.props.background,isActive:p===u},y))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,u=a.xAxis,c=a.yAxis,f=a.layout,p=a.children,h=tn(p,rc);if(!h)return null;var g=f==="vertical"?o[0].height/2:o[0].width/2,y=function(b,k){var O=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:O,errorVal:Mr(b,k)}},w={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(kt,w,h.map(function(_){return M.cloneElement(_,{key:"error-bar-".concat(i,"-").concat(_.props.dataKey),data:o,xAxis:u,yAxis:c,layout:f,offset:g,dataPointFormatter:y})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,u=n.xAxis,c=n.yAxis,f=n.left,p=n.top,h=n.width,g=n.height,y=n.isAnimationActive,w=n.background,_=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,k=qe("recharts-bar",o),O=u&&u.allowDataOverflow,A=c&&c.allowDataOverflow,j=O||A,E=Le(_)?this.id:_;return M.createElement(kt,{className:k},O||A?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(E)},M.createElement("rect",{x:O?f:f-h/2,y:A?p:p-g/2,width:O?h:h*2,height:A?g:g*2}))):null,M.createElement(kt,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(E,")"):null},w?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,E),(!y||b)&&aa.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])})(N.PureComponent);q$=bi;ra(bi,"displayName","Bar");ra(bi,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!$s.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});ra(bi,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,u=t.xAxisTicks,c=t.yAxisTicks,f=t.stackedData,p=t.dataStartIndex,h=t.displayedData,g=t.offset,y=NG(n,r);if(!y)return null;var w=e.layout,_=r.type.defaultProps,b=_!==void 0?Tt(Tt({},_),r.props):r.props,k=b.dataKey,O=b.children,A=b.minPointSize,j=w==="horizontal"?o:a,E=f?j.scale.domain():null,T=BG({numericAxis:j}),C=tn(O,xR),R=h.map(function(D,X){var $,I,q,U,V,G;f?$=RG(f[p+X],E):($=Mr(D,k),Array.isArray($)||($=[T,$]));var Z=sZ(A,q$.defaultProps.minPointSize)($[1],X);if(w==="horizontal"){var K,te=[o.scale($[0]),o.scale($[1])],H=te[0],B=te[1];I=ZT({axis:a,ticks:u,bandSize:i,offset:y.offset,entry:D,index:X}),q=(K=B??H)!==null&&K!==void 0?K:void 0,U=y.size;var z=H-B;if(V=Number.isNaN(z)?0:z,G={x:I,y:o.y,width:U,height:o.height},Math.abs(Z)>0&&Math.abs(V)<Math.abs(Z)){var J=kn(V||Z)*(Math.abs(Z)-Math.abs(V));q-=J,V+=J}}else{var ae=[a.scale($[0]),a.scale($[1])],se=ae[0],de=ae[1];if(I=se,q=ZT({axis:o,ticks:c,bandSize:i,offset:y.offset,entry:D,index:X}),U=de-se,V=y.size,G={x:a.x,y:q,width:a.width,height:V},Math.abs(Z)>0&&Math.abs(U)<Math.abs(Z)){var Ce=kn(U||Z)*(Math.abs(Z)-Math.abs(U));U+=Ce}}return Tt(Tt(Tt({},D),{},{x:I,y:q,width:U,height:V,value:f?$:$[1],payload:D,background:G},C&&C[X]&&C[X].props),{},{tooltipPayload:[E$(r,D)],tooltipPosition:{x:I+U/2,y:q+V/2}})});return Tt({data:R,layout:w},g)});function zu(t){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zu(t)}function vZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H$(n.key),n)}}function bZ(t,e,r){return e&&pP(t.prototype,e),r&&pP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mP(Object(r),!0).forEach(function(n){Uh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Uh(t,e,r){return e=H$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H$(t){var e=xZ(t,"string");return zu(e)=="symbol"?e:e+""}function xZ(t,e){if(zu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(zu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var W$=function(e,r,n,i,a){var o=e.width,u=e.height,c=e.layout,f=e.children,p=Object.keys(r),h={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:u-n.bottom,bottomMirror:u-n.bottom},g=!!Nr(f,bi);return p.reduce(function(y,w){var _=r[w],b=_.orientation,k=_.domain,O=_.padding,A=O===void 0?{}:O,j=_.mirror,E=_.reversed,T="".concat(b).concat(j?"Mirror":""),C,R,D,X,$;if(_.type==="number"&&(_.padding==="gap"||_.padding==="no-gap")){var I=k[1]-k[0],q=1/0,U=_.categoricalDomain.sort(gU);if(U.forEach(function(ae,se){se>0&&(q=Math.min((ae||0)-(U[se-1]||0),q))}),Number.isFinite(q)){var V=q/I,G=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(C=V*G/2),_.padding==="no-gap"){var Z=Ja(e.barCategoryGap,V*G),K=V*G/2;C=K-Z-(K-Z)/G*Z}}}i==="xAxis"?R=[n.left+(A.left||0)+(C||0),n.left+n.width-(A.right||0)-(C||0)]:i==="yAxis"?R=c==="horizontal"?[n.top+n.height-(A.bottom||0),n.top+(A.top||0)]:[n.top+(A.top||0)+(C||0),n.top+n.height-(A.bottom||0)-(C||0)]:R=_.range,E&&(R=[R[1],R[0]]);var te=PG(_,a,g),H=te.scale,B=te.realScaleType;H.domain(k).range(R),CG(H);var z=zG(H,yn(yn({},_),{},{realScaleType:B}));i==="xAxis"?($=b==="top"&&!j||b==="bottom"&&j,D=n.left,X=h[T]-$*_.height):i==="yAxis"&&($=b==="left"&&!j||b==="right"&&j,D=h[T]-$*_.width,X=n.top);var J=yn(yn(yn({},_),z),{},{realScaleType:B,x:D,y:X,scale:H,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return J.bandSize=Id(J,z),!_.hide&&i==="xAxis"?h[T]+=($?-1:1)*J.height:_.hide||(h[T]+=($?-1:1)*J.width),yn(yn({},y),{},Uh({},w,J))},{})},V$=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},wZ=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return V$({x:r,y:n},{x:i,y:a})},K$=(function(){function t(e){vZ(this,t),this.scale=e}return bZ(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new t(r)}}])})();Uh(K$,"EPS",1e-4);var i1=function(e){var r=Object.keys(e).reduce(function(n,i){return yn(yn({},n),{},Uh({},i,K$.create(e[i])))},{});return yn(yn({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,u=a.position;return XQ(i,function(c,f){return r[f].apply(c,{bandAware:o,position:u})})},isInRange:function(i){return B$(i,function(a,o){return r[o].isInRange(a)})}})};function _Z(t){return(t%180+180)%180}var SZ=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=_Z(i),o=a*Math.PI/180,u=Math.atan(n/r),c=o>u&&o<Math.PI-u?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},D0,gP;function kZ(){if(gP)return D0;gP=1;var t=fa(),e=Ju(),r=Oh();function n(i){return function(a,o,u){var c=Object(a);if(!e(a)){var f=t(o,3);a=r(a),o=function(h){return f(c[h],h,c)}}var p=i(a,o,u);return p>-1?c[f?a[p]:p]:void 0}}return D0=n,D0}var L0,yP;function EZ(){if(yP)return L0;yP=1;var t=M$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return L0=e,L0}var z0,vP;function OZ(){if(vP)return z0;vP=1;var t=oR(),e=fa(),r=EZ(),n=Math.max;function i(a,o,u){var c=a==null?0:a.length;if(!c)return-1;var f=u==null?0:r(u);return f<0&&(f=n(c+f,0)),t(a,e(o,3),f)}return z0=i,z0}var B0,bP;function AZ(){if(bP)return B0;bP=1;var t=kZ(),e=OZ(),r=t(e);return B0=r,B0}var TZ=AZ();const jZ=Ze(TZ);var PZ=_N();const CZ=Ze(PZ);var NZ=CZ(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),a1=N.createContext(void 0),o1=N.createContext(void 0),G$=N.createContext(void 0),X$=N.createContext({}),Y$=N.createContext(void 0),J$=N.createContext(0),Q$=N.createContext(0),xP=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,u=e.children,c=e.width,f=e.height,p=NZ(a);return M.createElement(a1.Provider,{value:n},M.createElement(o1.Provider,{value:i},M.createElement(X$.Provider,{value:a},M.createElement(G$.Provider,{value:p},M.createElement(Y$.Provider,{value:o},M.createElement(J$.Provider,{value:f},M.createElement(Q$.Provider,{value:c},u)))))))},RZ=function(){return N.useContext(Y$)},Z$=function(e){var r=N.useContext(a1);r==null&&Za();var n=r[e];return n==null&&Za(),n},$Z=function(){var e=N.useContext(a1);return ea(e)},IZ=function(){var e=N.useContext(o1),r=jZ(e,function(n){return B$(n.domain,Number.isFinite)});return r||ea(e)},eI=function(e){var r=N.useContext(o1);r==null&&Za();var n=r[e];return n==null&&Za(),n},MZ=function(){var e=N.useContext(G$);return e},DZ=function(){return N.useContext(X$)},s1=function(){return N.useContext(Q$)},l1=function(){return N.useContext(J$)};function gs(t){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gs(t)}function LZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zZ(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rI(n.key),n)}}function BZ(t,e,r){return e&&zZ(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qZ(t,e,r){return e=Yd(e),UZ(t,tI()?Reflect.construct(e,r||[],Yd(t).constructor):e.apply(t,r))}function UZ(t,e){if(e&&(gs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FZ(t)}function FZ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tI=function(){return!!t})()}function Yd(t){return Yd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yd(t)}function HZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mx(t,e)}function mx(t,e){return mx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mx(t,e)}function wP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function _P(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wP(Object(r),!0).forEach(function(n){u1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function u1(t,e,r){return e=rI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rI(t){var e=WZ(t,"string");return gs(e)=="symbol"?e:e+""}function WZ(t,e){if(gs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function VZ(t,e){return YZ(t)||XZ(t,e)||GZ(t,e)||KZ()}function KZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
471
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GZ(t,e){if(t){if(typeof t=="string")return SP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return SP(t,e)}}function SP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function XZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function YZ(t){if(Array.isArray(t))return t}function gx(){return gx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gx.apply(this,arguments)}var JZ=function(e,r){var n;return M.isValidElement(e)?n=M.cloneElement(e,r):Me(e)?n=e(r):n=M.createElement("line",gx({},r,{className:"recharts-reference-line-line"})),n},QZ=function(e,r,n,i,a,o,u,c,f){var p=a.x,h=a.y,g=a.width,y=a.height;if(n){var w=f.y,_=e.y.apply(w,{position:o});if(Fn(f,"discard")&&!e.y.isInRange(_))return null;var b=[{x:p+g,y:_},{x:p,y:_}];return c==="left"?b.reverse():b}if(r){var k=f.x,O=e.x.apply(k,{position:o});if(Fn(f,"discard")&&!e.x.isInRange(O))return null;var A=[{x:O,y:h+y},{x:O,y:h}];return u==="top"?A.reverse():A}if(i){var j=f.segment,E=j.map(function(T){return e.apply(T,{position:o})});return Fn(f,"discard")&&WQ(E,function(T){return!e.isInRange(T)})?null:E}return null};function ZZ(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,u=t.className,c=t.alwaysShow,f=RZ(),p=Z$(i),h=eI(a),g=MZ();if(!f||!g)return null;di(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=i1({x:p.scale,y:h.scale}),w=Dt(e),_=Dt(r),b=n&&n.length===2,k=QZ(y,w,_,b,g,t.position,p.orientation,h.orientation,t);if(!k)return null;var O=VZ(k,2),A=O[0],j=A.x,E=A.y,T=O[1],C=T.x,R=T.y,D=Fn(t,"hidden")?"url(#".concat(f,")"):void 0,X=_P(_P({clipPath:D},Be(t,!0)),{},{x1:j,y1:E,x2:C,y2:R});return M.createElement(kt,{className:qe("recharts-reference-line",u)},JZ(o,X),sr.renderCallByParent(t,wZ({x1:j,y1:E,x2:C,y2:R})))}var c1=(function(t){function e(){return LZ(this,e),qZ(this,e,arguments)}return HZ(e,t),BZ(e,[{key:"render",value:function(){return M.createElement(ZZ,this.props)}}])})(M.Component);u1(c1,"displayName","ReferenceLine");u1(c1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function yx(){return yx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},yx.apply(this,arguments)}function ys(t){"@babel/helpers - typeof";return ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ys(t)}function kP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function EP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kP(Object(r),!0).forEach(function(n){Fh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function eee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iI(n.key),n)}}function ree(t,e,r){return e&&tee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function nee(t,e,r){return e=Jd(e),iee(t,nI()?Reflect.construct(e,r||[],Jd(t).constructor):e.apply(t,r))}function iee(t,e){if(e&&(ys(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aee(t)}function aee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nI=function(){return!!t})()}function Jd(t){return Jd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jd(t)}function oee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vx(t,e)}function vx(t,e){return vx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},vx(t,e)}function Fh(t,e,r){return e=iI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iI(t){var e=see(t,"string");return ys(e)=="symbol"?e:e+""}function see(t,e){if(ys(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ys(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var lee=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=i1({x:i.scale,y:a.scale}),u=o.apply({x:r,y:n},{bandAware:!0});return Fn(e,"discard")&&!o.isInRange(u)?null:u},Hh=(function(t){function e(){return eee(this,e),nee(this,e,arguments)}return oee(e,t),ree(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,u=n.alwaysShow,c=n.clipPathId,f=Dt(i),p=Dt(a);if(di(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!p)return null;var h=lee(this.props);if(!h)return null;var g=h.x,y=h.y,w=this.props,_=w.shape,b=w.className,k=Fn(this.props,"hidden")?"url(#".concat(c,")"):void 0,O=EP(EP({clipPath:k},Be(this.props,!0)),{},{cx:g,cy:y});return M.createElement(kt,{className:qe("recharts-reference-dot",b)},e.renderDot(_,O),sr.renderCallByParent(this.props,{x:g-o,y:y-o,width:2*o,height:2*o}))}}])})(M.Component);Fh(Hh,"displayName","ReferenceDot");Fh(Hh,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Fh(Hh,"renderDot",function(t,e){var r;return M.isValidElement(t)?r=M.cloneElement(t,e):Me(t)?r=t(e):r=M.createElement(n1,yx({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function bx(){return bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},bx.apply(this,arguments)}function vs(t){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vs(t)}function OP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function AP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?OP(Object(r),!0).forEach(function(n){Wh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):OP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oI(n.key),n)}}function fee(t,e,r){return e&&cee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function dee(t,e,r){return e=Qd(e),hee(t,aI()?Reflect.construct(e,r||[],Qd(t).constructor):e.apply(t,r))}function hee(t,e){if(e&&(vs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pee(t)}function pee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function aI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aI=function(){return!!t})()}function Qd(t){return Qd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qd(t)}function mee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xx(t,e)}function xx(t,e){return xx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},xx(t,e)}function Wh(t,e,r){return e=oI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oI(t){var e=gee(t,"string");return vs(e)=="symbol"?e:e+""}function gee(t,e){if(vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var yee=function(e,r,n,i,a){var o=a.x1,u=a.x2,c=a.y1,f=a.y2,p=a.xAxis,h=a.yAxis;if(!p||!h)return null;var g=i1({x:p.scale,y:h.scale}),y={x:e?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:n?g.y.apply(c,{position:"start"}):g.y.rangeMin},w={x:r?g.x.apply(u,{position:"end"}):g.x.rangeMax,y:i?g.y.apply(f,{position:"end"}):g.y.rangeMax};return Fn(a,"discard")&&(!g.isInRange(y)||!g.isInRange(w))?null:V$(y,w)},Vh=(function(t){function e(){return uee(this,e),dee(this,e,arguments)}return mee(e,t),fee(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,u=n.y2,c=n.className,f=n.alwaysShow,p=n.clipPathId;di(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Dt(i),g=Dt(a),y=Dt(o),w=Dt(u),_=this.props.shape;if(!h&&!g&&!y&&!w&&!_)return null;var b=yee(h,g,y,w,this.props);if(!b&&!_)return null;var k=Fn(this.props,"hidden")?"url(#".concat(p,")"):void 0;return M.createElement(kt,{className:qe("recharts-reference-area",c)},e.renderRect(_,AP(AP({clipPath:k},Be(this.props,!0)),b)),sr.renderCallByParent(this.props,b))}}])})(M.Component);Wh(Vh,"displayName","ReferenceArea");Wh(Vh,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Wh(Vh,"renderRect",function(t,e){var r;return M.isValidElement(t)?r=M.cloneElement(t,e):Me(t)?r=t(e):r=M.createElement(r1,bx({},e,{className:"recharts-reference-area-rect"})),r});function sI(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],i=0;i<t.length;i+=e)n.push(t[i]);return n}function vee(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return SZ(n,r)}function bee(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,u=t.height;return e===1?{start:n?i:a,end:n?i+o:a+u}:{start:n?i+o:a+u,end:n?i:a}}function Zd(t,e,r,n,i){if(t*e<t*n||t*e>t*i)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-i)<=0}function xee(t,e){return sI(t,e+1)}function wee(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,u=e.end,c=0,f=1,p=o,h=function(){var w=n==null?void 0:n[c];if(w===void 0)return{v:sI(n,f)};var _=c,b,k=function(){return b===void 0&&(b=r(w,_)),b},O=w.coordinate,A=c===0||Zd(t,O,k,p,u);A||(c=0,p=o,f+=1),A&&(p=O+t*(k()/2+i),c+=f)},g;f<=a.length;)if(g=h(),g)return g.v;return[]}function Bu(t){"@babel/helpers - typeof";return Bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu(t)}function TP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?TP(Object(r),!0).forEach(function(n){_ee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):TP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _ee(t,e,r){return e=See(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function See(t){var e=kee(t,"string");return Bu(e)=="symbol"?e:e+""}function kee(t,e){if(Bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eee(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,u=e.start,c=e.end,f=function(g){var y=a[g],w,_=function(){return w===void 0&&(w=r(y,g)),w};if(g===o-1){var b=t*(y.coordinate+t*_()/2-c);a[g]=y=or(or({},y),{},{tickCoord:b>0?y.coordinate-b*t:y.coordinate})}else a[g]=y=or(or({},y),{},{tickCoord:y.coordinate});var k=Zd(t,y.tickCoord,_,u,c);k&&(c=y.tickCoord-t*(_()/2+i),a[g]=or(or({},y),{},{isShow:!0}))},p=o-1;p>=0;p--)f(p);return a}function Oee(t,e,r,n,i,a){var o=(n||[]).slice(),u=o.length,c=e.start,f=e.end;if(a){var p=n[u-1],h=r(p,u-1),g=t*(p.coordinate+t*h/2-f);o[u-1]=p=or(or({},p),{},{tickCoord:g>0?p.coordinate-g*t:p.coordinate});var y=Zd(t,p.tickCoord,function(){return h},c,f);y&&(f=p.tickCoord-t*(h/2+i),o[u-1]=or(or({},p),{},{isShow:!0}))}for(var w=a?u-1:u,_=function(O){var A=o[O],j,E=function(){return j===void 0&&(j=r(A,O)),j};if(O===0){var T=t*(A.coordinate-t*E()/2-c);o[O]=A=or(or({},A),{},{tickCoord:T<0?A.coordinate-T*t:A.coordinate})}else o[O]=A=or(or({},A),{},{tickCoord:A.coordinate});var C=Zd(t,A.tickCoord,E,c,f);C&&(c=A.tickCoord+t*(E()/2+i),o[O]=or(or({},A),{},{isShow:!0}))},b=0;b<w;b++)_(b);return o}function f1(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,u=t.orientation,c=t.interval,f=t.tickFormatter,p=t.unit,h=t.angle;if(!i||!i.length||!n)return[];if(fe(c)||$s.isSsr)return xee(i,typeof c=="number"&&fe(c)?c:0);var g=[],y=u==="top"||u==="bottom"?"width":"height",w=p&&y==="width"?Yl(p,{fontSize:e,letterSpacing:r}):{width:0,height:0},_=function(A,j){var E=Me(f)?f(A.value,j):A.value;return y==="width"?vee(Yl(E,{fontSize:e,letterSpacing:r}),w,h):Yl(E,{fontSize:e,letterSpacing:r})[y]},b=i.length>=2?kn(i[1].coordinate-i[0].coordinate):1,k=bee(a,b,y);return c==="equidistantPreserveStart"?wee(b,k,_,i,o):(c==="preserveStart"||c==="preserveStartEnd"?g=Oee(b,k,_,i,o,c==="preserveStartEnd"):g=Eee(b,k,_,i,o),g.filter(function(O){return O.isShow}))}var Aee=["viewBox"],Tee=["viewBox"],jee=["ticks"];function bs(t){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bs(t)}function Go(){return Go=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Go.apply(this,arguments)}function jP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jP(Object(r),!0).forEach(function(n){d1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function q0(t,e){if(t==null)return{};var r=Pee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Pee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Cee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uI(n.key),n)}}function Nee(t,e,r){return e&&PP(t.prototype,e),r&&PP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ree(t,e,r){return e=eh(e),$ee(t,lI()?Reflect.construct(e,r||[],eh(t).constructor):e.apply(t,r))}function $ee(t,e){if(e&&(bs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Iee(t)}function Iee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function lI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lI=function(){return!!t})()}function eh(t){return eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eh(t)}function Mee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wx(t,e)}function wx(t,e){return wx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},wx(t,e)}function d1(t,e,r){return e=uI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uI(t){var e=Dee(t,"string");return bs(e)=="symbol"?e:e+""}function Dee(t,e){if(bs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ls=(function(t){function e(r){var n;return Cee(this,e),n=Ree(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return Mee(e,t),Nee(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=q0(n,Aee),u=this.props,c=u.viewBox,f=q0(u,Tee);return!Qo(a,c)||!Qo(o,f)||!Qo(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,o=i.y,u=i.width,c=i.height,f=i.orientation,p=i.tickSize,h=i.mirror,g=i.tickMargin,y,w,_,b,k,O,A=h?-1:1,j=n.tickSize||p,E=fe(n.tickCoord)?n.tickCoord:n.coordinate;switch(f){case"top":y=w=n.coordinate,b=o+ +!h*c,_=b-A*j,O=_-A*g,k=E;break;case"left":_=b=n.coordinate,w=a+ +!h*u,y=w-A*j,k=y-A*g,O=E;break;case"right":_=b=n.coordinate,w=a+ +h*u,y=w+A*j,k=y+A*g,O=E;break;default:y=w=n.coordinate,b=o+ +h*c,_=b+A*j,O=_+A*g,k=E;break}return{line:{x1:y,y1:_,x2:w,y2:b},tick:{x:k,y:O}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,u=n.height,c=n.orientation,f=n.mirror,p=n.axisLine,h=It(It(It({},Be(this.props,!1)),Be(p,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var g=+(c==="top"&&!f||c==="bottom"&&f);h=It(It({},h),{},{x1:i,y1:a+g*u,x2:i+o,y2:a+g*u})}else{var y=+(c==="left"&&!f||c==="right"&&f);h=It(It({},h),{},{x1:i+y*o,y1:a,x2:i+y*o,y2:a+u})}return M.createElement("line",Go({},h,{className:qe("recharts-cartesian-axis-line",en(p,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,u=this.props,c=u.tickLine,f=u.stroke,p=u.tick,h=u.tickFormatter,g=u.unit,y=f1(It(It({},this.props),{},{ticks:n}),i,a),w=this.getTickTextAnchor(),_=this.getTickVerticalAnchor(),b=Be(this.props,!1),k=Be(p,!1),O=It(It({},b),{},{fill:"none"},Be(c,!1)),A=y.map(function(j,E){var T=o.getTickLineCoord(j),C=T.line,R=T.tick,D=It(It(It(It({textAnchor:w,verticalAnchor:_},b),{},{stroke:"none",fill:f},k),R),{},{index:E,payload:j,visibleTicksCount:y.length,tickFormatter:h});return M.createElement(kt,Go({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},ld(o.props,j,E)),c&&M.createElement("line",Go({},O,C,{className:qe("recharts-cartesian-axis-tick-line",en(c,"className"))})),p&&e.renderTickItem(p,D,"".concat(Me(h)?h(j.value,E):j.value).concat(g||"")))});return M.createElement("g",{className:"recharts-cartesian-axis-ticks"},A)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,u=i.height,c=i.ticksGenerator,f=i.className,p=i.hide;if(p)return null;var h=this.props,g=h.ticks,y=q0(h,jee),w=g;return Me(c)&&(w=g&&g.length>0?c(this.props):c(y)),o<=0||u<=0||!w||!w.length?null:M.createElement(kt,{className:qe("recharts-cartesian-axis",f),ref:function(b){n.layerReference=b}},a&&this.renderAxisLine(),this.renderTicks(w,this.state.fontSize,this.state.letterSpacing),sr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,u=qe(i.className,"recharts-cartesian-axis-tick-value");return M.isValidElement(n)?o=M.cloneElement(n,It(It({},i),{},{className:u})):Me(n)?o=n(It(It({},i),{},{className:u})):o=M.createElement(xd,Go({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);d1(Ls,"displayName","CartesianAxis");d1(Ls,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Lee=["x1","y1","x2","y2","key"],zee=["offset"];function eo(t){"@babel/helpers - typeof";return eo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eo(t)}function CP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function lr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CP(Object(r),!0).forEach(function(n){Bee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bee(t,e,r){return e=qee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qee(t){var e=Uee(t,"string");return eo(e)=="symbol"?e:e+""}function Uee(t,e){if(eo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(eo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wa(){return Wa=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Wa.apply(this,arguments)}function NP(t,e){if(t==null)return{};var r=Fee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Fee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Hee=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,i=e.x,a=e.y,o=e.width,u=e.height,c=e.ry;return M.createElement("rect",{x:i,y:a,ry:c,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function cI(t,e){var r;if(M.isValidElement(t))r=M.cloneElement(t,e);else if(Me(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,u=e.key,c=NP(e,Lee),f=Be(c,!1);f.offset;var p=NP(f,zee);r=M.createElement("line",Wa({},p,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:u}))}return r}function Wee(t){var e=t.x,r=t.width,n=t.horizontal,i=n===void 0?!0:n,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var f=lr(lr({},t),{},{x1:e,y1:u,x2:e+r,y2:u,key:"line-".concat(c),index:c});return cI(i,f)});return M.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Vee(t){var e=t.y,r=t.height,n=t.vertical,i=n===void 0?!0:n,a=t.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(u,c){var f=lr(lr({},t),{},{x1:u,y1:e,x2:u,y2:e+r,key:"line-".concat(c),index:c});return cI(i,f)});return M.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Kee(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,u=t.horizontalPoints,c=t.horizontal,f=c===void 0?!0:c;if(!f||!e||!e.length)return null;var p=u.map(function(g){return Math.round(g+i-i)}).sort(function(g,y){return g-y});i!==p[0]&&p.unshift(0);var h=p.map(function(g,y){var w=!p[y+1],_=w?i+o-g:p[y+1]-g;if(_<=0)return null;var b=y%e.length;return M.createElement("rect",{key:"react-".concat(y),y:g,x:n,height:_,width:a,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function Gee(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,u=t.width,c=t.height,f=t.verticalPoints;if(!r||!n||!n.length)return null;var p=f.map(function(g){return Math.round(g+a-a)}).sort(function(g,y){return g-y});a!==p[0]&&p.unshift(0);var h=p.map(function(g,y){var w=!p[y+1],_=w?a+u-g:p[y+1]-g;if(_<=0)return null;var b=y%n.length;return M.createElement("rect",{key:"react-".concat(y),x:g,y:o,width:_,height:c,stroke:"none",fill:n[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return M.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var Xee=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return S$(f1(lr(lr(lr({},Ls.defaultProps),n),{},{ticks:ui(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Yee=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return S$(f1(lr(lr(lr({},Ls.defaultProps),n),{},{ticks:ui(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Bo={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function qu(t){var e,r,n,i,a,o,u=s1(),c=l1(),f=DZ(),p=lr(lr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Bo.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:Bo.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:Bo.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Bo.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:Bo.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Bo.verticalFill,x:fe(t.x)?t.x:f.left,y:fe(t.y)?t.y:f.top,width:fe(t.width)?t.width:f.width,height:fe(t.height)?t.height:f.height}),h=p.x,g=p.y,y=p.width,w=p.height,_=p.syncWithTicks,b=p.horizontalValues,k=p.verticalValues,O=$Z(),A=IZ();if(!fe(y)||y<=0||!fe(w)||w<=0||!fe(h)||h!==+h||!fe(g)||g!==+g)return null;var j=p.verticalCoordinatesGenerator||Xee,E=p.horizontalCoordinatesGenerator||Yee,T=p.horizontalPoints,C=p.verticalPoints;if((!T||!T.length)&&Me(E)){var R=b&&b.length,D=E({yAxis:A?lr(lr({},A),{},{ticks:R?b:A.ticks}):void 0,width:u,height:c,offset:f},R?!0:_);di(Array.isArray(D),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(eo(D),"]")),Array.isArray(D)&&(T=D)}if((!C||!C.length)&&Me(j)){var X=k&&k.length,$=j({xAxis:O?lr(lr({},O),{},{ticks:X?k:O.ticks}):void 0,width:u,height:c,offset:f},X?!0:_);di(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(eo($),"]")),Array.isArray($)&&(C=$)}return M.createElement("g",{className:"recharts-cartesian-grid"},M.createElement(Hee,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),M.createElement(Wee,Wa({},p,{offset:f,horizontalPoints:T,xAxis:O,yAxis:A})),M.createElement(Vee,Wa({},p,{offset:f,verticalPoints:C,xAxis:O,yAxis:A})),M.createElement(Kee,Wa({},p,{horizontalPoints:T})),M.createElement(Gee,Wa({},p,{verticalPoints:C})))}qu.displayName="CartesianGrid";var Jee=["type","layout","connectNulls","ref"],Qee=["key"];function xs(t){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xs(t)}function RP(t,e){if(t==null)return{};var r=Zee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Zee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function eu(){return eu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},eu.apply(this,arguments)}function $P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$P(Object(r),!0).forEach(function(n){vn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$P(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qo(t){return nte(t)||rte(t)||tte(t)||ete()}function ete(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
472
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tte(t,e){if(t){if(typeof t=="string")return _x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _x(t,e)}}function rte(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function nte(t){if(Array.isArray(t))return _x(t)}function _x(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ite(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dI(n.key),n)}}function ate(t,e,r){return e&&IP(t.prototype,e),r&&IP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function ote(t,e,r){return e=th(e),ste(t,fI()?Reflect.construct(e,r||[],th(t).constructor):e.apply(t,r))}function ste(t,e){if(e&&(xs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lte(t)}function lte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fI=function(){return!!t})()}function th(t){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},th(t)}function ute(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sx(t,e)}function Sx(t,e){return Sx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Sx(t,e)}function vn(t,e,r){return e=dI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dI(t){var e=cte(t,"string");return xs(e)=="symbol"?e:e+""}function cte(t,e){if(xs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var nc=(function(t){function e(){var r;ite(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=ote(this,e,[].concat(i)),vn(r,"state",{isAnimationFinished:!0,totalLength:0}),vn(r,"generateSimpleStrokeDasharray",function(o,u){return"".concat(u,"px ").concat(o-u,"px")}),vn(r,"getStrokeDasharray",function(o,u,c){var f=c.reduce(function(k,O){return k+O});if(!f)return r.generateSimpleStrokeDasharray(u,o);for(var p=Math.floor(o/f),h=o%f,g=u-o,y=[],w=0,_=0;w<c.length;_+=c[w],++w)if(_+c[w]>h){y=[].concat(qo(c.slice(0,w)),[h-_]);break}var b=y.length%2===0?[0,g]:[g];return[].concat(qo(e.repeat(c,p)),qo(y),b).map(function(k){return"".concat(k,"px")}).join(", ")}),vn(r,"id",Yu("recharts-line-")),vn(r,"pathRef",function(o){r.mainCurve=o}),vn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),vn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return ute(e,t),ate(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,u=a.xAxis,c=a.yAxis,f=a.layout,p=a.children,h=tn(p,rc);if(!h)return null;var g=function(_,b){return{x:_.x,y:_.y,value:_.value,errorVal:Mr(_.payload,b)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(kt,y,h.map(function(w){return M.cloneElement(w,{key:"bar-".concat(w.props.dataKey),data:o,xAxis:u,yAxis:c,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,c=u.dot,f=u.points,p=u.dataKey,h=Be(this.props,!1),g=Be(c,!0),y=f.map(function(_,b){var k=Pr(Pr(Pr({key:"dot-".concat(b),r:3},h),g),{},{index:b,cx:_.x,cy:_.y,value:_.value,dataKey:p,payload:_.payload,points:f});return e.renderDotItem(c,k)}),w={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return M.createElement(kt,eu({className:"recharts-line-dots",key:"dots"},w),y)}},{key:"renderCurveStatically",value:function(n,i,a,o){var u=this.props,c=u.type,f=u.layout,p=u.connectNulls;u.ref;var h=RP(u,Jee),g=Pr(Pr(Pr({},Be(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:f,connectNulls:p});return M.createElement(ex,eu({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,u=o.points,c=o.strokeDasharray,f=o.isAnimationActive,p=o.animationBegin,h=o.animationDuration,g=o.animationEasing,y=o.animationId,w=o.animateNewValues,_=o.width,b=o.height,k=this.state,O=k.prevPoints,A=k.totalLength;return M.createElement(vi,{begin:p,duration:h,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var E=j.t;if(O){var T=O.length/u.length,C=u.map(function(I,q){var U=Math.floor(q*T);if(O[U]){var V=O[U],G=wn(V.x,I.x),Z=wn(V.y,I.y);return Pr(Pr({},I),{},{x:G(E),y:Z(E)})}if(w){var K=wn(_*2,I.x),te=wn(b/2,I.y);return Pr(Pr({},I),{},{x:K(E),y:te(E)})}return Pr(Pr({},I),{},{x:I.x,y:I.y})});return a.renderCurveStatically(C,n,i)}var R=wn(0,A),D=R(E),X;if(c){var $="".concat(c).split(/[,\s]+/gim).map(function(I){return parseFloat(I)});X=a.getStrokeDasharray(D,A,$)}else X=a.generateSimpleStrokeDasharray(A,D);return a.renderCurveStatically(u,n,i,{strokeDasharray:X})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,u=a.isAnimationActive,c=this.state,f=c.prevPoints,p=c.totalLength;return u&&o&&o.length&&(!f&&p>0||!Dh(f,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,u=i.points,c=i.className,f=i.xAxis,p=i.yAxis,h=i.top,g=i.left,y=i.width,w=i.height,_=i.isAnimationActive,b=i.id;if(a||!u||!u.length)return null;var k=this.state.isAnimationFinished,O=u.length===1,A=qe("recharts-line",c),j=f&&f.allowDataOverflow,E=p&&p.allowDataOverflow,T=j||E,C=Le(b)?this.id:b,R=(n=Be(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},D=R.r,X=D===void 0?3:D,$=R.strokeWidth,I=$===void 0?2:$,q=EU(o)?o:{},U=q.clipDot,V=U===void 0?!0:U,G=X*2+I;return M.createElement(kt,{className:A},j||E?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(C)},M.createElement("rect",{x:j?g:g-y/2,y:E?h:h-w/2,width:j?y:y*2,height:E?w:w*2})),!V&&M.createElement("clipPath",{id:"clipPath-dots-".concat(C)},M.createElement("rect",{x:g-G/2,y:h-G/2,width:y+G,height:w+G}))):null,!O&&this.renderCurve(T,C),this.renderErrorBar(T,C),(O||o)&&this.renderDots(T,V,C),(!_||k)&&aa.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(qo(n),[0]):n,o=[],u=0;u<i;++u)o=[].concat(qo(o),qo(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(M.isValidElement(n))a=M.cloneElement(n,i);else if(Me(n))a=n(i);else{var o=i.key,u=RP(i,Qee),c=qe("recharts-line-dot",typeof n!="boolean"?n.className:"");a=M.createElement(n1,eu({key:o},u,{className:c}))}return a}}])})(N.PureComponent);vn(nc,"displayName","Line");vn(nc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!$s.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});vn(nc,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,u=t.bandSize,c=t.displayedData,f=t.offset,p=e.layout,h=c.map(function(g,y){var w=Mr(g,o);return p==="horizontal"?{x:QT({axis:r,ticks:i,bandSize:u,entry:g,index:y}),y:Le(w)?null:n.scale(w),value:w,payload:g}:{x:Le(w)?null:r.scale(w),y:QT({axis:n,ticks:a,bandSize:u,entry:g,index:y}),value:w,payload:g}});return Pr({points:h,layout:p},f)});function ws(t){"@babel/helpers - typeof";return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ws(t)}function fte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dte(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mI(n.key),n)}}function hte(t,e,r){return e&&dte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pte(t,e,r){return e=rh(e),mte(t,hI()?Reflect.construct(e,r||[],rh(t).constructor):e.apply(t,r))}function mte(t,e){if(e&&(ws(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gte(t)}function gte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function hI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hI=function(){return!!t})()}function rh(t){return rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rh(t)}function yte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kx(t,e)}function kx(t,e){return kx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kx(t,e)}function pI(t,e,r){return e=mI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mI(t){var e=vte(t,"string");return ws(e)=="symbol"?e:e+""}function vte(t,e){if(ws(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ex(){return Ex=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ex.apply(this,arguments)}function bte(t){var e=t.xAxisId,r=s1(),n=l1(),i=Z$(e);return i==null?null:N.createElement(Ls,Ex({},i,{className:qe("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return ui(o,!0)}}))}var sa=(function(t){function e(){return fte(this,e),pte(this,e,arguments)}return yte(e,t),hte(e,[{key:"render",value:function(){return N.createElement(bte,this.props)}}])})(N.Component);pI(sa,"displayName","XAxis");pI(sa,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function _s(t){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_s(t)}function xte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wte(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,vI(n.key),n)}}function _te(t,e,r){return e&&wte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ste(t,e,r){return e=nh(e),kte(t,gI()?Reflect.construct(e,r||[],nh(t).constructor):e.apply(t,r))}function kte(t,e){if(e&&(_s(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ete(t)}function Ete(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gI=function(){return!!t})()}function nh(t){return nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nh(t)}function Ote(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ox(t,e)}function Ox(t,e){return Ox=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ox(t,e)}function yI(t,e,r){return e=vI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vI(t){var e=Ate(t,"string");return _s(e)=="symbol"?e:e+""}function Ate(t,e){if(_s(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Ax(){return Ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ax.apply(this,arguments)}var Tte=function(e){var r=e.yAxisId,n=s1(),i=l1(),a=eI(r);return a==null?null:N.createElement(Ls,Ax({},a,{className:qe("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(u){return ui(u,!0)}}))},la=(function(t){function e(){return xte(this,e),Ste(this,e,arguments)}return Ote(e,t),_te(e,[{key:"render",value:function(){return N.createElement(Tte,this.props)}}])})(N.Component);yI(la,"displayName","YAxis");yI(la,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function MP(t){return Nte(t)||Cte(t)||Pte(t)||jte()}function jte(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
473
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pte(t,e){if(t){if(typeof t=="string")return Tx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tx(t,e)}}function Cte(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nte(t){if(Array.isArray(t))return Tx(t)}function Tx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var jx=function(e,r,n,i,a){var o=tn(e,c1),u=tn(e,Hh),c=[].concat(MP(o),MP(u)),f=tn(e,Vh),p="".concat(i,"Id"),h=i[0],g=r;if(c.length&&(g=c.reduce(function(_,b){if(b.props[p]===n&&Fn(b.props,"extendDomain")&&fe(b.props[h])){var k=b.props[h];return[Math.min(_[0],k),Math.max(_[1],k)]}return _},g)),f.length){var y="".concat(h,"1"),w="".concat(h,"2");g=f.reduce(function(_,b){if(b.props[p]===n&&Fn(b.props,"extendDomain")&&fe(b.props[y])&&fe(b.props[w])){var k=b.props[y],O=b.props[w];return[Math.min(_[0],k,O),Math.max(_[1],k,O)]}return _},g)}return a&&a.length&&(g=a.reduce(function(_,b){return fe(b)?[Math.min(_[0],b),Math.max(_[1],b)]:_},g)),g},U0={exports:{}},DP;function Rte(){return DP||(DP=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,f,p){this.fn=c,this.context=f,this.once=p||!1}function a(c,f,p,h,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var y=new i(p,h||c,g),w=r?r+f:f;return c._events[w]?c._events[w].fn?c._events[w]=[c._events[w],y]:c._events[w].push(y):(c._events[w]=y,c._eventsCount++),c}function o(c,f){--c._eventsCount===0?c._events=new n:delete c._events[f]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,h;if(this._eventsCount===0)return f;for(h in p=this._events)e.call(p,h)&&f.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=r?r+f:f,h=this._events[p];if(!h)return[];if(h.fn)return[h.fn];for(var g=0,y=h.length,w=new Array(y);g<y;g++)w[g]=h[g].fn;return w},u.prototype.listenerCount=function(f){var p=r?r+f:f,h=this._events[p];return h?h.fn?1:h.length:0},u.prototype.emit=function(f,p,h,g,y,w){var _=r?r+f:f;if(!this._events[_])return!1;var b=this._events[_],k=arguments.length,O,A;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),k){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,p),!0;case 3:return b.fn.call(b.context,p,h),!0;case 4:return b.fn.call(b.context,p,h,g),!0;case 5:return b.fn.call(b.context,p,h,g,y),!0;case 6:return b.fn.call(b.context,p,h,g,y,w),!0}for(A=1,O=new Array(k-1);A<k;A++)O[A-1]=arguments[A];b.fn.apply(b.context,O)}else{var j=b.length,E;for(A=0;A<j;A++)switch(b[A].once&&this.removeListener(f,b[A].fn,void 0,!0),k){case 1:b[A].fn.call(b[A].context);break;case 2:b[A].fn.call(b[A].context,p);break;case 3:b[A].fn.call(b[A].context,p,h);break;case 4:b[A].fn.call(b[A].context,p,h,g);break;default:if(!O)for(E=1,O=new Array(k-1);E<k;E++)O[E-1]=arguments[E];b[A].fn.apply(b[A].context,O)}}return!0},u.prototype.on=function(f,p,h){return a(this,f,p,h,!1)},u.prototype.once=function(f,p,h){return a(this,f,p,h,!0)},u.prototype.removeListener=function(f,p,h,g){var y=r?r+f:f;if(!this._events[y])return this;if(!p)return o(this,y),this;var w=this._events[y];if(w.fn)w.fn===p&&(!g||w.once)&&(!h||w.context===h)&&o(this,y);else{for(var _=0,b=[],k=w.length;_<k;_++)(w[_].fn!==p||g&&!w[_].once||h&&w[_].context!==h)&&b.push(w[_]);b.length?this._events[y]=b.length===1?b[0]:b:o(this,y)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=r?r+f:f,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,t.exports=u})(U0)),U0.exports}var $te=Rte();const Ite=Ze($te);var F0=new Ite,H0="recharts.syncMouseEvents";function Uu(t){"@babel/helpers - typeof";return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uu(t)}function Mte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dte(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,bI(n.key),n)}}function Lte(t,e,r){return e&&Dte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function W0(t,e,r){return e=bI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bI(t){var e=zte(t,"string");return Uu(e)=="symbol"?e:e+""}function zte(t,e){if(Uu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Bte=(function(){function t(){Mte(this,t),W0(this,"activeIndex",0),W0(this,"coordinateList",[]),W0(this,"layout","horizontal")}return Lte(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,u=o===void 0?null:o,c=r.layout,f=c===void 0?null:c,p=r.offset,h=p===void 0?null:p,g=r.mouseHandlerCallback,y=g===void 0?null:g;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=u??this.container,this.layout=f??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=y??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,u=i.height,c=this.coordinateList[this.activeIndex].coordinate,f=((r=window)===null||r===void 0?void 0:r.scrollX)||0,p=((n=window)===null||n===void 0?void 0:n.scrollY)||0,h=a+c+f,g=o+this.offset.top+u/2+p;this.mouseHandlerCallback({pageX:h,pageY:g})}}}])})();function qte(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],i=t==null?void 0:t[1];if(n&&i&&fe(n)&&fe(i))return!0}return!1}function Ute(t,e,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-i,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function xI(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=Zt(e,r,n,i),u=Zt(e,r,n,a);return{points:[o,u],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function Fte(t,e,r){var n,i,a,o;if(t==="horizontal")n=e.x,a=n,i=r.top,o=r.top+r.height;else if(t==="vertical")i=e.y,o=i,n=r.left,a=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var u=e.cx,c=e.cy,f=e.innerRadius,p=e.outerRadius,h=e.angle,g=Zt(u,c,f,h),y=Zt(u,c,p,h);n=g.x,i=g.y,a=y.x,o=y.y}else return xI(e);return[{x:n,y:i},{x:a,y:o}]}function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function LP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function zf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?LP(Object(r),!0).forEach(function(n){Hte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):LP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hte(t,e,r){return e=Wte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wte(t){var e=Vte(t,"string");return Fu(e)=="symbol"?e:e+""}function Vte(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kte(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,u=t.activePayload,c=t.offset,f=t.activeTooltipIndex,p=t.tooltipAxisBandSize,h=t.layout,g=t.chartName,y=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!y||!a||!o||g!=="ScatterChart"&&i!=="axis")return null;var w,_=ex;if(g==="ScatterChart")w=o,_=WJ;else if(g==="BarChart")w=Ute(h,o,c,p),_=r1;else if(h==="radial"){var b=xI(o),k=b.cx,O=b.cy,A=b.radius,j=b.startAngle,E=b.endAngle;w={cx:k,cy:O,startAngle:j,endAngle:E,innerRadius:A,outerRadius:A},_=T$}else w={points:Fte(h,o,c)},_=ex;var T=zf(zf(zf(zf({stroke:"#ccc",pointerEvents:"none"},c),w),Be(y,!1)),{},{payload:u,payloadIndex:f,className:qe("recharts-tooltip-cursor",y.className)});return N.isValidElement(y)?N.cloneElement(y,T):N.createElement(_,T)}var Gte=["item"],Xte=["children","className","width","height","style","compact","title","desc"];function Ss(t){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ss(t)}function Xo(){return Xo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Xo.apply(this,arguments)}function zP(t,e){return Qte(t)||Jte(t,e)||_I(t,e)||Yte()}function Yte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
474
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jte(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,u=[],c=!0,f=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(c=(n=a.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(p){f=!0,i=p}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return u}}function Qte(t){if(Array.isArray(t))return t}function BP(t,e){if(t==null)return{};var r=Zte(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Zte(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function ere(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,SI(n.key),n)}}function rre(t,e,r){return e&&tre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function nre(t,e,r){return e=ih(e),ire(t,wI()?Reflect.construct(e,r||[],ih(t).constructor):e.apply(t,r))}function ire(t,e){if(e&&(Ss(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return are(t)}function are(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wI=function(){return!!t})()}function ih(t){return ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ih(t)}function ore(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Px(t,e)}function Px(t,e){return Px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Px(t,e)}function ks(t){return ure(t)||lre(t)||_I(t)||sre()}function sre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
475
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _I(t,e){if(t){if(typeof t=="string")return Cx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cx(t,e)}}function lre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ure(t){if(Array.isArray(t))return Cx(t)}function Cx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function qP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function re(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qP(Object(r),!0).forEach(function(n){Te(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Te(t,e,r){return e=SI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SI(t){var e=cre(t,"string");return Ss(e)=="symbol"?e:e+""}function cre(t,e){if(Ss(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ss(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fre={xAxis:["bottom","top"],yAxis:["left","right"]},dre={width:"100%",height:"100%"},kI={x:0,y:0};function Bf(t){return t}var hre=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},pre=function(e,r,n,i){var a=r.find(function(p){return p&&p.index===n});if(a){if(e==="horizontal")return{x:a.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:a.coordinate};if(e==="centric"){var o=a.coordinate,u=i.radius;return re(re(re({},i),Zt(i.cx,i.cy,u,o)),{},{angle:o,radius:u})}var c=a.coordinate,f=i.angle;return re(re(re({},i),Zt(i.cx,i.cy,c,f)),{},{angle:f,radius:c})}return kI},Kh=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(u,c){var f=c.props.data;return f&&f.length?[].concat(ks(u),ks(f)):u},[]);return o.length>0?o:e&&e.length&&fe(i)&&fe(a)?e.slice(i,a+1):[]};function EI(t){return t==="number"?[0,"auto"]:void 0}var Nx=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,u=Kh(r,e);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,f){var p,h=(p=f.props.data)!==null&&p!==void 0?p:r;h&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(h=h.slice(e.dataStartIndex,e.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var y=h===void 0?u:h;g=od(y,o.dataKey,i)}else g=h&&h[n]||u[n];return g?[].concat(ks(c),[E$(f,g)]):c},[])},UP=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=hre(a,n),u=e.orderedTooltipTicks,c=e.tooltipAxis,f=e.tooltipTicks,p=kG(o,u,f,c);if(p>=0&&f){var h=f[p]&&f[p].value,g=Nx(e,r,p,h),y=pre(n,u,p,a);return{activeTooltipIndex:p,activeLabel:h,activePayload:g,activeCoordinate:y}}return null},mre=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,p=e.layout,h=e.children,g=e.stackOffset,y=_$(p,a);return n.reduce(function(w,_){var b,k=_.type.defaultProps!==void 0?re(re({},_.type.defaultProps),_.props):_.props,O=k.type,A=k.dataKey,j=k.allowDataOverflow,E=k.allowDuplicatedCategory,T=k.scale,C=k.ticks,R=k.includeHidden,D=k[o];if(w[D])return w;var X=Kh(e.data,{graphicalItems:i.filter(function(z){var J,ae=o in z.props?z.props[o]:(J=z.type.defaultProps)===null||J===void 0?void 0:J[o];return ae===D}),dataStartIndex:c,dataEndIndex:f}),$=X.length,I,q,U;qte(k.domain,j,O)&&(I=Xb(k.domain,null,j),y&&(O==="number"||T!=="auto")&&(U=Ql(X,A,"category")));var V=EI(O);if(!I||I.length===0){var G,Z=(G=k.domain)!==null&&G!==void 0?G:V;if(A){if(I=Ql(X,A,O),O==="category"&&y){var K=mU(I);E&&K?(q=I,I=Wd(0,$)):E||(I=rj(Z,I,_).reduce(function(z,J){return z.indexOf(J)>=0?z:[].concat(ks(z),[J])},[]))}else if(O==="category")E?I=I.filter(function(z){return z!==""&&!Le(z)}):I=rj(Z,I,_).reduce(function(z,J){return z.indexOf(J)>=0||J===""||Le(J)?z:[].concat(ks(z),[J])},[]);else if(O==="number"){var te=jG(X,i.filter(function(z){var J,ae,se=o in z.props?z.props[o]:(J=z.type.defaultProps)===null||J===void 0?void 0:J[o],de="hide"in z.props?z.props.hide:(ae=z.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return se===D&&(R||!de)}),A,a,p);te&&(I=te)}y&&(O==="number"||T!=="auto")&&(U=Ql(X,A,"category"))}else y?I=Wd(0,$):u&&u[D]&&u[D].hasStack&&O==="number"?I=g==="expand"?[0,1]:k$(u[D].stackGroups,c,f):I=w$(X,i.filter(function(z){var J=o in z.props?z.props[o]:z.type.defaultProps[o],ae="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return J===D&&(R||!ae)}),O,p,!0);if(O==="number")I=jx(h,I,D,a,C),Z&&(I=Xb(Z,I,j));else if(O==="category"&&Z){var H=Z,B=I.every(function(z){return H.indexOf(z)>=0});B&&(I=H)}}return re(re({},w),{},Te({},D,re(re({},k),{},{axisType:a,domain:I,categoricalDomain:U,duplicateDomain:q,originalDomain:(b=k.domain)!==null&&b!==void 0?b:V,isCategorical:y,layout:p})))},{})},gre=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,p=e.layout,h=e.children,g=Kh(e.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:f}),y=g.length,w=_$(p,a),_=-1;return n.reduce(function(b,k){var O=k.type.defaultProps!==void 0?re(re({},k.type.defaultProps),k.props):k.props,A=O[o],j=EI("number");if(!b[A]){_++;var E;return w?E=Wd(0,y):u&&u[A]&&u[A].hasStack?(E=k$(u[A].stackGroups,c,f),E=jx(h,E,A,a)):(E=Xb(j,w$(g,n.filter(function(T){var C,R,D=o in T.props?T.props[o]:(C=T.type.defaultProps)===null||C===void 0?void 0:C[o],X="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return D===A&&!X}),"number",p),i.defaultProps.allowDataOverflow),E=jx(h,E,A,a)),re(re({},b),{},Te({},A,re(re({axisType:a},i.defaultProps),{},{hide:!0,orientation:en(fre,"".concat(a,".").concat(_%2),null),domain:E,originalDomain:j,isCategorical:w,layout:p})))}return b},{})},yre=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,f=r.dataEndIndex,p=e.children,h="".concat(i,"Id"),g=tn(p,a),y={};return g&&g.length?y=mre(e,{axes:g,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:u,dataStartIndex:c,dataEndIndex:f}):o&&o.length&&(y=gre(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:h,stackGroups:u,dataStartIndex:c,dataEndIndex:f})),y},vre=function(e){var r=ea(e),n=ui(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:jw(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Id(r,n)}},FP=function(e){var r=e.children,n=e.defaultShowTooltip,i=Nr(r,ps),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},bre=function(e){return!e||!e.length?!1:e.some(function(r){var n=fi(r&&r.type);return n&&n.indexOf("Bar")>=0})},HP=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},xre=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,u=e.yAxisMap,c=u===void 0?{}:u,f=n.width,p=n.height,h=n.children,g=n.margin||{},y=Nr(h,ps),w=Nr(h,Zo),_=Object.keys(c).reduce(function(E,T){var C=c[T],R=C.orientation;return!C.mirror&&!C.hide?re(re({},E),{},Te({},R,E[R]+C.width)):E},{left:g.left||0,right:g.right||0}),b=Object.keys(o).reduce(function(E,T){var C=o[T],R=C.orientation;return!C.mirror&&!C.hide?re(re({},E),{},Te({},R,en(E,"".concat(R))+C.height)):E},{top:g.top||0,bottom:g.bottom||0}),k=re(re({},b),_),O=k.bottom;y&&(k.bottom+=y.props.height||ps.defaultProps.height),w&&r&&(k=AG(k,i,n,r));var A=f-k.left-k.right,j=p-k.top-k.bottom;return re(re({brushBottom:O},k),{},{width:Math.max(A,0),height:Math.max(j,0)})},wre=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},OI=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=e.axisComponents,f=e.legendContent,p=e.formatAxisMap,h=e.defaultProps,g=function(k,O){var A=O.graphicalItems,j=O.stackGroups,E=O.offset,T=O.updateId,C=O.dataStartIndex,R=O.dataEndIndex,D=k.barSize,X=k.layout,$=k.barGap,I=k.barCategoryGap,q=k.maxBarSize,U=HP(X),V=U.numericAxisName,G=U.cateAxisName,Z=bre(A),K=[];return A.forEach(function(te,H){var B=Kh(k.data,{graphicalItems:[te],dataStartIndex:C,dataEndIndex:R}),z=te.type.defaultProps!==void 0?re(re({},te.type.defaultProps),te.props):te.props,J=z.dataKey,ae=z.maxBarSize,se=z["".concat(V,"Id")],de=z["".concat(G,"Id")],Ce={},pe=c.reduce(function(er,ot){var kr=O["".concat(ot.axisType,"Map")],ma=z["".concat(ot.axisType,"Id")];kr&&kr[ma]||ot.axisType==="zAxis"||Za();var ga=kr[ma];return re(re({},er),{},Te(Te({},ot.axisType,ga),"".concat(ot.axisType,"Ticks"),ui(ga)))},Ce),ne=pe[G],_e=pe["".concat(G,"Ticks")],Ee=j&&j[se]&&j[se].hasStack&&qG(te,j[se].stackGroups),ie=fi(te.type).indexOf("Bar")>=0,Fe=Id(ne,_e),Ne=[],ct=Z&&EG({barSize:D,stackGroups:j,totalSize:wre(pe,G)});if(ie){var at,ft,hr=Le(ae)?q:ae,Et=(at=(ft=Id(ne,_e,!0))!==null&&ft!==void 0?ft:hr)!==null&&at!==void 0?at:0;Ne=OG({barGap:$,barCategoryGap:I,bandSize:Et!==Fe?Et:Fe,sizeList:ct[de],maxBarSize:hr}),Et!==Fe&&(Ne=Ne.map(function(er){return re(re({},er),{},{position:re(re({},er.position),{},{offset:er.position.offset-Et/2})})}))}var Lr=te&&te.type&&te.type.getComposedData;Lr&&K.push({props:re(re({},Lr(re(re({},pe),{},{displayedData:B,props:k,dataKey:J,item:te,bandSize:Fe,barPosition:Ne,offset:E,stackedData:Ee,layout:X,dataStartIndex:C,dataEndIndex:R}))),{},Te(Te(Te({key:te.key||"item-".concat(H)},V,pe[V]),G,pe[G]),"animationId",T)),childIndex:TU(te,k.children),item:te})}),K},y=function(k,O){var A=k.props,j=k.dataStartIndex,E=k.dataEndIndex,T=k.updateId;if(!gO({props:A}))return null;var C=A.children,R=A.layout,D=A.stackOffset,X=A.data,$=A.reverseStackOrder,I=HP(R),q=I.numericAxisName,U=I.cateAxisName,V=tn(C,n),G=LG(X,V,"".concat(q,"Id"),"".concat(U,"Id"),D,$),Z=c.reduce(function(z,J){var ae="".concat(J.axisType,"Map");return re(re({},z),{},Te({},ae,yre(A,re(re({},J),{},{graphicalItems:V,stackGroups:J.axisType===q&&G,dataStartIndex:j,dataEndIndex:E}))))},{}),K=xre(re(re({},Z),{},{props:A,graphicalItems:V}),O==null?void 0:O.legendBBox);Object.keys(Z).forEach(function(z){Z[z]=p(A,Z[z],K,z.replace("Map",""),r)});var te=Z["".concat(U,"Map")],H=vre(te),B=g(A,re(re({},Z),{},{dataStartIndex:j,dataEndIndex:E,updateId:T,graphicalItems:V,stackGroups:G,offset:K}));return re(re({formattedGraphicalItems:B,graphicalItems:V,offset:K,stackGroups:G},H),Z)},w=(function(b){function k(O){var A,j,E;return ere(this,k),E=nre(this,k,[O]),Te(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Te(E,"accessibilityManager",new Bte),Te(E,"handleLegendBBoxUpdate",function(T){if(T){var C=E.state,R=C.dataStartIndex,D=C.dataEndIndex,X=C.updateId;E.setState(re({legendBBox:T},y({props:E.props,dataStartIndex:R,dataEndIndex:D,updateId:X},re(re({},E.state),{},{legendBBox:T}))))}}),Te(E,"handleReceiveSyncEvent",function(T,C,R){if(E.props.syncId===T){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(C)}}),Te(E,"handleBrushChange",function(T){var C=T.startIndex,R=T.endIndex;if(C!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var D=E.state.updateId;E.setState(function(){return re({dataStartIndex:C,dataEndIndex:R},y({props:E.props,dataStartIndex:C,dataEndIndex:R,updateId:D},E.state))}),E.triggerSyncEvent({dataStartIndex:C,dataEndIndex:R})}}),Te(E,"handleMouseEnter",function(T){var C=E.getMouseInfo(T);if(C){var R=re(re({},C),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseEnter;Me(D)&&D(R,T)}}),Te(E,"triggeredAfterMouseMove",function(T){var C=E.getMouseInfo(T),R=C?re(re({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseMove;Me(D)&&D(R,T)}),Te(E,"handleItemMouseEnter",function(T){E.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),Te(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),Te(E,"handleMouseMove",function(T){T.persist(),E.throttleTriggeredAfterMouseMove(T)}),Te(E,"handleMouseLeave",function(T){E.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};E.setState(C),E.triggerSyncEvent(C);var R=E.props.onMouseLeave;Me(R)&&R(C,T)}),Te(E,"handleOuterEvent",function(T){var C=AU(T),R=en(E.props,"".concat(C));if(C&&Me(R)){var D,X;/.*touch.*/i.test(C)?X=E.getMouseInfo(T.changedTouches[0]):X=E.getMouseInfo(T),R((D=X)!==null&&D!==void 0?D:{},T)}}),Te(E,"handleClick",function(T){var C=E.getMouseInfo(T);if(C){var R=re(re({},C),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onClick;Me(D)&&D(R,T)}}),Te(E,"handleMouseDown",function(T){var C=E.props.onMouseDown;if(Me(C)){var R=E.getMouseInfo(T);C(R,T)}}),Te(E,"handleMouseUp",function(T){var C=E.props.onMouseUp;if(Me(C)){var R=E.getMouseInfo(T);C(R,T)}}),Te(E,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),Te(E,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseDown(T.changedTouches[0])}),Te(E,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseUp(T.changedTouches[0])}),Te(E,"handleDoubleClick",function(T){var C=E.props.onDoubleClick;if(Me(C)){var R=E.getMouseInfo(T);C(R,T)}}),Te(E,"handleContextMenu",function(T){var C=E.props.onContextMenu;if(Me(C)){var R=E.getMouseInfo(T);C(R,T)}}),Te(E,"triggerSyncEvent",function(T){E.props.syncId!==void 0&&F0.emit(H0,E.props.syncId,T,E.eventEmitterSymbol)}),Te(E,"applySyncEvent",function(T){var C=E.props,R=C.layout,D=C.syncMethod,X=E.state.updateId,$=T.dataStartIndex,I=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)E.setState(re({dataStartIndex:$,dataEndIndex:I},y({props:E.props,dataStartIndex:$,dataEndIndex:I,updateId:X},E.state)));else if(T.activeTooltipIndex!==void 0){var q=T.chartX,U=T.chartY,V=T.activeTooltipIndex,G=E.state,Z=G.offset,K=G.tooltipTicks;if(!Z)return;if(typeof D=="function")V=D(K,T);else if(D==="value"){V=-1;for(var te=0;te<K.length;te++)if(K[te].value===T.activeLabel){V=te;break}}var H=re(re({},Z),{},{x:Z.left,y:Z.top}),B=Math.min(q,H.x+H.width),z=Math.min(U,H.y+H.height),J=K[V]&&K[V].value,ae=Nx(E.state,E.props.data,V),se=K[V]?{x:R==="horizontal"?K[V].coordinate:B,y:R==="horizontal"?z:K[V].coordinate}:kI;E.setState(re(re({},T),{},{activeLabel:J,activeCoordinate:se,activePayload:ae,activeTooltipIndex:V}))}else E.setState(T)}),Te(E,"renderCursor",function(T){var C,R=E.state,D=R.isTooltipActive,X=R.activeCoordinate,$=R.activePayload,I=R.offset,q=R.activeTooltipIndex,U=R.tooltipAxisBandSize,V=E.getTooltipEventType(),G=(C=T.props.active)!==null&&C!==void 0?C:D,Z=E.props.layout,K=T.key||"_recharts-cursor";return M.createElement(Kte,{key:K,activeCoordinate:X,activePayload:$,activeTooltipIndex:q,chartName:r,element:T,isActive:G,layout:Z,offset:I,tooltipAxisBandSize:U,tooltipEventType:V})}),Te(E,"renderPolarAxis",function(T,C,R){var D=en(T,"type.axisType"),X=en(E.state,"".concat(D,"Map")),$=T.type.defaultProps,I=$!==void 0?re(re({},$),T.props):T.props,q=X&&X[I["".concat(D,"Id")]];return N.cloneElement(T,re(re({},q),{},{className:qe(D,q.className),key:T.key||"".concat(C,"-").concat(R),ticks:ui(q,!0)}))}),Te(E,"renderPolarGrid",function(T){var C=T.props,R=C.radialLines,D=C.polarAngles,X=C.polarRadius,$=E.state,I=$.radiusAxisMap,q=$.angleAxisMap,U=ea(I),V=ea(q),G=V.cx,Z=V.cy,K=V.innerRadius,te=V.outerRadius;return N.cloneElement(T,{polarAngles:Array.isArray(D)?D:ui(V,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(X)?X:ui(U,!0).map(function(H){return H.coordinate}),cx:G,cy:Z,innerRadius:K,outerRadius:te,key:T.key||"polar-grid",radialLines:R})}),Te(E,"renderLegend",function(){var T=E.state.formattedGraphicalItems,C=E.props,R=C.children,D=C.width,X=C.height,$=E.props.margin||{},I=D-($.left||0)-($.right||0),q=b$({children:R,formattedGraphicalItems:T,legendWidth:I,legendContent:f});if(!q)return null;var U=q.item,V=BP(q,Gte);return N.cloneElement(U,re(re({},V),{},{chartWidth:D,chartHeight:X,margin:$,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),Te(E,"renderTooltip",function(){var T,C=E.props,R=C.children,D=C.accessibilityLayer,X=Nr(R,Rr);if(!X)return null;var $=E.state,I=$.isTooltipActive,q=$.activeCoordinate,U=$.activePayload,V=$.activeLabel,G=$.offset,Z=(T=X.props.active)!==null&&T!==void 0?T:I;return N.cloneElement(X,{viewBox:re(re({},G),{},{x:G.left,y:G.top}),active:Z,label:V,payload:Z?U:[],coordinate:q,accessibilityLayer:D})}),Te(E,"renderBrush",function(T){var C=E.props,R=C.margin,D=C.data,X=E.state,$=X.offset,I=X.dataStartIndex,q=X.dataEndIndex,U=X.updateId;return N.cloneElement(T,{key:T.key||"_recharts-brush",onChange:If(E.handleBrushChange,T.props.onChange),data:D,x:fe(T.props.x)?T.props.x:$.left,y:fe(T.props.y)?T.props.y:$.top+$.height+$.brushBottom-(R.bottom||0),width:fe(T.props.width)?T.props.width:$.width,startIndex:I,endIndex:q,updateId:"brush-".concat(U)})}),Te(E,"renderReferenceElement",function(T,C,R){if(!T)return null;var D=E,X=D.clipPathId,$=E.state,I=$.xAxisMap,q=$.yAxisMap,U=$.offset,V=T.type.defaultProps||{},G=T.props,Z=G.xAxisId,K=Z===void 0?V.xAxisId:Z,te=G.yAxisId,H=te===void 0?V.yAxisId:te;return N.cloneElement(T,{key:T.key||"".concat(C,"-").concat(R),xAxis:I[K],yAxis:q[H],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:X})}),Te(E,"renderActivePoints",function(T){var C=T.item,R=T.activePoint,D=T.basePoint,X=T.childIndex,$=T.isRange,I=[],q=C.props.key,U=C.item.type.defaultProps!==void 0?re(re({},C.item.type.defaultProps),C.item.props):C.item.props,V=U.activeDot,G=U.dataKey,Z=re(re({index:X,dataKey:G,cx:R.x,cy:R.y,r:4,fill:t1(C.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},Be(V,!1)),sd(V));return I.push(k.renderActiveDot(V,Z,"".concat(q,"-activePoint-").concat(X))),D?I.push(k.renderActiveDot(V,re(re({},Z),{},{cx:D.x,cy:D.y}),"".concat(q,"-basePoint-").concat(X))):$&&I.push(null),I}),Te(E,"renderGraphicChild",function(T,C,R){var D=E.filterFormatItem(T,C,R);if(!D)return null;var X=E.getTooltipEventType(),$=E.state,I=$.isTooltipActive,q=$.tooltipAxis,U=$.activeTooltipIndex,V=$.activeLabel,G=E.props.children,Z=Nr(G,Rr),K=D.props,te=K.points,H=K.isRange,B=K.baseLine,z=D.item.type.defaultProps!==void 0?re(re({},D.item.type.defaultProps),D.item.props):D.item.props,J=z.activeDot,ae=z.hide,se=z.activeBar,de=z.activeShape,Ce=!!(!ae&&I&&Z&&(J||se||de)),pe={};X!=="axis"&&Z&&Z.props.trigger==="click"?pe={onClick:If(E.handleItemMouseEnter,T.props.onClick)}:X!=="axis"&&(pe={onMouseLeave:If(E.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:If(E.handleItemMouseEnter,T.props.onMouseEnter)});var ne=N.cloneElement(T,re(re({},D.props),pe));function _e(ot){return typeof q.dataKey=="function"?q.dataKey(ot.payload):null}if(Ce)if(U>=0){var Ee,ie;if(q.dataKey&&!q.allowDuplicatedCategory){var Fe=typeof q.dataKey=="function"?_e:"payload.".concat(q.dataKey.toString());Ee=od(te,Fe,V),ie=H&&B&&od(B,Fe,V)}else Ee=te==null?void 0:te[U],ie=H&&B&&B[U];if(de||se){var Ne=T.props.activeIndex!==void 0?T.props.activeIndex:U;return[N.cloneElement(T,re(re(re({},D.props),pe),{},{activeIndex:Ne})),null,null]}if(!Le(Ee))return[ne].concat(ks(E.renderActivePoints({item:D,activePoint:Ee,basePoint:ie,childIndex:U,isRange:H})))}else{var ct,at=(ct=E.getItemByXY(E.state.activeCoordinate))!==null&&ct!==void 0?ct:{graphicalItem:ne},ft=at.graphicalItem,hr=ft.item,Et=hr===void 0?T:hr,Lr=ft.childIndex,er=re(re(re({},D.props),pe),{},{activeIndex:Lr});return[N.cloneElement(Et,er),null,null]}return H?[ne,null,null]:[ne,null]}),Te(E,"renderCustomized",function(T,C,R){return N.cloneElement(T,re(re({key:"recharts-customized-".concat(R)},E.props),E.state))}),Te(E,"renderMap",{CartesianGrid:{handler:Bf,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Bf},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Bf},YAxis:{handler:Bf},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((A=O.id)!==null&&A!==void 0?A:Yu("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=bR(E.triggeredAfterMouseMove,(j=O.throttleDelay)!==null&&j!==void 0?j:1e3/60),E.state={},E}return ore(k,b),rre(k,[{key:"componentDidMount",value:function(){var A,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,j=A.children,E=A.data,T=A.height,C=A.layout,R=Nr(j,Rr);if(R){var D=R.props.defaultIndex;if(!(typeof D!="number"||D<0||D>this.state.tooltipTicks.length-1)){var X=this.state.tooltipTicks[D]&&this.state.tooltipTicks[D].value,$=Nx(this.state,E,D,X),I=this.state.tooltipTicks[D].coordinate,q=(this.state.offset.top+T)/2,U=C==="horizontal",V=U?{x:I,y:q}:{y:I,x:q},G=this.state.formattedGraphicalItems.find(function(K){var te=K.item;return te.type.name==="Scatter"});G&&(V=re(re({},V),G.props.points[D].tooltipPosition),$=G.props.points[D].tooltipPayload);var Z={activeTooltipIndex:D,isTooltipActive:!0,activeLabel:X,activePayload:$,activeCoordinate:V};this.setState(Z),this.renderCursor(R),this.accessibilityManager.setIndex(D)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var E,T;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(A){yb([Nr(A.children,Rr)],[Nr(this.props.children,Rr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=Nr(this.props.children,Rr);if(A&&typeof A.props.shared=="boolean"){var j=A.props.shared?"axis":"item";return u.indexOf(j)>=0?j:a}return a}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var j=this.container,E=j.getBoundingClientRect(),T=pH(E),C={chartX:Math.round(A.pageX-T.left),chartY:Math.round(A.pageY-T.top)},R=E.width/j.offsetWidth||1,D=this.inRange(C.chartX,C.chartY,R);if(!D)return null;var X=this.state,$=X.xAxisMap,I=X.yAxisMap,q=this.getTooltipEventType(),U=UP(this.state,this.props.data,this.props.layout,D);if(q!=="axis"&&$&&I){var V=ea($).scale,G=ea(I).scale,Z=V&&V.invert?V.invert(C.chartX):null,K=G&&G.invert?G.invert(C.chartY):null;return re(re({},C),{},{xValue:Z,yValue:K},U)}return U?re(re({},C),U):null}},{key:"inRange",value:function(A,j){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,C=A/E,R=j/E;if(T==="horizontal"||T==="vertical"){var D=this.state.offset,X=C>=D.left&&C<=D.left+D.width&&R>=D.top&&R<=D.top+D.height;return X?{x:C,y:R}:null}var $=this.state,I=$.angleAxisMap,q=$.radiusAxisMap;if(I&&q){var U=ea(I);return aj({x:C,y:R},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,j=this.getTooltipEventType(),E=Nr(A,Rr),T={};E&&j==="axis"&&(E.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var C=sd(this.props,this.handleOuterEvent);return re(re({},C),T)}},{key:"addListener",value:function(){F0.on(H0,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){F0.removeListener(H0,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,j,E){for(var T=this.state.formattedGraphicalItems,C=0,R=T.length;C<R;C++){var D=T[C];if(D.item===A||D.props.key===A.key||j===fi(D.item.type)&&E===D.childIndex)return D}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,j=this.state.offset,E=j.left,T=j.top,C=j.height,R=j.width;return M.createElement("defs",null,M.createElement("clipPath",{id:A},M.createElement("rect",{x:E,y:T,height:C,width:R})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(j,E){var T=zP(E,2),C=T[0],R=T[1];return re(re({},j),{},Te({},C,R.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(j,E){var T=zP(E,2),C=T[0],R=T[1];return re(re({},j),{},Te({},C,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[A])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(A){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[A])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(A){var j=this.state,E=j.formattedGraphicalItems,T=j.activeItem;if(E&&E.length)for(var C=0,R=E.length;C<R;C++){var D=E[C],X=D.props,$=D.item,I=$.type.defaultProps!==void 0?re(re({},$.type.defaultProps),$.props):$.props,q=fi($.type);if(q==="Bar"){var U=(X.data||[]).find(function(K){return IJ(A,K)});if(U)return{graphicalItem:D,payload:U}}else if(q==="RadialBar"){var V=(X.data||[]).find(function(K){return aj(A,K)});if(V)return{graphicalItem:D,payload:V}}else if(Bh(D,T)||qh(D,T)||Mu(D,T)){var G=EQ({graphicalItem:D,activeTooltipItem:T,itemData:I.data}),Z=I.activeIndex===void 0?G:I.activeIndex;return{graphicalItem:re(re({},D),{},{childIndex:Z}),payload:Mu(D,T)?I.data[G]:D.props.data[G]}}}return null}},{key:"render",value:function(){var A=this;if(!gO(this))return null;var j=this.props,E=j.children,T=j.className,C=j.width,R=j.height,D=j.style,X=j.compact,$=j.title,I=j.desc,q=BP(j,Xte),U=Be(q,!1);if(X)return M.createElement(xP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement(bb,Xo({},U,{width:C,height:R,title:$,desc:I}),this.renderClipPath(),vO(E,this.renderMap)));if(this.props.accessibilityLayer){var V,G;U.tabIndex=(V=this.props.tabIndex)!==null&&V!==void 0?V:0,U.role=(G=this.props.role)!==null&&G!==void 0?G:"application",U.onKeyDown=function(K){A.accessibilityManager.keyboardEvent(K)},U.onFocus=function(){A.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return M.createElement(xP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},M.createElement("div",Xo({className:qe("recharts-wrapper",T),style:re({position:"relative",cursor:"default",width:C,height:R},D)},Z,{ref:function(te){A.container=te}}),M.createElement(bb,Xo({},U,{width:C,height:R,title:$,desc:I,style:dre}),this.renderClipPath(),vO(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(N.Component);Te(w,"displayName",r),Te(w,"defaultProps",re({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),Te(w,"getDerivedStateFromProps",function(b,k){var O=b.dataKey,A=b.data,j=b.children,E=b.width,T=b.height,C=b.layout,R=b.stackOffset,D=b.margin,X=k.dataStartIndex,$=k.dataEndIndex;if(k.updateId===void 0){var I=FP(b);return re(re(re({},I),{},{updateId:0},y(re(re({props:b},I),{},{updateId:0}),k)),{},{prevDataKey:O,prevData:A,prevWidth:E,prevHeight:T,prevLayout:C,prevStackOffset:R,prevMargin:D,prevChildren:j})}if(O!==k.prevDataKey||A!==k.prevData||E!==k.prevWidth||T!==k.prevHeight||C!==k.prevLayout||R!==k.prevStackOffset||!Qo(D,k.prevMargin)){var q=FP(b),U={chartX:k.chartX,chartY:k.chartY,isTooltipActive:k.isTooltipActive},V=re(re({},UP(k,A,C)),{},{updateId:k.updateId+1}),G=re(re(re({},q),U),V);return re(re(re({},G),y(re({props:b},G),k)),{},{prevDataKey:O,prevData:A,prevWidth:E,prevHeight:T,prevLayout:C,prevStackOffset:R,prevMargin:D,prevChildren:j})}if(!yb(j,k.prevChildren)){var Z,K,te,H,B=Nr(j,ps),z=B&&(Z=(K=B.props)===null||K===void 0?void 0:K.startIndex)!==null&&Z!==void 0?Z:X,J=B&&(te=(H=B.props)===null||H===void 0?void 0:H.endIndex)!==null&&te!==void 0?te:$,ae=z!==X||J!==$,se=!Le(A),de=se&&!ae?k.updateId:k.updateId+1;return re(re({updateId:de},y(re(re({props:b},k),{},{updateId:de,dataStartIndex:z,dataEndIndex:J}),k)),{},{prevChildren:j,dataStartIndex:z,dataEndIndex:J})}return null}),Te(w,"renderActiveDot",function(b,k,O){var A;return N.isValidElement(b)?A=N.cloneElement(b,k):Me(b)?A=b(k):A=M.createElement(n1,k),M.createElement(kt,{className:"recharts-active-dot",key:O},A)});var _=N.forwardRef(function(k,O){return M.createElement(w,Xo({},k,{ref:O}))});return _.displayName=w.displayName,_},_re=OI({chartName:"LineChart",GraphicalChild:nc,axisComponents:[{axisType:"xAxis",AxisComp:sa},{axisType:"yAxis",AxisComp:la}],formatAxisMap:W$}),Rx=OI({chartName:"BarChart",GraphicalChild:bi,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:sa},{axisType:"yAxis",AxisComp:la}],formatAxisMap:W$});const ah={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function ht(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.round(t))}function En(t){return`$${t.toFixed(4)}`}function na({label:t,value:e,sub:r,accent:n}){return v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[v.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),v.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&v.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}function Sre({tabs:t,active:e,onChange:r}){return v.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>v.jsx("button",{type:"button",onClick:()=>r(n),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px cursor-pointer ${e===n?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:n},n))})}function kre({records:t,totals:e}){const r=e.totalInputTokens+e.totalOutputTokens,n=new Map;for(const o of t){const u=o.squadId??"IO Orchestrator",c=n.get(u)??{name:u,inputTokens:0,outputTokens:0,calls:0,cost:0};c.inputTokens+=o.inputTokens,c.outputTokens+=o.outputTokens,c.calls+=1,c.cost+=o.estimatedCostUsd??0,n.set(u,c)}const i=Array.from(n.values()).sort((o,u)=>u.cost-o.cost),a=i.map(o=>({name:o.name.length>12?`${o.name.slice(0,12)}…`:o.name,cost:Number.parseFloat(o.cost.toFixed(4)),tokens:Math.round((o.inputTokens+o.outputTokens)/1e3)}));return v.jsxs("div",{className:"space-y-5",children:[v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[v.jsx(na,{label:"Total Tokens",value:ht(r),sub:`${ht(e.totalInputTokens)} in · ${ht(e.totalOutputTokens)} out`}),v.jsx(na,{label:"Total Cost",value:En(e.totalCostUsd),accent:!0}),v.jsx(na,{label:"API Calls",value:ht(e.callCount),sub:"across all entities"}),v.jsx(na,{label:"Avg Cost / Call",value:e.callCount>0?En(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[v.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?v.jsx(vd,{width:"100%",height:180,children:v.jsxs(Rx,{data:a,barCategoryGap:"35%",children:[v.jsx(qu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),v.jsx(sa,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),v.jsx(la,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),v.jsx(Rr,{contentStyle:ah,formatter:o=>[`$${o.toFixed(4)}`,"Cost"]}),v.jsx(bi,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),v.jsx("defs",{children:v.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),v.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):v.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[v.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?v.jsx(vd,{width:"100%",height:180,children:v.jsxs(Rx,{data:a,barCategoryGap:"35%",children:[v.jsx(qu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),v.jsx(sa,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),v.jsx(la,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),v.jsx(Rr,{contentStyle:ah,formatter:o=>[`${o}k`,"Tokens"]}),v.jsx(bi,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),v.jsx("defs",{children:v.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),v.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):v.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),v.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>v.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),v.jsxs("tbody",{children:[i.map(o=>v.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(o.inputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(o.outputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),v.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:En(o.cost)})]},o.name)),v.jsxs("tr",{className:"bg-[#1a1a1a]",children:[v.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:ht(e.totalInputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:ht(e.totalOutputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),v.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:En(e.totalCostUsd)})]})]})]})})]})}function Ere({records:t}){const[e,r]=N.useState([]),n=N.useMemo(()=>{const a=new Map;for(const o of t){if(!o.squadId)continue;const u=a.get(o.squadId)??{id:o.squadId,name:o.squadId,agents:new Map,inputTokens:0,outputTokens:0,calls:0,cost:0};u.inputTokens+=o.inputTokens,u.outputTokens+=o.outputTokens,u.calls+=1,u.cost+=o.estimatedCostUsd??0;const c=o.agentRole??"unknown",f=u.agents.get(c)??{role:c,model:o.model,inputTokens:0,outputTokens:0,calls:0,cost:0};f.inputTokens+=o.inputTokens,f.outputTokens+=o.outputTokens,f.calls+=1,f.cost+=o.estimatedCostUsd??0,u.agents.set(c,f),a.set(o.squadId,u)}return Array.from(a.values()).sort((o,u)=>u.cost-o.cost)},[t]),i=a=>r(o=>o.includes(a)?o.filter(u=>u!==a):[...o,a]);return n.length===0?v.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):v.jsx("div",{className:"space-y-2",children:n.map(a=>{const o=e.includes(a.id),u=Array.from(a.agents.values());return v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[v.jsxs("button",{type:"button",onClick:()=>i(a.id),className:"w-full flex items-center gap-3 px-4 py-3.5 hover:bg-white/[0.02] transition-colors text-left cursor-pointer",children:[v.jsx("div",{className:`transition-transform ${o?"rotate-90":""}`,children:v.jsx(Wx,{className:"w-3.5 h-3.5 text-zinc-600"})}),v.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:a.name}),v.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[v.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[v.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),ht(a.inputTokens)]}),v.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[v.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),ht(a.outputTokens)]}),v.jsxs("span",{className:"text-zinc-500",children:[v.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),a.calls]}),v.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:En(a.cost)})]})]}),o&&v.jsx("div",{className:"border-t border-white/[0.05]",children:v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(c=>v.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${c==="Cost"?"text-right":""}`,children:c},c))})}),v.jsx("tbody",{children:u.map(c=>v.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[v.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:c.role}),v.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:c.model}),v.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:ht(c.inputTokens)}),v.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:ht(c.outputTokens)}),v.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:c.calls}),v.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:En(c.cost)})]},c.role))})]})})]},a.id)})})}function Ore({records:t}){const e=N.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}`,o=n.get(a)??{name:i.agentRole??"orchestrator",squad:i.squadId??"IO",model:i.model,inputTokens:0,outputTokens:0,calls:0,cost:0};o.inputTokens+=i.inputTokens,o.outputTokens+=i.outputTokens,o.calls+=1,o.cost+=i.estimatedCostUsd??0,n.set(a,o)}return Array.from(n.values()).sort((i,a)=>a.cost-i.cost)},[t]),r=e.reduce((n,i)=>n+i.cost,0);return v.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>v.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),v.jsx("tbody",{children:e.map(n=>v.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),v.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),v.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(n.inputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(n.outputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),v.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:En(n.cost)}),v.jsx("td",{className:"px-4 py-3",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:v.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),v.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function Are({records:t}){const e=N.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=N.useMemo(()=>{const o=new Map;for(const u of e){const c=u.agentRole??"orchestrator",f=o.get(c)??{name:c,model:u.model,inputTokens:0,outputTokens:0,calls:0,cost:0};f.inputTokens+=u.inputTokens,f.outputTokens+=u.outputTokens,f.calls+=1,f.cost+=u.estimatedCostUsd??0,o.set(c,f)}return Array.from(o.values()).sort((u,c)=>c.cost-u.cost)},[e]),n=e.reduce((o,u)=>o+u.inputTokens,0),i=e.reduce((o,u)=>o+u.outputTokens,0),a=e.reduce((o,u)=>o+(u.estimatedCostUsd??0),0);return v.jsxs("div",{className:"space-y-5",children:[v.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[v.jsx(na,{label:"IO Tokens",value:ht(n+i),sub:`${ht(n)} in · ${ht(i)} out`}),v.jsx(na,{label:"IO Cost",value:En(a),accent:!0}),v.jsx(na,{label:"IO Calls",value:ht(e.length)}),v.jsx(na,{label:"IO Roles",value:String(r.length)})]}),v.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>v.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),v.jsx("tbody",{children:r.map(o=>v.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),v.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(o.inputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(o.outputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),v.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:En(o.cost)})]},o.name))})]})})]})}function Tre({records:t}){const e=N.useMemo(()=>{const n=new Map;for(const i of t){const a=i.timestamp.slice(0,10),o=n.get(a)??{date:a,inputTokens:0,outputTokens:0,cost:0,calls:0};o.inputTokens+=i.inputTokens,o.outputTokens+=i.outputTokens,o.cost+=i.estimatedCostUsd??0,o.calls+=1,n.set(a,o)}return Array.from(n.values()).sort((i,a)=>i.date.localeCompare(a.date))},[t]),r=e.map(n=>({...n,label:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),tokens:n.inputTokens+n.outputTokens}));return v.jsxs("div",{className:"space-y-5",children:[v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[v.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),r.length>0?v.jsx(vd,{width:"100%",height:220,children:v.jsxs(_re,{data:r,children:[v.jsx(qu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),v.jsx(sa,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),v.jsx(la,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:ht,width:44}),v.jsx(Rr,{contentStyle:ah,formatter:n=>[ht(n),"Tokens"]}),v.jsx(nc,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):v.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),v.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[v.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),r.length>0?v.jsx(vd,{width:"100%",height:180,children:v.jsxs(Rx,{data:r,barCategoryGap:"20%",children:[v.jsx(qu,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),v.jsx(sa,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),v.jsx(la,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:n=>`$${n.toFixed(2)}`,width:44}),v.jsx(Rr,{contentStyle:ah,formatter:n=>[En(n),"Cost"]}),v.jsx(bi,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),v.jsx("defs",{children:v.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),v.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):v.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),v.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:v.jsxs("table",{className:"w-full text-[11px] font-mono",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(n=>v.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),v.jsx("tbody",{children:e.map(n=>v.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[v.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.date}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(n.inputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:ht(n.outputTokens)}),v.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),v.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:En(n.cost)})]},n.date))})]})})]})}function jre(){const[t,e]=N.useState("summary"),[r,n]=N.useState(null),[i,a]=N.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(N.useEffect(()=>{const c=new Date;i==="7d"?c.setDate(c.getDate()-7):i==="14d"?c.setDate(c.getDate()-14):i==="30d"?c.setDate(c.getDate()-30):c.setDate(c.getDate()-1),Xe.get(`/usage?since=${c.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return v.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600 font-mono text-[11px]",children:"Loading..."});const u=i==="1d"?"Today":`Last ${i}`;return v.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[v.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),v.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:u})]}),v.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-white/[0.03] border border-white/[0.07]",children:["1d","7d","14d","30d"].map(c=>v.jsx("button",{type:"button",onClick:()=>a(c),className:`px-3 py-1.5 rounded-lg text-[11px] font-mono transition-colors cursor-pointer ${i===c?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400"}`,style:i===c?{background:"rgba(228,58,156,0.12)"}:void 0,children:c},c))})]}),v.jsx(Sre,{tabs:o,active:t,onChange:c=>e(c)}),t==="summary"&&v.jsx(kre,{records:r.records,totals:r.totals}),t==="by squad"&&v.jsx(Ere,{records:r.records}),t==="by agent"&&v.jsx(Ore,{records:r.records}),t==="io"&&v.jsx(Are,{records:r.records}),t==="timeline"&&v.jsx(Tre,{records:r.records})]})}const zl="shared";function AI(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:AI(e.children)}))}function Pre(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";for(const[o,u]of n.entries()){const c=o===n.length-1;a=a?`${a}/${u}`:u;let f=i.find(p=>p.path===a);f||(f={name:c&&r.name||u,path:a,isDir:!c,children:[]},i.push(f)),i=f.children}}return AI(e)}function TI(t,e){return e?t.flatMap(r=>{const n=r.name.toLowerCase().includes(e)||r.path.toLowerCase().includes(e);if(!r.isDir)return n?[r]:[];if(n)return[r];const i=TI(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function $x(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of $x(r.children))e.add(n)}return e}function Cre(t){const e=t.split("/").filter(Boolean),r=[];let n="";for(const i of e.slice(0,-1))n=n?`${n}/${i}`:i,r.push(n);return r}function jI({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o}){const u=r===t.path,c=t.isDir&&(n.has(t.path)||i.has(t.path)),f=12+e*16;return t.isDir?v.jsxs("div",{children:[v.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono text-zinc-400 transition-colors hover:bg-white/[0.04] hover:text-zinc-200",style:{paddingLeft:f},children:[v.jsx(Wx,{size:14,className:`shrink-0 transition-transform ${c?"rotate-90":""}`}),c?v.jsx(OL,{size:14,className:"shrink-0 text-zinc-500"}):v.jsx(TL,{size:14,className:"shrink-0 text-zinc-500"}),v.jsx("span",{className:"truncate",children:t.name})]}),c&&v.jsx("div",{children:t.children.map(p=>v.jsx(jI,{node:p,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o},p.path))})]}):v.jsxs("button",{type:"button",onClick:()=>o(t.path),className:`flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono transition-colors ${u?"border-l-2 border-[#E43A9C] bg-[#E43A9C]/10 text-[#E43A9C]":"text-zinc-500 hover:bg-white/[0.04] hover:text-zinc-300"}`,style:{paddingLeft:f},children:[v.jsx(kL,{size:14,className:"shrink-0"}),v.jsx("span",{className:"truncate",children:t.name})]})}function Nre(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState(""),[o,u]=N.useState(!1),[c,f]=N.useState(""),[p,h]=N.useState(""),[g,y]=N.useState(""),[w,_]=N.useState(new Set);N.useEffect(()=>{T()},[]);const b=N.useMemo(()=>Pre(t),[t]),k=g.trim().toLowerCase(),O=N.useMemo(()=>TI(b,k),[b,k]),A=N.useMemo(()=>{const I=k?$x(O):new Set;if(r)for(const q of Cre(r))I.add(q);return I},[O,k,r]),j=r?(function I(q){for(const U of q){if(U.path===r)return U;const V=I(U.children);if(V)return V}return null})(O):null,E=(j==null?void 0:j.name)??(r?r.split("/").pop()??"":"");N.useEffect(()=>{const I=$x(b);_(q=>{const U=new Set([...q].filter(V=>I.has(V)));if(U.size===0)for(const V of b)V.isDir&&U.add(V.path);return U})},[b]);async function T(){try{const I=await Xe.get(`/wiki/${zl}`);e(I.pages)}catch{e([])}}async function C(I){try{const q=await Xe.get(`/wiki/${zl}/${I}`);a(q.content),f(q.content),n(I),u(!1)}catch{et.error("Failed to load page")}}async function R(){if(r)try{await Xe.put(`/wiki/${zl}/${r}`,{content:c}),a(c),u(!1),et.success("Page saved")}catch{et.error("Failed to save page")}}async function D(){if(r)try{await Xe.delete(`/wiki/${zl}/${r}`),et.success("Page deleted"),n(null),a(""),f(""),u(!1),T()}catch{et.error("Failed to delete page")}}async function X(){let I=p.trim().replace(/^\/+|\/+$/g,"");if(I){I=I.replace(/\.md$/i,"");try{const q=I.split("/").slice(-1)[0]??I;await Xe.put(`/wiki/${zl}/${I}`,{content:`# ${q}
476
-
477
- `}),et.success("Page created"),h(""),await T(),await C(I)}catch{et.error("Failed to create page")}}}function $(I){_(q=>{const U=new Set(q);return U.has(I)?U.delete(I):U.add(I),U})}return v.jsxs("div",{className:"flex h-full",children:[v.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[v.jsx("div",{className:"border-b border-white/[0.07] p-3",children:v.jsxs("div",{className:"relative",children:[v.jsx(bC,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),v.jsx("input",{type:"text",value:g,onChange:I=>y(I.target.value),placeholder:"Search pages...",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] py-2 pl-8 pr-3 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"})]})}),v.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:O.length>0?O.map(I=>v.jsx(jI,{node:I,depth:0,selectedPage:r,expandedPaths:w,autoExpandedPaths:A,onToggle:$,onSelect:C},I.path)):v.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),v.jsx("div",{className:"border-t border-white/[0.07] p-3",children:v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{type:"text",value:p,onChange:I=>h(I.target.value),onKeyDown:I=>{I.key==="Enter"&&X(),I.key==="Escape"&&h("")},placeholder:"folder/new-page",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"}),v.jsxs(oa,{onClick:X,disabled:!p.trim(),className:"w-full justify-center px-3 py-2",children:[v.jsx(vC,{size:13})," Add Page"]})]})})]}),v.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:E}),v.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[o?v.jsxs(v.Fragment,{children:[v.jsxs(oa,{onClick:R,className:"px-3 py-1.5",children:[v.jsx(Vx,{size:12})," Save"]}),v.jsx(ci,{onClick:()=>{u(!1),f(i)},className:"px-3 py-1.5",children:"Cancel"})]}):v.jsxs(ci,{onClick:()=>{u(!0),f(i)},className:"px-3 py-1.5",children:[v.jsx(X0,{size:12})," Edit"]}),v.jsxs(ow,{onClick:D,className:"px-3 py-1.5",children:[v.jsx(Kx,{size:12})," Delete"]})]})]}),v.jsx("div",{className:"flex-1 overflow-y-auto bg-[#111111] p-6",children:o?v.jsx("textarea",{value:c,onChange:I=>f(I.target.value),className:"h-full min-h-[320px] w-full resize-none rounded-xl border border-white/[0.07] bg-[#181818] p-4 font-mono text-sm text-zinc-300 outline-none focus:border-[#E43A9C]/50"}):v.jsx("div",{className:"mx-auto max-w-4xl rounded-xl border border-white/[0.07] bg-[#181818] p-6",children:v.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:ze.parse(i)}})})})]}):v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsxs("div",{className:"text-center",children:[v.jsx(pC,{size:48,className:"mx-auto mb-3 text-zinc-800"}),v.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})})]})}function Rre({children:t}){const{session:e,supabase:r,loading:n}=gh();return n?v.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?v.jsx(v.Fragment,{children:t}):v.jsx(uq,{}):v.jsx(v.Fragment,{children:t})}function $re(){const{pathname:t}=Tn(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return v.jsxs(v.Fragment,{children:[v.jsx(I4,{children:v.jsxs(Jr,{element:v.jsx(oq,{}),children:[v.jsx(Jr,{index:!0,element:v.jsx(sq,{})}),v.jsx(Jr,{path:"squads",element:v.jsx(sE,{})}),v.jsx(Jr,{path:"squads/:name",element:v.jsx(sE,{})}),v.jsx(Jr,{path:"feed",element:v.jsx(lq,{})}),v.jsx(Jr,{path:"skills",element:v.jsx(_q,{})}),v.jsx(Jr,{path:"schedules",element:v.jsx(dq,{})}),v.jsx(Jr,{path:"wiki",element:v.jsx(Nre,{})}),v.jsx(Jr,{path:"settings",element:v.jsx(gq,{})}),v.jsx(Jr,{path:"usage",element:v.jsx(jre,{})}),v.jsx(Jr,{path:"*",element:v.jsx(N4,{to:"/",replace:!0})})]})}),!e&&v.jsx(lz,{})]})}function Ire(){return v.jsx(nq,{children:v.jsx(Rre,{children:v.jsx($re,{})})})}NM.createRoot(document.getElementById("root")).render(v.jsx(N.StrictMode,{children:v.jsxs(aD,{children:[v.jsx(Ire,{}),v.jsx(UD,{theme:"dark",position:"bottom-right"})]})}));
478
- //# sourceMappingURL=index-DsYVZ_Bi.js.map