heyio 3.1.12 → 3.1.14
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.
- package/dist/api/routes/wiki.js +15 -1
- package/dist/api/routes/wiki.js.map +1 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +30 -2
- package/dist/api/server.js.map +1 -1
- package/dist/copilot/tools.d.ts +2 -0
- package/dist/copilot/tools.d.ts.map +1 -1
- package/dist/copilot/tools.js +39 -3
- package/dist/copilot/tools.js.map +1 -1
- package/dist/squad/agent.d.ts +6 -1
- package/dist/squad/agent.d.ts.map +1 -1
- package/dist/squad/agent.js +6 -2
- package/dist/squad/agent.js.map +1 -1
- package/dist/squad/execution/meeting.d.ts +5 -0
- package/dist/squad/execution/meeting.d.ts.map +1 -1
- package/dist/squad/execution/meeting.js +6 -3
- package/dist/squad/execution/meeting.js.map +1 -1
- package/dist/squad/execution/runner.d.ts +5 -0
- package/dist/squad/execution/runner.d.ts.map +1 -1
- package/dist/squad/execution/runner.js +2 -2
- package/dist/squad/execution/runner.js.map +1 -1
- package/dist/squad/manager.d.ts +5 -1
- package/dist/squad/manager.d.ts.map +1 -1
- package/dist/squad/manager.js +2 -2
- package/dist/squad/manager.js.map +1 -1
- package/dist/squad/skill-parser.d.ts.map +1 -1
- package/dist/squad/skill-parser.js +8 -1
- package/dist/squad/skill-parser.js.map +1 -1
- package/dist/wiki/index.d.ts +1 -1
- package/dist/wiki/index.d.ts.map +1 -1
- package/dist/wiki/index.js +1 -1
- package/dist/wiki/index.js.map +1 -1
- package/dist/wiki/store.d.ts +12 -1
- package/dist/wiki/store.d.ts.map +1 -1
- package/dist/wiki/store.js +89 -4
- package/dist/wiki/store.js.map +1 -1
- package/node_modules/@io/shared/package.json +1 -1
- package/package.json +1 -1
- package/public/assets/index-CHPPgcPF.css +9 -0
- package/public/assets/index-CnXqSrcz.js +505 -0
- package/public/assets/{index-DbpsN9IE.js.map → index-CnXqSrcz.js.map} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-BLxFdut4.css +0 -9
- package/public/assets/index-DbpsN9IE.js +0 -505
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
var aL=Object.defineProperty;var oL=(t,e,r)=>e in t?aL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var bt=(t,e,r)=>oL(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 Zd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bg={exports:{}},uc={},xg={exports:{}},Ze={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var wk;function sL(){if(wk)return Ze;wk=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"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.iterator;function g(I){return I===null||typeof I!="object"?null:(I=f&&I[f]||I["@@iterator"],typeof I=="function"?I:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(I,$,V){this.props=I,this.context=$,this.refs=_,this.updater=V||v}b.prototype.isReactComponent={},b.prototype.setState=function(I,$){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,$,"setState")},b.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function S(){}S.prototype=b.prototype;function A(I,$,V){this.props=I,this.context=$,this.refs=_,this.updater=V||v}var O=A.prototype=new S;O.constructor=A,x(O,b.prototype),O.isPureReactComponent=!0;var j=Array.isArray,E=Object.prototype.hasOwnProperty,T={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function R(I,$,V){var oe,le={},ve=null,qe=null;if($!=null)for(oe in $.ref!==void 0&&(qe=$.ref),$.key!==void 0&&(ve=""+$.key),$)E.call($,oe)&&!N.hasOwnProperty(oe)&&(le[oe]=$[oe]);var xe=arguments.length-2;if(xe===1)le.children=V;else if(1<xe){for(var ae=Array(xe),Se=0;Se<xe;Se++)ae[Se]=arguments[Se+2];le.children=ae}if(I&&I.defaultProps)for(oe in xe=I.defaultProps,xe)le[oe]===void 0&&(le[oe]=xe[oe]);return{$$typeof:t,type:I,key:ve,ref:qe,props:le,_owner:T.current}}function M(I,$){return{$$typeof:t,type:I.type,key:$,ref:I.ref,props:I.props,_owner:I._owner}}function J(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function F(I){var $={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(V){return $[V]})}var B=/\/+/g;function K(I,$){return typeof I=="object"&&I!==null&&I.key!=null?F(""+I.key):$.toString(36)}function W(I,$,V,oe,le){var ve=typeof I;(ve==="undefined"||ve==="boolean")&&(I=null);var qe=!1;if(I===null)qe=!0;else switch(ve){case"string":case"number":qe=!0;break;case"object":switch(I.$$typeof){case t:case e:qe=!0}}if(qe)return qe=I,le=le(qe),I=oe===""?"."+K(qe,0):oe,j(le)?(V="",I!=null&&(V=I.replace(B,"$&/")+"/"),W(le,$,V,"",function(Se){return Se})):le!=null&&(J(le)&&(le=M(le,V+(!le.key||qe&&qe.key===le.key?"":(""+le.key).replace(B,"$&/")+"/")+I)),$.push(le)),1;if(qe=0,oe=oe===""?".":oe+":",j(I))for(var xe=0;xe<I.length;xe++){ve=I[xe];var ae=oe+K(ve,xe);qe+=W(ve,$,V,ae,le)}else if(ae=g(I),typeof ae=="function")for(I=ae.call(I),xe=0;!(ve=I.next()).done;)ve=ve.value,ae=oe+K(ve,xe++),qe+=W(ve,$,V,ae,le);else if(ve==="object")throw $=String(I),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return qe}function X(I,$,V){if(I==null)return I;var oe=[],le=0;return W(I,oe,"","",function(ve){return $.call(V,ve,le++)}),oe}function Y(I){if(I._status===-1){var $=I._result;$=$(),$.then(function(V){(I._status===0||I._status===-1)&&(I._status=1,I._result=V)},function(V){(I._status===0||I._status===-1)&&(I._status=2,I._result=V)}),I._status===-1&&(I._status=0,I._result=$)}if(I._status===1)return I._result.default;throw I._result}var te={current:null},H={transition:null},Q={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:H,ReactCurrentOwner:T};function U(){throw Error("act(...) is not supported in production builds of React.")}return Ze.Children={map:X,forEach:function(I,$,V){X(I,function(){$.apply(this,arguments)},V)},count:function(I){var $=0;return X(I,function(){$++}),$},toArray:function(I){return X(I,function($){return $})||[]},only:function(I){if(!J(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ze.Component=b,Ze.Fragment=r,Ze.Profiler=i,Ze.PureComponent=A,Ze.StrictMode=n,Ze.Suspense=u,Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,Ze.act=U,Ze.cloneElement=function(I,$,V){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var oe=x({},I.props),le=I.key,ve=I.ref,qe=I._owner;if($!=null){if($.ref!==void 0&&(ve=$.ref,qe=T.current),$.key!==void 0&&(le=""+$.key),I.type&&I.type.defaultProps)var xe=I.type.defaultProps;for(ae in $)E.call($,ae)&&!N.hasOwnProperty(ae)&&(oe[ae]=$[ae]===void 0&&xe!==void 0?xe[ae]:$[ae])}var ae=arguments.length-2;if(ae===1)oe.children=V;else if(1<ae){xe=Array(ae);for(var Se=0;Se<ae;Se++)xe[Se]=arguments[Se+2];oe.children=xe}return{$$typeof:t,type:I.type,key:le,ref:ve,props:oe,_owner:qe}},Ze.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:a,_context:I},I.Consumer=I},Ze.createElement=R,Ze.createFactory=function(I){var $=R.bind(null,I);return $.type=I,$},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(I){return{$$typeof:c,render:I}},Ze.isValidElement=J,Ze.lazy=function(I){return{$$typeof:p,_payload:{_status:-1,_result:I},_init:Y}},Ze.memo=function(I,$){return{$$typeof:d,type:I,compare:$===void 0?null:$}},Ze.startTransition=function(I){var $=H.transition;H.transition={};try{I()}finally{H.transition=$}},Ze.unstable_act=U,Ze.useCallback=function(I,$){return te.current.useCallback(I,$)},Ze.useContext=function(I){return te.current.useContext(I)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(I){return te.current.useDeferredValue(I)},Ze.useEffect=function(I,$){return te.current.useEffect(I,$)},Ze.useId=function(){return te.current.useId()},Ze.useImperativeHandle=function(I,$,V){return te.current.useImperativeHandle(I,$,V)},Ze.useInsertionEffect=function(I,$){return te.current.useInsertionEffect(I,$)},Ze.useLayoutEffect=function(I,$){return te.current.useLayoutEffect(I,$)},Ze.useMemo=function(I,$){return te.current.useMemo(I,$)},Ze.useReducer=function(I,$,V){return te.current.useReducer(I,$,V)},Ze.useRef=function(I){return te.current.useRef(I)},Ze.useState=function(I){return te.current.useState(I)},Ze.useSyncExternalStore=function(I,$,V){return te.current.useSyncExternalStore(I,$,V)},Ze.useTransition=function(){return te.current.useTransition()},Ze.version="18.3.1",Ze}var _k;function Ow(){return _k||(_k=1,xg.exports=sL()),xg.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 Sk;function lL(){if(Sk)return uc;Sk=1;var t=Ow(),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(c,u,d){var p,f={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)n.call(u,p)&&!a.hasOwnProperty(p)&&(f[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)f[p]===void 0&&(f[p]=u[p]);return{$$typeof:e,type:c,key:g,ref:v,props:f,_owner:i.current}}return uc.Fragment=r,uc.jsx=o,uc.jsxs=o,uc}var kk;function cL(){return kk||(kk=1,bg.exports=lL()),bg.exports}var y=cL(),P=Ow();const L=vt(P);var Qd={},wg={exports:{}},Vr={},_g={exports:{}},Sg={};/**
|
|
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 Ek;function uL(){return Ek||(Ek=1,(function(t){function e(H,Q){var U=H.length;H.push(Q);e:for(;0<U;){var I=U-1>>>1,$=H[I];if(0<i($,Q))H[I]=Q,H[U]=$,U=I;else break e}}function r(H){return H.length===0?null:H[0]}function n(H){if(H.length===0)return null;var Q=H[0],U=H.pop();if(U!==Q){H[0]=U;e:for(var I=0,$=H.length,V=$>>>1;I<V;){var oe=2*(I+1)-1,le=H[oe],ve=oe+1,qe=H[ve];if(0>i(le,U))ve<$&&0>i(qe,le)?(H[I]=qe,H[ve]=U,I=ve):(H[I]=le,H[oe]=U,I=oe);else if(ve<$&&0>i(qe,U))H[I]=qe,H[ve]=U,I=ve;else break e}}return Q}function i(H,Q){var U=H.sortIndex-Q.sortIndex;return U!==0?U:H.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],d=[],p=1,f=null,g=3,v=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(H){for(var Q=r(d);Q!==null;){if(Q.callback===null)n(d);else if(Q.startTime<=H)n(d),Q.sortIndex=Q.expirationTime,e(u,Q);else break;Q=r(d)}}function j(H){if(_=!1,O(H),!x)if(r(u)!==null)x=!0,Y(E);else{var Q=r(d);Q!==null&&te(j,Q.startTime-H)}}function E(H,Q){x=!1,_&&(_=!1,S(R),R=-1),v=!0;var U=g;try{for(O(Q),f=r(u);f!==null&&(!(f.expirationTime>Q)||H&&!F());){var I=f.callback;if(typeof I=="function"){f.callback=null,g=f.priorityLevel;var $=I(f.expirationTime<=Q);Q=t.unstable_now(),typeof $=="function"?f.callback=$:f===r(u)&&n(u),O(Q)}else n(u);f=r(u)}if(f!==null)var V=!0;else{var oe=r(d);oe!==null&&te(j,oe.startTime-Q),V=!1}return V}finally{f=null,g=U,v=!1}}var T=!1,N=null,R=-1,M=5,J=-1;function F(){return!(t.unstable_now()-J<M)}function B(){if(N!==null){var H=t.unstable_now();J=H;var Q=!0;try{Q=N(!0,H)}finally{Q?K():(T=!1,N=null)}}else T=!1}var K;if(typeof A=="function")K=function(){A(B)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,X=W.port2;W.port1.onmessage=B,K=function(){X.postMessage(null)}}else K=function(){b(B,0)};function Y(H){N=H,T||(T=!0,K())}function te(H,Q){R=b(function(){H(t.unstable_now())},Q)}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(H){H.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,Y(E))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(H){switch(g){case 1:case 2:case 3:var Q=3;break;default:Q=g}var U=g;g=Q;try{return H()}finally{g=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var U=g;g=H;try{return Q()}finally{g=U}},t.unstable_scheduleCallback=function(H,Q,U){var I=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?I+U:I):U=I,H){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=U+$,H={id:p++,callback:Q,priorityLevel:H,startTime:U,expirationTime:$,sortIndex:-1},U>I?(H.sortIndex=U,e(d,H),r(u)===null&&H===r(d)&&(_?(S(R),R=-1):_=!0,te(j,U-I))):(H.sortIndex=$,e(u,H),x||v||(x=!0,Y(E))),H},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(H){var Q=g;return function(){var U=g;g=Q;try{return H.apply(this,arguments)}finally{g=U}}}})(Sg)),Sg}var Ok;function dL(){return Ok||(Ok=1,_g.exports=uL()),_g.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 Ak;function fL(){if(Ak)return Vr;Ak=1;var t=Ow(),e=dL();function r(s){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+s,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);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 c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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={},f={};function g(s){return u.call(f,s)?!0:u.call(p,s)?!1:d.test(s)?f[s]=!0:(p[s]=!0,!1)}function v(s,l,h,m){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function x(s,l,h,m){if(l===null||typeof l>"u"||v(s,l,h,m))return!0;if(m)return!1;if(h!==null)switch(h.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,h,m,w,k,C){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=h,this.propertyName=s,this.type=l,this.sanitizeURL=k,this.removeEmptyString=C}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 S=/[\-:]([a-z])/g;function A(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(S,A);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(S,A);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(S,A);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 O(s,l,h,m){var w=b.hasOwnProperty(l)?b[l]:null;(w!==null?w.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,h,w,m)&&(h=null),m||w===null?g(l)&&(h===null?s.removeAttribute(l):s.setAttribute(l,""+h)):w.mustUseProperty?s[w.propertyName]=h===null?w.type===3?!1:"":h:(l=w.attributeName,m=w.attributeNamespace,h===null?s.removeAttribute(l):(w=w.type,h=w===3||w===4&&h===!0?"":""+h,m?s.setAttributeNS(m,l,h):s.setAttribute(l,h))))}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),F=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),H=Symbol.iterator;function Q(s){return s===null||typeof s!="object"?null:(s=H&&s[H]||s["@@iterator"],typeof s=="function"?s:null)}var U=Object.assign,I;function $(s){if(I===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);I=l&&l[1]||""}return`
|
|
34
|
+
`+I+s}var V=!1;function oe(s,l){if(!s||V)return"";V=!0;var h=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(re){var m=re}Reflect.construct(s,[],l)}else{try{l.call()}catch(re){m=re}s.call(l.prototype)}else{try{throw Error()}catch(re){m=re}s()}}catch(re){if(re&&m&&typeof re.stack=="string"){for(var w=re.stack.split(`
|
|
35
|
+
`),k=m.stack.split(`
|
|
36
|
+
`),C=w.length-1,z=k.length-1;1<=C&&0<=z&&w[C]!==k[z];)z--;for(;1<=C&&0<=z;C--,z--)if(w[C]!==k[z]){if(C!==1||z!==1)do if(C--,z--,0>z||w[C]!==k[z]){var q=`
|
|
37
|
+
`+w[C].replace(" at new "," at ");return s.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",s.displayName)),q}while(1<=C&&0<=z);break}}}finally{V=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?$(s):""}function le(s){switch(s.tag){case 5:return $(s.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return s=oe(s.type,!1),s;case 11:return s=oe(s.type.render,!1),s;case 1:return s=oe(s.type,!0),s;default:return""}}function ve(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 N:return"Fragment";case T:return"Portal";case M:return"Profiler";case R:return"StrictMode";case K:return"Suspense";case W:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case F:return(s.displayName||"Context")+".Consumer";case J:return(s._context.displayName||"Context")+".Provider";case B:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case X:return l=s.displayName||null,l!==null?l:ve(s.type)||"Memo";case Y:l=s._payload,s=s._init;try{return ve(s(l))}catch{}}return null}function qe(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 ve(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 xe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ae(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Se(s){var l=ae(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l),m=""+s[l];if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var w=h.get,k=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return w.call(this)},set:function(C){m=""+C,k.call(this,C)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(C){m=""+C},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Me(s){s._valueTracker||(s._valueTracker=Se(s))}function se(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var h=l.getValue(),m="";return s&&(m=ae(s)?s.checked?"true":"false":s.value),s=m,s!==h?(l.setValue(s),!0):!1}function tt(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 Fe(s,l){var h=l.checked;return U({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function kt(s,l){var h=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;h=xe(l.value!=null?l.value:h),s._wrapperState={initialChecked:m,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function wt(s,l){l=l.checked,l!=null&&O(s,"checked",l,!1)}function Et(s,l){wt(s,l);var h=xe(l.value),m=l.type;if(h!=null)m==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}l.hasOwnProperty("value")?Ut(s,l.type,h):l.hasOwnProperty("defaultValue")&&Ut(s,l.type,xe(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(s.defaultChecked=!!l.defaultChecked)}function Sr(s,l,h){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,h||l===s.value||(s.value=l),s.defaultValue=l}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function Ut(s,l,h){(l!=="number"||tt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var Rr=Array.isArray;function lr(s,l,h,m){if(s=s.options,l){l={};for(var w=0;w<h.length;w++)l["$"+h[w]]=!0;for(h=0;h<s.length;h++)w=l.hasOwnProperty("$"+s[h].value),s[h].selected!==w&&(s[h].selected=w),w&&m&&(s[h].defaultSelected=!0)}else{for(h=""+xe(h),l=null,w=0;w<s.length;w++){if(s[w].value===h){s[w].selected=!0,m&&(s[w].defaultSelected=!0);return}l!==null||s[w].disabled||(l=s[w])}l!==null&&(l.selected=!0)}}function _t(s,l){if(l.dangerouslySetInnerHTML!=null)throw Error(r(91));return U({},l,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function kr(s,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(r(92));if(Rr(h)){if(1<h.length)throw Error(r(93));h=h[0]}l=h}l==null&&(l=""),h=l}s._wrapperState={initialValue:xe(h)}}function Ir(s,l){var h=xe(l.value),m=xe(l.defaultValue);h!=null&&(h=""+h,h!==s.value&&(s.value=h),l.defaultValue==null&&s.defaultValue!==h&&(s.defaultValue=h)),m!=null&&(s.defaultValue=""+m)}function ni(s){var l=s.textContent;l===s._wrapperState.initialValue&&l!==""&&l!==null&&(s.value=l)}function Ur(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 ii(s,l){return s==null||s==="http://www.w3.org/1999/xhtml"?Ur(l):s==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var ai,aa=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,m,w){MSApp.execUnsafeLocalFunction(function(){return s(l,h,m,w)})}:s})(function(s,l){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=l;else{for(ai=ai||document.createElement("div"),ai.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=ai.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;l.firstChild;)s.appendChild(l.firstChild)}});function qr(s,l){if(l){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=l;return}}s.textContent=l}var oi={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},si=["Webkit","ms","Moz","O"];Object.keys(oi).forEach(function(s){si.forEach(function(l){l=l+s.charAt(0).toUpperCase()+s.substring(1),oi[l]=oi[s]})});function Go(s,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||oi.hasOwnProperty(s)&&oi[s]?(""+l).trim():l+"px"}function Xa(s,l){s=s.style;for(var h in l)if(l.hasOwnProperty(h)){var m=h.indexOf("--")===0,w=Go(h,l[h],m);h==="float"&&(h="cssFloat"),m?s.setProperty(h,w):s[h]=w}}var Ko=U({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 oa(s,l){if(l){if(Ko[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 Ya(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 Rn=null;function $r(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var sa=null,li=null,hn=null;function pn(s){if(s=Xl(s)){if(typeof sa!="function")throw Error(r(280));var l=s.stateNode;l&&(l=hd(l),sa(s.stateNode,s.type,l))}}function D(s){li?hn?hn.push(s):hn=[s]:li=s}function ne(){if(li){var s=li,l=hn;if(hn=li=null,pn(s),l)for(s=0;s<l.length;s++)pn(l[s])}}function de(s,l){return s(l)}function Re(){}var ht=!1;function Ke(s,l,h){if(ht)return s(l,h);ht=!0;try{return de(s,l,h)}finally{ht=!1,(li!==null||hn!==null)&&(Re(),ne())}}function ye(s,l){var h=s.stateNode;if(h===null)return null;var m=hd(h);if(m===null)return null;h=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(h&&typeof h!="function")throw Error(r(231,l,typeof h));return h}var we=!1;if(c)try{var je={};Object.defineProperty(je,"passive",{get:function(){we=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch{we=!1}function ut(s,l,h,m,w,k,C,z,q){var re=Array.prototype.slice.call(arguments,3);try{l.apply(h,re)}catch(ue){this.onError(ue)}}var gt=!1,cr=null,Ai=!1,Ja=null,zp={onError:function(s){gt=!0,cr=s}};function jl(s,l,h,m,w,k,C,z,q){gt=!1,cr=null,ut.apply(zp,arguments)}function Bp(s,l,h,m,w,k,C,z,q){if(jl.apply(this,arguments),gt){if(gt){var re=cr;gt=!1,cr=null}else throw Error(r(198));Ai||(Ai=!0,Ja=re)}}function Ti(s){var l=s,h=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(h=l.return),s=l.return;while(s)}return l.tag===3?h:null}function Wu(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 Cl(s){if(Ti(s)!==s)throw Error(r(188))}function Vo(s){var l=s.alternate;if(!l){if(l=Ti(s),l===null)throw Error(r(188));return l!==s?null:s}for(var h=s,m=l;;){var w=h.return;if(w===null)break;var k=w.alternate;if(k===null){if(m=w.return,m!==null){h=m;continue}break}if(w.child===k.child){for(k=w.child;k;){if(k===h)return Cl(w),s;if(k===m)return Cl(w),l;k=k.sibling}throw Error(r(188))}if(h.return!==m.return)h=w,m=k;else{for(var C=!1,z=w.child;z;){if(z===h){C=!0,h=w,m=k;break}if(z===m){C=!0,m=w,h=k;break}z=z.sibling}if(!C){for(z=k.child;z;){if(z===h){C=!0,h=k,m=w;break}if(z===m){C=!0,m=k,h=w;break}z=z.sibling}if(!C)throw Error(r(189))}}if(h.alternate!==m)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:l}function Gu(s){return s=Vo(s),s!==null?Ku(s):null}function Ku(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var l=Ku(s);if(l!==null)return l;s=s.sibling}return null}var Vu=e.unstable_scheduleCallback,In=e.unstable_cancelCallback,Xu=e.unstable_shouldYield,Yu=e.unstable_requestPaint,Lt=e.unstable_now,Up=e.unstable_getCurrentPriorityLevel,Nl=e.unstable_ImmediatePriority,Za=e.unstable_UserBlockingPriority,Xo=e.unstable_NormalPriority,he=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Xe=null,Qe=null;function Gt(s){if(Qe&&typeof Qe.onCommitFiberRoot=="function")try{Qe.onCommitFiberRoot(Xe,s,void 0,(s.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:Mr,ci=Math.log,Yo=Math.LN2;function Mr(s){return s>>>=0,s===0?32:31-(ci(s)/Yo|0)|0}var Lr=64,Qa=4194304;function la(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 eo(s,l){var h=s.pendingLanes;if(h===0)return 0;var m=0,w=s.suspendedLanes,k=s.pingedLanes,C=h&268435455;if(C!==0){var z=C&~w;z!==0?m=la(z):(k&=C,k!==0&&(m=la(k)))}else C=h&~w,C!==0?m=la(C):k!==0&&(m=la(k));if(m===0)return 0;if(l!==0&&l!==m&&(l&w)===0&&(w=m&-m,k=l&-l,w>=k||w===16&&(k&4194240)!==0))return l;if((m&4)!==0&&(m|=h&16),l=s.entangledLanes,l!==0)for(s=s.entanglements,l&=m;0<l;)h=31-Dt(l),w=1<<h,m|=s[h],l&=~w;return m}function qp(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 Fp(s,l){for(var h=s.suspendedLanes,m=s.pingedLanes,w=s.expirationTimes,k=s.pendingLanes;0<k;){var C=31-Dt(k),z=1<<C,q=w[C];q===-1?((z&h)===0||(z&m)!==0)&&(w[C]=qp(z,l)):q<=l&&(s.expiredLanes|=z),k&=~z}}function Pl(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Ju(){var s=Lr;return Lr<<=1,(Lr&4194240)===0&&(Lr=64),s}function ca(s){for(var l=[],h=0;31>h;h++)l.push(s);return l}function ua(s,l,h){s.pendingLanes|=l,l!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,l=31-Dt(l),s[l]=h}function mn(s,l){var h=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<h;){var w=31-Dt(h),k=1<<w;l[w]=0,m[w]=-1,s[w]=-1,h&=~k}}function Rl(s,l){var h=s.entangledLanes|=l;for(s=s.entanglements;h;){var m=31-Dt(h),w=1<<m;w&l|s[m]&l&&(s[m]|=l),h&=~w}}var lt=0;function Ge(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Il,Kt,yt,to,ui,ro=!1,da=[],me=null,Ee=null,He=null,rt=new Map,qt=new Map,ur=[],Hp="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 Zu(s,l){switch(s){case"focusin":case"focusout":me=null;break;case"dragenter":case"dragleave":Ee=null;break;case"mouseover":case"mouseout":He=null;break;case"pointerover":case"pointerout":rt.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":qt.delete(l.pointerId)}}function $l(s,l,h,m,w,k){return s===null||s.nativeEvent!==k?(s={blockedOn:l,domEventName:h,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},l!==null&&(l=Xl(l),l!==null&&Kt(l)),s):(s.eventSystemFlags|=m,l=s.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),s)}function TM(s,l,h,m,w){switch(l){case"focusin":return me=$l(me,s,l,h,m,w),!0;case"dragenter":return Ee=$l(Ee,s,l,h,m,w),!0;case"mouseover":return He=$l(He,s,l,h,m,w),!0;case"pointerover":var k=w.pointerId;return rt.set(k,$l(rt.get(k)||null,s,l,h,m,w)),!0;case"gotpointercapture":return k=w.pointerId,qt.set(k,$l(qt.get(k)||null,s,l,h,m,w)),!0}return!1}function a_(s){var l=no(s.target);if(l!==null){var h=Ti(l);if(h!==null){if(l=h.tag,l===13){if(l=Wu(h),l!==null){s.blockedOn=l,ui(s.priority,function(){yt(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Qu(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var h=Gp(s.domEventName,s.eventSystemFlags,l[0],s.nativeEvent);if(h===null){h=s.nativeEvent;var m=new h.constructor(h.type,h);Rn=m,h.target.dispatchEvent(m),Rn=null}else return l=Xl(h),l!==null&&Kt(l),s.blockedOn=h,!1;l.shift()}return!0}function o_(s,l,h){Qu(s)&&h.delete(l)}function jM(){ro=!1,me!==null&&Qu(me)&&(me=null),Ee!==null&&Qu(Ee)&&(Ee=null),He!==null&&Qu(He)&&(He=null),rt.forEach(o_),qt.forEach(o_)}function Ml(s,l){s.blockedOn===l&&(s.blockedOn=null,ro||(ro=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jM)))}function Ll(s){function l(w){return Ml(w,s)}if(0<da.length){Ml(da[0],s);for(var h=1;h<da.length;h++){var m=da[h];m.blockedOn===s&&(m.blockedOn=null)}}for(me!==null&&Ml(me,s),Ee!==null&&Ml(Ee,s),He!==null&&Ml(He,s),rt.forEach(l),qt.forEach(l),h=0;h<ur.length;h++)m=ur[h],m.blockedOn===s&&(m.blockedOn=null);for(;0<ur.length&&(h=ur[0],h.blockedOn===null);)a_(h),h.blockedOn===null&&ur.shift()}var Jo=j.ReactCurrentBatchConfig,ed=!0;function CM(s,l,h,m){var w=lt,k=Jo.transition;Jo.transition=null;try{lt=1,Wp(s,l,h,m)}finally{lt=w,Jo.transition=k}}function NM(s,l,h,m){var w=lt,k=Jo.transition;Jo.transition=null;try{lt=4,Wp(s,l,h,m)}finally{lt=w,Jo.transition=k}}function Wp(s,l,h,m){if(ed){var w=Gp(s,l,h,m);if(w===null)cm(s,l,m,td,h),Zu(s,m);else if(TM(w,s,l,h,m))m.stopPropagation();else if(Zu(s,m),l&4&&-1<Hp.indexOf(s)){for(;w!==null;){var k=Xl(w);if(k!==null&&Il(k),k=Gp(s,l,h,m),k===null&&cm(s,l,m,td,h),k===w)break;w=k}w!==null&&m.stopPropagation()}else cm(s,l,m,null,h)}}var td=null;function Gp(s,l,h,m){if(td=null,s=$r(m),s=no(s),s!==null)if(l=Ti(s),l===null)s=null;else if(h=l.tag,h===13){if(s=Wu(l),s!==null)return s;s=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null);return td=s,null}function s_(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(Up()){case Nl:return 1;case Za:return 4;case Xo:case he:return 16;case $e:return 536870912;default:return 16}default:return 16}}var fa=null,Kp=null,rd=null;function l_(){if(rd)return rd;var s,l=Kp,h=l.length,m,w="value"in fa?fa.value:fa.textContent,k=w.length;for(s=0;s<h&&l[s]===w[s];s++);var C=h-s;for(m=1;m<=C&&l[h-m]===w[k-m];m++);return rd=w.slice(s,1<m?1-m:void 0)}function nd(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 id(){return!0}function c_(){return!1}function Qr(s){function l(h,m,w,k,C){this._reactName=h,this._targetInst=w,this.type=m,this.nativeEvent=k,this.target=C,this.currentTarget=null;for(var z in s)s.hasOwnProperty(z)&&(h=s[z],this[z]=h?h(k):k[z]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?id:c_,this.isPropagationStopped=c_,this}return U(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=id)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=id)},persist:function(){},isPersistent:id}),l}var Zo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vp=Qr(Zo),Dl=U({},Zo,{view:0,detail:0}),PM=Qr(Dl),Xp,Yp,zl,ad=U({},Dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zp,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!==zl&&(zl&&s.type==="mousemove"?(Xp=s.screenX-zl.screenX,Yp=s.screenY-zl.screenY):Yp=Xp=0,zl=s),Xp)},movementY:function(s){return"movementY"in s?s.movementY:Yp}}),u_=Qr(ad),RM=U({},ad,{dataTransfer:0}),IM=Qr(RM),$M=U({},Dl,{relatedTarget:0}),Jp=Qr($M),MM=U({},Zo,{animationName:0,elapsedTime:0,pseudoElement:0}),LM=Qr(MM),DM=U({},Zo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),zM=Qr(DM),BM=U({},Zo,{data:0}),d_=Qr(BM),UM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qM={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"},FM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HM(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=FM[s])?!!l[s]:!1}function Zp(){return HM}var WM=U({},Dl,{key:function(s){if(s.key){var l=UM[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=nd(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?qM[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zp,charCode:function(s){return s.type==="keypress"?nd(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?nd(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),GM=Qr(WM),KM=U({},ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),f_=Qr(KM),VM=U({},Dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zp}),XM=Qr(VM),YM=U({},Zo,{propertyName:0,elapsedTime:0,pseudoElement:0}),JM=Qr(YM),ZM=U({},ad,{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}),QM=Qr(ZM),e3=[9,13,27,32],Qp=c&&"CompositionEvent"in window,Bl=null;c&&"documentMode"in document&&(Bl=document.documentMode);var t3=c&&"TextEvent"in window&&!Bl,h_=c&&(!Qp||Bl&&8<Bl&&11>=Bl),p_=" ",m_=!1;function g_(s,l){switch(s){case"keyup":return e3.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function y_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Qo=!1;function r3(s,l){switch(s){case"compositionend":return y_(l);case"keypress":return l.which!==32?null:(m_=!0,p_);case"textInput":return s=l.data,s===p_&&m_?null:s;default:return null}}function n3(s,l){if(Qo)return s==="compositionend"||!Qp&&g_(s,l)?(s=l_(),rd=Kp=fa=null,Qo=!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 h_&&l.locale!=="ko"?null:l.data;default:return null}}var i3={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 v_(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!i3[s.type]:l==="textarea"}function b_(s,l,h,m){D(m),l=ud(l,"onChange"),0<l.length&&(h=new Vp("onChange","change",null,h,m),s.push({event:h,listeners:l}))}var Ul=null,ql=null;function a3(s){L_(s,0)}function od(s){var l=is(s);if(se(l))return s}function o3(s,l){if(s==="change")return l}var x_=!1;if(c){var em;if(c){var tm="oninput"in document;if(!tm){var w_=document.createElement("div");w_.setAttribute("oninput","return;"),tm=typeof w_.oninput=="function"}em=tm}else em=!1;x_=em&&(!document.documentMode||9<document.documentMode)}function __(){Ul&&(Ul.detachEvent("onpropertychange",S_),ql=Ul=null)}function S_(s){if(s.propertyName==="value"&&od(ql)){var l=[];b_(l,ql,s,$r(s)),Ke(a3,l)}}function s3(s,l,h){s==="focusin"?(__(),Ul=l,ql=h,Ul.attachEvent("onpropertychange",S_)):s==="focusout"&&__()}function l3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return od(ql)}function c3(s,l){if(s==="click")return od(l)}function u3(s,l){if(s==="input"||s==="change")return od(l)}function d3(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var $n=typeof Object.is=="function"?Object.is:d3;function Fl(s,l){if($n(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var h=Object.keys(s),m=Object.keys(l);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var w=h[m];if(!u.call(l,w)||!$n(s[w],l[w]))return!1}return!0}function k_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function E_(s,l){var h=k_(s);s=0;for(var m;h;){if(h.nodeType===3){if(m=s+h.textContent.length,s<=l&&m>=l)return{node:h,offset:l-s};s=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=k_(h)}}function O_(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?O_(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function A_(){for(var s=window,l=tt();l instanceof s.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)s=l.contentWindow;else break;l=tt(s.document)}return l}function rm(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 f3(s){var l=A_(),h=s.focusedElem,m=s.selectionRange;if(l!==h&&h&&h.ownerDocument&&O_(h.ownerDocument.documentElement,h)){if(m!==null&&rm(h)){if(l=m.start,s=m.end,s===void 0&&(s=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(s,h.value.length);else if(s=(l=h.ownerDocument||document)&&l.defaultView||window,s.getSelection){s=s.getSelection();var w=h.textContent.length,k=Math.min(m.start,w);m=m.end===void 0?k:Math.min(m.end,w),!s.extend&&k>m&&(w=m,m=k,k=w),w=E_(h,k);var C=E_(h,m);w&&C&&(s.rangeCount!==1||s.anchorNode!==w.node||s.anchorOffset!==w.offset||s.focusNode!==C.node||s.focusOffset!==C.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),s.removeAllRanges(),k>m?(s.addRange(l),s.extend(C.node,C.offset)):(l.setEnd(C.node,C.offset),s.addRange(l)))}}for(l=[],s=h;s=s.parentNode;)s.nodeType===1&&l.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)s=l[h],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var h3=c&&"documentMode"in document&&11>=document.documentMode,es=null,nm=null,Hl=null,im=!1;function T_(s,l,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;im||es==null||es!==tt(m)||(m=es,"selectionStart"in m&&rm(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}),Hl&&Fl(Hl,m)||(Hl=m,m=ud(nm,"onSelect"),0<m.length&&(l=new Vp("onSelect","select",null,l,h),s.push({event:l,listeners:m}),l.target=es)))}function sd(s,l){var h={};return h[s.toLowerCase()]=l.toLowerCase(),h["Webkit"+s]="webkit"+l,h["Moz"+s]="moz"+l,h}var ts={animationend:sd("Animation","AnimationEnd"),animationiteration:sd("Animation","AnimationIteration"),animationstart:sd("Animation","AnimationStart"),transitionend:sd("Transition","TransitionEnd")},am={},j_={};c&&(j_=document.createElement("div").style,"AnimationEvent"in window||(delete ts.animationend.animation,delete ts.animationiteration.animation,delete ts.animationstart.animation),"TransitionEvent"in window||delete ts.transitionend.transition);function ld(s){if(am[s])return am[s];if(!ts[s])return s;var l=ts[s],h;for(h in l)if(l.hasOwnProperty(h)&&h in j_)return am[s]=l[h];return s}var C_=ld("animationend"),N_=ld("animationiteration"),P_=ld("animationstart"),R_=ld("transitionend"),I_=new Map,$_="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 ha(s,l){I_.set(s,l),a(l,[s])}for(var om=0;om<$_.length;om++){var sm=$_[om],p3=sm.toLowerCase(),m3=sm[0].toUpperCase()+sm.slice(1);ha(p3,"on"+m3)}ha(C_,"onAnimationEnd"),ha(N_,"onAnimationIteration"),ha(P_,"onAnimationStart"),ha("dblclick","onDoubleClick"),ha("focusin","onFocus"),ha("focusout","onBlur"),ha(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 Wl="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(" "),g3=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wl));function M_(s,l,h){var m=s.type||"unknown-event";s.currentTarget=h,Bp(m,l,void 0,s),s.currentTarget=null}function L_(s,l){l=(l&4)!==0;for(var h=0;h<s.length;h++){var m=s[h],w=m.event;m=m.listeners;e:{var k=void 0;if(l)for(var C=m.length-1;0<=C;C--){var z=m[C],q=z.instance,re=z.currentTarget;if(z=z.listener,q!==k&&w.isPropagationStopped())break e;M_(w,z,re),k=q}else for(C=0;C<m.length;C++){if(z=m[C],q=z.instance,re=z.currentTarget,z=z.listener,q!==k&&w.isPropagationStopped())break e;M_(w,z,re),k=q}}}if(Ai)throw s=Ja,Ai=!1,Ja=null,s}function Ct(s,l){var h=l[mm];h===void 0&&(h=l[mm]=new Set);var m=s+"__bubble";h.has(m)||(D_(l,s,2,!1),h.add(m))}function lm(s,l,h){var m=0;l&&(m|=4),D_(h,s,m,l)}var cd="_reactListening"+Math.random().toString(36).slice(2);function Gl(s){if(!s[cd]){s[cd]=!0,n.forEach(function(h){h!=="selectionchange"&&(g3.has(h)||lm(h,!1,s),lm(h,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[cd]||(l[cd]=!0,lm("selectionchange",!1,l))}}function D_(s,l,h,m){switch(s_(l)){case 1:var w=CM;break;case 4:w=NM;break;default:w=Wp}h=w.bind(null,l,h,s),w=void 0,!we||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),m?w!==void 0?s.addEventListener(l,h,{capture:!0,passive:w}):s.addEventListener(l,h,!0):w!==void 0?s.addEventListener(l,h,{passive:w}):s.addEventListener(l,h,!1)}function cm(s,l,h,m,w){var k=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var z=m.stateNode.containerInfo;if(z===w||z.nodeType===8&&z.parentNode===w)break;if(C===4)for(C=m.return;C!==null;){var q=C.tag;if((q===3||q===4)&&(q=C.stateNode.containerInfo,q===w||q.nodeType===8&&q.parentNode===w))return;C=C.return}for(;z!==null;){if(C=no(z),C===null)return;if(q=C.tag,q===5||q===6){m=k=C;continue e}z=z.parentNode}}m=m.return}Ke(function(){var re=k,ue=$r(h),fe=[];e:{var ce=I_.get(s);if(ce!==void 0){var _e=Vp,Ce=s;switch(s){case"keypress":if(nd(h)===0)break e;case"keydown":case"keyup":_e=GM;break;case"focusin":Ce="focus",_e=Jp;break;case"focusout":Ce="blur",_e=Jp;break;case"beforeblur":case"afterblur":_e=Jp;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=u_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=IM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=XM;break;case C_:case N_:case P_:_e=LM;break;case R_:_e=JM;break;case"scroll":_e=PM;break;case"wheel":_e=QM;break;case"copy":case"cut":case"paste":_e=zM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=f_}var Pe=(l&4)!==0,Vt=!Pe&&s==="scroll",Z=Pe?ce!==null?ce+"Capture":null:ce;Pe=[];for(var G=re,ee;G!==null;){ee=G;var pe=ee.stateNode;if(ee.tag===5&&pe!==null&&(ee=pe,Z!==null&&(pe=ye(G,Z),pe!=null&&Pe.push(Kl(G,pe,ee)))),Vt)break;G=G.return}0<Pe.length&&(ce=new _e(ce,Ce,null,h,ue),fe.push({event:ce,listeners:Pe}))}}if((l&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",_e=s==="mouseout"||s==="pointerout",ce&&h!==Rn&&(Ce=h.relatedTarget||h.fromElement)&&(no(Ce)||Ce[ji]))break e;if((_e||ce)&&(ce=ue.window===ue?ue:(ce=ue.ownerDocument)?ce.defaultView||ce.parentWindow:window,_e?(Ce=h.relatedTarget||h.toElement,_e=re,Ce=Ce?no(Ce):null,Ce!==null&&(Vt=Ti(Ce),Ce!==Vt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(_e=null,Ce=re),_e!==Ce)){if(Pe=u_,pe="onMouseLeave",Z="onMouseEnter",G="mouse",(s==="pointerout"||s==="pointerover")&&(Pe=f_,pe="onPointerLeave",Z="onPointerEnter",G="pointer"),Vt=_e==null?ce:is(_e),ee=Ce==null?ce:is(Ce),ce=new Pe(pe,G+"leave",_e,h,ue),ce.target=Vt,ce.relatedTarget=ee,pe=null,no(ue)===re&&(Pe=new Pe(Z,G+"enter",Ce,h,ue),Pe.target=ee,Pe.relatedTarget=Vt,pe=Pe),Vt=pe,_e&&Ce)t:{for(Pe=_e,Z=Ce,G=0,ee=Pe;ee;ee=rs(ee))G++;for(ee=0,pe=Z;pe;pe=rs(pe))ee++;for(;0<G-ee;)Pe=rs(Pe),G--;for(;0<ee-G;)Z=rs(Z),ee--;for(;G--;){if(Pe===Z||Z!==null&&Pe===Z.alternate)break t;Pe=rs(Pe),Z=rs(Z)}Pe=null}else Pe=null;_e!==null&&z_(fe,ce,_e,Pe,!1),Ce!==null&&Vt!==null&&z_(fe,Vt,Ce,Pe,!0)}}e:{if(ce=re?is(re):window,_e=ce.nodeName&&ce.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ce.type==="file")var Ie=o3;else if(v_(ce))if(x_)Ie=u3;else{Ie=l3;var Le=s3}else(_e=ce.nodeName)&&_e.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ie=c3);if(Ie&&(Ie=Ie(s,re))){b_(fe,Ie,h,ue);break e}Le&&Le(s,ce,re),s==="focusout"&&(Le=ce._wrapperState)&&Le.controlled&&ce.type==="number"&&Ut(ce,"number",ce.value)}switch(Le=re?is(re):window,s){case"focusin":(v_(Le)||Le.contentEditable==="true")&&(es=Le,nm=re,Hl=null);break;case"focusout":Hl=nm=es=null;break;case"mousedown":im=!0;break;case"contextmenu":case"mouseup":case"dragend":im=!1,T_(fe,h,ue);break;case"selectionchange":if(h3)break;case"keydown":case"keyup":T_(fe,h,ue)}var De;if(Qp)e:{switch(s){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Qo?g_(s,h)&&(We="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(We="onCompositionStart");We&&(h_&&h.locale!=="ko"&&(Qo||We!=="onCompositionStart"?We==="onCompositionEnd"&&Qo&&(De=l_()):(fa=ue,Kp="value"in fa?fa.value:fa.textContent,Qo=!0)),Le=ud(re,We),0<Le.length&&(We=new d_(We,s,null,h,ue),fe.push({event:We,listeners:Le}),De?We.data=De:(De=y_(h),De!==null&&(We.data=De)))),(De=t3?r3(s,h):n3(s,h))&&(re=ud(re,"onBeforeInput"),0<re.length&&(ue=new d_("onBeforeInput","beforeinput",null,h,ue),fe.push({event:ue,listeners:re}),ue.data=De))}L_(fe,l)})}function Kl(s,l,h){return{instance:s,listener:l,currentTarget:h}}function ud(s,l){for(var h=l+"Capture",m=[];s!==null;){var w=s,k=w.stateNode;w.tag===5&&k!==null&&(w=k,k=ye(s,h),k!=null&&m.unshift(Kl(s,k,w)),k=ye(s,l),k!=null&&m.push(Kl(s,k,w))),s=s.return}return m}function rs(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function z_(s,l,h,m,w){for(var k=l._reactName,C=[];h!==null&&h!==m;){var z=h,q=z.alternate,re=z.stateNode;if(q!==null&&q===m)break;z.tag===5&&re!==null&&(z=re,w?(q=ye(h,k),q!=null&&C.unshift(Kl(h,q,z))):w||(q=ye(h,k),q!=null&&C.push(Kl(h,q,z)))),h=h.return}C.length!==0&&s.push({event:l,listeners:C})}var y3=/\r\n?/g,v3=/\u0000|\uFFFD/g;function B_(s){return(typeof s=="string"?s:""+s).replace(y3,`
|
|
38
|
+
`).replace(v3,"")}function dd(s,l,h){if(l=B_(l),B_(s)!==l&&h)throw Error(r(425))}function fd(){}var um=null,dm=null;function fm(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 hm=typeof setTimeout=="function"?setTimeout:void 0,b3=typeof clearTimeout=="function"?clearTimeout:void 0,U_=typeof Promise=="function"?Promise:void 0,x3=typeof queueMicrotask=="function"?queueMicrotask:typeof U_<"u"?function(s){return U_.resolve(null).then(s).catch(w3)}:hm;function w3(s){setTimeout(function(){throw s})}function pm(s,l){var h=l,m=0;do{var w=h.nextSibling;if(s.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"){if(m===0){s.removeChild(w),Ll(l);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=w}while(h);Ll(l)}function pa(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 q_(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return s;l--}else h==="/$"&&l++}s=s.previousSibling}return null}var ns=Math.random().toString(36).slice(2),di="__reactFiber$"+ns,Vl="__reactProps$"+ns,ji="__reactContainer$"+ns,mm="__reactEvents$"+ns,_3="__reactListeners$"+ns,S3="__reactHandles$"+ns;function no(s){var l=s[di];if(l)return l;for(var h=s.parentNode;h;){if(l=h[ji]||h[di]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(s=q_(s);s!==null;){if(h=s[di])return h;s=q_(s)}return l}s=h,h=s.parentNode}return null}function Xl(s){return s=s[di]||s[ji],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function is(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function hd(s){return s[Vl]||null}var gm=[],as=-1;function ma(s){return{current:s}}function Nt(s){0>as||(s.current=gm[as],gm[as]=null,as--)}function Ot(s,l){as++,gm[as]=s.current,s.current=l}var ga={},Er=ma(ga),Fr=ma(!1),io=ga;function os(s,l){var h=s.type.contextTypes;if(!h)return ga;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var w={},k;for(k in h)w[k]=l[k];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=l,s.__reactInternalMemoizedMaskedChildContext=w),w}function Hr(s){return s=s.childContextTypes,s!=null}function pd(){Nt(Fr),Nt(Er)}function F_(s,l,h){if(Er.current!==ga)throw Error(r(168));Ot(Er,l),Ot(Fr,h)}function H_(s,l,h){var m=s.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var w in m)if(!(w in l))throw Error(r(108,qe(s)||"Unknown",w));return U({},h,m)}function md(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ga,io=Er.current,Ot(Er,s),Ot(Fr,Fr.current),!0}function W_(s,l,h){var m=s.stateNode;if(!m)throw Error(r(169));h?(s=H_(s,l,io),m.__reactInternalMemoizedMergedChildContext=s,Nt(Fr),Nt(Er),Ot(Er,s)):Nt(Fr),Ot(Fr,h)}var Ci=null,gd=!1,ym=!1;function G_(s){Ci===null?Ci=[s]:Ci.push(s)}function k3(s){gd=!0,G_(s)}function ya(){if(!ym&&Ci!==null){ym=!0;var s=0,l=lt;try{var h=Ci;for(lt=1;s<h.length;s++){var m=h[s];do m=m(!0);while(m!==null)}Ci=null,gd=!1}catch(w){throw Ci!==null&&(Ci=Ci.slice(s+1)),Vu(Nl,ya),w}finally{lt=l,ym=!1}}return null}var ss=[],ls=0,yd=null,vd=0,gn=[],yn=0,ao=null,Ni=1,Pi="";function oo(s,l){ss[ls++]=vd,ss[ls++]=yd,yd=s,vd=l}function K_(s,l,h){gn[yn++]=Ni,gn[yn++]=Pi,gn[yn++]=ao,ao=s;var m=Ni;s=Pi;var w=32-Dt(m)-1;m&=~(1<<w),h+=1;var k=32-Dt(l)+w;if(30<k){var C=w-w%5;k=(m&(1<<C)-1).toString(32),m>>=C,w-=C,Ni=1<<32-Dt(l)+w|h<<w|m,Pi=k+s}else Ni=1<<k|h<<w|m,Pi=s}function vm(s){s.return!==null&&(oo(s,1),K_(s,1,0))}function bm(s){for(;s===yd;)yd=ss[--ls],ss[ls]=null,vd=ss[--ls],ss[ls]=null;for(;s===ao;)ao=gn[--yn],gn[yn]=null,Pi=gn[--yn],gn[yn]=null,Ni=gn[--yn],gn[yn]=null}var en=null,tn=null,Rt=!1,Mn=null;function V_(s,l){var h=wn(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=s,l=s.deletions,l===null?(s.deletions=[h],s.flags|=16):l.push(h)}function X_(s,l){switch(s.tag){case 5:var h=s.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(s.stateNode=l,en=s,tn=pa(l.firstChild),!0):!1;case 6:return l=s.pendingProps===""||l.nodeType!==3?null:l,l!==null?(s.stateNode=l,en=s,tn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=ao!==null?{id:Ni,overflow:Pi}:null,s.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=wn(18,null,null,0),h.stateNode=l,h.return=s,s.child=h,en=s,tn=null,!0):!1;default:return!1}}function xm(s){return(s.mode&1)!==0&&(s.flags&128)===0}function wm(s){if(Rt){var l=tn;if(l){var h=l;if(!X_(s,l)){if(xm(s))throw Error(r(418));l=pa(h.nextSibling);var m=en;l&&X_(s,l)?V_(m,h):(s.flags=s.flags&-4097|2,Rt=!1,en=s)}}else{if(xm(s))throw Error(r(418));s.flags=s.flags&-4097|2,Rt=!1,en=s}}}function Y_(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;en=s}function bd(s){if(s!==en)return!1;if(!Rt)return Y_(s),Rt=!0,!1;var l;if((l=s.tag!==3)&&!(l=s.tag!==5)&&(l=s.type,l=l!=="head"&&l!=="body"&&!fm(s.type,s.memoizedProps)),l&&(l=tn)){if(xm(s))throw J_(),Error(r(418));for(;l;)V_(s,l),l=pa(l.nextSibling)}if(Y_(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 h=s.data;if(h==="/$"){if(l===0){tn=pa(s.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}s=s.nextSibling}tn=null}}else tn=en?pa(s.stateNode.nextSibling):null;return!0}function J_(){for(var s=tn;s;)s=pa(s.nextSibling)}function cs(){tn=en=null,Rt=!1}function _m(s){Mn===null?Mn=[s]:Mn.push(s)}var E3=j.ReactCurrentBatchConfig;function Yl(s,l,h){if(s=h.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(r(309));var m=h.stateNode}if(!m)throw Error(r(147,s));var w=m,k=""+s;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(C){var z=w.refs;C===null?delete z[k]:z[k]=C},l._stringRef=k,l)}if(typeof s!="string")throw Error(r(284));if(!h._owner)throw Error(r(290,s))}return s}function xd(s,l){throw s=Object.prototype.toString.call(l),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s))}function Z_(s){var l=s._init;return l(s._payload)}function Q_(s){function l(Z,G){if(s){var ee=Z.deletions;ee===null?(Z.deletions=[G],Z.flags|=16):ee.push(G)}}function h(Z,G){if(!s)return null;for(;G!==null;)l(Z,G),G=G.sibling;return null}function m(Z,G){for(Z=new Map;G!==null;)G.key!==null?Z.set(G.key,G):Z.set(G.index,G),G=G.sibling;return Z}function w(Z,G){return Z=Ea(Z,G),Z.index=0,Z.sibling=null,Z}function k(Z,G,ee){return Z.index=ee,s?(ee=Z.alternate,ee!==null?(ee=ee.index,ee<G?(Z.flags|=2,G):ee):(Z.flags|=2,G)):(Z.flags|=1048576,G)}function C(Z){return s&&Z.alternate===null&&(Z.flags|=2),Z}function z(Z,G,ee,pe){return G===null||G.tag!==6?(G=hg(ee,Z.mode,pe),G.return=Z,G):(G=w(G,ee),G.return=Z,G)}function q(Z,G,ee,pe){var Ie=ee.type;return Ie===N?ue(Z,G,ee.props.children,pe,ee.key):G!==null&&(G.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===Y&&Z_(Ie)===G.type)?(pe=w(G,ee.props),pe.ref=Yl(Z,G,ee),pe.return=Z,pe):(pe=Hd(ee.type,ee.key,ee.props,null,Z.mode,pe),pe.ref=Yl(Z,G,ee),pe.return=Z,pe)}function re(Z,G,ee,pe){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=pg(ee,Z.mode,pe),G.return=Z,G):(G=w(G,ee.children||[]),G.return=Z,G)}function ue(Z,G,ee,pe,Ie){return G===null||G.tag!==7?(G=mo(ee,Z.mode,pe,Ie),G.return=Z,G):(G=w(G,ee),G.return=Z,G)}function fe(Z,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number")return G=hg(""+G,Z.mode,ee),G.return=Z,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return ee=Hd(G.type,G.key,G.props,null,Z.mode,ee),ee.ref=Yl(Z,null,G),ee.return=Z,ee;case T:return G=pg(G,Z.mode,ee),G.return=Z,G;case Y:var pe=G._init;return fe(Z,pe(G._payload),ee)}if(Rr(G)||Q(G))return G=mo(G,Z.mode,ee,null),G.return=Z,G;xd(Z,G)}return null}function ce(Z,G,ee,pe){var Ie=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ie!==null?null:z(Z,G,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:return ee.key===Ie?q(Z,G,ee,pe):null;case T:return ee.key===Ie?re(Z,G,ee,pe):null;case Y:return Ie=ee._init,ce(Z,G,Ie(ee._payload),pe)}if(Rr(ee)||Q(ee))return Ie!==null?null:ue(Z,G,ee,pe,null);xd(Z,ee)}return null}function _e(Z,G,ee,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return Z=Z.get(ee)||null,z(G,Z,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case E:return Z=Z.get(pe.key===null?ee:pe.key)||null,q(G,Z,pe,Ie);case T:return Z=Z.get(pe.key===null?ee:pe.key)||null,re(G,Z,pe,Ie);case Y:var Le=pe._init;return _e(Z,G,ee,Le(pe._payload),Ie)}if(Rr(pe)||Q(pe))return Z=Z.get(ee)||null,ue(G,Z,pe,Ie,null);xd(G,pe)}return null}function Ce(Z,G,ee,pe){for(var Ie=null,Le=null,De=G,We=G=0,hr=null;De!==null&&We<ee.length;We++){De.index>We?(hr=De,De=null):hr=De.sibling;var dt=ce(Z,De,ee[We],pe);if(dt===null){De===null&&(De=hr);break}s&&De&&dt.alternate===null&&l(Z,De),G=k(dt,G,We),Le===null?Ie=dt:Le.sibling=dt,Le=dt,De=hr}if(We===ee.length)return h(Z,De),Rt&&oo(Z,We),Ie;if(De===null){for(;We<ee.length;We++)De=fe(Z,ee[We],pe),De!==null&&(G=k(De,G,We),Le===null?Ie=De:Le.sibling=De,Le=De);return Rt&&oo(Z,We),Ie}for(De=m(Z,De);We<ee.length;We++)hr=_e(De,Z,We,ee[We],pe),hr!==null&&(s&&hr.alternate!==null&&De.delete(hr.key===null?We:hr.key),G=k(hr,G,We),Le===null?Ie=hr:Le.sibling=hr,Le=hr);return s&&De.forEach(function(Oa){return l(Z,Oa)}),Rt&&oo(Z,We),Ie}function Pe(Z,G,ee,pe){var Ie=Q(ee);if(typeof Ie!="function")throw Error(r(150));if(ee=Ie.call(ee),ee==null)throw Error(r(151));for(var Le=Ie=null,De=G,We=G=0,hr=null,dt=ee.next();De!==null&&!dt.done;We++,dt=ee.next()){De.index>We?(hr=De,De=null):hr=De.sibling;var Oa=ce(Z,De,dt.value,pe);if(Oa===null){De===null&&(De=hr);break}s&&De&&Oa.alternate===null&&l(Z,De),G=k(Oa,G,We),Le===null?Ie=Oa:Le.sibling=Oa,Le=Oa,De=hr}if(dt.done)return h(Z,De),Rt&&oo(Z,We),Ie;if(De===null){for(;!dt.done;We++,dt=ee.next())dt=fe(Z,dt.value,pe),dt!==null&&(G=k(dt,G,We),Le===null?Ie=dt:Le.sibling=dt,Le=dt);return Rt&&oo(Z,We),Ie}for(De=m(Z,De);!dt.done;We++,dt=ee.next())dt=_e(De,Z,We,dt.value,pe),dt!==null&&(s&&dt.alternate!==null&&De.delete(dt.key===null?We:dt.key),G=k(dt,G,We),Le===null?Ie=dt:Le.sibling=dt,Le=dt);return s&&De.forEach(function(iL){return l(Z,iL)}),Rt&&oo(Z,We),Ie}function Vt(Z,G,ee,pe){if(typeof ee=="object"&&ee!==null&&ee.type===N&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:e:{for(var Ie=ee.key,Le=G;Le!==null;){if(Le.key===Ie){if(Ie=ee.type,Ie===N){if(Le.tag===7){h(Z,Le.sibling),G=w(Le,ee.props.children),G.return=Z,Z=G;break e}}else if(Le.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===Y&&Z_(Ie)===Le.type){h(Z,Le.sibling),G=w(Le,ee.props),G.ref=Yl(Z,Le,ee),G.return=Z,Z=G;break e}h(Z,Le);break}else l(Z,Le);Le=Le.sibling}ee.type===N?(G=mo(ee.props.children,Z.mode,pe,ee.key),G.return=Z,Z=G):(pe=Hd(ee.type,ee.key,ee.props,null,Z.mode,pe),pe.ref=Yl(Z,G,ee),pe.return=Z,Z=pe)}return C(Z);case T:e:{for(Le=ee.key;G!==null;){if(G.key===Le)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){h(Z,G.sibling),G=w(G,ee.children||[]),G.return=Z,Z=G;break e}else{h(Z,G);break}else l(Z,G);G=G.sibling}G=pg(ee,Z.mode,pe),G.return=Z,Z=G}return C(Z);case Y:return Le=ee._init,Vt(Z,G,Le(ee._payload),pe)}if(Rr(ee))return Ce(Z,G,ee,pe);if(Q(ee))return Pe(Z,G,ee,pe);xd(Z,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,G!==null&&G.tag===6?(h(Z,G.sibling),G=w(G,ee),G.return=Z,Z=G):(h(Z,G),G=hg(ee,Z.mode,pe),G.return=Z,Z=G),C(Z)):h(Z,G)}return Vt}var us=Q_(!0),eS=Q_(!1),wd=ma(null),_d=null,ds=null,Sm=null;function km(){Sm=ds=_d=null}function Em(s){var l=wd.current;Nt(wd),s._currentValue=l}function Om(s,l,h){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===h)break;s=s.return}}function fs(s,l){_d=s,Sm=ds=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&l)!==0&&(Wr=!0),s.firstContext=null)}function vn(s){var l=s._currentValue;if(Sm!==s)if(s={context:s,memoizedValue:l,next:null},ds===null){if(_d===null)throw Error(r(308));ds=s,_d.dependencies={lanes:0,firstContext:s}}else ds=ds.next=s;return l}var so=null;function Am(s){so===null?so=[s]:so.push(s)}function tS(s,l,h,m){var w=l.interleaved;return w===null?(h.next=h,Am(l)):(h.next=w.next,w.next=h),l.interleaved=h,Ri(s,m)}function Ri(s,l){s.lanes|=l;var h=s.alternate;for(h!==null&&(h.lanes|=l),h=s,s=s.return;s!==null;)s.childLanes|=l,h=s.alternate,h!==null&&(h.childLanes|=l),h=s,s=s.return;return h.tag===3?h.stateNode:null}var va=!1;function Tm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rS(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 Ii(s,l){return{eventTime:s,lane:l,tag:0,payload:null,callback:null,next:null}}function ba(s,l,h){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(ct&2)!==0){var w=m.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),m.pending=l,Ri(s,h)}return w=m.interleaved,w===null?(l.next=l,Am(m)):(l.next=w.next,w.next=l),m.interleaved=l,Ri(s,h)}function Sd(s,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var m=l.lanes;m&=s.pendingLanes,h|=m,l.lanes=h,Rl(s,h)}}function nS(s,l){var h=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var w=null,k=null;if(h=h.firstBaseUpdate,h!==null){do{var C={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};k===null?w=k=C:k=k.next=C,h=h.next}while(h!==null);k===null?w=k=l:k=k.next=l}else w=k=l;h={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:k,shared:m.shared,effects:m.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=l:s.next=l,h.lastBaseUpdate=l}function kd(s,l,h,m){var w=s.updateQueue;va=!1;var k=w.firstBaseUpdate,C=w.lastBaseUpdate,z=w.shared.pending;if(z!==null){w.shared.pending=null;var q=z,re=q.next;q.next=null,C===null?k=re:C.next=re,C=q;var ue=s.alternate;ue!==null&&(ue=ue.updateQueue,z=ue.lastBaseUpdate,z!==C&&(z===null?ue.firstBaseUpdate=re:z.next=re,ue.lastBaseUpdate=q))}if(k!==null){var fe=w.baseState;C=0,ue=re=q=null,z=k;do{var ce=z.lane,_e=z.eventTime;if((m&ce)===ce){ue!==null&&(ue=ue.next={eventTime:_e,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Ce=s,Pe=z;switch(ce=l,_e=h,Pe.tag){case 1:if(Ce=Pe.payload,typeof Ce=="function"){fe=Ce.call(_e,fe,ce);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Pe.payload,ce=typeof Ce=="function"?Ce.call(_e,fe,ce):Ce,ce==null)break e;fe=U({},fe,ce);break e;case 2:va=!0}}z.callback!==null&&z.lane!==0&&(s.flags|=64,ce=w.effects,ce===null?w.effects=[z]:ce.push(z))}else _e={eventTime:_e,lane:ce,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ue===null?(re=ue=_e,q=fe):ue=ue.next=_e,C|=ce;if(z=z.next,z===null){if(z=w.shared.pending,z===null)break;ce=z,z=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(ue===null&&(q=fe),w.baseState=q,w.firstBaseUpdate=re,w.lastBaseUpdate=ue,l=w.shared.interleaved,l!==null){w=l;do C|=w.lane,w=w.next;while(w!==l)}else k===null&&(w.shared.lanes=0);uo|=C,s.lanes=C,s.memoizedState=fe}}function iS(s,l,h){if(s=l.effects,l.effects=null,s!==null)for(l=0;l<s.length;l++){var m=s[l],w=m.callback;if(w!==null){if(m.callback=null,m=h,typeof w!="function")throw Error(r(191,w));w.call(m)}}}var Jl={},fi=ma(Jl),Zl=ma(Jl),Ql=ma(Jl);function lo(s){if(s===Jl)throw Error(r(174));return s}function jm(s,l){switch(Ot(Ql,l),Ot(Zl,s),Ot(fi,Jl),s=l.nodeType,s){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:ii(null,"");break;default:s=s===8?l.parentNode:l,l=s.namespaceURI||null,s=s.tagName,l=ii(l,s)}Nt(fi),Ot(fi,l)}function hs(){Nt(fi),Nt(Zl),Nt(Ql)}function aS(s){lo(Ql.current);var l=lo(fi.current),h=ii(l,s.type);l!==h&&(Ot(Zl,s),Ot(fi,h))}function Cm(s){Zl.current===s&&(Nt(fi),Nt(Zl))}var zt=ma(0);function Ed(s){for(var l=s;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.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 Nm=[];function Pm(){for(var s=0;s<Nm.length;s++)Nm[s]._workInProgressVersionPrimary=null;Nm.length=0}var Od=j.ReactCurrentDispatcher,Rm=j.ReactCurrentBatchConfig,co=0,Bt=null,tr=null,dr=null,Ad=!1,ec=!1,tc=0,O3=0;function Or(){throw Error(r(321))}function Im(s,l){if(l===null)return!1;for(var h=0;h<l.length&&h<s.length;h++)if(!$n(s[h],l[h]))return!1;return!0}function $m(s,l,h,m,w,k){if(co=k,Bt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Od.current=s===null||s.memoizedState===null?C3:N3,s=h(m,w),ec){k=0;do{if(ec=!1,tc=0,25<=k)throw Error(r(301));k+=1,dr=tr=null,l.updateQueue=null,Od.current=P3,s=h(m,w)}while(ec)}if(Od.current=Cd,l=tr!==null&&tr.next!==null,co=0,dr=tr=Bt=null,Ad=!1,l)throw Error(r(300));return s}function Mm(){var s=tc!==0;return tc=0,s}function hi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?Bt.memoizedState=dr=s:dr=dr.next=s,dr}function bn(){if(tr===null){var s=Bt.alternate;s=s!==null?s.memoizedState:null}else s=tr.next;var l=dr===null?Bt.memoizedState:dr.next;if(l!==null)dr=l,tr=s;else{if(s===null)throw Error(r(310));tr=s,s={memoizedState:tr.memoizedState,baseState:tr.baseState,baseQueue:tr.baseQueue,queue:tr.queue,next:null},dr===null?Bt.memoizedState=dr=s:dr=dr.next=s}return dr}function rc(s,l){return typeof l=="function"?l(s):l}function Lm(s){var l=bn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var m=tr,w=m.baseQueue,k=h.pending;if(k!==null){if(w!==null){var C=w.next;w.next=k.next,k.next=C}m.baseQueue=w=k,h.pending=null}if(w!==null){k=w.next,m=m.baseState;var z=C=null,q=null,re=k;do{var ue=re.lane;if((co&ue)===ue)q!==null&&(q=q.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),m=re.hasEagerState?re.eagerState:s(m,re.action);else{var fe={lane:ue,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};q===null?(z=q=fe,C=m):q=q.next=fe,Bt.lanes|=ue,uo|=ue}re=re.next}while(re!==null&&re!==k);q===null?C=m:q.next=z,$n(m,l.memoizedState)||(Wr=!0),l.memoizedState=m,l.baseState=C,l.baseQueue=q,h.lastRenderedState=m}if(s=h.interleaved,s!==null){w=s;do k=w.lane,Bt.lanes|=k,uo|=k,w=w.next;while(w!==s)}else w===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Dm(s){var l=bn(),h=l.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var m=h.dispatch,w=h.pending,k=l.memoizedState;if(w!==null){h.pending=null;var C=w=w.next;do k=s(k,C.action),C=C.next;while(C!==w);$n(k,l.memoizedState)||(Wr=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),h.lastRenderedState=k}return[k,m]}function oS(){}function sS(s,l){var h=Bt,m=bn(),w=l(),k=!$n(m.memoizedState,w);if(k&&(m.memoizedState=w,Wr=!0),m=m.queue,zm(uS.bind(null,h,m,s),[s]),m.getSnapshot!==l||k||dr!==null&&dr.memoizedState.tag&1){if(h.flags|=2048,nc(9,cS.bind(null,h,m,w,l),void 0,null),fr===null)throw Error(r(349));(co&30)!==0||lS(h,l,w)}return w}function lS(s,l,h){s.flags|=16384,s={getSnapshot:l,value:h},l=Bt.updateQueue,l===null?(l={lastEffect:null,stores:null},Bt.updateQueue=l,l.stores=[s]):(h=l.stores,h===null?l.stores=[s]:h.push(s))}function cS(s,l,h,m){l.value=h,l.getSnapshot=m,dS(l)&&fS(s)}function uS(s,l,h){return h(function(){dS(l)&&fS(s)})}function dS(s){var l=s.getSnapshot;s=s.value;try{var h=l();return!$n(s,h)}catch{return!0}}function fS(s){var l=Ri(s,1);l!==null&&Bn(l,s,1,-1)}function hS(s){var l=hi();return typeof s=="function"&&(s=s()),l.memoizedState=l.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:s},l.queue=s,s=s.dispatch=j3.bind(null,Bt,s),[l.memoizedState,s]}function nc(s,l,h,m){return s={tag:s,create:l,destroy:h,deps:m,next:null},l=Bt.updateQueue,l===null?(l={lastEffect:null,stores:null},Bt.updateQueue=l,l.lastEffect=s.next=s):(h=l.lastEffect,h===null?l.lastEffect=s.next=s:(m=h.next,h.next=s,s.next=m,l.lastEffect=s)),s}function pS(){return bn().memoizedState}function Td(s,l,h,m){var w=hi();Bt.flags|=s,w.memoizedState=nc(1|l,h,void 0,m===void 0?null:m)}function jd(s,l,h,m){var w=bn();m=m===void 0?null:m;var k=void 0;if(tr!==null){var C=tr.memoizedState;if(k=C.destroy,m!==null&&Im(m,C.deps)){w.memoizedState=nc(l,h,k,m);return}}Bt.flags|=s,w.memoizedState=nc(1|l,h,k,m)}function mS(s,l){return Td(8390656,8,s,l)}function zm(s,l){return jd(2048,8,s,l)}function gS(s,l){return jd(4,2,s,l)}function yS(s,l){return jd(4,4,s,l)}function vS(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 bS(s,l,h){return h=h!=null?h.concat([s]):null,jd(4,4,vS.bind(null,l,s),h)}function Bm(){}function xS(s,l){var h=bn();l=l===void 0?null:l;var m=h.memoizedState;return m!==null&&l!==null&&Im(l,m[1])?m[0]:(h.memoizedState=[s,l],s)}function wS(s,l){var h=bn();l=l===void 0?null:l;var m=h.memoizedState;return m!==null&&l!==null&&Im(l,m[1])?m[0]:(s=s(),h.memoizedState=[s,l],s)}function _S(s,l,h){return(co&21)===0?(s.baseState&&(s.baseState=!1,Wr=!0),s.memoizedState=h):($n(h,l)||(h=Ju(),Bt.lanes|=h,uo|=h,s.baseState=!0),l)}function A3(s,l){var h=lt;lt=h!==0&&4>h?h:4,s(!0);var m=Rm.transition;Rm.transition={};try{s(!1),l()}finally{lt=h,Rm.transition=m}}function SS(){return bn().memoizedState}function T3(s,l,h){var m=Sa(s);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},kS(s))ES(l,h);else if(h=tS(s,l,h,m),h!==null){var w=zr();Bn(h,s,m,w),OS(h,l,m)}}function j3(s,l,h){var m=Sa(s),w={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(kS(s))ES(l,w);else{var k=s.alternate;if(s.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var C=l.lastRenderedState,z=k(C,h);if(w.hasEagerState=!0,w.eagerState=z,$n(z,C)){var q=l.interleaved;q===null?(w.next=w,Am(l)):(w.next=q.next,q.next=w),l.interleaved=w;return}}catch{}finally{}h=tS(s,l,w,m),h!==null&&(w=zr(),Bn(h,s,m,w),OS(h,l,m))}}function kS(s){var l=s.alternate;return s===Bt||l!==null&&l===Bt}function ES(s,l){ec=Ad=!0;var h=s.pending;h===null?l.next=l:(l.next=h.next,h.next=l),s.pending=l}function OS(s,l,h){if((h&4194240)!==0){var m=l.lanes;m&=s.pendingLanes,h|=m,l.lanes=h,Rl(s,h)}}var Cd={readContext:vn,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useInsertionEffect:Or,useLayoutEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useMutableSource:Or,useSyncExternalStore:Or,useId:Or,unstable_isNewReconciler:!1},C3={readContext:vn,useCallback:function(s,l){return hi().memoizedState=[s,l===void 0?null:l],s},useContext:vn,useEffect:mS,useImperativeHandle:function(s,l,h){return h=h!=null?h.concat([s]):null,Td(4194308,4,vS.bind(null,l,s),h)},useLayoutEffect:function(s,l){return Td(4194308,4,s,l)},useInsertionEffect:function(s,l){return Td(4,2,s,l)},useMemo:function(s,l){var h=hi();return l=l===void 0?null:l,s=s(),h.memoizedState=[s,l],s},useReducer:function(s,l,h){var m=hi();return l=h!==void 0?h(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=T3.bind(null,Bt,s),[m.memoizedState,s]},useRef:function(s){var l=hi();return s={current:s},l.memoizedState=s},useState:hS,useDebugValue:Bm,useDeferredValue:function(s){return hi().memoizedState=s},useTransition:function(){var s=hS(!1),l=s[0];return s=A3.bind(null,s[1]),hi().memoizedState=s,[l,s]},useMutableSource:function(){},useSyncExternalStore:function(s,l,h){var m=Bt,w=hi();if(Rt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=l(),fr===null)throw Error(r(349));(co&30)!==0||lS(m,l,h)}w.memoizedState=h;var k={value:h,getSnapshot:l};return w.queue=k,mS(uS.bind(null,m,k,s),[s]),m.flags|=2048,nc(9,cS.bind(null,m,k,h,l),void 0,null),h},useId:function(){var s=hi(),l=fr.identifierPrefix;if(Rt){var h=Pi,m=Ni;h=(m&~(1<<32-Dt(m)-1)).toString(32)+h,l=":"+l+"R"+h,h=tc++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=O3++,l=":"+l+"r"+h.toString(32)+":";return s.memoizedState=l},unstable_isNewReconciler:!1},N3={readContext:vn,useCallback:xS,useContext:vn,useEffect:zm,useImperativeHandle:bS,useInsertionEffect:gS,useLayoutEffect:yS,useMemo:wS,useReducer:Lm,useRef:pS,useState:function(){return Lm(rc)},useDebugValue:Bm,useDeferredValue:function(s){var l=bn();return _S(l,tr.memoizedState,s)},useTransition:function(){var s=Lm(rc)[0],l=bn().memoizedState;return[s,l]},useMutableSource:oS,useSyncExternalStore:sS,useId:SS,unstable_isNewReconciler:!1},P3={readContext:vn,useCallback:xS,useContext:vn,useEffect:zm,useImperativeHandle:bS,useInsertionEffect:gS,useLayoutEffect:yS,useMemo:wS,useReducer:Dm,useRef:pS,useState:function(){return Dm(rc)},useDebugValue:Bm,useDeferredValue:function(s){var l=bn();return tr===null?l.memoizedState=s:_S(l,tr.memoizedState,s)},useTransition:function(){var s=Dm(rc)[0],l=bn().memoizedState;return[s,l]},useMutableSource:oS,useSyncExternalStore:sS,useId:SS,unstable_isNewReconciler:!1};function Ln(s,l){if(s&&s.defaultProps){l=U({},l),s=s.defaultProps;for(var h in s)l[h]===void 0&&(l[h]=s[h]);return l}return l}function Um(s,l,h,m){l=s.memoizedState,h=h(m,l),h=h==null?l:U({},l,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Nd={isMounted:function(s){return(s=s._reactInternals)?Ti(s)===s:!1},enqueueSetState:function(s,l,h){s=s._reactInternals;var m=zr(),w=Sa(s),k=Ii(m,w);k.payload=l,h!=null&&(k.callback=h),l=ba(s,k,w),l!==null&&(Bn(l,s,w,m),Sd(l,s,w))},enqueueReplaceState:function(s,l,h){s=s._reactInternals;var m=zr(),w=Sa(s),k=Ii(m,w);k.tag=1,k.payload=l,h!=null&&(k.callback=h),l=ba(s,k,w),l!==null&&(Bn(l,s,w,m),Sd(l,s,w))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var h=zr(),m=Sa(s),w=Ii(h,m);w.tag=2,l!=null&&(w.callback=l),l=ba(s,w,m),l!==null&&(Bn(l,s,m,h),Sd(l,s,m))}};function AS(s,l,h,m,w,k,C){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,k,C):l.prototype&&l.prototype.isPureReactComponent?!Fl(h,m)||!Fl(w,k):!0}function TS(s,l,h){var m=!1,w=ga,k=l.contextType;return typeof k=="object"&&k!==null?k=vn(k):(w=Hr(l)?io:Er.current,m=l.contextTypes,k=(m=m!=null)?os(s,w):ga),l=new l(h,k),s.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Nd,s.stateNode=l,l._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=w,s.__reactInternalMemoizedMaskedChildContext=k),l}function jS(s,l,h,m){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,m),l.state!==s&&Nd.enqueueReplaceState(l,l.state,null)}function qm(s,l,h,m){var w=s.stateNode;w.props=h,w.state=s.memoizedState,w.refs={},Tm(s);var k=l.contextType;typeof k=="object"&&k!==null?w.context=vn(k):(k=Hr(l)?io:Er.current,w.context=os(s,k)),w.state=s.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(Um(s,l,k,h),w.state=s.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&Nd.enqueueReplaceState(w,w.state,null),kd(s,h,w,m),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308)}function ps(s,l){try{var h="",m=l;do h+=le(m),m=m.return;while(m);var w=h}catch(k){w=`
|
|
39
|
+
Error generating stack: `+k.message+`
|
|
40
|
+
`+k.stack}return{value:s,source:l,stack:w,digest:null}}function Fm(s,l,h){return{value:s,source:null,stack:h??null,digest:l??null}}function Hm(s,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var R3=typeof WeakMap=="function"?WeakMap:Map;function CS(s,l,h){h=Ii(-1,h),h.tag=3,h.payload={element:null};var m=l.value;return h.callback=function(){Dd||(Dd=!0,ag=m),Hm(s,l)},h}function NS(s,l,h){h=Ii(-1,h),h.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;h.payload=function(){return m(w)},h.callback=function(){Hm(s,l)}}var k=s.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(h.callback=function(){Hm(s,l),typeof m!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})}),h}function PS(s,l,h){var m=s.pingCache;if(m===null){m=s.pingCache=new R3;var w=new Set;m.set(l,w)}else w=m.get(l),w===void 0&&(w=new Set,m.set(l,w));w.has(h)||(w.add(h),s=K3.bind(null,s,l,h),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 IS(s,l,h,m,w){return(s.mode&1)===0?(s===l?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Ii(-1,1),l.tag=2,ba(h,l,1))),h.lanes|=1),s):(s.flags|=65536,s.lanes=w,s)}var I3=j.ReactCurrentOwner,Wr=!1;function Dr(s,l,h,m){l.child=s===null?eS(l,null,h,m):us(l,s.child,h,m)}function $S(s,l,h,m,w){h=h.render;var k=l.ref;return fs(l,w),m=$m(s,l,h,m,k,w),h=Mm(),s!==null&&!Wr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~w,$i(s,l,w)):(Rt&&h&&vm(l),l.flags|=1,Dr(s,l,m,w),l.child)}function MS(s,l,h,m,w){if(s===null){var k=h.type;return typeof k=="function"&&!fg(k)&&k.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=k,LS(s,l,k,m,w)):(s=Hd(h.type,null,m,l,l.mode,w),s.ref=l.ref,s.return=l,l.child=s)}if(k=s.child,(s.lanes&w)===0){var C=k.memoizedProps;if(h=h.compare,h=h!==null?h:Fl,h(C,m)&&s.ref===l.ref)return $i(s,l,w)}return l.flags|=1,s=Ea(k,m),s.ref=l.ref,s.return=l,l.child=s}function LS(s,l,h,m,w){if(s!==null){var k=s.memoizedProps;if(Fl(k,m)&&s.ref===l.ref)if(Wr=!1,l.pendingProps=m=k,(s.lanes&w)!==0)(s.flags&131072)!==0&&(Wr=!0);else return l.lanes=s.lanes,$i(s,l,w)}return Wm(s,l,h,m,w)}function DS(s,l,h){var m=l.pendingProps,w=m.children,k=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(gs,rn),rn|=h;else{if((h&1073741824)===0)return s=k!==null?k.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:s,cachePool:null,transitions:null},l.updateQueue=null,Ot(gs,rn),rn|=s,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=k!==null?k.baseLanes:h,Ot(gs,rn),rn|=m}else k!==null?(m=k.baseLanes|h,l.memoizedState=null):m=h,Ot(gs,rn),rn|=m;return Dr(s,l,w,h),l.child}function zS(s,l){var h=l.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function Wm(s,l,h,m,w){var k=Hr(h)?io:Er.current;return k=os(l,k),fs(l,w),h=$m(s,l,h,m,k,w),m=Mm(),s!==null&&!Wr?(l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~w,$i(s,l,w)):(Rt&&m&&vm(l),l.flags|=1,Dr(s,l,h,w),l.child)}function BS(s,l,h,m,w){if(Hr(h)){var k=!0;md(l)}else k=!1;if(fs(l,w),l.stateNode===null)Rd(s,l),TS(l,h,m),qm(l,h,m,w),m=!0;else if(s===null){var C=l.stateNode,z=l.memoizedProps;C.props=z;var q=C.context,re=h.contextType;typeof re=="object"&&re!==null?re=vn(re):(re=Hr(h)?io:Er.current,re=os(l,re));var ue=h.getDerivedStateFromProps,fe=typeof ue=="function"||typeof C.getSnapshotBeforeUpdate=="function";fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(z!==m||q!==re)&&jS(l,C,m,re),va=!1;var ce=l.memoizedState;C.state=ce,kd(l,m,C,w),q=l.memoizedState,z!==m||ce!==q||Fr.current||va?(typeof ue=="function"&&(Um(l,h,ue,m),q=l.memoizedState),(z=va||AS(l,h,z,m,ce,q,re))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=q),C.props=m,C.state=q,C.context=re,m=z):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{C=l.stateNode,rS(s,l),z=l.memoizedProps,re=l.type===l.elementType?z:Ln(l.type,z),C.props=re,fe=l.pendingProps,ce=C.context,q=h.contextType,typeof q=="object"&&q!==null?q=vn(q):(q=Hr(h)?io:Er.current,q=os(l,q));var _e=h.getDerivedStateFromProps;(ue=typeof _e=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(z!==fe||ce!==q)&&jS(l,C,m,q),va=!1,ce=l.memoizedState,C.state=ce,kd(l,m,C,w);var Ce=l.memoizedState;z!==fe||ce!==Ce||Fr.current||va?(typeof _e=="function"&&(Um(l,h,_e,m),Ce=l.memoizedState),(re=va||AS(l,h,re,m,ce,Ce,q)||!1)?(ue||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(m,Ce,q),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(m,Ce,q)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||z===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=Ce),C.props=m,C.state=Ce,C.context=q,m=re):(typeof C.componentDidUpdate!="function"||z===s.memoizedProps&&ce===s.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||z===s.memoizedProps&&ce===s.memoizedState||(l.flags|=1024),m=!1)}return Gm(s,l,h,m,k,w)}function Gm(s,l,h,m,w,k){zS(s,l);var C=(l.flags&128)!==0;if(!m&&!C)return w&&W_(l,h,!1),$i(s,l,k);m=l.stateNode,I3.current=l;var z=C&&typeof h.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,s!==null&&C?(l.child=us(l,s.child,null,k),l.child=us(l,null,z,k)):Dr(s,l,z,k),l.memoizedState=m.state,w&&W_(l,h,!0),l.child}function US(s){var l=s.stateNode;l.pendingContext?F_(s,l.pendingContext,l.pendingContext!==l.context):l.context&&F_(s,l.context,!1),jm(s,l.containerInfo)}function qS(s,l,h,m,w){return cs(),_m(w),l.flags|=256,Dr(s,l,h,m),l.child}var Km={dehydrated:null,treeContext:null,retryLane:0};function Vm(s){return{baseLanes:s,cachePool:null,transitions:null}}function FS(s,l,h){var m=l.pendingProps,w=zt.current,k=!1,C=(l.flags&128)!==0,z;if((z=C)||(z=s!==null&&s.memoizedState===null?!1:(w&2)!==0),z?(k=!0,l.flags&=-129):(s===null||s.memoizedState!==null)&&(w|=1),Ot(zt,w&1),s===null)return wm(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):(C=m.children,s=m.fallback,k?(m=l.mode,k=l.child,C={mode:"hidden",children:C},(m&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=C):k=Wd(C,m,0,null),s=mo(s,m,h,null),k.return=l,s.return=l,k.sibling=s,l.child=k,l.child.memoizedState=Vm(h),l.memoizedState=Km,s):Xm(l,C));if(w=s.memoizedState,w!==null&&(z=w.dehydrated,z!==null))return $3(s,l,C,m,z,w,h);if(k){k=m.fallback,C=l.mode,w=s.child,z=w.sibling;var q={mode:"hidden",children:m.children};return(C&1)===0&&l.child!==w?(m=l.child,m.childLanes=0,m.pendingProps=q,l.deletions=null):(m=Ea(w,q),m.subtreeFlags=w.subtreeFlags&14680064),z!==null?k=Ea(z,k):(k=mo(k,C,h,null),k.flags|=2),k.return=l,m.return=l,m.sibling=k,l.child=m,m=k,k=l.child,C=s.child.memoizedState,C=C===null?Vm(h):{baseLanes:C.baseLanes|h,cachePool:null,transitions:C.transitions},k.memoizedState=C,k.childLanes=s.childLanes&~h,l.memoizedState=Km,m}return k=s.child,s=k.sibling,m=Ea(k,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=h),m.return=l,m.sibling=null,s!==null&&(h=l.deletions,h===null?(l.deletions=[s],l.flags|=16):h.push(s)),l.child=m,l.memoizedState=null,m}function Xm(s,l){return l=Wd({mode:"visible",children:l},s.mode,0,null),l.return=s,s.child=l}function Pd(s,l,h,m){return m!==null&&_m(m),us(l,s.child,null,h),s=Xm(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function $3(s,l,h,m,w,k,C){if(h)return l.flags&256?(l.flags&=-257,m=Fm(Error(r(422))),Pd(s,l,C,m)):l.memoizedState!==null?(l.child=s.child,l.flags|=128,null):(k=m.fallback,w=l.mode,m=Wd({mode:"visible",children:m.children},w,0,null),k=mo(k,w,C,null),k.flags|=2,m.return=l,k.return=l,m.sibling=k,l.child=m,(l.mode&1)!==0&&us(l,s.child,null,C),l.child.memoizedState=Vm(C),l.memoizedState=Km,k);if((l.mode&1)===0)return Pd(s,l,C,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var z=m.dgst;return m=z,k=Error(r(419)),m=Fm(k,m,void 0),Pd(s,l,C,m)}if(z=(C&s.childLanes)!==0,Wr||z){if(m=fr,m!==null){switch(C&-C){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|C))!==0?0:w,w!==0&&w!==k.retryLane&&(k.retryLane=w,Ri(s,w),Bn(m,s,w,-1))}return dg(),m=Fm(Error(r(421))),Pd(s,l,C,m)}return w.data==="$?"?(l.flags|=128,l.child=s.child,l=V3.bind(null,s),w._reactRetry=l,null):(s=k.treeContext,tn=pa(w.nextSibling),en=l,Rt=!0,Mn=null,s!==null&&(gn[yn++]=Ni,gn[yn++]=Pi,gn[yn++]=ao,Ni=s.id,Pi=s.overflow,ao=l),l=Xm(l,m.children),l.flags|=4096,l)}function HS(s,l,h){s.lanes|=l;var m=s.alternate;m!==null&&(m.lanes|=l),Om(s.return,l,h)}function Ym(s,l,h,m,w){var k=s.memoizedState;k===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:w}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=h,k.tailMode=w)}function WS(s,l,h){var m=l.pendingProps,w=m.revealOrder,k=m.tail;if(Dr(s,l,m.children,h),m=zt.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,h,l);else if(s.tag===19)HS(s,h,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(Ot(zt,m),(l.mode&1)===0)l.memoizedState=null;else switch(w){case"forwards":for(h=l.child,w=null;h!==null;)s=h.alternate,s!==null&&Ed(s)===null&&(w=h),h=h.sibling;h=w,h===null?(w=l.child,l.child=null):(w=h.sibling,h.sibling=null),Ym(l,!1,w,h,k);break;case"backwards":for(h=null,w=l.child,l.child=null;w!==null;){if(s=w.alternate,s!==null&&Ed(s)===null){l.child=w;break}s=w.sibling,w.sibling=h,h=w,w=s}Ym(l,!0,h,null,k);break;case"together":Ym(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Rd(s,l){(l.mode&1)===0&&s!==null&&(s.alternate=null,l.alternate=null,l.flags|=2)}function $i(s,l,h){if(s!==null&&(l.dependencies=s.dependencies),uo|=l.lanes,(h&l.childLanes)===0)return null;if(s!==null&&l.child!==s.child)throw Error(r(153));if(l.child!==null){for(s=l.child,h=Ea(s,s.pendingProps),l.child=h,h.return=l;s.sibling!==null;)s=s.sibling,h=h.sibling=Ea(s,s.pendingProps),h.return=l;h.sibling=null}return l.child}function M3(s,l,h){switch(l.tag){case 3:US(l),cs();break;case 5:aS(l);break;case 1:Hr(l.type)&&md(l);break;case 4:jm(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,w=l.memoizedProps.value;Ot(wd,m._currentValue),m._currentValue=w;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(Ot(zt,zt.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?FS(s,l,h):(Ot(zt,zt.current&1),s=$i(s,l,h),s!==null?s.sibling:null);Ot(zt,zt.current&1);break;case 19:if(m=(h&l.childLanes)!==0,(s.flags&128)!==0){if(m)return WS(s,l,h);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Ot(zt,zt.current),m)break;return null;case 22:case 23:return l.lanes=0,DS(s,l,h)}return $i(s,l,h)}var GS,Jm,KS,VS;GS=function(s,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Jm=function(){},KS=function(s,l,h,m){var w=s.memoizedProps;if(w!==m){s=l.stateNode,lo(fi.current);var k=null;switch(h){case"input":w=Fe(s,w),m=Fe(s,m),k=[];break;case"select":w=U({},w,{value:void 0}),m=U({},m,{value:void 0}),k=[];break;case"textarea":w=_t(s,w),m=_t(s,m),k=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=fd)}oa(h,m);var C;h=null;for(re in w)if(!m.hasOwnProperty(re)&&w.hasOwnProperty(re)&&w[re]!=null)if(re==="style"){var z=w[re];for(C in z)z.hasOwnProperty(C)&&(h||(h={}),h[C]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(i.hasOwnProperty(re)?k||(k=[]):(k=k||[]).push(re,null));for(re in m){var q=m[re];if(z=w!=null?w[re]:void 0,m.hasOwnProperty(re)&&q!==z&&(q!=null||z!=null))if(re==="style")if(z){for(C in z)!z.hasOwnProperty(C)||q&&q.hasOwnProperty(C)||(h||(h={}),h[C]="");for(C in q)q.hasOwnProperty(C)&&z[C]!==q[C]&&(h||(h={}),h[C]=q[C])}else h||(k||(k=[]),k.push(re,h)),h=q;else re==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,z=z?z.__html:void 0,q!=null&&z!==q&&(k=k||[]).push(re,q)):re==="children"?typeof q!="string"&&typeof q!="number"||(k=k||[]).push(re,""+q):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(i.hasOwnProperty(re)?(q!=null&&re==="onScroll"&&Ct("scroll",s),k||z===q||(k=[])):(k=k||[]).push(re,q))}h&&(k=k||[]).push("style",h);var re=k;(l.updateQueue=re)&&(l.flags|=4)}},VS=function(s,l,h,m){h!==m&&(l.flags|=4)};function ic(s,l){if(!Rt)switch(s.tailMode){case"hidden":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Ar(s){var l=s.alternate!==null&&s.alternate.child===s.child,h=0,m=0;if(l)for(var w=s.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=m,s.childLanes=h,l}function L3(s,l,h){var m=l.pendingProps;switch(bm(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ar(l),null;case 1:return Hr(l.type)&&pd(),Ar(l),null;case 3:return m=l.stateNode,hs(),Nt(Fr),Nt(Er),Pm(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(bd(l)?l.flags|=4:s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Mn!==null&&(lg(Mn),Mn=null))),Jm(s,l),Ar(l),null;case 5:Cm(l);var w=lo(Ql.current);if(h=l.type,s!==null&&l.stateNode!=null)KS(s,l,h,m,w),s.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(r(166));return Ar(l),null}if(s=lo(fi.current),bd(l)){m=l.stateNode,h=l.type;var k=l.memoizedProps;switch(m[di]=l,m[Vl]=k,s=(l.mode&1)!==0,h){case"dialog":Ct("cancel",m),Ct("close",m);break;case"iframe":case"object":case"embed":Ct("load",m);break;case"video":case"audio":for(w=0;w<Wl.length;w++)Ct(Wl[w],m);break;case"source":Ct("error",m);break;case"img":case"image":case"link":Ct("error",m),Ct("load",m);break;case"details":Ct("toggle",m);break;case"input":kt(m,k),Ct("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!k.multiple},Ct("invalid",m);break;case"textarea":kr(m,k),Ct("invalid",m)}oa(h,k),w=null;for(var C in k)if(k.hasOwnProperty(C)){var z=k[C];C==="children"?typeof z=="string"?m.textContent!==z&&(k.suppressHydrationWarning!==!0&&dd(m.textContent,z,s),w=["children",z]):typeof z=="number"&&m.textContent!==""+z&&(k.suppressHydrationWarning!==!0&&dd(m.textContent,z,s),w=["children",""+z]):i.hasOwnProperty(C)&&z!=null&&C==="onScroll"&&Ct("scroll",m)}switch(h){case"input":Me(m),Sr(m,k,!0);break;case"textarea":Me(m),ni(m);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(m.onclick=fd)}m=w,l.updateQueue=m,m!==null&&(l.flags|=4)}else{C=w.nodeType===9?w:w.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ur(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=C.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=C.createElement(h,{is:m.is}):(s=C.createElement(h),h==="select"&&(C=s,m.multiple?C.multiple=!0:m.size&&(C.size=m.size))):s=C.createElementNS(s,h),s[di]=l,s[Vl]=m,GS(s,l,!1,!1),l.stateNode=s;e:{switch(C=Ya(h,m),h){case"dialog":Ct("cancel",s),Ct("close",s),w=m;break;case"iframe":case"object":case"embed":Ct("load",s),w=m;break;case"video":case"audio":for(w=0;w<Wl.length;w++)Ct(Wl[w],s);w=m;break;case"source":Ct("error",s),w=m;break;case"img":case"image":case"link":Ct("error",s),Ct("load",s),w=m;break;case"details":Ct("toggle",s),w=m;break;case"input":kt(s,m),w=Fe(s,m),Ct("invalid",s);break;case"option":w=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},w=U({},m,{value:void 0}),Ct("invalid",s);break;case"textarea":kr(s,m),w=_t(s,m),Ct("invalid",s);break;default:w=m}oa(h,w),z=w;for(k in z)if(z.hasOwnProperty(k)){var q=z[k];k==="style"?Xa(s,q):k==="dangerouslySetInnerHTML"?(q=q?q.__html:void 0,q!=null&&aa(s,q)):k==="children"?typeof q=="string"?(h!=="textarea"||q!=="")&&qr(s,q):typeof q=="number"&&qr(s,""+q):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(i.hasOwnProperty(k)?q!=null&&k==="onScroll"&&Ct("scroll",s):q!=null&&O(s,k,q,C))}switch(h){case"input":Me(s),Sr(s,m,!1);break;case"textarea":Me(s),ni(s);break;case"option":m.value!=null&&s.setAttribute("value",""+xe(m.value));break;case"select":s.multiple=!!m.multiple,k=m.value,k!=null?lr(s,!!m.multiple,k,!1):m.defaultValue!=null&&lr(s,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(s.onclick=fd)}switch(h){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 Ar(l),null;case 6:if(s&&l.stateNode!=null)VS(s,l,s.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(r(166));if(h=lo(Ql.current),lo(fi.current),bd(l)){if(m=l.stateNode,h=l.memoizedProps,m[di]=l,(k=m.nodeValue!==h)&&(s=en,s!==null))switch(s.tag){case 3:dd(m.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&dd(m.nodeValue,h,(s.mode&1)!==0)}k&&(l.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[di]=l,l.stateNode=m}return Ar(l),null;case 13:if(Nt(zt),m=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Rt&&tn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)J_(),cs(),l.flags|=98560,k=!1;else if(k=bd(l),m!==null&&m.dehydrated!==null){if(s===null){if(!k)throw Error(r(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[di]=l}else cs(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Ar(l),k=!1}else Mn!==null&&(lg(Mn),Mn=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(s===null||(zt.current&1)!==0?rr===0&&(rr=3):dg())),l.updateQueue!==null&&(l.flags|=4),Ar(l),null);case 4:return hs(),Jm(s,l),s===null&&Gl(l.stateNode.containerInfo),Ar(l),null;case 10:return Em(l.type._context),Ar(l),null;case 17:return Hr(l.type)&&pd(),Ar(l),null;case 19:if(Nt(zt),k=l.memoizedState,k===null)return Ar(l),null;if(m=(l.flags&128)!==0,C=k.rendering,C===null)if(m)ic(k,!1);else{if(rr!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(C=Ed(s),C!==null){for(l.flags|=128,ic(k,!1),m=C.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=h,h=l.child;h!==null;)k=h,s=m,k.flags&=14680066,C=k.alternate,C===null?(k.childLanes=0,k.lanes=s,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=C.childLanes,k.lanes=C.lanes,k.child=C.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=C.memoizedProps,k.memoizedState=C.memoizedState,k.updateQueue=C.updateQueue,k.type=C.type,s=C.dependencies,k.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return Ot(zt,zt.current&1|2),l.child}s=s.sibling}k.tail!==null&&Lt()>ys&&(l.flags|=128,m=!0,ic(k,!1),l.lanes=4194304)}else{if(!m)if(s=Ed(C),s!==null){if(l.flags|=128,m=!0,h=s.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),ic(k,!0),k.tail===null&&k.tailMode==="hidden"&&!C.alternate&&!Rt)return Ar(l),null}else 2*Lt()-k.renderingStartTime>ys&&h!==1073741824&&(l.flags|=128,m=!0,ic(k,!1),l.lanes=4194304);k.isBackwards?(C.sibling=l.child,l.child=C):(h=k.last,h!==null?h.sibling=C:l.child=C,k.last=C)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=Lt(),l.sibling=null,h=zt.current,Ot(zt,m?h&1|2:h&1),l):(Ar(l),null);case 22:case 23:return ug(),m=l.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(rn&1073741824)!==0&&(Ar(l),l.subtreeFlags&6&&(l.flags|=8192)):Ar(l),null;case 24:return null;case 25:return null}throw Error(r(156,l.tag))}function D3(s,l){switch(bm(l),l.tag){case 1:return Hr(l.type)&&pd(),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return hs(),Nt(Fr),Nt(Er),Pm(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 5:return Cm(l),null;case 13:if(Nt(zt),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(r(340));cs()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return Nt(zt),null;case 4:return hs(),null;case 10:return Em(l.type._context),null;case 22:case 23:return ug(),null;case 24:return null;default:return null}}var Id=!1,Tr=!1,z3=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function ms(s,l){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){Ft(s,l,m)}else h.current=null}function Zm(s,l,h){try{h()}catch(m){Ft(s,l,m)}}var XS=!1;function B3(s,l){if(um=ed,s=A_(),rm(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var w=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{h.nodeType,k.nodeType}catch{h=null;break e}var C=0,z=-1,q=-1,re=0,ue=0,fe=s,ce=null;t:for(;;){for(var _e;fe!==h||w!==0&&fe.nodeType!==3||(z=C+w),fe!==k||m!==0&&fe.nodeType!==3||(q=C+m),fe.nodeType===3&&(C+=fe.nodeValue.length),(_e=fe.firstChild)!==null;)ce=fe,fe=_e;for(;;){if(fe===s)break t;if(ce===h&&++re===w&&(z=C),ce===k&&++ue===m&&(q=C),(_e=fe.nextSibling)!==null)break;fe=ce,ce=fe.parentNode}fe=_e}h=z===-1||q===-1?null:{start:z,end:q}}else h=null}h=h||{start:0,end:0}}else h=null;for(dm={focusedElem:s,selectionRange:h},ed=!1,Oe=l;Oe!==null;)if(l=Oe,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Oe=s;else for(;Oe!==null;){l=Oe;try{var Ce=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var Pe=Ce.memoizedProps,Vt=Ce.memoizedState,Z=l.stateNode,G=Z.getSnapshotBeforeUpdate(l.elementType===l.type?Pe:Ln(l.type,Pe),Vt);Z.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var ee=l.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(pe){Ft(l,l.return,pe)}if(s=l.sibling,s!==null){s.return=l.return,Oe=s;break}Oe=l.return}return Ce=XS,XS=!1,Ce}function ac(s,l,h){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&s)===s){var k=w.destroy;w.destroy=void 0,k!==void 0&&Zm(l,h,k)}w=w.next}while(w!==m)}}function $d(s,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&s)===s){var m=h.create;h.destroy=m()}h=h.next}while(h!==l)}}function Qm(s){var l=s.ref;if(l!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof l=="function"?l(s):l.current=s}}function YS(s){var l=s.alternate;l!==null&&(s.alternate=null,YS(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&(delete l[di],delete l[Vl],delete l[mm],delete l[_3],delete l[S3])),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 JS(s){return s.tag===5||s.tag===3||s.tag===4}function ZS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||JS(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 eg(s,l,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(s,l):h.insertBefore(s,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(s,h)):(l=h,l.appendChild(s)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=fd));else if(m!==4&&(s=s.child,s!==null))for(eg(s,l,h),s=s.sibling;s!==null;)eg(s,l,h),s=s.sibling}function tg(s,l,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,l?h.insertBefore(s,l):h.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(tg(s,l,h),s=s.sibling;s!==null;)tg(s,l,h),s=s.sibling}var yr=null,Dn=!1;function xa(s,l,h){for(h=h.child;h!==null;)QS(s,l,h),h=h.sibling}function QS(s,l,h){if(Qe&&typeof Qe.onCommitFiberUnmount=="function")try{Qe.onCommitFiberUnmount(Xe,h)}catch{}switch(h.tag){case 5:Tr||ms(h,l);case 6:var m=yr,w=Dn;yr=null,xa(s,l,h),yr=m,Dn=w,yr!==null&&(Dn?(s=yr,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):yr.removeChild(h.stateNode));break;case 18:yr!==null&&(Dn?(s=yr,h=h.stateNode,s.nodeType===8?pm(s.parentNode,h):s.nodeType===1&&pm(s,h),Ll(s)):pm(yr,h.stateNode));break;case 4:m=yr,w=Dn,yr=h.stateNode.containerInfo,Dn=!0,xa(s,l,h),yr=m,Dn=w;break;case 0:case 11:case 14:case 15:if(!Tr&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var k=w,C=k.destroy;k=k.tag,C!==void 0&&((k&2)!==0||(k&4)!==0)&&Zm(h,l,C),w=w.next}while(w!==m)}xa(s,l,h);break;case 1:if(!Tr&&(ms(h,l),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(z){Ft(h,l,z)}xa(s,l,h);break;case 21:xa(s,l,h);break;case 22:h.mode&1?(Tr=(m=Tr)||h.memoizedState!==null,xa(s,l,h),Tr=m):xa(s,l,h);break;default:xa(s,l,h)}}function ek(s){var l=s.updateQueue;if(l!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new z3),l.forEach(function(m){var w=X3.bind(null,s,m);h.has(m)||(h.add(m),m.then(w,w))})}}function zn(s,l){var h=l.deletions;if(h!==null)for(var m=0;m<h.length;m++){var w=h[m];try{var k=s,C=l,z=C;e:for(;z!==null;){switch(z.tag){case 5:yr=z.stateNode,Dn=!1;break e;case 3:yr=z.stateNode.containerInfo,Dn=!0;break e;case 4:yr=z.stateNode.containerInfo,Dn=!0;break e}z=z.return}if(yr===null)throw Error(r(160));QS(k,C,w),yr=null,Dn=!1;var q=w.alternate;q!==null&&(q.return=null),w.return=null}catch(re){Ft(w,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)tk(l,s),l=l.sibling}function tk(s,l){var h=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(zn(l,s),pi(s),m&4){try{ac(3,s,s.return),$d(3,s)}catch(Pe){Ft(s,s.return,Pe)}try{ac(5,s,s.return)}catch(Pe){Ft(s,s.return,Pe)}}break;case 1:zn(l,s),pi(s),m&512&&h!==null&&ms(h,h.return);break;case 5:if(zn(l,s),pi(s),m&512&&h!==null&&ms(h,h.return),s.flags&32){var w=s.stateNode;try{qr(w,"")}catch(Pe){Ft(s,s.return,Pe)}}if(m&4&&(w=s.stateNode,w!=null)){var k=s.memoizedProps,C=h!==null?h.memoizedProps:k,z=s.type,q=s.updateQueue;if(s.updateQueue=null,q!==null)try{z==="input"&&k.type==="radio"&&k.name!=null&&wt(w,k),Ya(z,C);var re=Ya(z,k);for(C=0;C<q.length;C+=2){var ue=q[C],fe=q[C+1];ue==="style"?Xa(w,fe):ue==="dangerouslySetInnerHTML"?aa(w,fe):ue==="children"?qr(w,fe):O(w,ue,fe,re)}switch(z){case"input":Et(w,k);break;case"textarea":Ir(w,k);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!k.multiple;var _e=k.value;_e!=null?lr(w,!!k.multiple,_e,!1):ce!==!!k.multiple&&(k.defaultValue!=null?lr(w,!!k.multiple,k.defaultValue,!0):lr(w,!!k.multiple,k.multiple?[]:"",!1))}w[Vl]=k}catch(Pe){Ft(s,s.return,Pe)}}break;case 6:if(zn(l,s),pi(s),m&4){if(s.stateNode===null)throw Error(r(162));w=s.stateNode,k=s.memoizedProps;try{w.nodeValue=k}catch(Pe){Ft(s,s.return,Pe)}}break;case 3:if(zn(l,s),pi(s),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Ll(l.containerInfo)}catch(Pe){Ft(s,s.return,Pe)}break;case 4:zn(l,s),pi(s);break;case 13:zn(l,s),pi(s),w=s.child,w.flags&8192&&(k=w.memoizedState!==null,w.stateNode.isHidden=k,!k||w.alternate!==null&&w.alternate.memoizedState!==null||(ig=Lt())),m&4&&ek(s);break;case 22:if(ue=h!==null&&h.memoizedState!==null,s.mode&1?(Tr=(re=Tr)||ue,zn(l,s),Tr=re):zn(l,s),pi(s),m&8192){if(re=s.memoizedState!==null,(s.stateNode.isHidden=re)&&!ue&&(s.mode&1)!==0)for(Oe=s,ue=s.child;ue!==null;){for(fe=Oe=ue;Oe!==null;){switch(ce=Oe,_e=ce.child,ce.tag){case 0:case 11:case 14:case 15:ac(4,ce,ce.return);break;case 1:ms(ce,ce.return);var Ce=ce.stateNode;if(typeof Ce.componentWillUnmount=="function"){m=ce,h=ce.return;try{l=m,Ce.props=l.memoizedProps,Ce.state=l.memoizedState,Ce.componentWillUnmount()}catch(Pe){Ft(m,h,Pe)}}break;case 5:ms(ce,ce.return);break;case 22:if(ce.memoizedState!==null){ik(fe);continue}}_e!==null?(_e.return=ce,Oe=_e):ik(fe)}ue=ue.sibling}e:for(ue=null,fe=s;;){if(fe.tag===5){if(ue===null){ue=fe;try{w=fe.stateNode,re?(k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(z=fe.stateNode,q=fe.memoizedProps.style,C=q!=null&&q.hasOwnProperty("display")?q.display:null,z.style.display=Go("display",C))}catch(Pe){Ft(s,s.return,Pe)}}}else if(fe.tag===6){if(ue===null)try{fe.stateNode.nodeValue=re?"":fe.memoizedProps}catch(Pe){Ft(s,s.return,Pe)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===s)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===s)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===s)break e;ue===fe&&(ue=null),fe=fe.return}ue===fe&&(ue=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:zn(l,s),pi(s),m&4&&ek(s);break;case 21:break;default:zn(l,s),pi(s)}}function pi(s){var l=s.flags;if(l&2){try{e:{for(var h=s.return;h!==null;){if(JS(h)){var m=h;break e}h=h.return}throw Error(r(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(qr(w,""),m.flags&=-33);var k=ZS(s);tg(s,k,w);break;case 3:case 4:var C=m.stateNode.containerInfo,z=ZS(s);eg(s,z,C);break;default:throw Error(r(161))}}catch(q){Ft(s,s.return,q)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function U3(s,l,h){Oe=s,rk(s)}function rk(s,l,h){for(var m=(s.mode&1)!==0;Oe!==null;){var w=Oe,k=w.child;if(w.tag===22&&m){var C=w.memoizedState!==null||Id;if(!C){var z=w.alternate,q=z!==null&&z.memoizedState!==null||Tr;z=Id;var re=Tr;if(Id=C,(Tr=q)&&!re)for(Oe=w;Oe!==null;)C=Oe,q=C.child,C.tag===22&&C.memoizedState!==null?ak(w):q!==null?(q.return=C,Oe=q):ak(w);for(;k!==null;)Oe=k,rk(k),k=k.sibling;Oe=w,Id=z,Tr=re}nk(s)}else(w.subtreeFlags&8772)!==0&&k!==null?(k.return=w,Oe=k):nk(s)}}function nk(s){for(;Oe!==null;){var l=Oe;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Tr||$d(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Tr)if(h===null)m.componentDidMount();else{var w=l.elementType===l.type?h.memoizedProps:Ln(l.type,h.memoizedProps);m.componentDidUpdate(w,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&iS(l,k,m);break;case 3:var C=l.updateQueue;if(C!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}iS(l,C,h)}break;case 5:var z=l.stateNode;if(h===null&&l.flags&4){h=z;var q=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":q.autoFocus&&h.focus();break;case"img":q.src&&(h.src=q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var ue=re.memoizedState;if(ue!==null){var fe=ue.dehydrated;fe!==null&&Ll(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tr||l.flags&512&&Qm(l)}catch(ce){Ft(l,l.return,ce)}}if(l===s){Oe=null;break}if(h=l.sibling,h!==null){h.return=l.return,Oe=h;break}Oe=l.return}}function ik(s){for(;Oe!==null;){var l=Oe;if(l===s){Oe=null;break}var h=l.sibling;if(h!==null){h.return=l.return,Oe=h;break}Oe=l.return}}function ak(s){for(;Oe!==null;){var l=Oe;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{$d(4,l)}catch(q){Ft(l,h,q)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var w=l.return;try{m.componentDidMount()}catch(q){Ft(l,w,q)}}var k=l.return;try{Qm(l)}catch(q){Ft(l,k,q)}break;case 5:var C=l.return;try{Qm(l)}catch(q){Ft(l,C,q)}}}catch(q){Ft(l,l.return,q)}if(l===s){Oe=null;break}var z=l.sibling;if(z!==null){z.return=l.return,Oe=z;break}Oe=l.return}}var q3=Math.ceil,Md=j.ReactCurrentDispatcher,rg=j.ReactCurrentOwner,xn=j.ReactCurrentBatchConfig,ct=0,fr=null,Yt=null,vr=0,rn=0,gs=ma(0),rr=0,oc=null,uo=0,Ld=0,ng=0,sc=null,Gr=null,ig=0,ys=1/0,Mi=null,Dd=!1,ag=null,wa=null,zd=!1,_a=null,Bd=0,lc=0,og=null,Ud=-1,qd=0;function zr(){return(ct&6)!==0?Lt():Ud!==-1?Ud:Ud=Lt()}function Sa(s){return(s.mode&1)===0?1:(ct&2)!==0&&vr!==0?vr&-vr:E3.transition!==null?(qd===0&&(qd=Ju()),qd):(s=lt,s!==0||(s=window.event,s=s===void 0?16:s_(s.type)),s)}function Bn(s,l,h,m){if(50<lc)throw lc=0,og=null,Error(r(185));ua(s,h,m),((ct&2)===0||s!==fr)&&(s===fr&&((ct&2)===0&&(Ld|=h),rr===4&&ka(s,vr)),Kr(s,m),h===1&&ct===0&&(l.mode&1)===0&&(ys=Lt()+500,gd&&ya()))}function Kr(s,l){var h=s.callbackNode;Fp(s,l);var m=eo(s,s===fr?vr:0);if(m===0)h!==null&&In(h),s.callbackNode=null,s.callbackPriority=0;else if(l=m&-m,s.callbackPriority!==l){if(h!=null&&In(h),l===1)s.tag===0?k3(sk.bind(null,s)):G_(sk.bind(null,s)),x3(function(){(ct&6)===0&&ya()}),h=null;else{switch(Ge(m)){case 1:h=Nl;break;case 4:h=Za;break;case 16:h=Xo;break;case 536870912:h=$e;break;default:h=Xo}h=mk(h,ok.bind(null,s))}s.callbackPriority=l,s.callbackNode=h}}function ok(s,l){if(Ud=-1,qd=0,(ct&6)!==0)throw Error(r(327));var h=s.callbackNode;if(vs()&&s.callbackNode!==h)return null;var m=eo(s,s===fr?vr:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||l)l=Fd(s,m);else{l=m;var w=ct;ct|=2;var k=ck();(fr!==s||vr!==l)&&(Mi=null,ys=Lt()+500,ho(s,l));do try{W3();break}catch(z){lk(s,z)}while(!0);km(),Md.current=k,ct=w,Yt!==null?l=0:(fr=null,vr=0,l=rr)}if(l!==0){if(l===2&&(w=Pl(s),w!==0&&(m=w,l=sg(s,w))),l===1)throw h=oc,ho(s,0),ka(s,m),Kr(s,Lt()),h;if(l===6)ka(s,m);else{if(w=s.current.alternate,(m&30)===0&&!F3(w)&&(l=Fd(s,m),l===2&&(k=Pl(s),k!==0&&(m=k,l=sg(s,k))),l===1))throw h=oc,ho(s,0),ka(s,m),Kr(s,Lt()),h;switch(s.finishedWork=w,s.finishedLanes=m,l){case 0:case 1:throw Error(r(345));case 2:po(s,Gr,Mi);break;case 3:if(ka(s,m),(m&130023424)===m&&(l=ig+500-Lt(),10<l)){if(eo(s,0)!==0)break;if(w=s.suspendedLanes,(w&m)!==m){zr(),s.pingedLanes|=s.suspendedLanes&w;break}s.timeoutHandle=hm(po.bind(null,s,Gr,Mi),l);break}po(s,Gr,Mi);break;case 4:if(ka(s,m),(m&4194240)===m)break;for(l=s.eventTimes,w=-1;0<m;){var C=31-Dt(m);k=1<<C,C=l[C],C>w&&(w=C),m&=~k}if(m=w,m=Lt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*q3(m/1960))-m,10<m){s.timeoutHandle=hm(po.bind(null,s,Gr,Mi),m);break}po(s,Gr,Mi);break;case 5:po(s,Gr,Mi);break;default:throw Error(r(329))}}}return Kr(s,Lt()),s.callbackNode===h?ok.bind(null,s):null}function sg(s,l){var h=sc;return s.current.memoizedState.isDehydrated&&(ho(s,l).flags|=256),s=Fd(s,l),s!==2&&(l=Gr,Gr=h,l!==null&&lg(l)),s}function lg(s){Gr===null?Gr=s:Gr.push.apply(Gr,s)}function F3(s){for(var l=s;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var w=h[m],k=w.getSnapshot;w=w.value;try{if(!$n(k(),w))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;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 ka(s,l){for(l&=~ng,l&=~Ld,s.suspendedLanes|=l,s.pingedLanes&=~l,s=s.expirationTimes;0<l;){var h=31-Dt(l),m=1<<h;s[h]=-1,l&=~m}}function sk(s){if((ct&6)!==0)throw Error(r(327));vs();var l=eo(s,0);if((l&1)===0)return Kr(s,Lt()),null;var h=Fd(s,l);if(s.tag!==0&&h===2){var m=Pl(s);m!==0&&(l=m,h=sg(s,m))}if(h===1)throw h=oc,ho(s,0),ka(s,l),Kr(s,Lt()),h;if(h===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=l,po(s,Gr,Mi),Kr(s,Lt()),null}function cg(s,l){var h=ct;ct|=1;try{return s(l)}finally{ct=h,ct===0&&(ys=Lt()+500,gd&&ya())}}function fo(s){_a!==null&&_a.tag===0&&(ct&6)===0&&vs();var l=ct;ct|=1;var h=xn.transition,m=lt;try{if(xn.transition=null,lt=1,s)return s()}finally{lt=m,xn.transition=h,ct=l,(ct&6)===0&&ya()}}function ug(){rn=gs.current,Nt(gs)}function ho(s,l){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,b3(h)),Yt!==null)for(h=Yt.return;h!==null;){var m=h;switch(bm(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&pd();break;case 3:hs(),Nt(Fr),Nt(Er),Pm();break;case 5:Cm(m);break;case 4:hs();break;case 13:Nt(zt);break;case 19:Nt(zt);break;case 10:Em(m.type._context);break;case 22:case 23:ug()}h=h.return}if(fr=s,Yt=s=Ea(s.current,null),vr=rn=l,rr=0,oc=null,ng=Ld=uo=0,Gr=sc=null,so!==null){for(l=0;l<so.length;l++)if(h=so[l],m=h.interleaved,m!==null){h.interleaved=null;var w=m.next,k=h.pending;if(k!==null){var C=k.next;k.next=w,m.next=C}h.pending=m}so=null}return s}function lk(s,l){do{var h=Yt;try{if(km(),Od.current=Cd,Ad){for(var m=Bt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}Ad=!1}if(co=0,dr=tr=Bt=null,ec=!1,tc=0,rg.current=null,h===null||h.return===null){rr=1,oc=l,Yt=null;break}e:{var k=s,C=h.return,z=h,q=l;if(l=vr,z.flags|=32768,q!==null&&typeof q=="object"&&typeof q.then=="function"){var re=q,ue=z,fe=ue.tag;if((ue.mode&1)===0&&(fe===0||fe===11||fe===15)){var ce=ue.alternate;ce?(ue.updateQueue=ce.updateQueue,ue.memoizedState=ce.memoizedState,ue.lanes=ce.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var _e=RS(C);if(_e!==null){_e.flags&=-257,IS(_e,C,z,k,l),_e.mode&1&&PS(k,re,l),l=_e,q=re;var Ce=l.updateQueue;if(Ce===null){var Pe=new Set;Pe.add(q),l.updateQueue=Pe}else Ce.add(q);break e}else{if((l&1)===0){PS(k,re,l),dg();break e}q=Error(r(426))}}else if(Rt&&z.mode&1){var Vt=RS(C);if(Vt!==null){(Vt.flags&65536)===0&&(Vt.flags|=256),IS(Vt,C,z,k,l),_m(ps(q,z));break e}}k=q=ps(q,z),rr!==4&&(rr=2),sc===null?sc=[k]:sc.push(k),k=C;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var Z=CS(k,q,l);nS(k,Z);break e;case 1:z=q;var G=k.type,ee=k.stateNode;if((k.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(wa===null||!wa.has(ee)))){k.flags|=65536,l&=-l,k.lanes|=l;var pe=NS(k,z,l);nS(k,pe);break e}}k=k.return}while(k!==null)}dk(h)}catch(Ie){l=Ie,Yt===h&&h!==null&&(Yt=h=h.return);continue}break}while(!0)}function ck(){var s=Md.current;return Md.current=Cd,s===null?Cd:s}function dg(){(rr===0||rr===3||rr===2)&&(rr=4),fr===null||(uo&268435455)===0&&(Ld&268435455)===0||ka(fr,vr)}function Fd(s,l){var h=ct;ct|=2;var m=ck();(fr!==s||vr!==l)&&(Mi=null,ho(s,l));do try{H3();break}catch(w){lk(s,w)}while(!0);if(km(),ct=h,Md.current=m,Yt!==null)throw Error(r(261));return fr=null,vr=0,rr}function H3(){for(;Yt!==null;)uk(Yt)}function W3(){for(;Yt!==null&&!Xu();)uk(Yt)}function uk(s){var l=pk(s.alternate,s,rn);s.memoizedProps=s.pendingProps,l===null?dk(s):Yt=l,rg.current=null}function dk(s){var l=s;do{var h=l.alternate;if(s=l.return,(l.flags&32768)===0){if(h=L3(h,l,rn),h!==null){Yt=h;return}}else{if(h=D3(h,l),h!==null){h.flags&=32767,Yt=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{rr=6,Yt=null;return}}if(l=l.sibling,l!==null){Yt=l;return}Yt=l=s}while(l!==null);rr===0&&(rr=5)}function po(s,l,h){var m=lt,w=xn.transition;try{xn.transition=null,lt=1,G3(s,l,h,m)}finally{xn.transition=w,lt=m}return null}function G3(s,l,h,m){do vs();while(_a!==null);if((ct&6)!==0)throw Error(r(327));h=s.finishedWork;var w=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var k=h.lanes|h.childLanes;if(mn(s,k),s===fr&&(Yt=fr=null,vr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||zd||(zd=!0,mk(Xo,function(){return vs(),null})),k=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||k){k=xn.transition,xn.transition=null;var C=lt;lt=1;var z=ct;ct|=4,rg.current=null,B3(s,h),tk(h,s),f3(dm),ed=!!um,dm=um=null,s.current=h,U3(h),Yu(),ct=z,lt=C,xn.transition=k}else s.current=h;if(zd&&(zd=!1,_a=s,Bd=w),k=s.pendingLanes,k===0&&(wa=null),Gt(h.stateNode),Kr(s,Lt()),l!==null)for(m=s.onRecoverableError,h=0;h<l.length;h++)w=l[h],m(w.value,{componentStack:w.stack,digest:w.digest});if(Dd)throw Dd=!1,s=ag,ag=null,s;return(Bd&1)!==0&&s.tag!==0&&vs(),k=s.pendingLanes,(k&1)!==0?s===og?lc++:(lc=0,og=s):lc=0,ya(),null}function vs(){if(_a!==null){var s=Ge(Bd),l=xn.transition,h=lt;try{if(xn.transition=null,lt=16>s?16:s,_a===null)var m=!1;else{if(s=_a,_a=null,Bd=0,(ct&6)!==0)throw Error(r(331));var w=ct;for(ct|=4,Oe=s.current;Oe!==null;){var k=Oe,C=k.child;if((Oe.flags&16)!==0){var z=k.deletions;if(z!==null){for(var q=0;q<z.length;q++){var re=z[q];for(Oe=re;Oe!==null;){var ue=Oe;switch(ue.tag){case 0:case 11:case 15:ac(8,ue,k)}var fe=ue.child;if(fe!==null)fe.return=ue,Oe=fe;else for(;Oe!==null;){ue=Oe;var ce=ue.sibling,_e=ue.return;if(YS(ue),ue===re){Oe=null;break}if(ce!==null){ce.return=_e,Oe=ce;break}Oe=_e}}}var Ce=k.alternate;if(Ce!==null){var Pe=Ce.child;if(Pe!==null){Ce.child=null;do{var Vt=Pe.sibling;Pe.sibling=null,Pe=Vt}while(Pe!==null)}}Oe=k}}if((k.subtreeFlags&2064)!==0&&C!==null)C.return=k,Oe=C;else e:for(;Oe!==null;){if(k=Oe,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:ac(9,k,k.return)}var Z=k.sibling;if(Z!==null){Z.return=k.return,Oe=Z;break e}Oe=k.return}}var G=s.current;for(Oe=G;Oe!==null;){C=Oe;var ee=C.child;if((C.subtreeFlags&2064)!==0&&ee!==null)ee.return=C,Oe=ee;else e:for(C=G;Oe!==null;){if(z=Oe,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:$d(9,z)}}catch(Ie){Ft(z,z.return,Ie)}if(z===C){Oe=null;break e}var pe=z.sibling;if(pe!==null){pe.return=z.return,Oe=pe;break e}Oe=z.return}}if(ct=w,ya(),Qe&&typeof Qe.onPostCommitFiberRoot=="function")try{Qe.onPostCommitFiberRoot(Xe,s)}catch{}m=!0}return m}finally{lt=h,xn.transition=l}}return!1}function fk(s,l,h){l=ps(h,l),l=CS(s,l,1),s=ba(s,l,1),l=zr(),s!==null&&(ua(s,1,l),Kr(s,l))}function Ft(s,l,h){if(s.tag===3)fk(s,s,h);else for(;l!==null;){if(l.tag===3){fk(l,s,h);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(wa===null||!wa.has(m))){s=ps(h,s),s=NS(l,s,1),l=ba(l,s,1),s=zr(),l!==null&&(ua(l,1,s),Kr(l,s));break}}l=l.return}}function K3(s,l,h){var m=s.pingCache;m!==null&&m.delete(l),l=zr(),s.pingedLanes|=s.suspendedLanes&h,fr===s&&(vr&h)===h&&(rr===4||rr===3&&(vr&130023424)===vr&&500>Lt()-ig?ho(s,0):ng|=h),Kr(s,l)}function hk(s,l){l===0&&((s.mode&1)===0?l=1:(l=Qa,Qa<<=1,(Qa&130023424)===0&&(Qa=4194304)));var h=zr();s=Ri(s,l),s!==null&&(ua(s,l,h),Kr(s,h))}function V3(s){var l=s.memoizedState,h=0;l!==null&&(h=l.retryLane),hk(s,h)}function X3(s,l){var h=0;switch(s.tag){case 13:var m=s.stateNode,w=s.memoizedState;w!==null&&(h=w.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(l),hk(s,h)}var pk;pk=function(s,l,h){if(s!==null)if(s.memoizedProps!==l.pendingProps||Fr.current)Wr=!0;else{if((s.lanes&h)===0&&(l.flags&128)===0)return Wr=!1,M3(s,l,h);Wr=(s.flags&131072)!==0}else Wr=!1,Rt&&(l.flags&1048576)!==0&&K_(l,vd,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;Rd(s,l),s=l.pendingProps;var w=os(l,Er.current);fs(l,h),w=$m(null,l,m,s,w,h);var k=Mm();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Hr(m)?(k=!0,md(l)):k=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Tm(l),w.updater=Nd,l.stateNode=w,w._reactInternals=l,qm(l,m,s,h),l=Gm(null,l,m,!0,k,h)):(l.tag=0,Rt&&k&&vm(l),Dr(null,l,w,h),l=l.child),l;case 16:m=l.elementType;e:{switch(Rd(s,l),s=l.pendingProps,w=m._init,m=w(m._payload),l.type=m,w=l.tag=J3(m),s=Ln(m,s),w){case 0:l=Wm(null,l,m,s,h);break e;case 1:l=BS(null,l,m,s,h);break e;case 11:l=$S(null,l,m,s,h);break e;case 14:l=MS(null,l,m,Ln(m.type,s),h);break e}throw Error(r(306,m,""))}return l;case 0:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Ln(m,w),Wm(s,l,m,w,h);case 1:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Ln(m,w),BS(s,l,m,w,h);case 3:e:{if(US(l),s===null)throw Error(r(387));m=l.pendingProps,k=l.memoizedState,w=k.element,rS(s,l),kd(l,m,null,h);var C=l.memoizedState;if(m=C.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){w=ps(Error(r(423)),l),l=qS(s,l,m,h,w);break e}else if(m!==w){w=ps(Error(r(424)),l),l=qS(s,l,m,h,w);break e}else for(tn=pa(l.stateNode.containerInfo.firstChild),en=l,Rt=!0,Mn=null,h=eS(l,null,m,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(cs(),m===w){l=$i(s,l,h);break e}Dr(s,l,m,h)}l=l.child}return l;case 5:return aS(l),s===null&&wm(l),m=l.type,w=l.pendingProps,k=s!==null?s.memoizedProps:null,C=w.children,fm(m,w)?C=null:k!==null&&fm(m,k)&&(l.flags|=32),zS(s,l),Dr(s,l,C,h),l.child;case 6:return s===null&&wm(l),null;case 13:return FS(s,l,h);case 4:return jm(l,l.stateNode.containerInfo),m=l.pendingProps,s===null?l.child=us(l,null,m,h):Dr(s,l,m,h),l.child;case 11:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Ln(m,w),$S(s,l,m,w,h);case 7:return Dr(s,l,l.pendingProps,h),l.child;case 8:return Dr(s,l,l.pendingProps.children,h),l.child;case 12:return Dr(s,l,l.pendingProps.children,h),l.child;case 10:e:{if(m=l.type._context,w=l.pendingProps,k=l.memoizedProps,C=w.value,Ot(wd,m._currentValue),m._currentValue=C,k!==null)if($n(k.value,C)){if(k.children===w.children&&!Fr.current){l=$i(s,l,h);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var z=k.dependencies;if(z!==null){C=k.child;for(var q=z.firstContext;q!==null;){if(q.context===m){if(k.tag===1){q=Ii(-1,h&-h),q.tag=2;var re=k.updateQueue;if(re!==null){re=re.shared;var ue=re.pending;ue===null?q.next=q:(q.next=ue.next,ue.next=q),re.pending=q}}k.lanes|=h,q=k.alternate,q!==null&&(q.lanes|=h),Om(k.return,h,l),z.lanes|=h;break}q=q.next}}else if(k.tag===10)C=k.type===l.type?null:k.child;else if(k.tag===18){if(C=k.return,C===null)throw Error(r(341));C.lanes|=h,z=C.alternate,z!==null&&(z.lanes|=h),Om(C,h,l),C=k.sibling}else C=k.child;if(C!==null)C.return=k;else for(C=k;C!==null;){if(C===l){C=null;break}if(k=C.sibling,k!==null){k.return=C.return,C=k;break}C=C.return}k=C}Dr(s,l,w.children,h),l=l.child}return l;case 9:return w=l.type,m=l.pendingProps.children,fs(l,h),w=vn(w),m=m(w),l.flags|=1,Dr(s,l,m,h),l.child;case 14:return m=l.type,w=Ln(m,l.pendingProps),w=Ln(m.type,w),MS(s,l,m,w,h);case 15:return LS(s,l,l.type,l.pendingProps,h);case 17:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:Ln(m,w),Rd(s,l),l.tag=1,Hr(m)?(s=!0,md(l)):s=!1,fs(l,h),TS(l,m,w),qm(l,m,w,h),Gm(null,l,m,!0,s,h);case 19:return WS(s,l,h);case 22:return DS(s,l,h)}throw Error(r(156,l.tag))};function mk(s,l){return Vu(s,l)}function Y3(s,l,h,m){this.tag=s,this.key=h,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 wn(s,l,h,m){return new Y3(s,l,h,m)}function fg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function J3(s){if(typeof s=="function")return fg(s)?1:0;if(s!=null){if(s=s.$$typeof,s===B)return 11;if(s===X)return 14}return 2}function Ea(s,l){var h=s.alternate;return h===null?(h=wn(s.tag,l,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=l,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,l=s.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Hd(s,l,h,m,w,k){var C=2;if(m=s,typeof s=="function")fg(s)&&(C=1);else if(typeof s=="string")C=5;else e:switch(s){case N:return mo(h.children,w,k,l);case R:C=8,w|=8;break;case M:return s=wn(12,h,l,w|2),s.elementType=M,s.lanes=k,s;case K:return s=wn(13,h,l,w),s.elementType=K,s.lanes=k,s;case W:return s=wn(19,h,l,w),s.elementType=W,s.lanes=k,s;case te:return Wd(h,w,k,l);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case J:C=10;break e;case F:C=9;break e;case B:C=11;break e;case X:C=14;break e;case Y:C=16,m=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return l=wn(C,h,l,w),l.elementType=s,l.type=m,l.lanes=k,l}function mo(s,l,h,m){return s=wn(7,s,m,l),s.lanes=h,s}function Wd(s,l,h,m){return s=wn(22,s,m,l),s.elementType=te,s.lanes=h,s.stateNode={isHidden:!1},s}function hg(s,l,h){return s=wn(6,s,null,l),s.lanes=h,s}function pg(s,l,h){return l=wn(4,s.children!==null?s.children:[],s.key,l),l.lanes=h,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}function Z3(s,l,h,m,w){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=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function mg(s,l,h,m,w,k,C,z,q){return s=new Z3(s,l,h,z,q),l===1?(l=1,k===!0&&(l|=8)):l=0,k=wn(3,null,null,l),s.current=k,k.stateNode=s,k.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tm(k),s}function Q3(s,l,h){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:h}}function gk(s){if(!s)return ga;s=s._reactInternals;e:{if(Ti(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(Hr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(r(171))}if(s.tag===1){var h=s.type;if(Hr(h))return H_(s,h,l)}return l}function yk(s,l,h,m,w,k,C,z,q){return s=mg(h,m,!0,s,w,k,C,z,q),s.context=gk(null),h=s.current,m=zr(),w=Sa(h),k=Ii(m,w),k.callback=l??null,ba(h,k,w),s.current.lanes=w,ua(s,w,m),Kr(s,m),s}function Gd(s,l,h,m){var w=l.current,k=zr(),C=Sa(w);return h=gk(h),l.context===null?l.context=h:l.pendingContext=h,l=Ii(k,C),l.payload={element:s},m=m===void 0?null:m,m!==null&&(l.callback=m),s=ba(w,l,C),s!==null&&(Bn(s,w,C,k),Sd(s,w,C)),C}function Kd(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 vk(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<l?h:l}}function gg(s,l){vk(s,l),(s=s.alternate)&&vk(s,l)}function eL(){return null}var bk=typeof reportError=="function"?reportError:function(s){console.error(s)};function yg(s){this._internalRoot=s}Vd.prototype.render=yg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(r(409));Gd(s,l,null,null)},Vd.prototype.unmount=yg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;fo(function(){Gd(null,s,null,null)}),l[ji]=null}};function Vd(s){this._internalRoot=s}Vd.prototype.unstable_scheduleHydration=function(s){if(s){var l=to();s={blockedOn:null,target:s,priority:l};for(var h=0;h<ur.length&&l!==0&&l<ur[h].priority;h++);ur.splice(h,0,s),h===0&&a_(s)}};function vg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Xd(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function xk(){}function tL(s,l,h,m,w){if(w){if(typeof m=="function"){var k=m;m=function(){var re=Kd(C);k.call(re)}}var C=yk(l,m,s,0,null,!1,!1,"",xk);return s._reactRootContainer=C,s[ji]=C.current,Gl(s.nodeType===8?s.parentNode:s),fo(),C}for(;w=s.lastChild;)s.removeChild(w);if(typeof m=="function"){var z=m;m=function(){var re=Kd(q);z.call(re)}}var q=mg(s,0,!1,null,null,!1,!1,"",xk);return s._reactRootContainer=q,s[ji]=q.current,Gl(s.nodeType===8?s.parentNode:s),fo(function(){Gd(l,q,h,m)}),q}function Yd(s,l,h,m,w){var k=h._reactRootContainer;if(k){var C=k;if(typeof w=="function"){var z=w;w=function(){var q=Kd(C);z.call(q)}}Gd(l,C,s,w)}else C=tL(h,l,s,w,m);return Kd(C)}Il=function(s){switch(s.tag){case 3:var l=s.stateNode;if(l.current.memoizedState.isDehydrated){var h=la(l.pendingLanes);h!==0&&(Rl(l,h|1),Kr(l,Lt()),(ct&6)===0&&(ys=Lt()+500,ya()))}break;case 13:fo(function(){var m=Ri(s,1);if(m!==null){var w=zr();Bn(m,s,1,w)}}),gg(s,1)}},Kt=function(s){if(s.tag===13){var l=Ri(s,134217728);if(l!==null){var h=zr();Bn(l,s,134217728,h)}gg(s,134217728)}},yt=function(s){if(s.tag===13){var l=Sa(s),h=Ri(s,l);if(h!==null){var m=zr();Bn(h,s,l,m)}gg(s,l)}},to=function(){return lt},ui=function(s,l){var h=lt;try{return lt=s,l()}finally{lt=h}},sa=function(s,l,h){switch(l){case"input":if(Et(s,h),l=h.name,h.type==="radio"&&l!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var m=h[l];if(m!==s&&m.form===s.form){var w=hd(m);if(!w)throw Error(r(90));se(m),Et(m,w)}}}break;case"textarea":Ir(s,h);break;case"select":l=h.value,l!=null&&lr(s,!!h.multiple,l,!1)}},de=cg,Re=fo;var rL={usingClientEntryPoint:!1,Events:[Xl,is,hd,D,ne,cg]},cc={findFiberByHostInstance:no,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nL={bundleType:cc.bundleType,version:cc.version,rendererPackageName:cc.rendererPackageName,rendererConfig:cc.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=Gu(s),s===null?null:s.stateNode},findFiberByHostInstance:cc.findFiberByHostInstance||eL,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 Jd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jd.isDisabled&&Jd.supportsFiber)try{Xe=Jd.inject(nL),Qe=Jd}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rL,Vr.createPortal=function(s,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vg(l))throw Error(r(200));return Q3(s,l,null,h)},Vr.createRoot=function(s,l){if(!vg(s))throw Error(r(299));var h=!1,m="",w=bk;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=mg(s,1,!1,null,null,h,!1,m,w),s[ji]=l.current,Gl(s.nodeType===8?s.parentNode:s),new yg(l)},Vr.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=Gu(l),s=s===null?null:s.stateNode,s},Vr.flushSync=function(s){return fo(s)},Vr.hydrate=function(s,l,h){if(!Xd(l))throw Error(r(200));return Yd(null,s,l,!0,h)},Vr.hydrateRoot=function(s,l,h){if(!vg(s))throw Error(r(405));var m=h!=null&&h.hydratedSources||null,w=!1,k="",C=bk;if(h!=null&&(h.unstable_strictMode===!0&&(w=!0),h.identifierPrefix!==void 0&&(k=h.identifierPrefix),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),l=yk(l,null,s,1,h??null,w,!1,k,C),s[ji]=l.current,Gl(s),m)for(s=0;s<m.length;s++)h=m[s],w=h._getVersion,w=w(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,w]:l.mutableSourceEagerHydrationData.push(h,w);return new Vd(l)},Vr.render=function(s,l,h){if(!Xd(l))throw Error(r(200));return Yd(null,s,l,!1,h)},Vr.unmountComponentAtNode=function(s){if(!Xd(s))throw Error(r(40));return s._reactRootContainer?(fo(function(){Yd(null,null,s,!1,function(){s._reactRootContainer=null,s[ji]=null})}),!0):!1},Vr.unstable_batchedUpdates=cg,Vr.unstable_renderSubtreeIntoContainer=function(s,l,h,m){if(!Xd(h))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Yd(s,l,h,!1,m)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}var Tk;function EN(){if(Tk)return wg.exports;Tk=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(),wg.exports=fL(),wg.exports}var jk;function hL(){if(jk)return Qd;jk=1;var t=EN();return Qd.createRoot=t.createRoot,Qd.hydrateRoot=t.hydrateRoot,Qd}var pL=hL();/**
|
|
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 Ck="popstate";function Nk(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function mL(t={}){function e(n,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:c,hash:u}=a||n.location;return Mb("",{pathname:o,search:c,hash:u},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:Bc(i)}return yL(e,r,null,t)}function Mt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ei(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function gL(){return Math.random().toString(36).substring(2,10)}function Pk(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 Mb(t,e,r=null,n,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ml(e):e,state:r,key:e&&e.key||n||gL(),mask:i}}function Bc({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 ml(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 yL(t,e,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,c="POP",u=null,d=p();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function p(){return(o.state||{idx:null}).idx}function f(){c="POP";let b=p(),S=b==null?null:b-d;d=b,u&&u({action:c,location:_.location,delta:S})}function g(b,S){c="PUSH";let A=Nk(b)?b:Mb(_.location,b,S);d=p()+1;let O=Pk(A,d),j=_.createHref(A.mask||A);try{o.pushState(O,"",j)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(j)}a&&u&&u({action:c,location:_.location,delta:1})}function v(b,S){c="REPLACE";let A=Nk(b)?b:Mb(_.location,b,S);d=p();let O=Pk(A,d),j=_.createHref(A.mask||A);o.replaceState(O,"",j),a&&u&&u({action:c,location:_.location,delta:0})}function x(b){return vL(i,b)}let _={get action(){return c},get location(){return t(i,o)},listen(b){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(Ck,f),u=b,()=>{i.removeEventListener(Ck,f),u=null}},createHref(b){return e(i,b)},createURL:x,encodeLocation(b){let S=x(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:v,go(b){return o.go(b)}};return _}function vL(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:Bc(e);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function ON(t,e,r="/"){return bL(t,e,r,!1)}function bL(t,e,r,n,i){let a=typeof e=="string"?ml(e):e,o=Xi(a.pathname||"/",r);if(o==null)return null;let c=xL(t),u=null,d=PL(o);for(let p=0;u==null&&p<c.length;++p)u=CL(c[p],d,n);return u}function xL(t){let e=AN(t);return wL(e),e}function AN(t,e=[],r=[],n="",i=!1){let a=(o,c,u=i,d)=>{let p={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&u)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 f=Qn([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 "${f}".`),AN(o.children,e,g,f,u)),!(o.path==null&&!o.index)&&e.push({path:f,score:TL(f,o.index),routesMeta:g})};return t.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let d of TN(o.path))a(o,c,!0,d)}),e}function TN(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=TN(n.join("/")),c=[];return c.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&c.push(...o),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function wL(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:jL(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var _L=/^:[\w-]+$/,SL=3,kL=2,EL=1,OL=10,AL=-2,Rk=t=>t==="*";function TL(t,e){let r=t.split("/"),n=r.length;return r.some(Rk)&&(n+=AL),e&&(n+=kL),r.filter(i=>!Rk(i)).reduce((i,a)=>i+(_L.test(a)?SL:a===""?EL:OL),n)}function jL(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 CL(t,e,r=!1){let{routesMeta:n}=t,i={},a="/",o=[];for(let c=0;c<n.length;++c){let u=n[c],d=c===n.length-1,p=a==="/"?e:e.slice(a.length)||"/",f=Nf({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),g=u.route;if(!f&&d&&r&&!n[n.length-1].route.index&&(f=Nf({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Qn([a,f.pathname]),pathnameBase:ML(Qn([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=Qn([a,f.pathnameBase]))}return o}function Nf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=NL(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),c=i.slice(1);return{params:n.reduce((d,{paramName:p,isOptional:f},g)=>{if(p==="*"){let x=c[g]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const v=c[g];return f&&!v?d[p]=void 0:d[p]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:t}}function NL(t,e=!1,r=!0){ei(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,c,u,d,p)=>{if(n.push({paramName:c,isOptional:u!=null}),u){let f=p.charAt(d+o.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 PL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ei(!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 Xi(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 RL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function IL(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?ml(t):t,a;return r?(r=jN(r),r.startsWith("/")?a=Ik(r.substring(1),"/"):a=Ik(r,e)):a=e,{pathname:a,search:LL(n),hash:DL(i)}}function Ik(t,e){let r=Pf(e).split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function kg(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 $L(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Aw(t){let e=$L(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function Vh(t,e,r,n=!1){let i;typeof t=="string"?i=ml(t):(i={...t},Mt(!i.pathname||!i.pathname.includes("?"),kg("?","pathname","search",i)),Mt(!i.pathname||!i.pathname.includes("#"),kg("#","pathname","hash",i)),Mt(!i.search||!i.search.includes("#"),kg("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,c;if(o==null)c=r;else{let f=e.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),f-=1;i.pathname=g.join("/")}c=f>=0?e[f]:"/"}let u=IL(i,c),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}var jN=t=>t.replace(/\/\/+/g,"/"),Qn=t=>jN(t.join("/")),Pf=t=>t.replace(/\/+$/,""),ML=t=>Pf(t).replace(/^\/*/,"/"),LL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,DL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,zL=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 BL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function UL(t){let e=t.map(r=>r.route.path).filter(Boolean);return Qn(e)||"/"}var CN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function NN(t,e){let r=t;if(typeof r!="string"||!RL.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(CN)try{let a=new URL(window.location.href),o=r.startsWith("//")?new URL(a.protocol+r):new URL(r),c=Xi(o.pathname,e);o.origin===a.origin&&c!=null?r=c+o.search+o.hash:i=!0}catch{ei(!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 PN=["POST","PUT","PATCH","DELETE"];new Set(PN);var qL=["GET",...PN];new Set(qL);var gl=P.createContext(null);gl.displayName="DataRouter";var Xh=P.createContext(null);Xh.displayName="DataRouterState";var RN=P.createContext(!1);function FL(){return P.useContext(RN)}var IN=P.createContext({isTransitioning:!1});IN.displayName="ViewTransition";var HL=P.createContext(new Map);HL.displayName="Fetchers";var WL=P.createContext(null);WL.displayName="Await";var fn=P.createContext(null);fn.displayName="Navigation";var Cu=P.createContext(null);Cu.displayName="Location";var Nn=P.createContext({outlet:null,matches:[],isDataRoute:!1});Nn.displayName="Route";var Tw=P.createContext(null);Tw.displayName="RouteError";var $N="REACT_ROUTER_ERROR",GL="REDIRECT",KL="ROUTE_ERROR_RESPONSE";function VL(t){if(t.startsWith(`${$N}:${GL}:{`))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 XL(t){if(t.startsWith(`${$N}:${KL}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new zL(e.status,e.statusText,e.data)}catch{}}function YL(t,{relative:e}={}){Mt(yl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=P.useContext(fn),{hash:i,pathname:a,search:o}=Pu(t,{relative:e}),c=a;return r!=="/"&&(c=a==="/"?r:Qn([r,a])),n.createHref({pathname:c,search:o,hash:i})}function yl(){return P.useContext(Cu)!=null}function ti(){return Mt(yl(),"useLocation() may be used only in the context of a <Router> component."),P.useContext(Cu).location}var MN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LN(t){P.useContext(fn).static||P.useLayoutEffect(t)}function Nu(){let{isDataRoute:t}=P.useContext(Nn);return t?fD():JL()}function JL(){Mt(yl(),"useNavigate() may be used only in the context of a <Router> component.");let t=P.useContext(gl),{basename:e,navigator:r}=P.useContext(fn),{matches:n}=P.useContext(Nn),{pathname:i}=ti(),a=JSON.stringify(Aw(n)),o=P.useRef(!1);return LN(()=>{o.current=!0}),P.useCallback((u,d={})=>{if(ei(o.current,MN),!o.current)return;if(typeof u=="number"){r.go(u);return}let p=Vh(u,JSON.parse(a),i,d.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Qn([e,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[e,r,a,i,t])}var ZL=P.createContext(null);function QL(t){let e=P.useContext(Nn).outlet;return P.useMemo(()=>e&&P.createElement(ZL.Provider,{value:t},e),[e,t])}function eD(){let{matches:t}=P.useContext(Nn),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Pu(t,{relative:e}={}){let{matches:r}=P.useContext(Nn),{pathname:n}=ti(),i=JSON.stringify(Aw(r));return P.useMemo(()=>Vh(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function tD(t,e){return DN(t,e)}function DN(t,e,r){var b;Mt(yl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=P.useContext(fn),{matches:i}=P.useContext(Nn),a=i[i.length-1],o=a?a.params:{},c=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let S=d&&d.path||"";BN(c,!d||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=ti(),f;if(e){let S=typeof e=="string"?ml(e):e;Mt(u==="/"||((b=S.pathname)==null?void 0:b.startsWith(u)),`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 "${u}" but pathname "${S.pathname}" was given in the \`location\` prop.`),f=S}else f=p;let g=f.pathname||"/",v=g;if(u!=="/"){let S=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=r&&r.state.matches.length?r.state.matches.map(S=>Object.assign(S,{route:r.manifest[S.route.id]||S.route})):ON(t,{pathname:v});ei(d||x!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ei(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 _=oD(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Qn([u,n.encodeLocation?n.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:Qn([u,n.encodeLocation?n.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),i,r);return e&&_?P.createElement(Cu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},_):_}function rD(){let t=dD(),e=BL(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=P.createElement(P.Fragment,null,P.createElement("p",null,"💿 Hey developer 👋"),P.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",P.createElement("code",{style:a},"ErrorBoundary")," or"," ",P.createElement("code",{style:a},"errorElement")," prop on your route.")),P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},e),r?P.createElement("pre",{style:i},r):null,o)}var nD=P.createElement(rD,null),zN=class extends P.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=XL(t.digest);r&&(t=r)}let e=t!==void 0?P.createElement(Nn.Provider,{value:this.props.routeContext},P.createElement(Tw.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?P.createElement(iD,{error:t},e):e}};zN.contextType=RN;var Eg=new WeakMap;function iD({children:t,error:e}){let{basename:r}=P.useContext(fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=VL(e.digest);if(n){let i=Eg.get(e);if(i)throw i;let a=NN(n.location,r);if(CN&&!Eg.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 Eg.set(e,o),o}return P.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function aD({routeContext:t,match:e,children:r}){let n=P.useContext(gl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),P.createElement(Nn.Provider,{value:t},r)}function oD(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(f=>f.route.id&&(a==null?void 0:a[f.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,c=-1;if(r&&n){o=n.renderFallback;for(let p=0;p<i.length;p++){let f=i[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=p),f.route.id){let{loaderData:g,errors:v}=n,x=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||x){r.isStatic&&(o=!0),c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}}let u=r==null?void 0:r.onError,d=n&&u?(p,f)=>{var g,v;u(p,{location:n.location,params:((v=(g=n.matches)==null?void 0:g[0])==null?void 0:v.params)??{},pattern:UL(n.matches),errorInfo:f})}:void 0;return i.reduceRight((p,f,g)=>{let v,x=!1,_=null,b=null;n&&(v=a&&f.route.id?a[f.route.id]:void 0,_=f.route.errorElement||nD,o&&(c<0&&g===0?(BN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):c===g&&(x=!0,b=f.route.hydrateFallbackElement||null)));let S=e.concat(i.slice(0,g+1)),A=()=>{let O;return v?O=_:x?O=b:f.route.Component?O=P.createElement(f.route.Component,null):f.route.element?O=f.route.element:O=p,P.createElement(aD,{match:f,routeContext:{outlet:p,matches:S,isDataRoute:n!=null},children:O})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?P.createElement(zN,{location:n.location,revalidation:n.revalidation,component:_,error:v,children:A(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):A()},null)}function jw(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sD(t){let e=P.useContext(gl);return Mt(e,jw(t)),e}function lD(t){let e=P.useContext(Xh);return Mt(e,jw(t)),e}function cD(t){let e=P.useContext(Nn);return Mt(e,jw(t)),e}function Cw(t){let e=cD(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 uD(){return Cw("useRouteId")}function dD(){var n;let t=P.useContext(Tw),e=lD("useRouteError"),r=Cw("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function fD(){let{router:t}=sD("useNavigate"),e=Cw("useNavigate"),r=P.useRef(!1);return LN(()=>{r.current=!0}),P.useCallback(async(i,a={})=>{ei(r.current,MN),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var $k={};function BN(t,e,r){!e&&!$k[t]&&($k[t]=!0,ei(!1,r))}P.memo(hD);function hD({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return DN(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function pD({to:t,replace:e,state:r,relative:n}){Mt(yl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=P.useContext(fn);ei(!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}=P.useContext(Nn),{pathname:o}=ti(),c=Nu(),u=Vh(t,Aw(a),o,n==="path"),d=JSON.stringify(u);return P.useEffect(()=>{c(JSON.parse(d),{replace:e,state:r,relative:n})},[c,d,n,e,r]),null}function mD(t){return QL(t.context)}function nn(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 gD({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){Mt(!yl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:o,future:{}}),[c,i,a,o]);typeof r=="string"&&(r=ml(r));let{pathname:d="/",search:p="",hash:f="",state:g=null,key:v="default",mask:x}=r,_=P.useMemo(()=>{let b=Xi(d,c);return b==null?null:{location:{pathname:b,search:p,hash:f,state:g,key:v,mask:x},navigationType:n}},[c,d,p,f,g,v,n,x]);return ei(_!=null,`<Router basename="${c}"> is not able to match the URL "${d}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:P.createElement(fn.Provider,{value:u},P.createElement(Cu.Provider,{children:e,value:_}))}function yD({children:t,location:e}){return tD(Lb(t),e)}function Lb(t,e=[]){let r=[];return P.Children.forEach(t,(n,i)=>{if(!P.isValidElement(n))return;let a=[...e,i];if(n.type===P.Fragment){r.push.apply(r,Lb(n.props.children,a));return}Mt(n.type===nn,`[${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=Lb(n.props.children,a)),r.push(o)}),r}var Tf="get",jf="application/x-www-form-urlencoded";function Yh(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function vD(t){return Yh(t)&&t.tagName.toLowerCase()==="button"}function bD(t){return Yh(t)&&t.tagName.toLowerCase()==="form"}function xD(t){return Yh(t)&&t.tagName.toLowerCase()==="input"}function wD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function _D(t,e){return t.button===0&&(!e||e==="_self")&&!wD(t)}var ef=null;function SD(){if(ef===null)try{new FormData(document.createElement("form"),0),ef=!1}catch{ef=!0}return ef}var kD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Og(t){return t!=null&&!kD.has(t)?(ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jf}"`),null):t}function ED(t,e){let r,n,i,a,o;if(bD(t)){let c=t.getAttribute("action");n=c?Xi(c,e):null,r=t.getAttribute("method")||Tf,i=Og(t.getAttribute("enctype"))||jf,a=new FormData(t)}else if(vD(t)||xD(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(n=u?Xi(u,e):null,r=t.getAttribute("formmethod")||c.getAttribute("method")||Tf,i=Og(t.getAttribute("formenctype"))||Og(c.getAttribute("enctype"))||jf,a=new FormData(c,t),!SD()){let{name:d,type:p,value:f}=t;if(p==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,f)}}else{if(Yh(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Tf,n=null,i=jf,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 Nw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function UN(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&&Xi(i.pathname,e)==="/"?i.pathname=`${Pf(e)}/_root.${n}`:i.pathname=`${Pf(i.pathname)}.${n}`,i}async function OD(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 AD(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 TD(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await OD(a,r);return o.links?o.links():[]}return[]}));return PD(n.flat(1).filter(AD).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function Mk(t,e,r,n,i,a){let o=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,c=(u,d)=>{var p;return r[d].pathname!==u.pathname||((p=r[d].route.path)==null?void 0:p.endsWith("*"))&&r[d].params["*"]!==u.params["*"]};return a==="assets"?e.filter((u,d)=>o(u,d)||c(u,d)):a==="data"?e.filter((u,d)=>{var f;let p=n.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(o(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function jD(t,e,{includeHydrateFallback:r}={}){return CD(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 CD(t){return[...new Set(t)]}function ND(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function PD(t,e){let r=new Set;return new Set(e),t.reduce((n,i)=>{let a=JSON.stringify(ND(i));return r.has(a)||(r.add(a),n.push({key:a,link:i})),n},[])}function Pw(){let t=P.useContext(gl);return Nw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function RD(){let t=P.useContext(Xh);return Nw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Rw=P.createContext(void 0);Rw.displayName="FrameworkContext";function Iw(){let t=P.useContext(Rw);return Nw(t,"You must render this element inside a <HydratedRouter> element"),t}function ID(t,e){let r=P.useContext(Rw),[n,i]=P.useState(!1),[a,o]=P.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:f}=e,g=P.useRef(null);P.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let _=S=>{S.forEach(A=>{o(A.isIntersecting)})},b=new IntersectionObserver(_,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[t]),P.useEffect(()=>{if(n){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[n]);let v=()=>{i(!0)},x=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,g,{}]:[a,g,{onFocus:dc(c,v),onBlur:dc(u,x),onMouseEnter:dc(d,v),onMouseLeave:dc(p,x),onTouchStart:dc(f,v)}]:[!1,g,{}]}function dc(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function $D({page:t,...e}){let r=FL(),{router:n}=Pw(),i=P.useMemo(()=>ON(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?P.createElement(LD,{page:t,matches:i,...e}):P.createElement(DD,{page:t,matches:i,...e}):null}function MD(t){let{manifest:e,routeModules:r}=Iw(),[n,i]=P.useState([]);return P.useEffect(()=>{let a=!1;return TD(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function LD({page:t,matches:e,...r}){let n=ti(),{future:i}=Iw(),{basename:a}=Pw(),o=P.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let c=UN(t,a,i.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let p of e)typeof p.route.shouldRevalidate=="function"?u=!0:d.push(p.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[a,i.v8_trailingSlashAwareDataRequests,t,n,e]);return P.createElement(P.Fragment,null,o.map(c=>P.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function DD({page:t,matches:e,...r}){let n=ti(),{future:i,manifest:a,routeModules:o}=Iw(),{basename:c}=Pw(),{loaderData:u,matches:d}=RD(),p=P.useMemo(()=>Mk(t,e,d,a,n,"data"),[t,e,d,a,n]),f=P.useMemo(()=>Mk(t,e,d,a,n,"assets"),[t,e,d,a,n]),g=P.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let _=new Set,b=!1;if(e.forEach(A=>{var j;let O=a.routes[A.route.id];!O||!O.hasLoader||(!p.some(E=>E.route.id===A.route.id)&&A.route.id in u&&((j=o[A.route.id])!=null&&j.shouldRevalidate)||O.hasClientLoader?b=!0:_.add(A.route.id))}),_.size===0)return[];let S=UN(t,c,i.v8_trailingSlashAwareDataRequests,"data");return b&&_.size>0&&S.searchParams.set("_routes",e.filter(A=>_.has(A.route.id)).map(A=>A.route.id).join(",")),[S.pathname+S.search]},[c,i.v8_trailingSlashAwareDataRequests,u,n,a,p,e,t,o]),v=P.useMemo(()=>jD(f,a),[f,a]),x=MD(f);return P.createElement(P.Fragment,null,g.map(_=>P.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...r})),v.map(_=>P.createElement("link",{key:_,rel:"modulepreload",href:_,...r})),x.map(({key:_,link:b})=>P.createElement("link",{key:_,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function zD(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var BD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BD&&(window.__reactRouterVersion="7.16.0")}catch{}function UD({basename:t,children:e,useTransitions:r,window:n}){let i=P.useRef();i.current==null&&(i.current=mL({window:n,v5Compat:!0}));let a=i.current,[o,c]=P.useState({action:a.action,location:a.location}),u=P.useCallback(d=>{r===!1?c(d):P.startTransition(()=>c(d))},[r]);return P.useLayoutEffect(()=>a.listen(u),[a,u]),P.createElement(gD,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var qN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FN=P.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:i,reloadDocument:a,replace:o,mask:c,state:u,target:d,to:p,preventScrollReset:f,viewTransition:g,defaultShouldRevalidate:v,...x},_){let{basename:b,navigator:S,useTransitions:A}=P.useContext(fn),O=typeof p=="string"&&qN.test(p),j=NN(p,b);p=j.to;let E=YL(p,{relative:i}),T=ti(),N=null;if(c){let X=Vh(c,[],T.mask?T.mask.pathname:"/",!0);b!=="/"&&(X.pathname=X.pathname==="/"?b:Qn([b,X.pathname])),N=S.createHref(X)}let[R,M,J]=ID(n,x),F=HD(p,{replace:o,mask:c,state:u,target:d,preventScrollReset:f,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:A});function B(X){e&&e(X),X.defaultPrevented||F(X)}let K=!(j.isExternal||a),W=P.createElement("a",{...x,...J,href:(K?N:void 0)||j.absoluteURL||E,onClick:K?B:e,ref:zD(_,M),target:d,"data-discover":!O&&r==="render"?"true":void 0});return R&&!O?P.createElement(P.Fragment,null,W,P.createElement($D,{page:E})):W});FN.displayName="Link";var HN=P.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:i=!1,style:a,to:o,viewTransition:c,children:u,...d},p){let f=Pu(o,{relative:d.relative}),g=ti(),v=P.useContext(Xh),{navigator:x,basename:_}=P.useContext(fn),b=v!=null&&XD(f)&&c===!0,S=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,A=g.pathname,O=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(A=A.toLowerCase(),O=O?O.toLowerCase():null,S=S.toLowerCase()),O&&_&&(O=Xi(O,_)||O);const j=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let E=A===S||!i&&A.startsWith(S)&&A.charAt(j)==="/",T=O!=null&&(O===S||!i&&O.startsWith(S)&&O.charAt(S.length)==="/"),N={isActive:E,isPending:T,isTransitioning:b},R=E?e:void 0,M;typeof n=="function"?M=n(N):M=[n,E?"active":null,T?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let J=typeof a=="function"?a(N):a;return P.createElement(FN,{...d,"aria-current":R,className:M,ref:p,style:J,to:o,viewTransition:c},typeof u=="function"?u(N):u)});HN.displayName="NavLink";var qD=P.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=Tf,action:c,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...v},x)=>{let{useTransitions:_}=P.useContext(fn),b=KD(),S=VD(c,{relative:d}),A=o.toLowerCase()==="get"?"get":"post",O=typeof c=="string"&&qN.test(c),j=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,N=(T==null?void 0:T.getAttribute("formmethod"))||o,R=()=>b(T||E.currentTarget,{fetcherKey:e,method:N,navigate:r,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g});_&&r!==!1?P.startTransition(()=>R()):R()};return P.createElement("form",{ref:x,method:A,action:S,onSubmit:n?u:j,...v,"data-discover":!O&&t==="render"?"true":void 0})});qD.displayName="Form";function FD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WN(t){let e=P.useContext(gl);return Mt(e,FD(t)),e}function HD(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let p=Nu(),f=ti(),g=Pu(t,{relative:o});return P.useCallback(v=>{if(_D(v,e)){v.preventDefault();let x=r!==void 0?r:Bc(f)===Bc(g),_=()=>p(t,{replace:x,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:c,defaultShouldRevalidate:u});d?P.startTransition(()=>_()):_()}},[f,p,g,r,n,i,e,t,a,o,c,u,d])}var WD=0,GD=()=>`__${String(++WD)}__`;function KD(){let{router:t}=WN("useSubmit"),{basename:e}=P.useContext(fn),r=uD(),n=t.fetch,i=t.navigate;return P.useCallback(async(a,o={})=>{let{action:c,method:u,encType:d,formData:p,body:f}=ED(a,e);if(o.navigate===!1){let g=o.fetcherKey||GD();await n(g,r,o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||c,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,i,e,r])}function VD(t,{relative:e}={}){let{basename:r}=P.useContext(fn),n=P.useContext(Nn);Mt(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Pu(t||".",{relative:e})},o=ti();if(t==null){a.search=o.search;let c=new URLSearchParams(a.search),u=c.getAll("index");if(u.some(p=>p==="")){c.delete("index"),u.filter(f=>f).forEach(f=>c.append("index",f));let p=c.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:Qn([r,a.pathname])),Bc(a)}function XD(t,{relative:e}={}){let r=P.useContext(IN);Mt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=WN("useViewTransitionState"),i=Pu(t,{relative:e});if(!r.isTransitioning)return!1;let a=Xi(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Xi(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Nf(i.pathname,o)!=null||Nf(i.pathname,a)!=null}var YD=EN();const JD=vt(YD);function ZD(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 QD=t=>{switch(t){case"success":return r5;case"info":return i5;case"warning":return n5;case"error":return a5;default:return null}},e5=Array(12).fill(0),t5=({visible:t,className:e})=>L.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},L.createElement("div",{className:"sonner-spinner"},e5.map((r,n)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),r5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),n5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.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"})),i5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),a5=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.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"})),o5=L.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"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),s5=()=>{const[t,e]=L.useState(document.hidden);return L.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let Db=1;class l5{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:Db++,o=this.toasts.find(u=>u.id===a),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:c,title:n}):u):this.addToast({title:n,...i,dismissible:c,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 c=i.then(async d=>{if(o=["resolve",d],L.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(u5(d)&&!d.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:g,...x})}else if(d instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(d):r.error,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:g,...x})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(d):r.success,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!L.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:g,...x})}}).catch(async d=>{if(o=["reject",d],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(d):r.error,f=typeof r.description=="function"?await r.description(d):r.description,v=typeof p=="object"&&!L.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...v})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),u=()=>new Promise((d,p)=>c.then(()=>o[0]==="reject"?p(o[1]):d(o[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,r)=>{const n=(r==null?void 0:r.id)||Db++;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 Yr=new l5,c5=(t,e)=>{const r=(e==null?void 0:e.id)||Db++;return Yr.addToast({title:t,...e,id:r}),r},u5=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",d5=c5,f5=()=>Yr.toasts,h5=()=>Yr.getActiveToasts(),at=Object.assign(d5,{success:Yr.success,info:Yr.info,warning:Yr.warning,error:Yr.error,custom:Yr.custom,message:Yr.message,promise:Yr.promise,dismiss:Yr.dismiss,loading:Yr.loading},{getHistory:f5,getToasts:h5});ZD("[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 tf(t){return t.label!==void 0}const p5=3,m5="24px",g5="16px",Lk=4e3,y5=356,v5=14,b5=45,x5=200;function mi(...t){return t.filter(Boolean).join(" ")}function w5(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const _5=t=>{var e,r,n,i,a,o,c,u,d;const{invert:p,toast:f,unstyled:g,interacting:v,setHeights:x,visibleToasts:_,heights:b,index:S,toasts:A,expanded:O,removeToast:j,defaultRichColors:E,closeButton:T,style:N,cancelButtonStyle:R,actionButtonStyle:M,className:J="",descriptionClassName:F="",duration:B,position:K,gap:W,expandByDefault:X,classNames:Y,icons:te,closeButtonAriaLabel:H="Close toast"}=t,[Q,U]=L.useState(null),[I,$]=L.useState(null),[V,oe]=L.useState(!1),[le,ve]=L.useState(!1),[qe,xe]=L.useState(!1),[ae,Se]=L.useState(!1),[Me,se]=L.useState(!1),[tt,Fe]=L.useState(0),[kt,wt]=L.useState(0),Et=L.useRef(f.duration||B||Lk),Sr=L.useRef(null),Ut=L.useRef(null),Rr=S===0,lr=S+1<=_,_t=f.type,kr=f.dismissible!==!1,Ir=f.className||"",ni=f.descriptionClassName||"",Ur=L.useMemo(()=>b.findIndex(D=>D.toastId===f.id)||0,[b,f.id]),ii=L.useMemo(()=>{var D;return(D=f.closeButton)!=null?D:T},[f.closeButton,T]),ai=L.useMemo(()=>f.duration||B||Lk,[f.duration,B]),aa=L.useRef(0),qr=L.useRef(0),oi=L.useRef(0),si=L.useRef(null),[Go,Xa]=K.split("-"),Ko=L.useMemo(()=>b.reduce((D,ne,de)=>de>=Ur?D:D+ne.height,0),[b,Ur]),oa=s5(),Ya=f.invert||p,Rn=_t==="loading";qr.current=L.useMemo(()=>Ur*W+Ko,[Ur,Ko]),L.useEffect(()=>{Et.current=ai},[ai]),L.useEffect(()=>{oe(!0)},[]),L.useEffect(()=>{const D=Ut.current;if(D){const ne=D.getBoundingClientRect().height;return wt(ne),x(de=>[{toastId:f.id,height:ne,position:f.position},...de]),()=>x(de=>de.filter(Re=>Re.toastId!==f.id))}},[x,f.id]),L.useLayoutEffect(()=>{if(!V)return;const D=Ut.current,ne=D.style.height;D.style.height="auto";const de=D.getBoundingClientRect().height;D.style.height=ne,wt(de),x(Re=>Re.find(Ke=>Ke.toastId===f.id)?Re.map(Ke=>Ke.toastId===f.id?{...Ke,height:de}:Ke):[{toastId:f.id,height:de,position:f.position},...Re])},[V,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const $r=L.useCallback(()=>{ve(!0),Fe(qr.current),x(D=>D.filter(ne=>ne.toastId!==f.id)),setTimeout(()=>{j(f)},x5)},[f,j,x,qr]);L.useEffect(()=>{if(f.promise&&_t==="loading"||f.duration===1/0||f.type==="loading")return;let D;return O||v||oa?(()=>{if(oi.current<aa.current){const Re=new Date().getTime()-aa.current;Et.current=Et.current-Re}oi.current=new Date().getTime()})():(()=>{Et.current!==1/0&&(aa.current=new Date().getTime(),D=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),$r()},Et.current))})(),()=>clearTimeout(D)},[O,v,f,_t,oa,$r]),L.useEffect(()=>{f.delete&&($r(),f.onDismiss==null||f.onDismiss.call(f,f))},[$r,f.delete]);function sa(){var D;if(te!=null&&te.loading){var ne;return L.createElement("div",{className:mi(Y==null?void 0:Y.loader,f==null||(ne=f.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":_t==="loading"},te.loading)}return L.createElement(t5,{className:mi(Y==null?void 0:Y.loader,f==null||(D=f.classNames)==null?void 0:D.loader),visible:_t==="loading"})}const li=f.icon||(te==null?void 0:te[_t])||QD(_t);var hn,pn;return L.createElement("li",{tabIndex:0,ref:Ut,className:mi(J,Ir,Y==null?void 0:Y.toast,f==null||(e=f.classNames)==null?void 0:e.toast,Y==null?void 0:Y.default,Y==null?void 0:Y[_t],f==null||(r=f.classNames)==null?void 0:r[_t]),"data-sonner-toast":"","data-rich-colors":(hn=f.richColors)!=null?hn:E,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":V,"data-promise":!!f.promise,"data-swiped":Me,"data-removed":le,"data-visible":lr,"data-y-position":Go,"data-x-position":Xa,"data-index":S,"data-front":Rr,"data-swiping":qe,"data-dismissible":kr,"data-type":_t,"data-invert":Ya,"data-swipe-out":ae,"data-swipe-direction":I,"data-expanded":!!(O||X&&V),"data-testid":f.testId,style:{"--index":S,"--toasts-before":S,"--z-index":A.length-S,"--offset":`${le?tt:qr.current}px`,"--initial-height":X?"auto":`${kt}px`,...N,...f.style},onDragEnd:()=>{xe(!1),U(null),si.current=null},onPointerDown:D=>{D.button!==2&&(Rn||!kr||(Sr.current=new Date,Fe(qr.current),D.target.setPointerCapture(D.pointerId),D.target.tagName!=="BUTTON"&&(xe(!0),si.current={x:D.clientX,y:D.clientY})))},onPointerUp:()=>{var D,ne,de;if(ae||!kr)return;si.current=null;const Re=Number(((D=Ut.current)==null?void 0:D.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ne=Ut.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ke=new Date().getTime()-((de=Sr.current)==null?void 0:de.getTime()),ye=Q==="x"?Re:ht,we=Math.abs(ye)/Ke;if(Math.abs(ye)>=b5||we>.11){Fe(qr.current),f.onDismiss==null||f.onDismiss.call(f,f),$(Q==="x"?Re>0?"right":"left":ht>0?"down":"up"),$r(),Se(!0);return}else{var je,ut;(je=Ut.current)==null||je.style.setProperty("--swipe-amount-x","0px"),(ut=Ut.current)==null||ut.style.setProperty("--swipe-amount-y","0px")}se(!1),xe(!1),U(null)},onPointerMove:D=>{var ne,de,Re;if(!si.current||!kr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;const Ke=D.clientY-si.current.y,ye=D.clientX-si.current.x;var we;const je=(we=t.swipeDirections)!=null?we:w5(K);!Q&&(Math.abs(ye)>1||Math.abs(Ke)>1)&&U(Math.abs(ye)>Math.abs(Ke)?"x":"y");let ut={x:0,y:0};const gt=cr=>1/(1.5+Math.abs(cr)/20);if(Q==="y"){if(je.includes("top")||je.includes("bottom"))if(je.includes("top")&&Ke<0||je.includes("bottom")&&Ke>0)ut.y=Ke;else{const cr=Ke*gt(Ke);ut.y=Math.abs(cr)<Math.abs(Ke)?cr:Ke}}else if(Q==="x"&&(je.includes("left")||je.includes("right")))if(je.includes("left")&&ye<0||je.includes("right")&&ye>0)ut.x=ye;else{const cr=ye*gt(ye);ut.x=Math.abs(cr)<Math.abs(ye)?cr:ye}(Math.abs(ut.x)>0||Math.abs(ut.y)>0)&&se(!0),(de=Ut.current)==null||de.style.setProperty("--swipe-amount-x",`${ut.x}px`),(Re=Ut.current)==null||Re.style.setProperty("--swipe-amount-y",`${ut.y}px`)}},ii&&!f.jsx&&_t!=="loading"?L.createElement("button",{"aria-label":H,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!kr?()=>{}:()=>{$r(),f.onDismiss==null||f.onDismiss.call(f,f)},className:mi(Y==null?void 0:Y.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(pn=te==null?void 0:te.close)!=null?pn:o5):null,(_t||f.icon||f.promise)&&f.icon!==null&&((te==null?void 0:te[_t])!==null||f.icon)?L.createElement("div",{"data-icon":"",className:mi(Y==null?void 0:Y.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||sa():null,f.type!=="loading"?li:null):null,L.createElement("div",{"data-content":"",className:mi(Y==null?void 0:Y.content,f==null||(a=f.classNames)==null?void 0:a.content)},L.createElement("div",{"data-title":"",className:mi(Y==null?void 0:Y.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?L.createElement("div",{"data-description":"",className:mi(F,ni,Y==null?void 0:Y.description,f==null||(c=f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),L.isValidElement(f.cancel)?f.cancel:f.cancel&&tf(f.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:D=>{tf(f.cancel)&&kr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,D),$r())},className:mi(Y==null?void 0:Y.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,L.isValidElement(f.action)?f.action:f.action&&tf(f.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||M,onClick:D=>{tf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,D),!D.defaultPrevented&&$r())},className:mi(Y==null?void 0:Y.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function Dk(){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 S5(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",c=a?g5:m5;function u(d){["top","right","bottom","left"].forEach(p=>{r[`${o}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=c:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):u(c)}),r}const k5=L.forwardRef(function(e,r){const{id:n,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:c,closeButton:u,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:v,duration:x,style:_,visibleToasts:b=p5,toastOptions:S,dir:A=Dk(),gap:O=v5,icons:j,containerAriaLabel:E="Notifications"}=e,[T,N]=L.useState([]),R=L.useMemo(()=>n?T.filter(V=>V.toasterId===n):T.filter(V=>!V.toasterId),[T,n]),M=L.useMemo(()=>Array.from(new Set([a].concat(R.filter(V=>V.position).map(V=>V.position)))),[R,a]),[J,F]=L.useState([]),[B,K]=L.useState(!1),[W,X]=L.useState(!1),[Y,te]=L.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=L.useRef(null),Q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=L.useRef(null),I=L.useRef(!1),$=L.useCallback(V=>{N(oe=>{var le;return(le=oe.find(ve=>ve.id===V.id))!=null&&le.delete||Yr.dismiss(V.id),oe.filter(({id:ve})=>ve!==V.id)})},[]);return L.useEffect(()=>Yr.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{N(oe=>oe.map(le=>le.id===V.id?{...le,delete:!0}:le))});return}setTimeout(()=>{JD.flushSync(()=>{N(oe=>{const le=oe.findIndex(ve=>ve.id===V.id);return le!==-1?[...oe.slice(0,le),{...oe[le],...V},...oe.slice(le+1)]:[V,...oe]})})})}),[T]),L.useEffect(()=>{if(g!=="system"){te(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:oe})=>{te(oe?"dark":"light")})}catch{V.addListener(({matches:le})=>{try{te(le?"dark":"light")}catch(ve){console.error(ve)}})}},[g]),L.useEffect(()=>{T.length<=1&&K(!1)},[T]),L.useEffect(()=>{const V=oe=>{var le;if(o.every(xe=>oe[xe]||oe.code===xe)){var qe;K(!0),(qe=H.current)==null||qe.focus()}oe.code==="Escape"&&(document.activeElement===H.current||(le=H.current)!=null&&le.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[o]),L.useEffect(()=>{if(H.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,I.current=!1)}},[H.current]),L.createElement("section",{ref:r,"aria-label":`${E} ${Q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((V,oe)=>{var le;const[ve,qe]=V.split("-");return R.length?L.createElement("ol",{key:V,dir:A==="auto"?Dk():A,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":ve,"data-x-position":qe,style:{"--front-toast-height":`${((le=J[0])==null?void 0:le.height)||0}px`,"--width":`${y5}px`,"--gap":`${O}px`,..._,...S5(p,f)},onBlur:xe=>{I.current&&!xe.currentTarget.contains(xe.relatedTarget)&&(I.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||I.current||(I.current=!0,U.current=xe.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{W||K(!1)},onDragEnd:()=>K(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},R.filter(xe=>!xe.position&&oe===0||xe.position===V).map((xe,ae)=>{var Se,Me;return L.createElement(_5,{key:xe.id,icons:j,index:ae,toast:xe,defaultRichColors:v,duration:(Se=S==null?void 0:S.duration)!=null?Se:x,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Me=S==null?void 0:S.closeButton)!=null?Me:u,interacting:W,position:V,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:$,toasts:R.filter(se=>se.position==xe.position),heights:J.filter(se=>se.position==xe.position),setHeights:F,expandByDefault:c,gap:O,expanded:B,swipeDirections:e.swipeDirections})})):null}))}),E5="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 Ra({height:t=32}){const e=Math.round(t*1);return y.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[y.jsx("path",{d:E5,fill:"url(#io-grad)"}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{stopColor:"#D83333"}),y.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),y.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 O5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),A5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),zk=t=>{const e=A5(t);return e.charAt(0).toUpperCase()+e.slice(1)},GN=(...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 T5={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 j5=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...c},u)=>P.createElement("svg",{ref:u,...T5,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:GN("lucide",i),...c},[...o.map(([d,p])=>P.createElement(d,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 Ue=(t,e)=>{const r=P.forwardRef(({className:n,...i},a)=>P.createElement(j5,{ref:a,iconNode:e,className:GN(`lucide-${O5(zk(t))}`,`lucide-${t}`,n),...i}));return r.displayName=zk(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 C5=[["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"}]],Ds=Ue("activity",C5);/**
|
|
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 N5=[["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"}]],P5=Ue("bell",N5);/**
|
|
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 R5=[["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"}]],KN=Ue("book-open",R5);/**
|
|
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 I5=[["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"}]],Uc=Ue("bot",I5);/**
|
|
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 $5=[["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"}]],M5=Ue("bug",$5);/**
|
|
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 L5=[["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"}]],D5=Ue("calendar",L5);/**
|
|
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 z5=[["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"}]],B5=Ue("chart-no-axes-column",z5);/**
|
|
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 U5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],q5=Ue("chevron-down",U5);/**
|
|
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 F5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vl=Ue("chevron-left",F5);/**
|
|
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 H5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],$w=Ue("chevron-right",H5);/**
|
|
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 W5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],VN=Ue("circle-check-big",W5);/**
|
|
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 G5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],XN=Ue("circle-x",G5);/**
|
|
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 K5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Mw=Ue("clock",K5);/**
|
|
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 V5=[["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"}]],X5=Ue("cpu",V5);/**
|
|
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 Y5=[["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"}]],Lw=Ue("crown",Y5);/**
|
|
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 J5=[["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"}]],Z5=Ue("download",J5);/**
|
|
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 Q5=[["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"}]],YN=Ue("external-link",Q5);/**
|
|
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 e4=[["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"}]],t4=Ue("eye-off",e4);/**
|
|
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 r4=[["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"}]],zb=Ue("eye",r4);/**
|
|
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 n4=[["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"}]],i4=Ue("file-text",n4);/**
|
|
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 a4=[["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"}]],o4=Ue("folder-open",a4);/**
|
|
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 s4=[["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"}]],l4=Ue("folder",s4);/**
|
|
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 c4=[["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"}]],u4=Ue("github",c4);/**
|
|
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 d4=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],JN=Ue("hash",d4);/**
|
|
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 f4=[["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"}]],Bb=Ue("inbox",f4);/**
|
|
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 h4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],p4=Ue("info",h4);/**
|
|
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 m4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],js=Ue("loader-circle",m4);/**
|
|
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 g4=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],ZN=Ue("loader",g4);/**
|
|
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 y4=[["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"}]],v4=Ue("log-out",y4);/**
|
|
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 b4=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],x4=Ue("message-circle",b4);/**
|
|
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 w4=[["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"}]],Dw=Ue("message-square",w4);/**
|
|
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 _4=[["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"}]],QN=Ue("paperclip",_4);/**
|
|
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 S4=[["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"}]],k4=Ue("pause",S4);/**
|
|
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 E4=[["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"}]],O4=Ue("pen",E4);/**
|
|
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 A4=[["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"}]],Ub=Ue("pencil",A4);/**
|
|
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 T4=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],j4=Ue("play",T4);/**
|
|
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 C4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zw=Ue("plus",C4);/**
|
|
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 N4=[["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"}]],Bw=Ue("save",N4);/**
|
|
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 P4=[["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"}]],R4=Ue("scroll-text",P4);/**
|
|
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 I4=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],eP=Ue("search",I4);/**
|
|
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 $4=[["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"}]],tP=Ue("send",$4);/**
|
|
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 M4=[["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"}]],L4=Ue("settings",M4);/**
|
|
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 D4=[["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"}]],z4=Ue("sparkles",D4);/**
|
|
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 B4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Jh=Ue("square",B4);/**
|
|
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 U4=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],rP=Ue("terminal",U4);/**
|
|
297
|
+
* @license lucide-react v0.487.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const q4=[["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"}]],Ma=Ue("trash-2",q4);/**
|
|
302
|
+
* @license lucide-react v0.487.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const F4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],H4=Ue("triangle-alert",F4);/**
|
|
307
|
+
* @license lucide-react v0.487.0 - ISC
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the ISC license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const W4=[["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"}]],Zh=Ue("users",W4);/**
|
|
312
|
+
* @license lucide-react v0.487.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const G4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nP=Ue("x",G4);/**
|
|
317
|
+
* @license lucide-react v0.487.0 - ISC
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the ISC license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const K4=[["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"}]],qb=Ue("zap",K4),V4="/api";let jo=null;function X4(t){jo=t}function iP(){return(jo==null?void 0:jo())??null}async function fc(t,e){const r=jo==null?void 0:jo(),n={"Content-Type":"application/json",...e==null?void 0:e.headers};r&&(n.Authorization=`Bearer ${r}`);const i=await fetch(`${V4}${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 Ve={get:t=>fc(t),post:(t,e)=>fc(t,{method:"POST",body:e?JSON.stringify(e):void 0}),patch:(t,e)=>fc(t,{method:"PATCH",body:JSON.stringify(e)}),put:(t,e)=>fc(t,{method:"PUT",body:JSON.stringify(e)}),delete:t=>fc(t,{method:"DELETE"})},aP=P.createContext({timezone:"UTC"});function Y4({children:t}){const[e,r]=P.useState("UTC");return P.useEffect(()=>{Ve.get("/config").then(n=>{n.config.timezone&&r(n.config.timezone)}).catch(()=>{})},[]),y.jsx(aP.Provider,{value:{timezone:e},children:t})}function qa(){return P.useContext(aP).timezone}const J4=[{label:"UTC",value:"UTC"},{label:"Eastern Time (US)",value:"America/New_York"},{label:"Central Time (US)",value:"America/Chicago"},{label:"Mountain Time (US)",value:"America/Denver"},{label:"Pacific Time (US)",value:"America/Los_Angeles"},{label:"Alaska Time",value:"America/Anchorage"},{label:"Hawaii Time",value:"Pacific/Honolulu"},{label:"London (GMT/BST)",value:"Europe/London"},{label:"Central European",value:"Europe/Berlin"},{label:"Eastern European",value:"Europe/Bucharest"},{label:"India (IST)",value:"Asia/Kolkata"},{label:"China (CST)",value:"Asia/Shanghai"},{label:"Japan (JST)",value:"Asia/Tokyo"},{label:"Australia Eastern",value:"Australia/Sydney"},{label:"New Zealand",value:"Pacific/Auckland"},{label:"São Paulo",value:"America/Sao_Paulo"}];function Ws(t,e,r){if(!t)return"";try{return new Date(t).toLocaleString("en-US",{timeZone:e,month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...r})}catch{return new Date(t).toLocaleString()}}function Qh(t,e,r){if(!t)return"";try{return new Date(t).toLocaleTimeString("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",...r})}catch{return new Date(t).toLocaleTimeString()}}function Z4(t,e,r){if(!t)return"";try{return new Date(t).toLocaleDateString("en-US",{timeZone:e,month:"short",day:"numeric",...r})}catch{return new Date(t).toLocaleDateString()}}let Rf=[];const If=new Set;function Q4(t){Rf=[t,...Rf].slice(0,50);for(const e of If)e()}function ez(){Rf=[];for(const t of If)t()}function tz(){const[,t]=P.useState(0);return P.useEffect(()=>{const e=()=>t(r=>r+1);return If.add(e),()=>{If.delete(e)}},[]),Rf}function rz(){const[t,e]=P.useState(!1),r=tz(),n=P.useRef(null),[i,a]=P.useState(0),o=qa(),c=r.length-i;P.useEffect(()=>{function d(p){n.current&&!n.current.contains(p.target)&&e(!1)}if(t)return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t]);function u(){e(!t),t||a(r.length)}return y.jsxs("div",{className:"relative",ref:n,children:[y.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:[y.jsx(P5,{className:"w-3.5 h-3.5"}),c>0&&y.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-[#E43A9C]"})]}),t&&y.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:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07]",children:[y.jsx("span",{className:"text-xs font-mono text-zinc-300",children:"Notifications"}),r.length>0&&y.jsx("button",{type:"button",onClick:ez,className:"text-[10px] font-mono text-zinc-500 hover:text-zinc-300 cursor-pointer",children:"Clear all"})]}),r.length===0?y.jsx("div",{className:"px-4 py-8 text-center text-zinc-600 text-xs font-mono",children:"No notifications yet"}):y.jsx("div",{className:"divide-y divide-white/[0.04]",children:r.map(d=>y.jsxs("div",{className:"px-4 py-3 hover:bg-white/[0.03]",children:[y.jsx("p",{className:"text-xs text-zinc-300 leading-relaxed",children:d.message}),y.jsx("p",{className:"text-[10px] text-zinc-600 font-mono mt-1",children:Qh(d.timestamp,o)})]},d.id))})]})]})}const nz=10,iz=1e3,az=3e4;function oz(t={}){const[e,r]=P.useState(!1),[n,i]=P.useState(null),[a,o]=P.useState("connecting"),c=P.useRef(null),u=P.useRef(t),d=P.useRef(0),p=P.useRef(null),f=P.useRef(!0),g=P.useRef(!1);u.current=t,P.useEffect(()=>{let _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;const b=iP();b&&(_+=`?token=${encodeURIComponent(b)}`);const S=()=>{if(!f.current)return;o(d.current>0?"reconnecting":"connecting");const A=new WebSocket(_);c.current=A,A.onopen=()=>{const O=d.current>0||g.current;d.current=0,g.current=!1,r(!0),o("connected"),O&&console.info("WebSocket reconnected")},A.onmessage=O=>{var j,E,T,N,R,M,J,F;try{const B=JSON.parse(O.data);switch(B.type){case"connected":i(B.connectionId??null);break;case"delta":(E=(j=u.current).onDelta)==null||E.call(j,B.content??"");break;case"message":(N=(T=u.current).onMessage)==null||N.call(T,B.content??"");break;case"event":(M=(R=u.current).onEvent)==null||M.call(R,B);break;case"error":(F=(J=u.current).onError)==null||F.call(J,B.content??"Unknown error");break}}catch{}},A.onclose=()=>{if(c.current=null,r(!1),i(null),!f.current)return;if(g.current||(g.current=!0,console.warn("WebSocket disconnected; attempting to reconnect")),d.current>=nz){o("disconnected");return}const O=Math.min(iz*2**d.current,az);d.current+=1,o("reconnecting"),p.current=setTimeout(S,O)},A.onerror=()=>{A.close()}};return S(),()=>{var A;f.current=!1,p.current&&clearTimeout(p.current),(A=c.current)==null||A.close()}},[]);const v=P.useCallback((x,_="web")=>{var b;((b=c.current)==null?void 0:b.readyState)===WebSocket.OPEN&&c.current.send(JSON.stringify({type:"message",content:x,source:_}))},[]);return{connected:e,connectionId:n,connectionState:a,sendMessage:v}}const oP=P.createContext(null);function sz({children:t}){const[e,r]=P.useState([]),[n,i]=P.useState(""),[a,o]=P.useState(!1),[c,u]=P.useState(!1),d=P.useRef(!1);P.useEffect(()=>{d.current||(d.current=!0,Ve.get("/conversations?limit=50").then(O=>{r(O.messages.map(j=>({...j,timestamp:j.timestamp})))}).catch(()=>{}))},[]);const p=P.useCallback(O=>{u(!1),o(!0),i(O)},[]),f=P.useCallback(O=>{u(!1),o(!1),i(""),r(j=>[...j,{id:crypto.randomUUID(),role:"assistant",content:O,timestamp:new Date().toISOString()}])},[]),g=P.useCallback(O=>{var j,E,T;O.notification&&Q4({id:((j=O.event)==null?void 0:j.id)??crypto.randomUUID(),message:O.notification,timestamp:((E=O.event)==null?void 0:E.timestamp)??new Date().toISOString(),eventType:((T=O.event)==null?void 0:T.type)??"unknown"})},[]),v=P.useCallback(()=>{u(!1),o(!1),i("")},[]),{connected:x,sendMessage:_}=oz({onDelta:p,onMessage:f,onEvent:g,onError:v}),b=P.useCallback(O=>{u(!0),_(O)},[_]),S=P.useCallback(O=>{r(j=>[...j,O])},[]),A=P.useCallback(async(O,j)=>{const E=new FormData;E.append("file",O),E.append("messageId",j);const T=iP();if(!(await fetch("/api/attachments",{method:"POST",body:E,headers:T?{Authorization:`Bearer ${T}`}:void 0})).ok)throw new Error("Failed to upload attachment")},[]);return y.jsx(oP.Provider,{value:{messages:e,streaming:n,isStreaming:a,isThinking:c,connected:x,sendChatMessage:b,addUserMessage:S,uploadAttachment:A},children:t})}function sP(){const t=P.useContext(oP);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function Uw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var zo=Uw();function lP(t){zo=t}var So={exec:()=>null};function bs(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 st(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(Pr.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var lz=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Pr={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:bs(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:bs(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:bs(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:bs(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:bs(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:bs(t=>new RegExp(`^ {0,${t}}>`))},cz=/^(?:[ \t]*(?:\n|$))+/,uz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ru=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qw=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uP=st(cP).replace(/bull/g,qw).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(),hz=st(cP).replace(/bull/g,qw).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(),Fw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pz=/^[^\n]+/,Hw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mz=st(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gz=st(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qw).getRegex(),ep="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",Ww=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yz=st("^ {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",Ww).replace("tag",ep).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dP=st(Fw).replace("hr",Ru).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",ep).getRegex(),vz=st(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dP).getRegex(),Gw={blockquote:vz,code:uz,def:mz,fences:dz,heading:fz,hr:Ru,html:yz,lheading:uP,list:gz,newline:cz,paragraph:dP,table:So,text:pz},Bk=st("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ru).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",ep).getRegex(),bz={...Gw,lheading:hz,table:Bk,paragraph:st(Fw).replace("hr",Ru).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bk).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",ep).getRegex()},xz={...Gw,html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ww).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:So,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:st(Fw).replace("hr",Ru).replace("heading",` *#{1,6} *[^
|
|
322
|
+
]`).replace("lheading",uP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_z=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,fP=/^( {2,}|\\)\n(?!\s*$)/,Sz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bl=/[\p{P}\p{S}]/u,tp=/[\s\p{P}\p{S}]/u,Kw=/[^\s\p{P}\p{S}]/u,kz=st(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,tp).getRegex(),hP=/(?!~)[\p{P}\p{S}]/u,Ez=/(?!~)[\s\p{P}\p{S}]/u,Oz=/(?:[^\s\p{P}\p{S}]|~)/u,Az=st(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lz?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pP=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Tz=st(pP,"u").replace(/punct/g,bl).getRegex(),jz=st(pP,"u").replace(/punct/g,hP).getRegex(),mP="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Cz=st(mP,"gu").replace(/notPunctSpace/g,Kw).replace(/punctSpace/g,tp).replace(/punct/g,bl).getRegex(),Nz=st(mP,"gu").replace(/notPunctSpace/g,Oz).replace(/punctSpace/g,Ez).replace(/punct/g,hP).getRegex(),Pz=st("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kw).replace(/punctSpace/g,tp).replace(/punct/g,bl).getRegex(),Rz=st(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bl).getRegex(),Iz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$z=st(Iz,"gu").replace(/notPunctSpace/g,Kw).replace(/punctSpace/g,tp).replace(/punct/g,bl).getRegex(),Mz=st(/\\(punct)/,"gu").replace(/punct/g,bl).getRegex(),Lz=st(/^<(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(),Dz=st(Ww).replace("(?:-->|$)","-->").getRegex(),zz=st("^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",Dz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$f=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bz=st(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",$f).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gP=st(/^!?\[(label)\]\[(ref)\]/).replace("label",$f).replace("ref",Hw).getRegex(),yP=st(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hw).getRegex(),Uz=st("reflink|nolink(?!\\()","g").replace("reflink",gP).replace("nolink",yP).getRegex(),Uk=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vw={_backpedal:So,anyPunctuation:Mz,autolink:Lz,blockSkip:Az,br:fP,code:_z,del:So,delLDelim:So,delRDelim:So,emStrongLDelim:Tz,emStrongRDelimAst:Cz,emStrongRDelimUnd:Pz,escape:wz,link:Bz,nolink:yP,punctuation:kz,reflink:gP,reflinkSearch:Uz,tag:zz,text:Sz,url:So},qz={...Vw,link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",$f).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$f).getRegex()},Fb={...Vw,emStrongRDelimAst:Nz,emStrongLDelim:jz,delLDelim:Rz,delRDelim:$z,url:st(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Uk).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:st(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Uk).getRegex()},Fz={...Fb,br:st(fP).replace("{2,}","*").getRegex(),text:st(Fb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},rf={normal:Gw,gfm:bz,pedantic:xz},hc={normal:Vw,gfm:Fb,breaks:Fz,pedantic:qz},Hz={"&":"&","<":"<",">":">",'"':""","'":"'"},qk=t=>Hz[t];function vi(t,e){if(e){if(Pr.escapeTest.test(t))return t.replace(Pr.escapeReplace,qk)}else if(Pr.escapeTestNoEncode.test(t))return t.replace(Pr.escapeReplaceNoEncode,qk);return t}function Fk(t){try{t=encodeURI(t).replace(Pr.percentDecode,"%")}catch{return null}return t}function Hk(t,e){var a;let r=t.replace(Pr.findPipe,(o,c,u)=>{let d=!1,p=c;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),n=r.split(Pr.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(Pr.slashPipe,"|");return n}function Aa(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 Wk(t){let e=t.split(`
|
|
323
|
+
`),r=e.length-1;for(;r>=0&&Pr.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
|
|
324
|
+
`)}function Wz(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 Gz(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 Gk(t,e,r,n,i){let a=e.href,o=e.title||null,c=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:c,tokens:n.inlineTokens(c)};return n.state.inLink=!1,u}function Kz(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
|
|
325
|
+
`).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[c]=o;return c.length>=i.length?a.slice(i.length):a}).join(`
|
|
326
|
+
`)}var Mf=class{constructor(t){bt(this,"options");bt(this,"rules");bt(this,"lexer");this.options=t||zo}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]:Wk(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=Kz(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=Aa(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:Aa(e[0],`
|
|
327
|
+
`),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:Aa(e[0],`
|
|
328
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Aa(e[0],`
|
|
329
|
+
`).split(`
|
|
330
|
+
`),n="",i="",a=[];for(;r.length>0;){let o=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),o=!0;else if(!o)c.push(r[u]);else break;r=r.slice(u);let d=c.join(`
|
|
331
|
+
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
332
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
333
|
+
${d}`:d,i=i?`${i}
|
|
334
|
+
${p}`:p;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=f,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 v=g,x=v.raw+`
|
|
335
|
+
`+r.join(`
|
|
336
|
+
`),_=this.blockquote(x);a[a.length-1]=_,n=n.substring(0,n.length-v.raw.length)+_.raw,i=i.substring(0,i.length-v.text.length)+_.text;break}else if((g==null?void 0:g.type)==="list"){let v=g,x=v.raw+`
|
|
337
|
+
`+r.join(`
|
|
338
|
+
`),_=this.list(x);a[a.length-1]=_,n=n.substring(0,n.length-g.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,r=x.substring(a.at(-1).raw.length).split(`
|
|
339
|
+
`);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 u=!1,d="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let f=Gz(e[2].split(`
|
|
340
|
+
`,1)[0],e[1].length),g=t.split(`
|
|
341
|
+
`,1)[0],v=!f.trim(),x=0;if(this.options.pedantic?(x=2,p=f.trimStart()):v?x=e[1].length+1:(x=f.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=f.slice(x),x+=e[1].length),v&&this.rules.other.blankLine.test(g)&&(d+=g+`
|
|
342
|
+
`,t=t.substring(g.length+1),u=!0),!u){let _=this.rules.other.nextBulletRegex(x),b=this.rules.other.hrRegex(x),S=this.rules.other.fencesBeginRegex(x),A=this.rules.other.headingBeginRegex(x),O=this.rules.other.htmlBeginRegex(x),j=this.rules.other.blockquoteBeginRegex(x);for(;t;){let E=t.split(`
|
|
343
|
+
`,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," "),S.test(g)||A.test(g)||O.test(g)||j.test(g)||_.test(g)||b.test(g))break;if(T.search(this.rules.other.nonSpaceChar)>=x||!g.trim())p+=`
|
|
344
|
+
`+T.slice(x);else{if(v||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||A.test(f)||b.test(f))break;p+=`
|
|
345
|
+
`+g}v=!g.trim(),d+=E+`
|
|
346
|
+
`,t=t.substring(E.length+1),f=T.slice(x)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let d=u.tokens[0];if(u.task&&((d==null?void 0:d.type)==="text"||(d==null?void 0:d.type)==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let f={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=f.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1);if(!i.loose){let p=u.tokens.filter(g=>g.type==="space"),f=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=f}}if(i.loose)for(let u of i.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=Wk(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:Aa(e[0],`
|
|
347
|
+
`),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(`
|
|
348
|
+
`):[],a={type:"table",raw:Aa(e[0],`
|
|
349
|
+
`),header:[],align:[],rows:[]};if(r.length===n.length){for(let c of n)this.rules.other.tableAlignRight.test(c)?a.align.push("right"):this.rules.other.tableAlignCenter.test(c)?a.align.push("center"):this.rules.other.tableAlignLeft.test(c)?a.align.push("left"):a.align.push(null);for(let c=0;c<r.length;c++)a.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:a.align[c]});for(let c of i)a.rows.push(Hk(c,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[d]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:Aa(e[0],`
|
|
350
|
+
`),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)===`
|
|
351
|
+
`?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=Aa(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=Wz(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)),Gk(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 Gk(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,c=i,u=0,d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(n=d.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]){c+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){u+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+u);let p=[...n[0]][0].length,f=t.slice(0,i+n.index+p+o);if(Math.min(i,o)%2){let v=f.slice(1,-1);return{type:"em",raw:f,text:v,tokens:this.lexer.inlineTokens(v)}}let g=f.slice(2,-2);return{type:"strong",raw:f,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,c=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(n=u.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]){c+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c);let d=[...n[0]][0].length,p=t.slice(0,i+n.index+d+o),f=p.slice(i,-i);return{type:"del",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}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}}}},Gn=class Hb{constructor(e){bt(this,"tokens");bt(this,"options");bt(this,"state");bt(this,"inlineQueue");bt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||zo,this.options.tokenizer=this.options.tokenizer||new Mf,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:Pr,block:rf.normal,inline:hc.normal};this.options.pedantic?(r.block=rf.pedantic,r.inline=hc.pedantic):this.options.gfm&&(r.block=rf.gfm,this.options.breaks?r.inline=hc.breaks:r.inline=hc.gfm),this.tokenizer.rules=r}static get rules(){return{block:rf,inline:hc}}static lex(e,r){return new Hb(r).lex(e)}static lexInline(e,r){return new Hb(r).inlineTokens(e)}lex(e){e=e.replace(Pr.carriageReturn,`
|
|
352
|
+
`),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,c;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Pr.tabCharGlobal," ").replace(Pr.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let u;if((o=(a=this.options.extensions)==null?void 0:a.block)!=null&&o.some(p=>(u=p.call({lexer:this},e,r))?(e=e.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);let p=r.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
|
|
353
|
+
`:r.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.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(`
|
|
354
|
+
`)?"":`
|
|
355
|
+
`)+u.raw,p.text+=`
|
|
356
|
+
`+u.text,this.inlineQueue.at(-1).src=p.text):r.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.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(`
|
|
357
|
+
`)?"":`
|
|
358
|
+
`)+u.raw,p.text+=`
|
|
359
|
+
`+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},r.push(u));continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),r.push(u);continue}let d=e;if((c=this.options.extensions)!=null&&c.startBlock){let p=1/0,f=e.slice(1),g;this.options.extensions.startBlock.forEach(v=>{g=v.call({lexer:this},f),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){let p=r.at(-1);n&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
360
|
+
`)?"":`
|
|
361
|
+
`)+u.raw,p.text+=`
|
|
362
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u),n=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
363
|
+
`)?"":`
|
|
364
|
+
`)+u.raw,p.text+=`
|
|
365
|
+
`+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u);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 d,p,f,g,v;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)x.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=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:p.call({lexer:this},n))??n;let o=!1,c="",u=1/0;for(;e;){if(e.length<u)u=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(c=""),o=!1;let x;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(b=>(x=b.call({lexer:this},e,r))?(e=e.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(x.raw.length);let b=r.at(-1);x.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(e,n,c)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(e,n,c)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(e)){e=e.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(e))){e=e.substring(x.raw.length),r.push(x);continue}let _=e;if((v=this.options.extensions)!=null&&v.startInline){let b=1/0,S=e.slice(1),A;this.options.extensions.startInline.forEach(O=>{A=O.call({lexer:this},S),typeof A=="number"&&A>=0&&(b=Math.min(b,A))}),b<1/0&&b>=0&&(_=e.substring(0,b+1))}if(x=this.tokenizer.inlineText(_)){e=e.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(c=x.raw.slice(-1)),o=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);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)}},Lf=class{constructor(e){bt(this,"options");bt(this,"parser");this.options=e||zo}space(e){return""}code({text:e,lang:r,escaped:n}){var o;let i=(o=(r||"").match(Pr.notSpaceStart))==null?void 0:o[0],a=e.replace(Pr.endingNewline,"")+`
|
|
366
|
+
`;return i?'<pre><code class="language-'+vi(i)+'">'+(n?a:vi(a,!0))+`</code></pre>
|
|
367
|
+
`:"<pre><code>"+(n?a:vi(a,!0))+`</code></pre>
|
|
368
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
369
|
+
${this.parser.parse(e)}</blockquote>
|
|
370
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
|
|
371
|
+
`}hr(e){return`<hr>
|
|
372
|
+
`}list(e){let r=e.ordered,n=e.start,i="";for(let c=0;c<e.items.length;c++){let u=e.items[c];i+=this.listitem(u)}let a=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+a+o+`>
|
|
373
|
+
`+i+"</"+a+`>
|
|
374
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
375
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
376
|
+
`}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 c=0;c<o.length;c++)n+=this.tablecell(o[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
377
|
+
<thead>
|
|
378
|
+
`+r+`</thead>
|
|
379
|
+
`+i+`</table>
|
|
380
|
+
`}tablerow({text:e}){return`<tr>
|
|
381
|
+
${e}</tr>
|
|
382
|
+
`}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
|
|
383
|
+
`}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>${vi(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=Fk(e);if(a===null)return i;e=a;let o='<a href="'+e+'"';return r&&(o+=' title="'+vi(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=Fk(e);if(a===null)return vi(n);e=a;let o=`<img src="${e}" alt="${vi(n)}"`;return r&&(o+=` title="${vi(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:vi(e.text)}},Xw=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}},Kn=class Wb{constructor(e){bt(this,"options");bt(this,"renderer");bt(this,"textRenderer");this.options=e||zo,this.options.renderer=this.options.renderer||new Lf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Xw}static parse(e,r){return new Wb(r).parse(e)}static parseInline(e,r){return new Wb(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 u=o,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){r+=d||"";continue}}let c=o;switch(c.type){case"space":{r+=this.renderer.space(c);break}case"hr":{r+=this.renderer.hr(c);break}case"heading":{r+=this.renderer.heading(c);break}case"code":{r+=this.renderer.code(c);break}case"table":{r+=this.renderer.table(c);break}case"blockquote":{r+=this.renderer.blockquote(c);break}case"list":{r+=this.renderer.list(c);break}case"checkbox":{r+=this.renderer.checkbox(c);break}case"html":{r+=this.renderer.html(c);break}case"def":{r+=this.renderer.def(c);break}case"paragraph":{r+=this.renderer.paragraph(c);break}case"text":{r+=this.renderer.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}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 c=e[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){n+=d||"";continue}}let u=c;switch(u.type){case"escape":{n+=r.text(u);break}case"html":{n+=r.html(u);break}case"link":{n+=r.link(u);break}case"image":{n+=r.image(u);break}case"checkbox":{n+=r.checkbox(u);break}case"strong":{n+=r.strong(u);break}case"em":{n+=r.em(u);break}case"codespan":{n+=r.codespan(u);break}case"br":{n+=r.br(u);break}case"del":{n+=r.del(u);break}case"text":{n+=r.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},Af,Ec=(Af=class{constructor(e){bt(this,"options");bt(this,"block");this.options=e||zo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Gn.lex:Gn.lexInline}provideParser(e=this.block){return e?Kn.parse:Kn.parseInline}},bt(Af,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),bt(Af,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Af),Vz=class{constructor(...t){bt(this,"defaults",Uw());bt(this,"options",this.setOptions);bt(this,"parse",this.parseMarkdown(!0));bt(this,"parseInline",this.parseMarkdown(!1));bt(this,"Parser",Kn);bt(this,"Renderer",Lf);bt(this,"TextRenderer",Xw);bt(this,"Lexer",Gn);bt(this,"Tokenizer",Mf);bt(this,"Hooks",Ec);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 c of o.header)r=r.concat(this.walkTokens(c.tokens,e));for(let c of o.rows)for(let u of c)r=r.concat(this.walkTokens(u.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(c=>{let u=o[c].flat(1/0);r=r.concat(this.walkTokens(u,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 c=i.renderer.apply(this,o);return c===!1&&(c=a.apply(this,o)),c}: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 Lf(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,c=r.renderer[o],u=i[o];i[o]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Mf(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,c=r.tokenizer[o],u=i[o];i[o]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new Ec;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,c=r.hooks[o],u=i[o];Ec.passThroughHooks.has(a)?i[o]=d=>{if(this.defaults.async&&Ec.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await c.call(i,d);return u.call(i,f)})();let p=c.call(i,d);return u.call(i,p)}:i[o]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(i,d);return f===!1&&(f=await u.apply(i,d)),f})();let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(o){let c=[];return c.push(a.call(this,o)),i&&(c=c.concat(i.call(this,o))),c}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Gn.lex(t,e??this.defaults)}parser(t,e){return Kn.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,c=await(i.hooks?await i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(o,i),u=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(o,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
|
|
384
|
+
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+vi(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ro=new Vz;function nt(t,e){return Ro.parse(t,e)}nt.options=nt.setOptions=function(t){return Ro.setOptions(t),nt.defaults=Ro.defaults,lP(nt.defaults),nt};nt.getDefaults=Uw;nt.defaults=zo;nt.use=function(...t){return Ro.use(...t),nt.defaults=Ro.defaults,lP(nt.defaults),nt};nt.walkTokens=function(t,e){return Ro.walkTokens(t,e)};nt.parseInline=Ro.parseInline;nt.Parser=Kn;nt.parser=Kn.parse;nt.Renderer=Lf;nt.TextRenderer=Xw;nt.Lexer=Gn;nt.lexer=Gn.lex;nt.Tokenizer=Mf;nt.Hooks=Ec;nt.parse=nt;nt.options;nt.setOptions;nt.use;nt.walkTokens;nt.parseInline;Kn.parse;Gn.lex;function Xz(){const[t,e]=P.useState(!1),[r,n]=P.useState(""),[i,a]=P.useState(null),o=P.useRef(null),c=P.useRef(null),u=P.useRef(null),{messages:d,streaming:p,isStreaming:f,connected:g,sendChatMessage:v,addUserMessage:x,uploadAttachment:_}=sP(),b=P.useMemo(()=>d.slice(-10),[d]);P.useLayoutEffect(()=>{const j=o.current;j&&(j.scrollTop=j.scrollHeight)},[b,p,f,t]);async function S(){const j=r.trim();if(!j&&!i||f)return;const E=crypto.randomUUID(),T=i==null?void 0:i.name,N=[j,T?`Attachment: ${T}`:""].filter(Boolean).join(`
|
|
385
|
+
|
|
386
|
+
`);x({id:E,role:"user",content:j,timestamp:new Date().toISOString(),attachmentName:T}),n(""),a(null),u.current&&(u.current.value=""),c.current&&(c.current.style.height="auto");try{i&&await _(i,E),v(N),e(!0)}catch{}}function A(j){n(j.target.value),c.current&&(c.current.style.height="auto",c.current.style.height=`${Math.min(c.current.scrollHeight,96)}px`)}function O(j){j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),S())}return y.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",children:[t&&y.jsxs("div",{className:"w-[340px] h-[460px] rounded-2xl border border-white/[0.09] shadow-2xl overflow-hidden flex flex-col",style:{background:"#1c1c1c"},children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07] flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(216,51,51,0.18) 0%, rgba(240,65,255,0.10) 100%)"},children:[y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:20}),y.jsx("span",{className:"text-xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:"quick chat"})]}),y.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1 rounded-lg hover:bg-white/[0.07] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:y.jsx(nP,{className:"w-3.5 h-3.5"})})]}),y.jsxs("div",{ref:o,className:"flex-1 overflow-y-auto p-3 space-y-2",children:[b.length===0&&!f?y.jsx("div",{className:"h-full flex items-center justify-center text-center px-6",children:y.jsx("p",{className:"text-xs text-zinc-500",children:"Ask IO anything without leaving this page."})}):b.map(j=>y.jsx("div",{className:`flex ${j.role==="user"?"justify-end":"justify-start"}`,title:j.timestamp,children:y.jsxs("div",{className:`max-w-[85%] ${j.role==="user"?"ml-8":"mr-8"}`,children:[j.attachmentName&&y.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:j.attachmentName}),j.content&&y.jsx("div",{className:j.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:j.role==="user"?j.content:y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(j.content)}})})]})},j.id)),f&&y.jsx("div",{className:"flex justify-start",children:y.jsx("div",{className:"max-w-[85%] mr-8 bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:p?y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(p)}}):y.jsx("div",{className:"flex items-center gap-1.5 py-1",children:[0,120,240].map(j=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${j}ms`}},j))})})})]}),y.jsx("div",{className:"p-2.5 border-t border-white/[0.06]",children:y.jsxs("div",{className:"bg-[#252525] border border-white/[0.08] rounded-xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:u,type:"file",className:"hidden",onChange:j=>{var E;return a(((E=j.target.files)==null?void 0:E[0])??null)}}),i&&y.jsxs("div",{className:"px-3 pt-2 text-[10px] font-mono text-zinc-400",children:["Attached: ",i.name]}),y.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2",children:[y.jsx("button",{type:"button",onClick:()=>{var j;return(j=u.current)==null?void 0:j.click()},className:"p-1 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors flex-shrink-0 cursor-pointer",children:y.jsx(QN,{className:"w-3.5 h-3.5"})}),y.jsx("textarea",{ref:c,value:r,onChange:A,onKeyDown:O,placeholder:"Message IO…",rows:1,className:"flex-1 bg-transparent text-xs text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none leading-relaxed",style:{minHeight:"18px",maxHeight:"96px",fontFamily:"Inter, sans-serif"}}),y.jsx("button",{type:"button",onClick:()=>void S(),disabled:!r.trim()&&!i||!g&&!f,className:"p-1.5 rounded-lg text-white disabled:opacity-25 disabled:cursor-not-allowed transition-opacity hover:opacity-90 flex-shrink-0 cursor-pointer",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:f?y.jsx(Jh,{className:"w-3 h-3"}):y.jsx(tP,{className:"w-3 h-3"})})]})]})})]}),y.jsx("button",{type:"button",onClick:()=>e(j=>!j),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:y.jsx(x4,{className:"w-5 h-5"})})]})}function vP(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=vP(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function ot(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=vP(t))&&(n&&(n+=" "),n+=e);return n}const Yz=(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},Jz=(t,e)=>({classGroupId:t,validator:e}),bP=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),Df="-",Kk=[],Zz="arbitrary..",Qz=t=>{const e=tB(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return eB(o);const c=o.split(Df),u=c[0]===""&&c.length>1?1:0;return xP(c,u,e)},getConflictingClassGroupIds:(o,c)=>{if(c){const u=n[o],d=r[o];return u?d?Yz(d,u):u:d||Kk}return r[o]||Kk}}},xP=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const i=t[e],a=r.nextPart.get(i);if(a){const d=xP(t,e+1,a);if(d)return d}const o=r.validators;if(o===null)return;const c=e===0?t.join(Df):t.slice(e).join(Df),u=o.length;for(let d=0;d<u;d++){const p=o[d];if(p.validator(c))return p.classGroupId}},eB=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?Zz+n:void 0})(),tB=t=>{const{theme:e,classGroups:r}=t;return rB(r,e)},rB=(t,e)=>{const r=bP();for(const n in t){const i=t[n];Yw(i,r,n,e)}return r},Yw=(t,e,r,n)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];nB(o,e,r,n)}},nB=(t,e,r,n)=>{if(typeof t=="string"){iB(t,e,r);return}if(typeof t=="function"){aB(t,e,r,n);return}oB(t,e,r,n)},iB=(t,e,r)=>{const n=t===""?e:wP(e,t);n.classGroupId=r},aB=(t,e,r,n)=>{if(sB(t)){Yw(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(Jz(r,t))},oB=(t,e,r,n)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[c,u]=i[o];Yw(u,wP(e,c),r,n)}},wP=(t,e)=>{let r=t;const n=e.split(Df),i=n.length;for(let a=0;a<i;a++){const o=n[a];let c=r.nextPart.get(o);c||(c=bP(),r.nextPart.set(o,c)),r=c}return r},sB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,lB=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)}}},Gb="!",Vk=":",cB=[],Xk=(t,e,r,n,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),uB=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=i=>{const a=[];let o=0,c=0,u=0,d;const p=i.length;for(let _=0;_<p;_++){const b=i[_];if(o===0&&c===0){if(b===Vk){a.push(i.slice(u,_)),u=_+1;continue}if(b==="/"){d=_;continue}}b==="["?o++:b==="]"?o--:b==="("?c++:b===")"&&c--}const f=a.length===0?i:i.slice(u);let g=f,v=!1;f.endsWith(Gb)?(g=f.slice(0,-1),v=!0):f.startsWith(Gb)&&(g=f.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return Xk(a,v,g,x)};if(e){const i=e+Vk,a=n;n=o=>o.startsWith(i)?a(o.slice(i.length)):Xk(cB,!1,o,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},dB=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],c=o[0]==="[",u=e.has(o);c||u?(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}},fB=t=>({cache:lB(t.cacheSize),parseClassName:uB(t),sortModifiers:dB(t),postfixLookupClassGroupIds:hB(t),...Qz(t)}),hB=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},pB=/\s+/,mB=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=e,c=[],u=t.trim().split(pB);let d="";for(let p=u.length-1;p>=0;p-=1){const f=u[p],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=r(f);if(g){d=f+(d.length>0?" "+d:d);continue}let S=!!b,A;if(S){const N=_.substring(0,b);A=n(N);const R=A&&o[A]?n(_):void 0;R&&R!==A&&(A=R,S=!1)}else A=n(_);if(!A){if(!S){d=f+(d.length>0?" "+d:d);continue}if(A=n(_),!A){d=f+(d.length>0?" "+d:d);continue}S=!1}const O=v.length===0?"":v.length===1?v[0]:a(v).join(":"),j=x?O+Gb:O,E=j+A;if(c.indexOf(E)>-1)continue;c.push(E);const T=i(A,S);for(let N=0;N<T.length;++N){const R=T[N];c.push(j+R)}d=f+(d.length>0?" "+d:d)}return d},gB=(...t)=>{let e=0,r,n,i="";for(;e<t.length;)(r=t[e++])&&(n=_P(r))&&(i&&(i+=" "),i+=n);return i},_P=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=_P(t[n]))&&(r&&(r+=" "),r+=e);return r},yB=(t,...e)=>{let r,n,i,a;const o=u=>{const d=e.reduce((p,f)=>f(p),t());return r=fB(d),n=r.cache.get,i=r.cache.set,a=c,c(u)},c=u=>{const d=n(u);if(d)return d;const p=mB(u,r);return i(u,p),p};return a=o,(...u)=>a(gB(...u))},vB=[],nr=t=>{const e=r=>r[t]||vB;return e.isThemeGetter=!0,e},SP=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wB=/\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$/,_B=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ta=t=>bB.test(t),Ye=t=>!!t&&!Number.isNaN(Number(t)),gi=t=>!!t&&Number.isInteger(Number(t)),Ag=t=>t.endsWith("%")&&Ye(t.slice(0,-1)),Li=t=>xB.test(t),EP=()=>!0,EB=t=>wB.test(t)&&!_B.test(t),Jw=()=>!1,OB=t=>SB.test(t),AB=t=>kB.test(t),TB=t=>!ke(t)&&!Ae(t),jB=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)),CB=t=>Fa(t,TP,Jw),ke=t=>SP.test(t),go=t=>Fa(t,jP,EB),Yk=t=>Fa(t,DB,Ye),NB=t=>Fa(t,NP,EP),PB=t=>Fa(t,CP,Jw),Jk=t=>Fa(t,OP,Jw),RB=t=>Fa(t,AP,AB),nf=t=>Fa(t,PP,OB),Ae=t=>kP.test(t),pc=t=>Bo(t,jP),IB=t=>Bo(t,CP),Zk=t=>Bo(t,OP),$B=t=>Bo(t,TP),MB=t=>Bo(t,AP),af=t=>Bo(t,PP,!0),LB=t=>Bo(t,NP,!0),Fa=(t,e,r)=>{const n=SP.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Bo=(t,e,r=!1)=>{const n=kP.exec(t);return n?n[1]?e(n[1]):r:!1},OP=t=>t==="position"||t==="percentage",AP=t=>t==="image"||t==="url",TP=t=>t==="length"||t==="size"||t==="bg-size",jP=t=>t==="length",DB=t=>t==="number",CP=t=>t==="family-name",NP=t=>t==="number"||t==="weight",PP=t=>t==="shadow",zB=()=>{const t=nr("color"),e=nr("font"),r=nr("text"),n=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),c=nr("container"),u=nr("spacing"),d=nr("radius"),p=nr("shadow"),f=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),x=nr("blur"),_=nr("perspective"),b=nr("aspect"),S=nr("ease"),A=nr("animate"),O=()=>["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(),Ae,ke],T=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],R=()=>[Ae,ke,u],M=()=>[Ta,"full","auto",...R()],J=()=>[gi,"none","subgrid",Ae,ke],F=()=>["auto",{span:["full",gi,Ae,ke]},gi,Ae,ke],B=()=>[gi,"auto",Ae,ke],K=()=>["auto","min","max","fr",Ae,ke],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...R()],te=()=>[Ta,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],H=()=>[Ta,"screen","full","dvw","lvw","svw","min","max","fit",...R()],Q=()=>[Ta,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],U=()=>[t,Ae,ke],I=()=>[...j(),Zk,Jk,{position:[Ae,ke]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",$B,CB,{size:[Ae,ke]}],oe=()=>[Ag,pc,go],le=()=>["","none","full",d,Ae,ke],ve=()=>["",Ye,pc,go],qe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Ye,Ag,Zk,Jk],Se=()=>["","none",x,Ae,ke],Me=()=>["none",Ye,Ae,ke],se=()=>["none",Ye,Ae,ke],tt=()=>[Ye,Ae,ke],Fe=()=>[Ta,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Li],breakpoint:[Li],color:[EP],container:[Li],"drop-shadow":[Li],ease:["in","out","in-out"],font:[TB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Li],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Li],shadow:[Li],spacing:["px",Ye],text:[Li],"text-shadow":[Li],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ta,ke,Ae,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,ke]}],"container-named":[jB],columns:[{columns:[Ye,ke,Ae,c]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ae,ke]}],basis:[{basis:[Ta,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Ta,"auto","initial","none",ke]}],grow:[{grow:["",Ye,Ae,ke]}],shrink:[{shrink:["",Ye,Ae,ke]}],order:[{order:[gi,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],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:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:te()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[c,"screen",...te()]}],"min-w":[{"min-w":[c,"screen","none",...te()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...te()]}],h:[{h:["screen","lh",...te()]}],"min-h":[{"min-h":["screen","lh","none",...te()]}],"max-h":[{"max-h":["screen","lh",...te()]}],"font-size":[{text:["base",r,pc,go]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,LB,NB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ag,ke]}],"font-family":[{font:[IB,PB,e]}],"font-features":[{"font-features":[ke]}],"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,Ae,ke]}],"line-clamp":[{"line-clamp":[Ye,"none",Ae,Yk]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",Ae,go]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Ye,"auto",Ae,ke]}],"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:[gi,Ae,ke]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],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",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ae,ke],radial:["",Ae,ke],conic:[gi,Ae,ke]},MB,RB]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,Ae,ke]}],"outline-w":[{outline:["",Ye,pc,go]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",p,af,nf]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,af,nf]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Ye,go]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,af,nf]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Ye,Ae,ke]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:Se()}],brightness:[{brightness:[Ye,Ae,ke]}],contrast:[{contrast:[Ye,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,af,nf]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Ye,Ae,ke]}],"hue-rotate":[{"hue-rotate":[Ye,Ae,ke]}],invert:[{invert:["",Ye,Ae,ke]}],saturate:[{saturate:[Ye,Ae,ke]}],sepia:[{sepia:["",Ye,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",Ye,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,Ae,ke]}],"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",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",Ae,ke]}],ease:[{ease:["linear","initial",S,Ae,ke]}],delay:[{delay:[Ye,Ae,ke]}],animate:[{animate:["none",A,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ae,ke]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:tt()}],"skew-x":[{"skew-x":tt()}],"skew-y":[{"skew-y":tt()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[gi,Ae,ke]}],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Ae,ke]}],"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":U()}],"scrollbar-track-color":[{"scrollbar-track":U()}],"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",Ae,ke]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Ye,pc,go,Yk]}],stroke:[{stroke:["none",...U()]}],"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"]}},BB=yB(zB);function Oc(...t){return BB(ot(t))}function UB({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 y.jsxs("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[r&&y.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${e} opacity-40 animate-ping`}),y.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${e}`})]})}function jt({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 y.jsx("span",{className:`inline-flex items-center px-2 py-px rounded-full text-[10px] font-mono border ${n} ${r}`,children:t})}function qB({name:t,color:e}){return e?y.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}):y.jsx(jt,{variant:"muted",children:t})}function za({children:t,onClick:e,className:r="",type:n="button",disabled:i=!1}){return y.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 _i({children:t,onClick:e,className:r=""}){return y.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 zf({children:t,onClick:e,className:r=""}){return y.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 FB({children:t,onClick:e,className:r=""}){return y.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 Co(t){return t==="connected"||t==="idle"?"success":t==="active"||t==="working"?"warning":t==="reviewing"||t==="in meeting"||t==="planning"||t==="meeting"?"info":t==="error"||t==="failed"?"error":"muted"}function rp(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 HB(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 c(p){try{d(n.next(p))}catch(f){o(f)}}function u(p){try{d(n.throw(p))}catch(f){o(f)}}function d(p){p.done?a(p.value):i(p.value).then(c,u)}d((n=n.apply(t,e||[])).next())})}const WB=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Zw 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 GB extends Zw{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Qk extends Zw{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class eE extends Zw{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Kb;(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"})(Kb||(Kb={}));class KB{constructor(e,{headers:r={},customFetch:n,region:i=Kb.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=WB(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return HB(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:c,method:u,body:d,signal:p,timeout:f}=n;let g={},{region:v}=n;v||(v=this.region);const x=new URL(`${this.url}/${r}`);v&&v!=="any"&&(g["x-region"]=v,x.searchParams.set("forceFunctionRegion",v));let _;d&&(c&&!Object.prototype.hasOwnProperty.call(c,"Content-Type")||!c)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",_=d):typeof d=="string"?(g["Content-Type"]="text/plain",_=d):typeof FormData<"u"&&d instanceof FormData?_=d:(g["Content-Type"]="application/json",_=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?_=JSON.stringify(d):_=d;let b=p;f&&(o=new AbortController,a=setTimeout(()=>o.abort(),f),p?(b=o.signal,p.addEventListener("abort",()=>o.abort())):b=o.signal);const S=yield this.fetch(x.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),c),body:_,signal:b}).catch(E=>{throw new GB(E)}),A=S.headers.get("x-relay-error");if(A&&A==="true")throw new Qk(S);if(!S.ok)throw new eE(S);let O=((i=S.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),j;return O==="application/json"?j=yield S.json():O==="application/octet-stream"||O==="application/pdf"?j=yield S.blob():O==="text/event-stream"?j=S:O==="multipart/form-data"?j=yield S.formData():j=yield S.text(),{data:j,error:null,response:S}}catch(c){return{data:null,error:c,response:c instanceof eE||c instanceof Qk?c.context:void 0}}finally{a&&clearTimeout(a)}})}}const RP=3,tE=t=>Math.min(1e3*2**t,3e4),VB=[520,503],IP=["GET","HEAD","OPTIONS"];var XB=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 rE(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 YB(t,e,r,n){return!(!n||r>=RP||!IP.includes(t)||!VB.includes(e))}var JB=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 d=new Headers(r.headers);o>0&&d.set("X-Retry-Count",String(o));let p;try{p=await n(r.url.toString(),{method:r.method,headers:d,body:JSON.stringify(r.body,(f,g)=>typeof g=="bigint"?g.toString():g),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!IP.includes(r.method))throw f;if(r.retryEnabled&&o<RP){const g=tE(o);o++,await rE(g,r.signal);continue}throw f}if(YB(r.method,p.status,o,r.retryEnabled)){var c,u;const f=(c=(u=p.headers)===null||u===void 0?void 0:u.get("Retry-After"))!==null&&c!==void 0?c:null,g=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:tE(o);await p.text(),o++,await rE(g,r.signal);continue}return await r.processResponse(p)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var c;let u="",d="",p="";const f=o==null?void 0:o.cause;if(f){var g,v,x,_;const A=(g=f==null?void 0:f.message)!==null&&g!==void 0?g:"",O=(v=f==null?void 0:f.code)!==null&&v!==void 0?v:"";u=`${(x=o==null?void 0:o.name)!==null&&x!==void 0?x:"FetchError"}: ${o==null?void 0:o.message}`,u+=`
|
|
387
|
+
|
|
388
|
+
Caused by: ${(_=f==null?void 0:f.name)!==null&&_!==void 0?_:"Error"}: ${A}`,O&&(u+=` (${O})`),f!=null&&f.stack&&(u+=`
|
|
389
|
+
${f.stack}`)}else{var b;u=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const S=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(p="",d="Request was aborted (timeout or manual cancellation)",S>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${S} 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.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(p="",d="HTTP headers exceeded server limits (typically 16KB)",S>this.urlLengthLimit&&(d+=`. Your request URL is ${S} 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:`${(c=o==null?void 0:o.name)!==null&&c!==void 0?c:"FetchError"}: ${o==null?void 0:o.message}`,details:u,hint:d,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 c,u;if(e.method!=="HEAD"){var d;const g=await t.text();g===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((d=e.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?n=g:n=JSON.parse(g))}const p=(c=e.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),f=(u=t.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");p&&f&&f.length>1&&(i=parseInt(f[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 XB(r)}return{success:r===null,error:r,data:n,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},ZB=class extends JB{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 c=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${u}"; options=${c};`),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 nE=new RegExp("[,()]");var Cs=class extends ZB{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"&&nE.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"&&nE.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}},QB=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(d=>/\s/.test(d)&&!a?"":(d==='"'&&(a=!a),d)).join(""),{url:c,headers:u}=this.cloneRequestState();return c.searchParams.set("select",o),n&&u.append("Prefer",`count=${n}`),new Cs({method:i,url:c,headers:u,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 c=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new Cs({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:c,headers:u}=this.cloneRequestState();if(u.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&c.searchParams.set("on_conflict",e),n&&u.append("Prefer",`count=${n}`),i||u.append("Prefer","missing=default"),Array.isArray(t)){const d=t.reduce((p,f)=>p.concat(Object.keys(f)),[]);if(d.length>0){const p=[...new Set(d)].map(f=>`"${f}"`);c.searchParams.set("columns",p.join(","))}}return new Cs({method:o,url:c,headers:u,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 Cs({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 Cs({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 qc(t){"@babel/helpers - typeof";return qc=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},qc(t)}function e6(t,e){if(qc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t6(t){var e=e6(t,"string");return qc(e)=="symbol"?e:e+""}function r6(t,e,r){return(e=t6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iE(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 of(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iE(Object(r),!0).forEach(function(n){r6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var n6=class $P{constructor(e,{headers:r={},schema:n,fetch:i,timeout:a,urlLengthLimit:o=8e3,retry:c}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const u=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(d,p)=>{const f=new AbortController,g=setTimeout(()=>f.abort(),a),v=p==null?void 0:p.signal;if(v){if(v.aborted)return clearTimeout(g),u(d,p);const x=()=>{clearTimeout(g),f.abort()};return v.addEventListener("abort",x,{once:!0}),u(d,of(of({},p),{},{signal:f.signal})).finally(()=>{clearTimeout(g),v.removeEventListener("abort",x)})}return u(d,of(of({},p),{},{signal:f.signal})).finally(()=>clearTimeout(g))}:this.fetch=u,this.retry=c}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new QB(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 $P(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 c;const u=new URL(`${this.url}/rpc/${e}`);let d;const p=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(p)),f=n&&Object.values(r).some(p);f?(c="POST",d=r):n||i?(c=n?"HEAD":"GET",Object.entries(r).filter(([v,x])=>x!==void 0).map(([v,x])=>[v,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([v,x])=>{u.searchParams.append(v,x)})):(c="POST",d=r);const g=new Headers(this.headers);return f?g.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&g.set("Prefer",`count=${a}`),new Cs({method:c,url:u,headers:g,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class i6{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,c=parseInt(o.replace(/^v/,"").split(".")[0]);return c>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${c} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${c} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
390
|
+
import ws from "ws"
|
|
391
|
+
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+=`
|
|
392
|
+
|
|
393
|
+
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 a6="2.106.2",o6=`realtime-js/${a6}`,s6="1.0.0",MP="2.0.0",l6=MP,c6=1e4,u6=100,Ca={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},LP={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Vb={connecting:"connecting",closing:"closing",closed:"closed"};class d6{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,c=(i=e.ref)!==null&&i!==void 0?i:"",u=(a=e.join_ref)!==null&&a!==void 0?a:"",d=e.payload.event,p=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(p).length===0?"":JSON.stringify(p);if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+c.length+o.length+d.length+f.length,v=new ArrayBuffer(this.HEADER_LENGTH+g);let x=new DataView(v),_=0;x.setUint8(_++,this.KINDS.userBroadcastPush),x.setUint8(_++,u.length),x.setUint8(_++,c.length),x.setUint8(_++,o.length),x.setUint8(_++,d.length),x.setUint8(_++,f.length),x.setUint8(_++,r),Array.from(u,S=>x.setUint8(_++,S.charCodeAt(0))),Array.from(c,S=>x.setUint8(_++,S.charCodeAt(0))),Array.from(o,S=>x.setUint8(_++,S.charCodeAt(0))),Array.from(d,S=>x.setUint8(_++,S.charCodeAt(0))),Array.from(f,S=>x.setUint8(_++,S.charCodeAt(0)));var b=new Uint8Array(v.byteLength+n.byteLength);return b.set(new Uint8Array(v),0),b.set(new Uint8Array(n),v.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,c,u]=n;return r({join_ref:i,ref:a,topic:o,event:c,payload:u})}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),c=r.getUint8(4);let u=this.HEADER_LENGTH+4;const d=n.decode(e.slice(u,u+i));u=u+i;const p=n.decode(e.slice(u,u+a));u=u+a;const f=n.decode(e.slice(u,u+o));u=u+o;const g=e.slice(u,e.byteLength),v=c===this.JSON_ENCODING?JSON.parse(n.decode(g)):g,x={type:this.BROADCAST_EVENT,event:p,payload:v};return o>0&&(x.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:x}}_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 At;(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"})(At||(At={}));const aE=(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]=f6(o,t,e,i),a),{}):{}},f6=(t,e,r,n)=>{const i=e.find(c=>c.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?DP(a,o):Xb(o)},DP=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return g6(e,r)}switch(t){case At.bool:return h6(e);case At.float4:case At.float8:case At.int2:case At.int4:case At.int8:case At.numeric:case At.oid:return p6(e);case At.json:case At.jsonb:return m6(e);case At.timestamp:return y6(e);case At.abstime:case At.date:case At.daterange:case At.int4range:case At.int8range:case At.money:case At.reltime:case At.text:case At.time:case At.timestamptz:case At.timetz:case At.tsrange:case At.tstzrange:return Xb(e);default:return Xb(e)}},Xb=t=>t,h6=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},p6=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},m6=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},g6=(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(c=>DP(e,c))}return t},y6=t=>typeof t=="string"?t.replace(" ","T"):t,zP=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 Pc=t=>typeof t=="function"?t:function(){return t},v6=typeof self<"u"?self:null,Ns=typeof window<"u"?window:null,bi=v6||Ns||globalThis,b6="2.0.0",x6=1e4,w6=1e3,xi={connecting:0,open:1,closing:2,closed:3},Xr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Bi={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Yb={longpoll:"longpoll",websocket:"websocket"},_6={complete:4},Jb="base64url.bearer.phx.",sf=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})}},BP=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))}},S6=class{constructor(t,e,r){this.state=Xr.closed,this.topic=t,this.params=Pc(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new sf(this,Bi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new BP(()=>{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 sf(this,Bi.leave,Pc({}),this.timeout).send(),this.state=Xr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Bi.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(Bi.close,t)}onError(t){return this.on(Bi.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 sf(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(Bi.close,"leave")},r=new sf(this,Bi.leave,Pc({}),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}},Bf=class{static request(t,e,r,n,i,a,o){if(bi.XDomainRequest){let c=new bi.XDomainRequest;return this.xdomainRequest(c,t,e,n,i,a,o)}else if(bi.XMLHttpRequest){let c=new bi.XMLHttpRequest;return this.xhrRequest(c,t,e,r,n,i,a,o)}else{if(bi.fetch&&bi.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 c={method:t,headers:r,body:n},u=null;return i&&(u=new AbortController,setTimeout(()=>u.abort(),i),c.signal=u.signal),bi.fetch(e,c).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>o&&o(d)).catch(d=>{d.name==="AbortError"&&a?a():o&&o(null)}),u}static xdomainRequest(t,e,r,n,i,a,o){return t.timeout=i,t.open(e,r),t.onload=()=>{let c=this.parseJSON(t.responseText);o&&o(c)},a&&(t.ontimeout=a),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,i,a,o,c){t.open(e,r,!0),t.timeout=a;for(let[u,d]of Object.entries(n))t.setRequestHeader(u,d);return t.onerror=()=>c&&c(null),t.onreadystatechange=()=>{if(t.readyState===_6.complete&&c){let u=this.parseJSON(t.responseText);c(u)}},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)}`}},k6=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)},xs=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Jb)&&(this.authToken=atob(e[1].slice(Jb.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=xi.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Yb.websocket),"$1/"+Yb.longpoll)}endpointURL(){return Bf.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=xi.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===xi.open||this.readyState===xi.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=xi.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=k6(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(`
|
|
394
|
+
`),()=>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=xi.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=Bf.request(t,this.endpointURL(),e,r,this.timeout,o,c=>{this.reqs.delete(a),this.isActive()&&i(c)}),this.reqs.add(a)}},E6=class Ac{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:c}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Ac.syncState(this.state,i,a,o),this.pendingDiffs.forEach(u=>{this.state=Ac.syncDiff(this.state,u,a,o)}),this.pendingDiffs=[],c()}),this.channel.on(n.diff,i=>{let{onJoin:a,onLeave:o,onSync:c}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Ac.syncDiff(this.state,i,a,o),c())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Ac.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={},c={};return this.map(a,(u,d)=>{r[u]||(c[u]=d)}),this.map(r,(u,d)=>{let p=a[u];if(p){let f=d.metas.map(_=>_.phx_ref),g=p.metas.map(_=>_.phx_ref),v=d.metas.filter(_=>g.indexOf(_.phx_ref)<0),x=p.metas.filter(_=>f.indexOf(_.phx_ref)<0);v.length>0&&(o[u]=d,o[u].metas=v),x.length>0&&(c[u]=this.clone(p),c[u].metas=x)}else o[u]=d}),this.syncDiff(a,{joins:o,leaves:c},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,(c,u)=>{let d=e[c];if(e[c]=this.clone(u),d){let p=e[c].metas.map(g=>g.phx_ref),f=d.metas.filter(g=>p.indexOf(g.phx_ref)<0);e[c].metas.unshift(...f)}n(c,d,u)}),this.map(o,(c,u)=>{let d=e[c];if(!d)return;let p=u.metas.map(f=>f.phx_ref);d.metas=d.metas.filter(f=>p.indexOf(f.phx_ref)<0),i(c,d,u),d.metas.length===0&&delete e[c]}),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))}},lf={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,c=new ArrayBuffer(this.HEADER_LENGTH+o),u=new DataView(c),d=0;u.setUint8(d++,this.KINDS.push),u.setUint8(d++,e.length),u.setUint8(d++,r.length),u.setUint8(d++,i.length),u.setUint8(d++,n.length),Array.from(e,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(r,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(i,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(n,f=>u.setUint8(d++,f.charCodeAt(0)));var p=new Uint8Array(c.byteLength+a.byteLength);return p.set(new Uint8Array(c),0),p.set(new Uint8Array(a),c.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,c=r.decode(t.slice(o,o+n));o=o+n;let u=r.decode(t.slice(o,o+i));o=o+i;let d=r.decode(t.slice(o,o+a));o=o+a;let p=t.slice(o,t.byteLength);return{join_ref:c,ref:null,topic:u,event:d,payload:p}},decodeReply(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=e.getUint8(4),c=this.HEADER_LENGTH+this.META_LENGTH,u=r.decode(t.slice(c,c+n));c=c+n;let d=r.decode(t.slice(c,c+i));c=c+i;let p=r.decode(t.slice(c,c+a));c=c+a;let f=r.decode(t.slice(c,c+o));c=c+o;let g=t.slice(c,t.byteLength),v={status:f,response:g};return{join_ref:u,ref:d,topic:p,event:Bi.reply,payload:v}},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 c=r.decode(t.slice(a,a+i));a=a+i;let u=t.slice(a,t.byteLength);return{join_ref:null,ref:null,topic:o,event:c,payload:u}}},O6=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||x6,this.transport=e.transport||bi.WebSocket||xs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=bi&&bi.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=lf.encode.bind(lf),this.defaultDecoder=lf.decode.bind(lf),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!==xs?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Ns&&Ns.addEventListener&&(Ns.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Ns.addEventListener("pageshow",i=>{n===this.connectClock&&(n=null,this.connect())}),Ns.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=Pc(e.params||{}),this.endPoint=`${t}/${Yb.websocket}`,this.vsn=e.vsn||b6,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new BP(()=>{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 xs}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=Bf.appendParams(Bf.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=Pc(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==xs?this.connectWithFallback(xs,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 xs:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Jb}${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),c=u=>{this.log("transport",`falling back to ${o}...`,u),this.off([i,a]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return c("memorized");this.fallbackTimer=setTimeout(c,e),a=this.onError(u=>{this.log("transport","error",u),n&&!r&&(clearTimeout(this.fallbackTimer),c(u))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let u=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${u}`,"true"),this.log("transport",`established ${u} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(c,e),this.ping(u=>{this.log("transport","connected to primary after",u),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(),w6,"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===xi.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(Bi.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case xi.connecting:return"connecting";case xi.open:return"open";case xi.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 S6(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 c=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",c)}catch(u){this.log("error","error in heartbeat callback",u)}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 c=0;c<this.channels.length;c++){const u=this.channels[c];u.isMember(r,n,i,o)&&u.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 Rc{constructor(e,r){const n=T6(r);this.presence=new E6(e.getChannel(),n),this.presence.onJoin((i,a,o)=>{const c=Rc.onJoinPayload(i,a,o);e.getChannel().trigger("presence",c)}),this.presence.onLeave((i,a,o)=>{const c=Rc.onLeavePayload(i,a,o);e.getChannel().trigger("presence",c)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Rc.transformState(this.presence.state)}static transformState(e){return e=A6(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return r[n]=Cf(i),r},{})}static onJoinPayload(e,r,n){const i=oE(r),a=Cf(n);return{event:"join",key:e,currentPresences:i,newPresences:a}}static onLeavePayload(e,r,n){const i=oE(r),a=Cf(n);return{event:"leave",key:e,currentPresences:i,leftPresences:a}}}function Cf(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function A6(t){return JSON.parse(JSON.stringify(t))}function T6(t){return(t==null?void 0:t.events)&&{events:t.events}}function oE(t){return t!=null&&t.metas?Cf(t):[]}var sE;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(sE||(sE={}));class j6{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new Rc(this.channel.channelAdapter,r)}}function C6(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 N6{constructor(e,r,n){const i=P6(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>u6){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===Ca.joined}isJoined(){return this.state===Ca.joined}isJoining(){return this.state===Ca.joining}isClosed(){return this.state===Ca.closed}isLeaving(){return this.state===Ca.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function P6(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var lE;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(lE||(lE={}));var Is;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Is||(Is={}));var Ui;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Ui||(Ui={}));class Ic{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 N6(this.socket.socketAdapter,e,this.params),this.presence=new j6(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=zP(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:c,private:u}}=this.params,d=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(v=>v.filter))!==null&&i!==void 0?i:[],p=!!this.bindings[Is.PRESENCE]&&this.bindings[Is.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},g={broadcast:o,presence:Object.assign(Object.assign({},c),{enabled:p}),postgres_changes:d,private:u};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(v=>{e==null||e(Ui.CHANNEL_ERROR,C6(v))}),this._onClose(()=>e==null?void 0:e(Ui.CLOSED)),this.updateJoinPayload(Object.assign({config:g},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:v})=>{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){e==null||e(Ui.SUBSCRIBED);return}this._updatePostgresBindings(v,e)}).receive("error",v=>{this.state=Ca.errored;const x=Object.values(v).join(", ")||"error";e==null||e(Ui.CHANNEL_ERROR,new Error(x,{cause:v}))}).receive("timeout",()=>{e==null||e(Ui.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 c=0;c<a;c++){const u=i[c],{filter:{event:d,schema:p,table:f,filter:g}}=u,v=e&&e[c];if(v&&v.event===d&&Ic.isFilterValueEqual(v.schema,p)&&Ic.isFilterValueEqual(v.table,f)&&Ic.isFilterValueEqual(v.filter,g))o.push(Object.assign(Object.assign({},u),{id:v.id}));else{this.unsubscribe(),this.state=Ca.errored,r==null||r(Ui.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Ca.errored&&r&&r(Ui.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===Is.PRESENCE||e===Is.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}]})},c=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(c.status===202)return{success:!0};let u=c.statusText;try{const d=await c.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}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,c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=d.body)===null||i===void 0?void 0:i.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,c,u;const d=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(c=(o=this.params)===null||o===void 0?void 0:o.config)===null||c===void 0?void 0:c.broadcast)===null||u===void 0)&&u.ack)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.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,c,u,d,p;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const g=(i=this.bindings[f])===null||i===void 0?void 0:i.find(v=>v.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in g){const v=g.id,x=(a=g.filter)===null||a===void 0?void 0:a.event;return v&&((o=r.ids)===null||o===void 0?void 0:o.includes(v))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((c=r.data)===null||c===void 0?void 0:c.type.toLocaleLowerCase()))}else{const v=(d=(u=g==null?void 0:g.filter)===null||u===void 0?void 0:u.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return v==="*"||v===((p=r==null?void 0:r.event)===null||p===void 0?void 0:p.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,r){const{close:n,error:i,leave:a,join:o}=LP;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:c,type:u,errors:d}=i;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:c,eventType:u,new:{},old:{},errors:d}),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=aE(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=aE(e.columns,e.old_record)),r}}class R6{constructor(e,r){this.socket=new O6(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()==Vb.connecting}isDisconnecting(){return this.socket.connectionState()==Vb.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const cE={HEARTBEAT_INTERVAL:25e3},I6=[1e3,2e3,5e3,1e4],$6=1e4;function M6(){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 L6(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return M6()}const D6=`
|
|
395
|
+
addEventListener("message", (e) => {
|
|
396
|
+
if (e.data.event === "start") {
|
|
397
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
398
|
+
}
|
|
399
|
+
});`;class z6{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 d6,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 R6(e,i),this.httpEndpoint=zP(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}
|
|
400
|
+
|
|
401
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
402
|
+
|
|
403
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
404
|
+
Option 2: Install and provide the "ws" package:
|
|
405
|
+
|
|
406
|
+
npm install ws
|
|
407
|
+
|
|
408
|
+
import ws from "ws"
|
|
409
|
+
const client = new RealtimeClient(url, {
|
|
410
|
+
...options,
|
|
411
|
+
transport: ws
|
|
412
|
+
})`):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()||Vb.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 Ic(`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:o6};r&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(LP.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([D6],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,i,a,o,c,u,d,p,f,g,v;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 x={};x.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:c6,x.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:cE.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((c=e==null?void 0:e.heartbeatIntervalMs)!==null&&c!==void 0?c:cE.HEARTBEAT_INTERVAL),x.transport=(u=e==null?void 0:e.transport)!==null&&u!==void 0?u:i6.getWebSocketConstructor(),x.params=e==null?void 0:e.params,x.logger=e==null?void 0:e.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),x.sessionStorage=(d=e==null?void 0:e.sessionStorage)!==null&&d!==void 0?d:L6(),x.reconnectAfterMs=(p=e==null?void 0:e.reconnectAfterMs)!==null&&p!==void 0?p:(A=>I6[A-1]||$6);let _,b;const S=(f=e==null?void 0:e.vsn)!==null&&f!==void 0?f:l6;switch(S){case s6:_=(A,O)=>O(JSON.stringify(A)),b=(A,O)=>O(JSON.parse(A));break;case MP:_=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=S,x.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:_,x.decode=(v=e==null?void 0:e.decode)!==null&&v!==void 0?v:b,x.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,x.params=Object.assign(Object.assign({},x.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,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Fc=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 B6(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 U6(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 q6(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const c=B6(t.baseUrl,n,i),u=await U6(t.auth),d=await e(c,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...u,...o},body:a?JSON.stringify(a):void 0}),p=await d.text(),f=(d.headers.get("content-type")||"").includes("application/json"),g=f&&p?JSON.parse(p):p;if(!d.ok){const v=f?g:void 0,x=v==null?void 0:v.error;throw new Fc((x==null?void 0:x.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:v})}return{status:d.status,headers:d.headers,data:g}}}}function cf(t){return t.join("")}var F6=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:cf(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/${cf(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${cf(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${cf(t.namespace)}`}),!0}catch(e){if(e instanceof Fc&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof Fc&&r.status===409)return;throw r}}};function ws(t){return t.join("")}var H6=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/${ws(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/${ws(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/${ws(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/${ws(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/${ws(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/${ws(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof Fc&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof Fc&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},W6=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=q6({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new F6(this.client,e),this.tableOps=new H6(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 Hc(t){"@babel/helpers - typeof";return Hc=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},Hc(t)}function G6(t,e){if(Hc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function K6(t){var e=G6(t,"string");return Hc(e)=="symbol"?e:e+""}function V6(t,e,r){return(e=K6(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uE(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 Be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?uE(Object(r),!0).forEach(function(n){V6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):uE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var np=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 ip(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Zb=class extends np{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 Be({},super.toJSON())}},UP=class extends np{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Uf(t,e,r){const n=Be({},t),i=e.toLowerCase();for(const a of Object.keys(n))a.toLowerCase()===i&&delete n[a];return n[i]=r,n}function X6(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const Y6=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),J6=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)},Qb=t=>{if(Array.isArray(t))return t.map(r=>Qb(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]=Qb(n)}),e},Z6=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),dE=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)},Q6=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 c=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";e(new Zb(dE(o),a,c,n))}).catch(()=>{const o=a+"";e(new Zb(i.statusText||`HTTP ${a} error`,a,o,n))})}else e(new UP(dE(t),t,n))},e8=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return Be(Be({},i),r);if(J6(n)){var a;const o=(e==null?void 0:e.headers)||{};let c;for(const[u,d]of Object.entries(o))u.toLowerCase()==="content-type"&&(c=d);i.headers=Uf(o,"Content-Type",(a=c)!==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),Be(Be({},i),r)};async function mc(t,e,r,n,i,a,o){return new Promise((c,u)=>{t(r,e8(e,n,i,a)).then(d=>{if(!d.ok)throw d;if(n!=null&&n.noResolveJson)return d;if(o==="vectors"){const p=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!p||!p.includes("application/json"))return{}}return d.json()}).then(d=>c(d)).catch(d=>Q6(d,u,n,o))})}function qP(t="storage"){return{get:async(e,r,n,i)=>mc(e,"GET",r,n,i,void 0,t),post:async(e,r,n,i,a)=>mc(e,"POST",r,i,a,n,t),put:async(e,r,n,i,a)=>mc(e,"PUT",r,i,a,n,t),head:async(e,r,n,i)=>mc(e,"HEAD",r,Be(Be({},n),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,r,n,i,a)=>mc(e,"DELETE",r,i,a,n,t)}}const t8=qP("storage"),{get:Wc,post:Fn,put:ex,head:r8,remove:Qw}=t8,cn=qP("vectors");var xl=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=X6(e),this.fetch=Y6(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Uf(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(ip(r))return{data:null,error:r};throw r}}};let FP;FP=Symbol.toStringTag;var n8=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[FP]="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(ip(e))return{data:null,error:e};throw e}}};let HP;HP=Symbol.toStringTag;var i8=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[HP]="BlobDownloadBuilder",this.promise=null}asStream(){return new n8(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(ip(e))return{data:null,error:e};throw e}}};const a8={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},fE={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var o8=class extends xl{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=Be(Be({},fE),n);let c=Be(Be({},i.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const u=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),u&&a.append("metadata",i.encodeMetadata(u)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),u&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(u))):(a=r,c["cache-control"]=`max-age=${o.cacheControl}`,c["content-type"]=o.contentType,u&&(c["x-metadata"]=i.toBase64(i.encodeMetadata(u))),(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,v]of Object.entries(n.headers))c=Uf(c,g,v);const d=i._removeEmptyFolders(e),p=i._getFinalPath(d),f=await(t=="PUT"?ex:Fn)(i.fetch,`${i.url}/object/${p}`,a,Be({headers:c},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:d,id:f.Id,fullPath:f.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),c=new URL(i.url+`/object/upload/sign/${o}`);return c.searchParams.set("token",e),i.handleOperation(async()=>{let u;const d=Be(Be({},fE),n);let p=Be(Be({},i.headers),{"x-upsert":String(d.upsert)});const f=d.metadata;if(typeof Blob<"u"&&r instanceof Blob?(u=new FormData,u.append("cacheControl",d.cacheControl),f&&u.append("metadata",i.encodeMetadata(f)),u.append("",r)):typeof FormData<"u"&&r instanceof FormData?(u=r,u.has("cacheControl")||u.append("cacheControl",d.cacheControl),f&&!u.has("metadata")&&u.append("metadata",i.encodeMetadata(f))):(u=r,p["cache-control"]=`max-age=${d.cacheControl}`,p["content-type"]=d.contentType,f&&(p["x-metadata"]=i.toBase64(i.encodeMetadata(f))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!d.duplex&&(d.duplex="half")),n!=null&&n.headers)for(const[g,v]of Object.entries(n.headers))p=Uf(p,g,v);return{path:a,fullPath:(await ex(i.fetch,c.toString(),u,Be({headers:p},d!=null&&d.duplex?{duplex:d.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const i=Be({},r.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const a=await Fn(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),c=o.searchParams.get("token");if(!c)throw new np("No token returned by API");return{signedUrl:o.toString(),path:t,token:c}})}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 Fn(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 Fn(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 Fn(n.fetch,`${n.url}/object/sign/${i}`,Be({expiresIn:e},a?{transform:r.transform}:{}),{headers:n.headers});const c=new URLSearchParams;r!=null&&r.download&&c.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&c.set("cacheNonce",String(r.cacheNonce));const u=c.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${u?`&${u}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const i=await Fn(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(c=>Be(Be({},c),{},{signedUrl:c.signedURL?encodeURI(`${n.url}${c.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),c=()=>Wc(this.fetch,`${this.url}/${n}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new i8(c,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>Qb(await Wc(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await r8(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;if(ip(i)){var n;const a=i instanceof Zb?i.status:i instanceof UP?(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 Qw(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=Be(Be(Be({},a8),e),{},{prefix:t||""});return await Fn(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=Be({},t);return await Fn(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 s8="2.106.2",Iu={"X-Client-Info":`storage-js/${s8}`};var l8=class extends xl{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=Be(Be({},Iu),e);super(a,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await Wc(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Wc(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Fn(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 ex(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 Fn(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Qw(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():""}},c8=class extends xl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Iu),e);super(n,i,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Fn(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 Wc(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Qw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!Z6(t))throw new np("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 W6({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(...c)=>{try{return{data:await o.apply(i,c),error:null}}catch(u){if(n)throw u;return{data:null,error:u}}}}})}},u8=class extends xl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Iu),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},d8=class extends xl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Iu),{},{"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 cn.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await cn.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 cn.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await cn.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 cn.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},f8=class extends xl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Iu),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},h8=class extends f8{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new p8(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)}},p8=class extends u8{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,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,Be(Be({},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 m8(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},m8=class extends d8{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,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},g8=class extends l8{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new o8(this.url,this.headers,t,this.fetch)}get vectors(){return new h8(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new c8(this.url+"/iceberg",this.headers,this.fetch)}};const WP="2.106.2",Ps=30*1e3,tx=3,Tg=tx*Ps,y8="http://localhost:9999",v8="supabase.auth.token",b8={"X-Client-Info":`gotrue-js/${WP}`},rx="X-Supabase-Api-Version",GP={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},x8=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,w8=600*1e3;class Gs 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 be(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class _8 extends Gs{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function S8(t){return be(t)&&t.name==="AuthApiError"}class Xn extends Gs{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class ta extends Gs{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class pr extends ta{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function uf(t){return be(t)&&t.name==="AuthSessionMissingError"}class _s extends ta{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class df extends ta{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ff extends ta{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 k8(t){return be(t)&&t.name==="AuthImplicitGrantRedirectError"}class hE extends ta{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 E8 extends ta{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 nx extends ta{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function jg(t){return be(t)&&t.name==="AuthRetryableFetchError"}class pE extends ta{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 ix extends ta{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const qf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),mE=`
|
|
413
|
+
\r=`.split(""),O8=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<mE.length;e+=1)t[mE[e].charCodeAt(0)]=-2;for(let e=0;e<qf.length;e+=1)t[qf[e].charCodeAt(0)]=e;return t})();function gE(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(qf[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(qf[n]),e.queuedBits-=6}}function KP(t,e,r){const n=O8[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 yE(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{j8(o,n,r)};for(let o=0;o<t.length;o+=1)KP(t.charCodeAt(o),i,a);return e.join("")}function A8(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 T8(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}A8(n,e)}}function j8(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 zs(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)KP(t.charCodeAt(i),r,n);return new Uint8Array(e)}function C8(t){const e=[];return T8(t,r=>e.push(r)),new Uint8Array(e)}function ko(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>gE(i,r,n)),gE(null,r,n),e.join("")}function N8(t){return Math.round(Date.now()/1e3)+t}function P8(){return Symbol("auth-callback")}const xr=()=>typeof window<"u"&&typeof document<"u",yo={tested:!1,writable:!1},VP=()=>{if(!xr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(yo.tested)return yo.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),yo.tested=!0,yo.writable=!0}catch{yo.tested=!0,yo.writable=!1}return yo.writable};function R8(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 XP=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),I8=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Rs=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},vo=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},br=async(t,e)=>{await t.removeItem(e)};class ap{constructor(){this.promise=new ap.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}ap.promiseConstructor=Promise;function hf(t){const e=t.split(".");if(e.length!==3)throw new ix("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!x8.test(e[n]))throw new ix("JWT not in base64url format");return{header:JSON.parse(yE(e[0])),payload:JSON.parse(yE(e[1])),signature:zs(e[2]),raw:{header:e[0],payload:e[1]}}}async function $8(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function M8(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 L8(t){return("0"+t.toString(16)).substr(-2)}function D8(){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,L8).join("")}async function z8(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 B8(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 z8(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ss(t,e,r=!1){const n=D8();let i=n;r&&(i+="/recovery"),await Rs(t,`${e}-code-verifier`,i);const a=await B8(n);return[a,n===a?"plain":"s256"]}const U8=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function q8(t){const e=t.headers.get(rx);if(!e||!e.match(U8))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function F8(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 H8(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 W8=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Di(t){if(!W8.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function qn(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 Cg(){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 G8(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 vE(t){return JSON.parse(JSON.stringify(t))}const xo=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)},K8=[502,503,504,520,521,522,523,524,530];async function bE(t){var e;if(!I8(t))throw new nx(xo(t),0);if(K8.includes(t.status))throw new nx(xo(t),t.status);let r;try{r=await t.json()}catch(a){throw new Xn(xo(a),a)}let n;const i=q8(t);if(i&&i.getTime()>=GP["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 pE(xo(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new pr}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 pE(xo(r),t.status,r.weak_password.reasons);throw new _8(xo(r),t.status||500,n)}const V8=(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 Ne(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[rx]||(a[rx]=GP["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 c=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",u=await X8(t,e,r+c,{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(u):{data:Object.assign({},u),error:null}}async function X8(t,e,r,n,i,a){const o=V8(e,n,i,a);let c;try{c=await t(r,Object.assign({},o))}catch(u){throw console.error(u),new nx(xo(u),0)}if(c.ok||await bE(c),n!=null&&n.noResolveJson)return c;try{return await c.json()}catch(u){await bE(u)}}function On(t){var e;let r=null;Z8(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=N8(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 xE(t){const e=On(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 Na(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Y8(t){return{data:t,error:null}}function J8(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=rp(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),c={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},u=Object.assign({},o);return{data:{properties:c,user:u},error:null}}function wE(t){return t}function Z8(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Ng=["global","local","others"];class Q8{_encodePathSegment(e){if(e==="."||e==="..")throw new Gs("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:r={},fetch:n,experimental:i}){this.url=e,this.headers=r,this.fetch=XP(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=Ng[0]){if(Ng.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ng.join(", ")}`);try{return await Ne(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(be(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await Ne(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Na})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=rp(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 Ne(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:J8,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(be(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Na})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,c,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Ne(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:wE});if(p.error)throw p.error;const f=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(be(d))return{data:{users:[]},error:d};throw d}}async getUserById(e){Di(e);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Na})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Di(e);try{return await Ne(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Na})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Di(e);try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Na})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Di(e.userId);try{const{data:r,error:n}=await Ne(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(be(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Di(e.userId),Di(e.id);try{return{data:await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,c,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Ne(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:wE});if(p.error)throw p.error;const f=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(be(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{const r=this._encodePathSegment(e);return await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{const n=this._encodePathSegment(e);return await Ne(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{const r=this._encodePathSegment(e);return await Ne(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{const r=this._encodePathSegment(e);return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await Ne(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(be(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await Ne(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{const r=this._encodePathSegment(e);return await Ne(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{const n=this._encodePathSegment(e);return await Ne(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{const r=this._encodePathSegment(e);return await Ne(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){qn(this.experimental),Di(e.userId);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){qn(this.experimental),Di(e.userId),Di(e.passkeyId);try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}}function _E(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const yi={debug:!!(globalThis&&VP()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class YP extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class SE extends YP{}async function eU(t,e,r){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{n.abort(),yi.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),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await r()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new SE(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(yi.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 yi.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){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{yi.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 yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new SE(`Lock "${t}" was released because another request stole it`)}throw a}}function tU(){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 JP(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function rU(t){return parseInt(t,16)}function nU(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function iU(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:c,requestId:u,resources:d,scheme:p,uri:f,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(!f)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(`
|
|
414
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const v=JP(t.address),x=p?`${p}://${n}`:n,_=t.statement?`${t.statement}
|
|
415
|
+
`:"",b=`${x} wants you to sign in with your Ethereum account:
|
|
416
|
+
${v}
|
|
417
|
+
|
|
418
|
+
${_}`;let S=`URI: ${f}
|
|
419
|
+
Version: ${g}
|
|
420
|
+
Chain ID: ${r}${o?`
|
|
421
|
+
Nonce: ${o}`:""}
|
|
422
|
+
Issued At: ${a.toISOString()}`;if(i&&(S+=`
|
|
423
|
+
Expiration Time: ${i.toISOString()}`),c&&(S+=`
|
|
424
|
+
Not Before: ${c.toISOString()}`),u&&(S+=`
|
|
425
|
+
Request ID: ${u}`),d){let A=`
|
|
426
|
+
Resources:`;for(const O of d){if(!O||typeof O!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${O}`);A+=`
|
|
427
|
+
- ${O}`}S+=A}return`${b}
|
|
428
|
+
${S}`}class Zt 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 Ff extends Zt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function aU({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 Zt({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 Zt({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 Zt({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 Zt({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 Zt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(c=>c.type==="public-key").length===0?new Zt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Zt({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(ZP(o)){if(a.rp.id!==o)return new Zt({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({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 Zt({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 Zt({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 Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function oU({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 Zt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(ZP(n)){if(r.rpId!==n)return new Zt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Zt({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 Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class sU{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 ax=new sU;function kE(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=rp(t,["challenge","user","excludeCredentials"]),a=zs(e).buffer,o=Object.assign(Object.assign({},r),{id:zs(r.id).buffer}),c=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){c.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){const d=n[u];c.excludeCredentials[u]=Object.assign(Object.assign({},d),{id:zs(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return c}function EE(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=rp(t,["challenge","allowCredentials"]),i=zs(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 c=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},c),{id:zs(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function OE(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:ko(new Uint8Array(t.response.attestationObject)),clientDataJSON:ko(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function AE(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:ko(new Uint8Array(i.authenticatorData)),clientDataJSON:ko(new Uint8Array(i.clientDataJSON)),signature:ko(new Uint8Array(i.signature)),userHandle:i.userHandle?ko(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function ZP(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Hf(){var t,e;return!!(xr()&&"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 QP(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ff("Browser returned unexpected credential type",e)}:{data:null,error:new Ff("Empty credential response",e)}}catch(e){return{data:null,error:aU({error:e,options:t})}}}async function eR(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ff("Browser returned unexpected credential type",e)}:{data:null,error:new Ff("Empty credential response",e)}}catch(e){return{data:null,error:oU({error:e,options:t})}}}const lU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},cU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Wf(...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 c=n[a];e(c)?n[a]=Wf(c,o):n[a]=Wf(o)}else n[a]=o}return n}function uU(t,e){return Wf(lU,t,e||{})}function dU(t,e){return Wf(cU,t,e||{})}class fU{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:c,error:u}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!c)return{data:null,error:u};const d=i??ax.createNewAbortSignal();if(c.webauthn.type==="create"){const{user:p}=c.webauthn.credential_options.publicKey;if(!p.name){const f=n;if(f)p.name=`${p.id}:${f}`;else{const v=(await this.client.getUser()).data.user,x=((o=v==null?void 0:v.user_metadata)===null||o===void 0?void 0:o.name)||(v==null?void 0:v.email)||(v==null?void 0:v.id)||"User";p.name=`${p.id}:${x}`}}p.displayName||(p.displayName=p.name)}switch(c.webauthn.type){case"create":{const p=uU(c.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:g}=await QP({publicKey:p,signal:d});return f?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:f}},error:null}:{data:null,error:g}}case"request":{const p=dU(c.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:g}=await eR(Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:p,signal:d}));return f?{data:{factorId:e,challengeId:c.id,webauthn:{type:c.webauthn.type,credential_response:f}},error:null}:{data:null,error:g}}}}catch(c){return be(c)?{data:null,error:c}:{data:null,error:new Xn("Unexpected error in challenge",c)}}}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 Gs("rpId is required for WebAuthn authentication")};try{if(!Hf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:c}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:c};const{webauthn:u}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("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 Gs("rpId is required for WebAuthn registration")};try{if(!Hf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:c}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(p=>{var f;return(f=p.data)===null||f===void 0?void 0:f.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:c};const{data:u,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return u?this._verify({factorId:o.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:d}}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("Unexpected error in register",o)}}}}tU();const hU={url:y8,storageKey:v8,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:b8,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function TE(t,e,r){return await r()}const ks={};class Gc{get jwks(){var e,r;return(r=(e=ks[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){ks[this.storageKey]=Object.assign(Object.assign({},ks[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=ks[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){ks[this.storageKey]=Object.assign(Object.assign({},ks[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({},hU),e);if(this.storageKey=o.storageKey,this.instanceID=(r=Gc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Gc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&xr()){const c=`${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(c),this.logDebugMessages&&console.trace(c)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new Q8({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=XP(o.fetch),this.lock=o.lock||TE,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&&xr()&&(!((i=globalThis==null?void 0:globalThis.navigator)===null||i===void 0)&&i.locks)?this.lock=eU:this.lock=TE,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 fU(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:VP()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=_E(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=_E(this.memoryStorage)),xr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(c){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",c)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async c=>{this._debug("received broadcast notification from other tab or client",c);try{await this._notifyAllSubscribers(c.data.event,c.data.session,!1)}catch(u){this._debug("#broadcastChannel","error",u)}})}o.skipAutoInitialize||this.initialize().catch(c=>{this._debug("#initialize()","error",c)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${WP}) ${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(xr()&&(r=R8(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),xr()&&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),k8(a)){const u=(e=a.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:c}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",c),await this._saveSession(o),setTimeout(async()=>{c==="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 be(r)?this._returnResult({error:r}):this._returnResult({error:new Xn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await Ne(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:On}),{data:o,error:c}=a;if(c||!o)return this._returnResult({data:{user:null,session:null},error:c});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(be(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:f,options:g}=e;let v=null,x=null;this.flowType==="pkce"&&([v,x]=await Ss(this.storage,this.storageKey)),a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:p,password:f,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:v,code_challenge_method:x},xform:On})}else if("phone"in e){const{phone:p,password:f,options:g}=e;a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:f,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:On})}else throw new df("You must provide either an email or phone number and a password");const{data:o,error:c}=a;if(c||!o)return await br(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(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:c}=e;r=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},xform:xE})}else if("phone"in e){const{phone:a,password:o,options:c}=e;r=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},xform:xE})}else throw new df("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 _s;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(be(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,c,u,d,p,f,g;let v,x;if("message"in e)v=e.message,x=e.signature;else{const{chain:_,wallet:b,statement:S,options:A}=e;let O;if(xr())if(typeof b=="object")O=b;else{const M=window;if("ethereum"in M&&typeof M.ethereum=="object"&&"request"in M.ethereum&&typeof M.ethereum.request=="function")O=M.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"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=b}const j=new URL((r=A==null?void 0:A.url)!==null&&r!==void 0?r:window.location.href),E=await O.request({method:"eth_requestAccounts"}).then(M=>M).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=JP(E[0]);let N=(n=A==null?void 0:A.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const M=await O.request({method:"eth_chainId"});N=rU(M)}const R={domain:j.host,address:T,statement:S,uri:j.href,version:"1",chainId:N,nonce:(i=A==null?void 0:A.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=A==null?void 0:A.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(c=A==null?void 0:A.signInWithEthereum)===null||c===void 0?void 0:c.expirationTime,notBefore:(u=A==null?void 0:A.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(d=A==null?void 0:A.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(p=A==null?void 0:A.signInWithEthereum)===null||p===void 0?void 0:p.resources};v=iU(R),x=await O.request({method:"personal_sign",params:[nU(v),T]})}try{const{data:_,error:b}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:x},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:On});if(b)throw b;if(!_||!_.session||!_.user){const S=new _s;return this._returnResult({data:{user:null,session:null},error:S})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:b})}catch(_){if(be(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async signInWithSolana(e){var r,n,i,a,o,c,u,d,p,f,g,v;let x,_;if("message"in e)x=e.message,_=e.signature;else{const{chain:b,wallet:S,statement:A,options:O}=e;let j;if(xr())if(typeof S=="object")j=S;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 S!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=S}const E=new URL((r=O==null?void 0:O.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()},O==null?void 0:O.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),A?{statement:A}:null));let N;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")N=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)N=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)x=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),_=N.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");x=[`${E.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...A?["",A,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(i=(n=O==null?void 0:O.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=O==null?void 0:O.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${O.signInWithSolana.notBefore}`]:[],...!((o=O==null?void 0:O.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${O.signInWithSolana.expirationTime}`]:[],...!((c=O==null?void 0:O.signInWithSolana)===null||c===void 0)&&c.chainId?[`Chain ID: ${O.signInWithSolana.chainId}`]:[],...!((u=O==null?void 0:O.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${O.signInWithSolana.nonce}`]:[],...!((d=O==null?void 0:O.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${O.signInWithSolana.requestId}`]:[],...!((f=(p=O==null?void 0:O.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||f===void 0)&&f.length?["Resources",...O.signInWithSolana.resources.map(N=>`- ${N}`)]:[]].join(`
|
|
429
|
+
`);const T=await j.signMessage(new TextEncoder().encode(x),"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:S}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:ko(_)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(v=e.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:On});if(S)throw S;if(!b||!b.session||!b.user){const A=new _s;return this._returnResult({data:{user:null,session:null},error:A})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:S})}catch(b){if(be(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await vo(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new E8;const{data:a,error:o}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:On});if(await br(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const c=new _s;return this._returnResult({data:{user:null,session:null,redirectType:null},error:c})}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 br(this.storage,`${this.storageKey}-code-verifier`),be(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,c=await Ne(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:On}),{data:u,error:d}=c;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!u||!u.session||!u.user){const p=new _s;return this._returnResult({data:{user:null,session:null},error:p})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:d})}catch(r){if(be(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:c,options:u}=e;let d=null,p=null;this.flowType==="pkce"&&([d,p]=await Ss(this.storage,this.storageKey));const{error:f}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:c,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:d,code_challenge_method:p},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:c,options:u}=e,{data:d,error:p}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:c,data:(i=u==null?void 0:u.data)!==null&&i!==void 0?i:{},create_user:(a=u==null?void 0:u.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(o=u==null?void 0:u.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:p})}throw new df("You must provide either an email or phone number.")}catch(c){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}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:c}=await Ne(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:On});if(c)throw c;if(!o)throw new Error("An error occurred on token verification.");const u=o.session,d=o.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(i){if(be(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i,a,o;try{let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Ss(this.storage,this.storageKey));const d=await Ne(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:c,code_challenge_method:u}),headers:this.headers,xform:Y8});return!((a=d.data)===null||a===void 0)&&a.url&&xr()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(c){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(c))return this._returnResult({data:null,error:c});throw c}}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 pr;const{error:i}=await Ne(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(be(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 Ne(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:c}=await Ne(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:c})}throw new df("You must provide either an email or phone number and a type")}catch(r){if(be(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 vo(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()<Tg:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await vo(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Cg()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=G8(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 Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Na}):await this._useSession(async r=>{var n,i,a;const{data:o,error:c}=r;if(c)throw c;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new pr}:await Ne(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:Na})})}catch(r){if(be(r))return uf(r)&&(await this._removeSession(),await br(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 pr;const o=i.session;let c=null,u=null;this.flowType==="pkce"&&e.email!=null&&([c,u]=await Ss(this.storage,this.storageKey));const{data:d,error:p}=await Ne(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:c,code_challenge_method:u}),jwt:o.access_token,xform:Na});if(p)throw p;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(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 pr;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=hf(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:c,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c)return{data:{user:null,session:null},error:null};a=c}else{const{data:c,error:u}=await this._getUser(e.access_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});a={access_token:e.access_token,refresh_token:e.refresh_token,user:c.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(be(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:c}=r;if(c)throw c;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new pr;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(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!xr())throw new ff("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ff(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 hE("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ff("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 hE("No code detected.");const{data:O,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:O.session,redirectType:(n=O.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:i,provider_refresh_token:a,access_token:o,refresh_token:c,expires_in:u,expires_at:d,token_type:p}=e;if(!o||!u||!c||!p)throw new ff("No session defined in URL");const f=Math.round(Date.now()/1e3),g=parseInt(u);let v=f+g;d&&(v=parseInt(d));const x=v-f;x*1e3<=Ps&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${g}s`);const _=v-g;f-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,v,f):f-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,v,f);const{data:b,error:S}=await this._getUser(o);if(S)throw S;const A={provider_token:i,provider_refresh_token:a,access_token:o,expires_in:g,expires_at:v,refresh_token:c,token_type:p,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:A,redirectType:e.type},error:null})}catch(i){if(be(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 vo(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&&!uf(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:c}=await this.admin.signOut(o,e);if(c&&!(S8(c)&&(c.status===404||c.status===401||c.status===403)||uf(c)))return this._returnResult({error:c})}return e!=="others"&&(await this._removeSession(),await br(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=P8(),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),uf(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await Ss(this.storage,this.storageKey,!0));try{return await Ne(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 br(this.storage,`${this.storageKey}-code-verifier`),be(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(be(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,c,u,d,p;const{data:f,error:g}=a;if(g)throw g;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(c=e.options)===null||c===void 0?void 0:c.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await Ne(this.fetch,"GET",v,{headers:this.headers,jwt:(p=(d=f.session)===null||d===void 0?void 0:d.access_token)!==null&&p!==void 0?p:void 0})});if(i)throw i;return xr()&&!(!((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(be(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:c,token:u,access_token:d,nonce:p}=e,f=await Ne(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:c,id_token:u,access_token:d,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:On}),{data:g,error:v}=f;return v?this._returnResult({data:{user:null,session:null},error:v}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new _s}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:v}))}catch(i){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(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 Ne(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(be(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 M8(async i=>(i>0&&await $8(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Ne(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:On})),(i,a)=>{const o=200*Math.pow(2,i);return a&&jg(a)&&Date.now()+o-n<Ps})}catch(n){if(this._debug(r,"error",n),be(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),xr()&&!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 vo(this.storage,this.storageKey);if(i&&this.userStorage){let o=await vo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await Rs(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Cg()}else if(i&&!i.user&&!i.user){const o=await vo(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await br(this.storage,this.storageKey+"-user"),await Rs(this.storage,this.storageKey,i)):i.user=Cg()}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()<Tg;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${Tg}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),jg(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:c}=await this._getUser(i.access_token);!c&&(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 pr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new ap;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new pr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const c={data:a.session,error:null};return this.refreshingDeferred.resolve(c),c}catch(a){if(this._debug(i,"error",a),be(a)){const o={data:null,error:a};return jg(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 c=>{try{await c.callback(e,r)}catch(u){a.push(u)}});if(await Promise.all(o),a.length>0){for(let c=0;c<a.length;c+=1)console.error(a[c]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await br(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 Rs(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=vE(i);await Rs(this.storage,this.storageKey,a)}else{const i=vE(r);await Rs(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await br(this.storage,this.storageKey),await br(this.storage,this.storageKey+"-code-verifier"),await br(this.storage,this.storageKey+"-user"),this.userStorage&&await br(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&xr()&&(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(),Ps);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)/Ps);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ps}ms, refresh threshold is ${tx} ticks`),i<=tx&&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 YP)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!xr()||!(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 Ss(this.storage,this.storageKey),c=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(c.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 Ne(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(be(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 c=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:d}=await Ne(this.fetch,"POST",`${this.url}/factors`,{body:c,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(e.factorType==="totp"&&u.type==="totp"&&(!((i=u==null?void 0:u.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if(be(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"?OE(e.webauthn.credential_response):AE(e.webauthn.credential_response)})}:{code:e.code}),{data:c,error:u}=await Ne(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 u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:u}))})}catch(r){if(be(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 Ne(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:c}=o;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:kE(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:EE(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(be(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:v}=hf(e);let x=null;v.aal&&(x=v.aal);let _=x;const{data:{user:b},error:S}=await this.getUser(e);if(S)return this._returnResult({data:null,error:S});((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 O=v.amr||[];return{data:{currentLevel:x,nextLevel:_,currentAuthenticationMethods:O},error:null}}catch(v){if(be(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:o},error:c}=await this.getSession();if(c)return this._returnResult({data:null,error:c});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=hf(o.access_token);let d=null;u.aal&&(d=u.aal);let p=d;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(v=>v.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(p="aal2");const g=u.amr||[];return{data:{currentLevel:d,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 Ne(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 pr})})}catch(r){if(be(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 pr});const o=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:c=>({data:c,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(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 pr});const o=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:c=>({data:c,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(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 Ne(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 pr})})}catch(e){if(be(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 Ne(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 pr})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(c=>c.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(c=>c.kid===e),n&&this.jwks_cached_at+w8>i)return n;const{data:a,error:o}=await Ne(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(c=>c.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:v,error:x}=await this.getSession();if(x||!v.session)return this._returnResult({data:null,error:x});n=v.session.access_token}const{header:i,payload:a,signature:o,raw:{header:c,payload:u}}=hf(n);r!=null&&r.allowExpired||F8(a.exp);const d=!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(!d){const{error:v}=await this.getUser(n);if(v)throw v;return{data:{claims:a,header:i,signature:o},error:null}}const p=H8(i.alg),f=await crypto.subtle.importKey("jwk",d,p,!0,["verify"]);if(!await crypto.subtle.verify(p,f,o,C8(`${c}.${u}`)))throw new ix("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,i;qn(this.experimental);try{if(!Hf())return this._returnResult({data:null,error:new Xn("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 c=EE(a.options),u=(i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&i!==void 0?i:ax.createNewAbortSignal(),{data:d,error:p}=await eR({publicKey:c,signal:u});if(p||!d)return this._returnResult({data:null,error:p??new Xn("WebAuthn ceremony failed",null)});const f=AE(d);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:f})}catch(a){if(be(a))return this._returnResult({data:null,error:a});throw a}}async registerPasskey(e){var r,n;qn(this.experimental);try{if(!Hf())return this._returnResult({data:null,error:new Xn("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=kE(i.options),c=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:ax.createNewAbortSignal(),{data:u,error:d}=await QP({publicKey:o,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new Xn("WebAuthn ceremony failed",null)});const p=OE(u);return this._verifyPasskeyRegistration({challengeId:i.challenge_id,credential:p})}catch(i){if(be(i))return this._returnResult({data:null,error:i});throw i}}async _startPasskeyRegistration(){qn(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 pr});const{data:i,error:a}=await Ne(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(be(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){qn(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 pr});const{data:a,error:o}=await Ne(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(be(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;qn(this.experimental);try{const{data:n,error:i}=await Ne(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(be(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){qn(this.experimental);try{const{data:r,error:n}=await Ne(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:On});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(be(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){qn(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 pr});const{data:i,error:a}=await Ne(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(be(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){qn(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 pr});const{data:a,error:o}=await Ne(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(be(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){qn(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 pr});const{error:a}=await Ne(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(be(r))return this._returnResult({data:null,error:r});throw r}}}Gc.nextInstanceID={};const pU=Gc,mU="2.106.2";let Tc="";typeof Deno<"u"?Tc="deno":typeof document<"u"?Tc="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Tc="react-native":Tc="node";const gU={"X-Client-Info":`supabase-js-${Tc}/${mU}`},yU={headers:gU},vU={schema:"public"},bU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},xU={},wU={enabled:!1,respectSamplingDecision:!0};function _U(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 c(p){try{d(n.next(p))}catch(f){o(f)}}function u(p){try{d(n.throw(p))}catch(f){o(f)}}function d(p){p.done?a(p.value):i(p.value).then(c,u)}d((n=n.apply(t,[])).next())})}let Pg=null;const SU="@opentelemetry/api";function kU(){return Pg===null&&(Pg=import(SU).catch(()=>null)),Pg}function EU(){return _U(this,void 0,void 0,function*(){try{const t=yield kU();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 OU(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 AU(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(TU(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 TU(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 jU(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 Kc(t){"@babel/helpers - typeof";return Kc=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},Kc(t)}function CU(t,e){if(Kc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NU(t){var e=CU(t,"string");return Kc(e)=="symbol"?e:e+""}function PU(t,e,r){return(e=NU(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jE(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 Ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jE(Object(r),!0).forEach(function(n){PU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const RU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),IU=()=>Headers,$U=(t,e,r,n,i)=>{const a=RU(n),o=IU(),c=(i==null?void 0:i.enabled)===!0,u=(i==null?void 0:i.respectSamplingDecision)!==!1,d=c?jU(e):null;return async(p,f)=>{var g;const v=(g=await r())!==null&&g!==void 0?g:t;let x=new o(f==null?void 0:f.headers);if(x.has("apikey")||x.set("apikey",t),x.has("Authorization")||x.set("Authorization",`Bearer ${v}`),d){const _=await MU(p,d,u);_&&(_.traceparent&&!x.has("traceparent")&&x.set("traceparent",_.traceparent),_.tracestate&&!x.has("tracestate")&&x.set("tracestate",_.tracestate),_.baggage&&!x.has("baggage")&&x.set("baggage",_.baggage))}return a(p,Ht(Ht({},f),{},{headers:x}))}};async function MU(t,e,r){if(!AU(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await EU();if(!n||!n.traceparent)return null;if(r){const i=OU(n.traceparent);if(i&&!i.isSampled)return null}return n}function CE(t){return typeof t=="boolean"?{enabled:t}:t}function LU(t){return t.endsWith("/")?t:t+"/"}function DU(t,e){var r,n,i,a,o,c;const{db:u,auth:d,realtime:p,global:f}=t,{db:g,auth:v,realtime:x,global:_}=e,b=CE(t.tracePropagation),S=CE(e.tracePropagation),A={db:Ht(Ht({},g),u),auth:Ht(Ht({},v),d),realtime:Ht(Ht({},x),p),storage:{},global:Ht(Ht(Ht({},_),f),{},{headers:Ht(Ht({},(r=_==null?void 0:_.headers)!==null&&r!==void 0?r:{}),(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(i=(a=b==null?void 0:b.enabled)!==null&&a!==void 0?a:S==null?void 0:S.enabled)!==null&&i!==void 0?i:!1,respectSamplingDecision:(o=(c=b==null?void 0:b.respectSamplingDecision)!==null&&c!==void 0?c:S==null?void 0:S.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return t.accessToken?A.accessToken=t.accessToken:delete A.accessToken,A}function zU(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(LU(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var BU=class extends pU{constructor(t){super(t)}},UU=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const a=zU(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`,c={db:vU,realtime:xU,auth:Ht(Ht({},bU),{},{storageKey:o}),global:yU,tracePropagation:wU},u=DU(r??{},c);if(this.settings=u,this.storageKey=(n=u.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken)this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(p,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=u.auth)!==null&&d!==void 0?d:{},this.headers,u.global.fetch)}this.fetch=$U(e,t,this._getAccessToken.bind(this),u.global.fetch,u.tracePropagation),this.realtime=this._initRealtimeClient(Ht({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},u.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 n6(new URL("rest/v1",a).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch,timeout:u.db.timeout,urlLengthLimit:u.db.urlLengthLimit}),this.storage=new g8(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new KB(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:c,debug:u,throwOnError:d,experimental:p,lockAcquireTimeout:f,skipAutoInitialize:g},v,x){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new BU({url:this.authUrl.href,headers:Ht(Ht({},_),v),storageKey:a,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:c,debug:u,throwOnError:d,experimental:p,fetch:x,lockAcquireTimeout:f,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new z6(this.realtimeUrl.href,Ht(Ht({},t),{},{params:Ht(Ht({},{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 qU=(t,e,r)=>new UU(t,e,r);function FU(){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}FU()&&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 tR=P.createContext({session:null,supabase:null,loading:!0,signIn:async()=>({error:"Not initialized"}),signOut:async()=>{}});function op(){return P.useContext(tR)}function HU({children:t}){const[e,r]=P.useState(null),[n,i]=P.useState(null),[a,o]=P.useState(!0),c=P.useRef(null);P.useEffect(()=>{X4(()=>{var p;return((p=c.current)==null?void 0:p.access_token)??null})},[]),P.useEffect(()=>{Ve.get("/config").then(({config:p})=>{if(p.supabase.projectUrl&&p.supabase.anonKey){const f=qU(p.supabase.projectUrl,p.supabase.anonKey);r(f),f.auth.getSession().then(({data:v})=>{c.current=v.session,i(v.session),o(!1)});const{data:{subscription:g}}=f.auth.onAuthStateChange((v,x)=>{c.current=x,i(x)});return()=>g.unsubscribe()}o(!1)}).catch(()=>{o(!1)})},[]);async function u(p,f){if(!e)return{error:"Supabase not configured"};const{error:g}=await e.auth.signInWithPassword({email:p,password:f});return{error:(g==null?void 0:g.message)??null}}async function d(){e&&(await e.auth.signOut(),c.current=null,i(null))}return y.jsx(tR.Provider,{value:{session:n,supabase:e,loading:a,signIn:u,signOut:d},children:t})}const WU=[{to:"/squads",icon:Zh,label:"Squads"},{to:"/skills",icon:qb,label:"Skills"},{to:"/schedules",icon:D5,label:"Schedules"},{to:"/wiki",icon:KN,label:"Wiki"},{to:"/usage",icon:B5,label:"Usage"}],GU=[{to:"/",icon:Dw,label:"Chat"},{to:"/feed",icon:Bb,label:"Inbox"},{to:"/settings",icon:L4,label:"Settings"}];function NE({to:t,icon:e,label:r,collapsed:n,badge:i}){return y.jsxs(HN,{to:t,end:t==="/",title:n?r:void 0,className:({isActive:a})=>Oc("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono transition-colors cursor-pointer relative",n?"justify-center":"",a?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"),style:({isActive:a})=>a?{background:"rgba(228,58,156,0.1)"}:void 0,children:[y.jsx(e,{className:"w-3.5 h-3.5 flex-shrink-0"}),!n&&r,i!=null&&i>0&&y.jsx("span",{className:"absolute top-1 right-1 min-w-[14px] h-[14px] flex items-center justify-center rounded-full bg-[#E43A9C] text-[9px] text-white font-mono px-1",children:i>99?"99+":i})]})}function KU(){const[t,e]=P.useState(!1),[r,n]=P.useState("..."),[i,a]=P.useState(0),{supabase:o}=op();return P.useEffect(()=>{let c=!0;Ve.get("/version").then(({version:d})=>{c&&n(d)}).catch(()=>{c&&n("unknown")}),Ve.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{});const u=setInterval(()=>{Ve.get("/inbox/unread-count").then(({count:d})=>{c&&a(d)}).catch(()=>{})},3e4);return()=>{c=!1,clearInterval(u)}},[]),y.jsxs("div",{className:"flex h-screen overflow-hidden bg-background relative",children:[y.jsxs("div",{className:Oc("flex-shrink-0 flex flex-col border-r border-white/[0.06] bg-[#181818] transition-all duration-200",t?"w-[52px]":"w-[210px]"),children:[y.jsx("div",{className:Oc("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?y.jsx(Ra,{height:26}):y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:26}),y.jsx("span",{className:"text-2xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"})]})}),y.jsx("nav",{className:"flex-1 py-2 px-1.5 space-y-0.5 overflow-y-auto",children:WU.map(c=>y.jsx(NE,{collapsed:t,...c},c.to))}),y.jsxs("div",{className:"flex-shrink-0 border-t border-white/[0.06]",children:[y.jsx("div",{className:"py-1.5 px-1.5 space-y-0.5",children:GU.map(c=>y.jsx(NE,{collapsed:t,badge:c.to==="/feed"?i:void 0,...c},c.to))}),y.jsxs("div",{className:"border-t border-white/[0.05] py-1.5 px-1.5 space-y-0.5",children:[y.jsxs("a",{href:`https://github.com/michaeljolley/io/releases/tag/v${r}`,target:"_blank",rel:"noreferrer",title:"GitHub",className:Oc("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:[y.jsx(u4,{className:"w-3.5 h-3.5 flex-shrink-0"}),!t&&y.jsxs("span",{className:"text-zinc-700",children:["v",r]})]}),y.jsx("button",{type:"button",onClick:()=>e(!t),title:t?"Expand sidebar":"Collapse sidebar",className:Oc("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?y.jsx($w,{className:"w-3.5 h-3.5 flex-shrink-0"}):y.jsx(vl,{className:"w-3.5 h-3.5 flex-shrink-0"})})]})]})]}),y.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[y.jsxs("div",{className:"h-[52px] flex-shrink-0 flex items-center justify-between px-4 border-b border-white/[0.06] bg-[#181818]",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(UB,{status:"connected"}),y.jsx("span",{className:"text-[11px] font-mono text-green-400",children:"connected"})]}),y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx(rz,{}),o&&y.jsx("button",{type:"button",onClick:()=>o.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:y.jsx(v4,{className:"w-3.5 h-3.5"})})]})]}),y.jsxs("main",{className:"flex-1 overflow-hidden flex flex-col min-h-0 relative",children:[y.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{zIndex:0},children:[y.jsx("div",{className:"orb orb-pink"}),y.jsx("div",{className:"orb orb-gray"})]}),y.jsx(mD,{})]})]})]})}function VU(){const{session:t}=op(),e=qa(),{messages:r,streaming:n,isStreaming:i,isThinking:a,sendChatMessage:o,addUserMessage:c,uploadAttachment:u}=sP(),[d,p]=P.useState(""),[f,g]=P.useState(null),[v,x]=P.useState(null),_=P.useRef(null),b=P.useRef(null),S=P.useRef(null);P.useLayoutEffect(()=>{const E=_.current;E&&(E.scrollTop=E.scrollHeight)},[r,n,a]);async function A(){const E=d.trim();if(!E&&!f||i||a)return;const T=crypto.randomUUID(),N=f==null?void 0:f.name,R=[E,N?`Attachment: ${N}`:""].filter(Boolean).join(`
|
|
430
|
+
|
|
431
|
+
`);c({id:T,role:"user",content:E,timestamp:new Date().toISOString(),attachmentName:N}),p(""),g(null),S.current&&(S.current.value=""),b.current&&(b.current.style.height="auto");try{f&&await u(f,T),o(R)}catch{}}function O(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}function j(E){p(E.target.value),b.current&&(b.current.style.height="auto",b.current.style.height=`${Math.min(b.current.scrollHeight,160)}px`)}return y.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[y.jsxs("div",{ref:_,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[r.map(E=>{var T,N;return y.jsxs("div",{className:`flex gap-3 ${E.role==="user"?"flex-row-reverse":""}`,children:[y.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${E.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:E.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:E.role==="user"?((N=(T=t==null?void 0:t.user)==null?void 0:T.email)==null?void 0:N.charAt(0).toUpperCase())??"U":y.jsx(Ra,{height:12})}),y.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${E.role==="user"?"items-end":"items-start"}`,children:[E.toolCall&&y.jsxs("button",{type:"button",onClick:()=>x(v===E.id?null:E.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:[y.jsx(Ds,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:E.toolCall.name}),y.jsx(jt,{variant:E.toolCall.status==="done"?"success":E.toolCall.status==="error"?"error":"warning",children:E.toolCall.status}),y.jsx(q5,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${v===E.id?"rotate-180":""}`})]}),E.toolCall&&v===E.id&&y.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:E.toolCall.result})}),E.attachmentName&&y.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:E.attachmentName}),E.content&&y.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${E.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:E.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:E.role==="user"?y.jsx("p",{className:"whitespace-pre-wrap",children:E.content}):y.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:nt.parse(E.content)}})}),y.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:Qh(E.timestamp,e)})]})]},E.id)}),a&&y.jsxs("div",{className:"flex gap-3",children:[y.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:y.jsx(Ra,{height:12})}),y.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(E=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]}),i&&n&&y.jsxs("div",{className:"flex gap-3",children:[y.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:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:y.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:nt.parse(n)}})})]}),i&&!n&&y.jsxs("div",{className:"flex gap-3",children:[y.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:y.jsx(Ra,{height:12})}),y.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(E=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]})]}),y.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[y.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:S,type:"file",className:"hidden",onChange:E=>{var T;return g(((T=E.target.files)==null?void 0:T[0])??null)}}),f&&y.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",f.name]}),y.jsx("textarea",{ref:b,value:d,onChange:j,onKeyDown:O,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"}}),y.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[y.jsx("button",{type:"button",onClick:()=>{var E;return(E=S.current)==null?void 0:E.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:y.jsx(QN,{className:"w-4 h-4"})}),y.jsx("div",{className:"flex items-center gap-2",children:i?y.jsxs("button",{type:"button",onClick:()=>{},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:[y.jsx(Jh,{className:"w-3 h-3"})," Stop"]}):y.jsx("button",{type:"button",onClick:A,disabled:!d.trim()&&!f||a,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:y.jsx(tP,{className:"w-3.5 h-3.5"})})})]})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}var Rg,PE;function XU(){if(PE)return Rg;PE=1;function t(D){return D instanceof Map?D.clear=D.delete=D.set=function(){throw new Error("map is read-only")}:D instanceof Set&&(D.add=D.clear=D.delete=function(){throw new Error("set is read-only")}),Object.freeze(D),Object.getOwnPropertyNames(D).forEach(ne=>{const de=D[ne],Re=typeof de;(Re==="object"||Re==="function")&&!Object.isFrozen(de)&&t(de)}),D}class e{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(D){return D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function n(D,...ne){const de=Object.create(null);for(const Re in D)de[Re]=D[Re];return ne.forEach(function(Re){for(const ht in Re)de[ht]=Re[ht]}),de}const i="</span>",a=D=>!!D.scope,o=(D,{prefix:ne})=>{if(D.startsWith("language:"))return D.replace("language:","language-");if(D.includes(".")){const de=D.split(".");return[`${ne}${de.shift()}`,...de.map((Re,ht)=>`${Re}${"_".repeat(ht+1)}`)].join(" ")}return`${ne}${D}`};class c{constructor(ne,de){this.buffer="",this.classPrefix=de.classPrefix,ne.walk(this)}addText(ne){this.buffer+=r(ne)}openNode(ne){if(!a(ne))return;const de=o(ne.scope,{prefix:this.classPrefix});this.span(de)}closeNode(ne){a(ne)&&(this.buffer+=i)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const u=(D={})=>{const ne={children:[]};return Object.assign(ne,D),ne};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const de=u({scope:ne});this.add(de),this.stack.push(de)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,de){return typeof de=="string"?ne.addText(de):de.children&&(ne.openNode(de),de.children.forEach(Re=>this._walk(ne,Re)),ne.closeNode(de)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(de=>typeof de=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(de=>{d._collapse(de)}))}}class p extends d{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,de){const Re=ne.root;de&&(Re.scope=`language:${de}`),this.add(Re)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(D){return D?typeof D=="string"?D:D.source:null}function g(D){return _("(?=",D,")")}function v(D){return _("(?:",D,")*")}function x(D){return _("(?:",D,")?")}function _(...D){return D.map(de=>f(de)).join("")}function b(D){const ne=D[D.length-1];return typeof ne=="object"&&ne.constructor===Object?(D.splice(D.length-1,1),ne):{}}function S(...D){return"("+(b(D).capture?"":"?:")+D.map(Re=>f(Re)).join("|")+")"}function A(D){return new RegExp(D.toString()+"|").exec("").length-1}function O(D,ne){const de=D&&D.exec(ne);return de&&de.index===0}const j=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(D,{joinWith:ne}){let de=0;return D.map(Re=>{de+=1;const ht=de;let Ke=f(Re),ye="";for(;Ke.length>0;){const we=j.exec(Ke);if(!we){ye+=Ke;break}ye+=Ke.substring(0,we.index),Ke=Ke.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?ye+="\\"+String(Number(we[1])+ht):(ye+=we[0],we[0]==="("&&de++)}return ye}).map(Re=>`(${Re})`).join(ne)}const T=/\b\B/,N="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",M="\\b\\d+(\\.\\d+)?",J="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",K=(D={})=>{const ne=/^#![ ]*\//;return D.binary&&(D.begin=_(ne,/.*\b/,D.binary,/\b.*/)),n({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(de,Re)=>{de.index!==0&&Re.ignoreMatch()}},D)},W={begin:"\\\\[\\s\\S]",relevance:0},X={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[W]},Y={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[W]},te={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},H=function(D,ne,de={}){const Re=n({scope:"comment",begin:D,end:ne,contains:[]},de);Re.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=S("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Re.contains.push({begin:_(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Re},Q=H("//","$"),U=H("/\\*","\\*/"),I=H("#","$"),$={scope:"number",begin:M,relevance:0},V={scope:"number",begin:J,relevance:0},oe={scope:"number",begin:F,relevance:0},le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[W,{begin:/\[/,end:/\]/,relevance:0,contains:[W]}]},ve={scope:"title",begin:N,relevance:0},qe={scope:"title",begin:R,relevance:0},xe={begin:"\\.\\s*"+R,relevance:0};var Se=Object.freeze({__proto__:null,APOS_STRING_MODE:X,BACKSLASH_ESCAPE:W,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:F,COMMENT:H,C_BLOCK_COMMENT_MODE:U,C_LINE_COMMENT_MODE:Q,C_NUMBER_MODE:V,C_NUMBER_RE:J,END_SAME_AS_BEGIN:function(D){return Object.assign(D,{"on:begin":(ne,de)=>{de.data._beginMatch=ne[1]},"on:end":(ne,de)=>{de.data._beginMatch!==ne[1]&&de.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:N,MATCH_NOTHING_RE:T,METHOD_GUARD:xe,NUMBER_MODE:$,NUMBER_RE:M,PHRASAL_WORDS_MODE:te,QUOTE_STRING_MODE:Y,REGEXP_MODE:le,RE_STARTERS_RE:B,SHEBANG:K,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:qe});function Me(D,ne){D.input[D.index-1]==="."&&ne.ignoreMatch()}function se(D,ne){D.className!==void 0&&(D.scope=D.className,delete D.className)}function tt(D,ne){ne&&D.beginKeywords&&(D.begin="\\b("+D.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",D.__beforeBegin=Me,D.keywords=D.keywords||D.beginKeywords,delete D.beginKeywords,D.relevance===void 0&&(D.relevance=0))}function Fe(D,ne){Array.isArray(D.illegal)&&(D.illegal=S(...D.illegal))}function kt(D,ne){if(D.match){if(D.begin||D.end)throw new Error("begin & end are not supported with match");D.begin=D.match,delete D.match}}function wt(D,ne){D.relevance===void 0&&(D.relevance=1)}const Et=(D,ne)=>{if(!D.beforeMatch)return;if(D.starts)throw new Error("beforeMatch cannot be used with starts");const de=Object.assign({},D);Object.keys(D).forEach(Re=>{delete D[Re]}),D.keywords=de.keywords,D.begin=_(de.beforeMatch,g(de.begin)),D.starts={relevance:0,contains:[Object.assign(de,{endsParent:!0})]},D.relevance=0,delete de.beforeMatch},Sr=["of","and","for","in","not","or","if","then","parent","list","value"],Ut="keyword";function Rr(D,ne,de=Ut){const Re=Object.create(null);return typeof D=="string"?ht(de,D.split(" ")):Array.isArray(D)?ht(de,D):Object.keys(D).forEach(function(Ke){Object.assign(Re,Rr(D[Ke],ne,Ke))}),Re;function ht(Ke,ye){ne&&(ye=ye.map(we=>we.toLowerCase())),ye.forEach(function(we){const je=we.split("|");Re[je[0]]=[Ke,lr(je[0],je[1])]})}}function lr(D,ne){return ne?Number(ne):_t(D)?0:1}function _t(D){return Sr.includes(D.toLowerCase())}const kr={},Ir=D=>{console.error(D)},ni=(D,...ne)=>{console.log(`WARN: ${D}`,...ne)},Ur=(D,ne)=>{kr[`${D}/${ne}`]||(console.log(`Deprecated as of ${D}. ${ne}`),kr[`${D}/${ne}`]=!0)},ii=new Error;function ai(D,ne,{key:de}){let Re=0;const ht=D[de],Ke={},ye={};for(let we=1;we<=ne.length;we++)ye[we+Re]=ht[we],Ke[we+Re]=!0,Re+=A(ne[we-1]);D[de]=ye,D[de]._emit=Ke,D[de]._multi=!0}function aa(D){if(Array.isArray(D.begin)){if(D.skip||D.excludeBegin||D.returnBegin)throw Ir("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ii;if(typeof D.beginScope!="object"||D.beginScope===null)throw Ir("beginScope must be object"),ii;ai(D,D.begin,{key:"beginScope"}),D.begin=E(D.begin,{joinWith:""})}}function qr(D){if(Array.isArray(D.end)){if(D.skip||D.excludeEnd||D.returnEnd)throw Ir("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ii;if(typeof D.endScope!="object"||D.endScope===null)throw Ir("endScope must be object"),ii;ai(D,D.end,{key:"endScope"}),D.end=E(D.end,{joinWith:""})}}function oi(D){D.scope&&typeof D.scope=="object"&&D.scope!==null&&(D.beginScope=D.scope,delete D.scope)}function si(D){oi(D),typeof D.beginScope=="string"&&(D.beginScope={_wrap:D.beginScope}),typeof D.endScope=="string"&&(D.endScope={_wrap:D.endScope}),aa(D),qr(D)}function Go(D){function ne(ye,we){return new RegExp(f(ye),"m"+(D.case_insensitive?"i":"")+(D.unicodeRegex?"u":"")+(we?"g":""))}class de{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,we]),this.matchAt+=A(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(je=>je[1]);this.matcherRe=ne(E(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(we);if(!je)return null;const ut=je.findIndex((cr,Ai)=>Ai>0&&cr!==void 0),gt=this.matchIndexes[ut];return je.splice(0,ut),Object.assign(je,gt)}}class Re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const je=new de;return this.rules.slice(we).forEach(([ut,gt])=>je.addRule(ut,gt)),je.compile(),this.multiRegexes[we]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,je){this.rules.push([we,je]),je.type==="begin"&&this.count++}exec(we){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let ut=je.exec(we);if(this.resumingScanAtSamePosition()&&!(ut&&ut.index===this.lastIndex)){const gt=this.getMatcher(0);gt.lastIndex=this.lastIndex+1,ut=gt.exec(we)}return ut&&(this.regexIndex+=ut.position+1,this.regexIndex===this.count&&this.considerAll()),ut}}function ht(ye){const we=new Re;return ye.contains.forEach(je=>we.addRule(je.begin,{rule:je,type:"begin"})),ye.terminatorEnd&&we.addRule(ye.terminatorEnd,{type:"end"}),ye.illegal&&we.addRule(ye.illegal,{type:"illegal"}),we}function Ke(ye,we){const je=ye;if(ye.isCompiled)return je;[se,kt,si,Et].forEach(gt=>gt(ye,we)),D.compilerExtensions.forEach(gt=>gt(ye,we)),ye.__beforeBegin=null,[tt,Fe,wt].forEach(gt=>gt(ye,we)),ye.isCompiled=!0;let ut=null;return typeof ye.keywords=="object"&&ye.keywords.$pattern&&(ye.keywords=Object.assign({},ye.keywords),ut=ye.keywords.$pattern,delete ye.keywords.$pattern),ut=ut||/\w+/,ye.keywords&&(ye.keywords=Rr(ye.keywords,D.case_insensitive)),je.keywordPatternRe=ne(ut,!0),we&&(ye.begin||(ye.begin=/\B|\b/),je.beginRe=ne(je.begin),!ye.end&&!ye.endsWithParent&&(ye.end=/\B|\b/),ye.end&&(je.endRe=ne(je.end)),je.terminatorEnd=f(je.end)||"",ye.endsWithParent&&we.terminatorEnd&&(je.terminatorEnd+=(ye.end?"|":"")+we.terminatorEnd)),ye.illegal&&(je.illegalRe=ne(ye.illegal)),ye.contains||(ye.contains=[]),ye.contains=[].concat(...ye.contains.map(function(gt){return Ko(gt==="self"?ye:gt)})),ye.contains.forEach(function(gt){Ke(gt,je)}),ye.starts&&Ke(ye.starts,we),je.matcher=ht(je),je}if(D.compilerExtensions||(D.compilerExtensions=[]),D.contains&&D.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return D.classNameAliases=n(D.classNameAliases||{}),Ke(D)}function Xa(D){return D?D.endsWithParent||Xa(D.starts):!1}function Ko(D){return D.variants&&!D.cachedVariants&&(D.cachedVariants=D.variants.map(function(ne){return n(D,{variants:null},ne)})),D.cachedVariants?D.cachedVariants:Xa(D)?n(D,{starts:D.starts?n(D.starts):null}):Object.isFrozen(D)?n(D):D}var oa="11.11.1";class Ya extends Error{constructor(ne,de){super(ne),this.name="HTMLInjectionError",this.html=de}}const Rn=r,$r=n,sa=Symbol("nomatch"),li=7,hn=function(D){const ne=Object.create(null),de=Object.create(null),Re=[];let ht=!0;const Ke="Could not find the language '{}', did you forget to load/include a language module?",ye={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function je(he){return we.noHighlightRe.test(he)}function ut(he){let $e=he.className+" ";$e+=he.parentNode?he.parentNode.className:"";const Xe=we.languageDetectRe.exec($e);if(Xe){const Qe=In(Xe[1]);return Qe||(ni(Ke.replace("{}",Xe[1])),ni("Falling back to no-highlight mode for this block.",he)),Qe?Xe[1]:"no-highlight"}return $e.split(/\s+/).find(Qe=>je(Qe)||In(Qe))}function gt(he,$e,Xe){let Qe="",Gt="";typeof $e=="object"?(Qe=he,Xe=$e.ignoreIllegals,Gt=$e.language):(Ur("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ur("10.7.0",`Please use highlight(code, options) instead.
|
|
432
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Gt=he,Qe=$e),Xe===void 0&&(Xe=!0);const Dt={code:Qe,language:Gt};Za("before:highlight",Dt);const ci=Dt.result?Dt.result:cr(Dt.language,Dt.code,Xe);return ci.code=Dt.code,Za("after:highlight",ci),ci}function cr(he,$e,Xe,Qe){const Gt=Object.create(null);function Dt(me,Ee){return me.keywords[Ee]}function ci(){if(!Ge.keywords){Kt.addText(yt);return}let me=0;Ge.keywordPatternRe.lastIndex=0;let Ee=Ge.keywordPatternRe.exec(yt),He="";for(;Ee;){He+=yt.substring(me,Ee.index);const rt=mn.case_insensitive?Ee[0].toLowerCase():Ee[0],qt=Dt(Ge,rt);if(qt){const[ur,Hp]=qt;if(Kt.addText(He),He="",Gt[rt]=(Gt[rt]||0)+1,Gt[rt]<=li&&(to+=Hp),ur.startsWith("_"))He+=Ee[0];else{const Zu=mn.classNameAliases[ur]||ur;Lr(Ee[0],Zu)}}else He+=Ee[0];me=Ge.keywordPatternRe.lastIndex,Ee=Ge.keywordPatternRe.exec(yt)}He+=yt.substring(me),Kt.addText(He)}function Yo(){if(yt==="")return;let me=null;if(typeof Ge.subLanguage=="string"){if(!ne[Ge.subLanguage]){Kt.addText(yt);return}me=cr(Ge.subLanguage,yt,!0,Il[Ge.subLanguage]),Il[Ge.subLanguage]=me._top}else me=Ja(yt,Ge.subLanguage.length?Ge.subLanguage:null);Ge.relevance>0&&(to+=me.relevance),Kt.__addSublanguage(me._emitter,me.language)}function Mr(){Ge.subLanguage!=null?Yo():ci(),yt=""}function Lr(me,Ee){me!==""&&(Kt.startScope(Ee),Kt.addText(me),Kt.endScope())}function Qa(me,Ee){let He=1;const rt=Ee.length-1;for(;He<=rt;){if(!me._emit[He]){He++;continue}const qt=mn.classNameAliases[me[He]]||me[He],ur=Ee[He];qt?Lr(ur,qt):(yt=ur,ci(),yt=""),He++}}function la(me,Ee){return me.scope&&typeof me.scope=="string"&&Kt.openNode(mn.classNameAliases[me.scope]||me.scope),me.beginScope&&(me.beginScope._wrap?(Lr(yt,mn.classNameAliases[me.beginScope._wrap]||me.beginScope._wrap),yt=""):me.beginScope._multi&&(Qa(me.beginScope,Ee),yt="")),Ge=Object.create(me,{parent:{value:Ge}}),Ge}function eo(me,Ee,He){let rt=O(me.endRe,He);if(rt){if(me["on:end"]){const qt=new e(me);me["on:end"](Ee,qt),qt.isMatchIgnored&&(rt=!1)}if(rt){for(;me.endsParent&&me.parent;)me=me.parent;return me}}if(me.endsWithParent)return eo(me.parent,Ee,He)}function qp(me){return Ge.matcher.regexIndex===0?(yt+=me[0],1):(da=!0,0)}function Fp(me){const Ee=me[0],He=me.rule,rt=new e(He),qt=[He.__beforeBegin,He["on:begin"]];for(const ur of qt)if(ur&&(ur(me,rt),rt.isMatchIgnored))return qp(Ee);return He.skip?yt+=Ee:(He.excludeBegin&&(yt+=Ee),Mr(),!He.returnBegin&&!He.excludeBegin&&(yt=Ee)),la(He,me),He.returnBegin?0:Ee.length}function Pl(me){const Ee=me[0],He=$e.substring(me.index),rt=eo(Ge,me,He);if(!rt)return sa;const qt=Ge;Ge.endScope&&Ge.endScope._wrap?(Mr(),Lr(Ee,Ge.endScope._wrap)):Ge.endScope&&Ge.endScope._multi?(Mr(),Qa(Ge.endScope,me)):qt.skip?yt+=Ee:(qt.returnEnd||qt.excludeEnd||(yt+=Ee),Mr(),qt.excludeEnd&&(yt=Ee));do Ge.scope&&Kt.closeNode(),!Ge.skip&&!Ge.subLanguage&&(to+=Ge.relevance),Ge=Ge.parent;while(Ge!==rt.parent);return rt.starts&&la(rt.starts,me),qt.returnEnd?0:Ee.length}function Ju(){const me=[];for(let Ee=Ge;Ee!==mn;Ee=Ee.parent)Ee.scope&&me.unshift(Ee.scope);me.forEach(Ee=>Kt.openNode(Ee))}let ca={};function ua(me,Ee){const He=Ee&&Ee[0];if(yt+=me,He==null)return Mr(),0;if(ca.type==="begin"&&Ee.type==="end"&&ca.index===Ee.index&&He===""){if(yt+=$e.slice(Ee.index,Ee.index+1),!ht){const rt=new Error(`0 width match regex (${he})`);throw rt.languageName=he,rt.badRule=ca.rule,rt}return 1}if(ca=Ee,Ee.type==="begin")return Fp(Ee);if(Ee.type==="illegal"&&!Xe){const rt=new Error('Illegal lexeme "'+He+'" for mode "'+(Ge.scope||"<unnamed>")+'"');throw rt.mode=Ge,rt}else if(Ee.type==="end"){const rt=Pl(Ee);if(rt!==sa)return rt}if(Ee.type==="illegal"&&He==="")return yt+=`
|
|
433
|
+
`,1;if(ro>1e5&&ro>Ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=He,He.length}const mn=In(he);if(!mn)throw Ir(Ke.replace("{}",he)),new Error('Unknown language: "'+he+'"');const Rl=Go(mn);let lt="",Ge=Qe||Rl;const Il={},Kt=new we.__emitter(we);Ju();let yt="",to=0,ui=0,ro=0,da=!1;try{if(mn.__emitTokens)mn.__emitTokens($e,Kt);else{for(Ge.matcher.considerAll();;){ro++,da?da=!1:Ge.matcher.considerAll(),Ge.matcher.lastIndex=ui;const me=Ge.matcher.exec($e);if(!me)break;const Ee=$e.substring(ui,me.index),He=ua(Ee,me);ui=me.index+He}ua($e.substring(ui))}return Kt.finalize(),lt=Kt.toHTML(),{language:he,value:lt,relevance:to,illegal:!1,_emitter:Kt,_top:Ge}}catch(me){if(me.message&&me.message.includes("Illegal"))return{language:he,value:Rn($e),illegal:!0,relevance:0,_illegalBy:{message:me.message,index:ui,context:$e.slice(ui-100,ui+100),mode:me.mode,resultSoFar:lt},_emitter:Kt};if(ht)return{language:he,value:Rn($e),illegal:!1,relevance:0,errorRaised:me,_emitter:Kt,_top:Ge};throw me}}function Ai(he){const $e={value:Rn(he),illegal:!1,relevance:0,_top:ye,_emitter:new we.__emitter(we)};return $e._emitter.addText(he),$e}function Ja(he,$e){$e=$e||we.languages||Object.keys(ne);const Xe=Ai(he),Qe=$e.filter(In).filter(Yu).map(Mr=>cr(Mr,he,!1));Qe.unshift(Xe);const Gt=Qe.sort((Mr,Lr)=>{if(Mr.relevance!==Lr.relevance)return Lr.relevance-Mr.relevance;if(Mr.language&&Lr.language){if(In(Mr.language).supersetOf===Lr.language)return 1;if(In(Lr.language).supersetOf===Mr.language)return-1}return 0}),[Dt,ci]=Gt,Yo=Dt;return Yo.secondBest=ci,Yo}function zp(he,$e,Xe){const Qe=$e&&de[$e]||Xe;he.classList.add("hljs"),he.classList.add(`language-${Qe}`)}function jl(he){let $e=null;const Xe=ut(he);if(je(Xe))return;if(Za("before:highlightElement",{el:he,language:Xe}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(he)),we.throwUnescapedHTML))throw new Ya("One of your code blocks includes unescaped HTML.",he.innerHTML);$e=he;const Qe=$e.textContent,Gt=Xe?gt(Qe,{language:Xe,ignoreIllegals:!0}):Ja(Qe);he.innerHTML=Gt.value,he.dataset.highlighted="yes",zp(he,Xe,Gt.language),he.result={language:Gt.language,re:Gt.relevance,relevance:Gt.relevance},Gt.secondBest&&(he.secondBest={language:Gt.secondBest.language,relevance:Gt.secondBest.relevance}),Za("after:highlightElement",{el:he,result:Gt,text:Qe})}function Bp(he){we=$r(we,he)}const Ti=()=>{Vo(),Ur("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Wu(){Vo(),Ur("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Cl=!1;function Vo(){function he(){Vo()}if(document.readyState==="loading"){Cl||window.addEventListener("DOMContentLoaded",he,!1),Cl=!0;return}document.querySelectorAll(we.cssSelector).forEach(jl)}function Gu(he,$e){let Xe=null;try{Xe=$e(D)}catch(Qe){if(Ir("Language definition for '{}' could not be registered.".replace("{}",he)),ht)Ir(Qe);else throw Qe;Xe=ye}Xe.name||(Xe.name=he),ne[he]=Xe,Xe.rawDefinition=$e.bind(null,D),Xe.aliases&&Xu(Xe.aliases,{languageName:he})}function Ku(he){delete ne[he];for(const $e of Object.keys(de))de[$e]===he&&delete de[$e]}function Vu(){return Object.keys(ne)}function In(he){return he=(he||"").toLowerCase(),ne[he]||ne[de[he]]}function Xu(he,{languageName:$e}){typeof he=="string"&&(he=[he]),he.forEach(Xe=>{de[Xe.toLowerCase()]=$e})}function Yu(he){const $e=In(he);return $e&&!$e.disableAutodetect}function Lt(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=$e=>{he["before:highlightBlock"](Object.assign({block:$e.el},$e))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=$e=>{he["after:highlightBlock"](Object.assign({block:$e.el},$e))})}function Up(he){Lt(he),Re.push(he)}function Nl(he){const $e=Re.indexOf(he);$e!==-1&&Re.splice($e,1)}function Za(he,$e){const Xe=he;Re.forEach(function(Qe){Qe[Xe]&&Qe[Xe]($e)})}function Xo(he){return Ur("10.7.0","highlightBlock will be removed entirely in v12.0"),Ur("10.7.0","Please use highlightElement now."),jl(he)}Object.assign(D,{highlight:gt,highlightAuto:Ja,highlightAll:Vo,highlightElement:jl,highlightBlock:Xo,configure:Bp,initHighlighting:Ti,initHighlightingOnLoad:Wu,registerLanguage:Gu,unregisterLanguage:Ku,listLanguages:Vu,getLanguage:In,registerAliases:Xu,autoDetection:Yu,inherit:$r,addPlugin:Up,removePlugin:Nl}),D.debugMode=function(){ht=!1},D.safeMode=function(){ht=!0},D.versionString=oa,D.regex={concat:_,lookahead:g,either:S,optional:x,anyNumberOfTimes:v};for(const he in Se)typeof Se[he]=="object"&&t(Se[he]);return Object.assign(D,Se),D},pn=hn({});return pn.newInstance=()=>hn({}),Rg=pn,pn.HighlightJS=pn,pn.default=pn,Rg}var YU=XU();const Qt=vt(YU),JU=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ZU=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],QU=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eq=[...ZU,...QU],tq=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rq=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nq=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),iq=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function aq(t){const e=t.regex,r=JU(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rq.join("|")+")"},{begin:":(:)?("+nq.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+iq.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:tq.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+eq.join("|")+")\\b"}]}}function oq(t){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}const RE="[A-Za-z$_][0-9A-Za-z$_]*",sq=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],lq=["true","false","null","undefined","NaN","Infinity"],rR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cq=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],uq=[].concat(iR,rR,nR);function aR(t){const e=t.regex,r=(H,{after:Q})=>{const U="</"+H[0].slice(1);return H.input.indexOf(U,Q)!==-1},n=RE,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(H,Q)=>{const U=H[0].length+H.index,I=H.input[U];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(r(H,{after:U})||Q.ignoreMatch());let $;const V=H.input.substring(U);if($=V.match(/^\s*=/)){Q.ignoreMatch();return}if(($=V.match(/^\s+extends\s+/))&&$.index===0){Q.ignoreMatch();return}}},c={$pattern:RE,keyword:sq,literal:lq,built_in:uq,"variable.language":cq},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},f];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const j=[].concat(A,g.contains),E=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(j)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:E},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rR,...nR]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(H){return e.concat("(?!",H.join("|"),")")}const K={match:e.concat(/\b/,B([...iR,"super","import"].map(H=>`${H}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},Y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,A,{match:/\$\d+/},f,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},te,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:Y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},K,F,N,X,{match:/\$[(.]/}]}}function dq(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function oR(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},p={begin:/\{\{/,relevance:0},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",v=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,x=`\\b|${n.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${v}))[eE][+-]?(${g})[jJ]?(?=${x})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${g})[jJ](?=${x})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,_,f,t.HASH_COMMENT_MODE]}]};return d.contains=[f,_,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,b,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,S,f]}]}}function fq(t){const e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),i=e.concat(r,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:p,keyword:c,literal:u,built_in:d},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,n],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:p}},{className:"punctuation",begin:"->"},a]}}function e1(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}const Gf="[A-Za-z$_][0-9A-Za-z$_]*",sR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],lR=["true","false","null","undefined","NaN","Infinity"],cR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],uR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hR=[].concat(dR,cR,uR);function hq(t){const e=t.regex,r=(H,{after:Q})=>{const U="</"+H[0].slice(1);return H.input.indexOf(U,Q)!==-1},n=Gf,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(H,Q)=>{const U=H[0].length+H.index,I=H.input[U];if(I==="<"||I===","){Q.ignoreMatch();return}I===">"&&(r(H,{after:U})||Q.ignoreMatch());let $;const V=H.input.substring(U);if($=V.match(/^\s*=/)){Q.ignoreMatch();return}if(($=V.match(/^\s+extends\s+/))&&$.index===0){Q.ignoreMatch();return}}},c={$pattern:Gf,keyword:sR,literal:lR,built_in:hR,"variable.language":fR},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},f];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const j=[].concat(A,g.contains),E=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(j)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:E},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...cR,...uR]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},J={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(H){return e.concat("(?!",H.join("|"),")")}const K={match:e.concat(/\b/,B([...dR,"super","import"].map(H=>`${H}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},W={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},Y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",te={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,A,{match:/\$\d+/},f,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},te,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:Y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},J,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},W,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},K,F,N,X,{match:/\$[(.]/}]}}function pR(t){const e=t.regex,r=hq(t),n=Gf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:Gf,keyword:sR.concat(u),literal:lR,built_in:hR.concat(i),"variable.language":fR},p={className:"meta",begin:"@"+n},f=(_,b,S)=>{const A=_.contains.findIndex(O=>O.label===b);if(A===-1)throw new Error("can not find mode to replace");_.contains.splice(A,1,S)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(p);const g=r.contains.find(_=>_.scope==="attr"),v=Object.assign({},g,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,g,v]),r.contains=r.contains.concat([p,a,o,v]),f(r,"shebang",t.SHEBANG()),f(r,"use_strict",c);const x=r.contains.find(_=>_.label==="func.def");return x.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function mR(t){const e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,c,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,u,c]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function gR(t){const e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},c=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},x={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},b=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},x,_,a,o],S=[...b];return S.pop(),S.push(c),v.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}Qt.registerLanguage("javascript",aR);Qt.registerLanguage("js",aR);Qt.registerLanguage("typescript",pR);Qt.registerLanguage("ts",pR);Qt.registerLanguage("python",oR);Qt.registerLanguage("py",oR);Qt.registerLanguage("rust",fq);Qt.registerLanguage("go",oq);Qt.registerLanguage("json",dq);Qt.registerLanguage("yaml",gR);Qt.registerLanguage("yml",gR);Qt.registerLanguage("shell",e1);Qt.registerLanguage("bash",e1);Qt.registerLanguage("sh",e1);Qt.registerLanguage("html",mR);Qt.registerLanguage("xml",mR);Qt.registerLanguage("css",aq);nt.use({renderer:{heading({tokens:t,depth:e}){const r=t.map(a=>a.raw).join(""),n=`h${e}`;return`<${n} style="font-size:${{1:"2rem",2:"1.625rem",3:"1.375rem",4:"1.125rem"}[e]??"1rem"};font-weight:500;color:#e4e4e7;margin:1.1em 0 0.4em;line-height:1.5;">${r}</${n}>`},code({text:t,lang:e}){let r;return e&&Qt.getLanguage(e)?r=Qt.highlight(t,{language:e}).value:r=Qt.highlightAuto(t).value,`<pre style="background:#161616;border:1px solid rgba(255,255,255,0.07);border-radius:10px;padding:0.9em 1.1em;overflow-x:auto;margin:0.8em 0;"><code class="hljs" style="background:none;border:none;padding:0;color:#d4d4d8;font-size:0.85em;">${r}</code></pre>`}}});function sp({content:t,className:e=""}){const r=P.useMemo(()=>nt.parse(t),[t]);return y.jsx("div",{className:`prose-io ${e}`,style:{color:"#d4d4d8",fontSize:"0.875rem",lineHeight:"1.7"},dangerouslySetInnerHTML:{__html:r}})}const IE=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function pq(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);return IE[Math.abs(e)%IE.length]}function $E({name:t,color:e}){const r=t.toLowerCase(),n=e??(r==="orchestrator"||r==="io"?"#71717a":pq(t));return y.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${n}15`,color:n,borderColor:`${n}30`},children:t})}function mq(){const[t,e]=P.useState([]),[r,n]=P.useState(null),[i,a]=P.useState(new Set),[o,c]=P.useState("all"),u=qa();P.useEffect(()=>{Ve.get("/inbox").then(O=>e(O.entries)).catch(()=>{})},[]);const d=t.filter(O=>O.status==="unread").length,p=o==="unread"?t.filter(O=>O.status==="unread"):t,f=p.length>0&&p.every(O=>i.has(O.id)),g=i.size>0;function v(O){g||(n(O),O.status==="unread"&&(Ve.post(`/inbox/${O.id}/read`).catch(()=>{}),e(j=>j.map(E=>E.id===O.id?{...E,status:"read"}:E))))}function x(O,j){O.stopPropagation(),a(E=>{const T=new Set(E);return T.has(j)?T.delete(j):T.add(j),T})}function _(){a(f?new Set:new Set(p.map(O=>O.id)))}function b(){const O=Array.from(i);Ve.post("/inbox/bulk/read",{ids:O}).catch(()=>{}),e(j=>j.map(E=>i.has(E.id)?{...E,status:"read"}:E)),a(new Set)}function S(){const O=Array.from(i);Ve.post("/inbox/bulk/delete",{ids:O}).catch(()=>{}),e(j=>j.filter(E=>!i.has(E.id))),r&&i.has(r.id)&&n(null),a(new Set)}function A(O){Ve.delete(`/inbox/${O}`).catch(()=>{}),e(j=>j.filter(E=>E.id!==O)),(r==null?void 0:r.id)===O&&n(null)}return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-72 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex-shrink-0 space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-lg tracking-wide text-zinc-200",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),d>0&&y.jsxs(jt,{variant:"default",children:[d," unread"]})]}),y.jsx("div",{className:"flex gap-1",children:["all","unread"].map(O=>y.jsx("button",{type:"button",onClick:()=>{c(O),a(new Set)},className:`flex-1 py-1 text-[11px] font-mono rounded-lg transition-colors cursor-pointer ${o===O?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300"}`,style:o===O?{background:"rgba(228,58,156,0.12)"}:void 0,children:O},O))})]}),g&&y.jsxs("div",{className:"px-3 py-2 border-b border-white/[0.06] flex items-center gap-1.5 flex-shrink-0",style:{background:"rgba(228,58,156,0.06)"},children:[y.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 flex-1",children:[i.size," selected"]}),y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-zinc-400 hover:text-zinc-200 hover:bg-white/[0.06] transition-colors cursor-pointer",children:[y.jsx(zb,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-red-400 hover:text-red-300 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),p.length>0&&y.jsxs("div",{className:"px-4 py-1.5 border-b border-white/[0.04] flex items-center gap-2 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:_,className:`w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${f?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/40"}`,children:f&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:"Select all"})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.map(O=>{const j=i.has(O.id),E=(r==null?void 0:r.id)===O.id&&!g;return y.jsxs("div",{onClick:()=>v(O),onKeyDown:T=>T.key==="Enter"&&v(O),className:`flex items-start gap-2.5 px-3 py-3 border-b border-white/[0.04] cursor-pointer transition-colors ${E?"border-l-2 border-l-[#E43A9C] pl-2.5":"hover:bg-white/[0.025]"} ${j?"bg-[#E43A9C]/5":""}`,style:E?{background:"rgba(228,58,156,0.05)"}:void 0,children:[y.jsx("button",{type:"button",onClick:T=>x(T,O.id),className:`mt-0.5 w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${j?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/50"}`,children:j&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[O.status==="unread"&&y.jsx("div",{className:"w-1 h-1 rounded-full bg-[#E43A9C] flex-shrink-0"}),y.jsx($E,{name:O.squadName??(O.squadId?O.squadId.slice(0,8):"Orchestrator"),color:O.squadColor})]}),y.jsx("p",{className:`text-[11px] truncate ${O.status==="unread"?"text-zinc-200":"text-zinc-500"}`,children:O.title}),y.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-1",children:Ws(O.createdAt,u)})]})]},O.id)}),p.length===0&&y.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[y.jsx(Bb,{size:32,className:"text-zinc-800 mb-2"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:o==="unread"?"All caught up":"No items yet"})]})]})]}),y.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:r&&!g?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-start justify-between flex-shrink-0",children:[y.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[y.jsx($E,{name:r.squadName??(r.squadId?r.squadId.slice(0,8):"Orchestrator"),color:r.squadColor}),y.jsx("h3",{className:"text-sm font-mono text-zinc-100 mt-1.5",children:r.title}),y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:Ws(r.createdAt,u)})]}),y.jsxs("button",{type:"button",onClick:()=>A(r.id),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",children:[y.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:y.jsx(sp,{content:r.content})})]}):g?y.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-center px-8",children:[y.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center border border-[#E43A9C]/20",style:{background:"rgba(228,58,156,0.08)"},children:y.jsx(Bb,{className:"w-4 h-4 text-[#E43A9C]"})}),y.jsxs("div",{children:[y.jsxs("p",{className:"text-sm font-mono text-zinc-300",children:[i.size," message",i.size!==1?"s":""," selected"]}),y.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Use the actions above to mark as read or delete"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-300 border border-white/[0.1] hover:bg-white/[0.05] transition-colors cursor-pointer",children:[y.jsx(zb,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-red-400 border border-red-500/20 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx(Ma,{className:"w-3 h-3"}),"Delete selected"]})]})]}):y.jsx("div",{className:"flex-1 flex items-center justify-center text-zinc-700 font-mono text-xs",children:"Select an item to read"})})]})}function gq(){const{signIn:t}=op(),[e,r]=P.useState(""),[n,i]=P.useState(""),[a,o]=P.useState(null),[c,u]=P.useState(!1);async function d(p){p.preventDefault(),o(null),u(!0);const{error:f}=await t(e,n);f&&o(f),u(!1)}return y.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[y.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),y.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%)"}}),y.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[y.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[y.jsx(Ra,{height:52}),y.jsx("div",{className:"text-center",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),y.jsxs("form",{onSubmit:d,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),y.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"})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),y.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&&y.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),y.jsx("button",{type:"submit",disabled:c,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:c?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const yR="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",Bs="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 qi({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 y.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:[y.jsxs("div",{className:"w-[140px] shrink-0",children:[y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&y.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),y.jsx("div",{className:i,children:n})]})}function yq({onSave:t,onCancel:e,squads:r}){var x;const[n,i]=P.useState("io"),[a,o]=P.useState(((x=r[0])==null?void 0:x.id)??""),[c,u]=P.useState(""),[d,p]=P.useState(""),[f,g]=P.useState(""),v=()=>{!d.trim()||!f.trim()||!c.trim()||t({name:c.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:d.trim(),prompt:f.trim()})};return y.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:y.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:[y.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[y.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),y.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:y.jsx(nP,{className:"w-4 h-4"})})]}),y.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[y.jsx(qi,{label:"Name",children:y.jsx("input",{value:c,onChange:_=>u(_.target.value),placeholder:"Daily triage",className:`${Bs} w-48`})}),y.jsx(qi,{label:"Type",children:y.jsx("div",{className:"flex gap-2",children:["io","squad"].map(_=>y.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":"Squad"},_))})}),n==="squad"&&y.jsx(qi,{label:"Squad",children:y.jsx("select",{value:a,onChange:_=>o(_.target.value),className:`${Bs} w-48`,children:r.map(_=>y.jsx("option",{value:_.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:_.name},_.id))})}),y.jsx(qi,{label:"Cron Expression",children:y.jsx("input",{value:d,onChange:_=>p(_.target.value),placeholder:"0 9 * * 1-5",className:`${Bs} w-40`})}),y.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsx("textarea",{value:f,onChange:_=>g(_.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${yR} resize-none leading-relaxed`})})]}),y.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:[y.jsx(_i,{onClick:e,children:"Cancel"}),y.jsxs(za,{onClick:v,className:"px-4 py-1.5",children:[y.jsx(Bw,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function vq({sched:t,squads:e,onSave:r,onBack:n}){var x,_;const[i,a]=P.useState(t.name),[o,c]=P.useState(t.cron),[u,d]=P.useState(t.prompt),[p,f]=P.useState(t.targetId??((x=e[0])==null?void 0:x.id)??""),g=()=>{!o.trim()||!u.trim()||!i.trim()||r({name:i.trim(),cron:o.trim(),prompt:u.trim(),targetId:t.targetType==="squad"?p:void 0})},v=t.targetType==="orchestrator"?"IO Schedule":`Squad — ${((_=e.find(b=>b.id===t.targetId))==null?void 0:_.name)??"Unknown"}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[y.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:[y.jsx(vl,{className:"w-3.5 h-3.5"}),"Schedules"]}),y.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:v})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(_i,{onClick:n,children:"Cancel"}),y.jsxs(za,{onClick:g,className:"px-4 py-1.5",children:[y.jsx(Bw,{className:"w-3 h-3"}),"Save Changes"]})]})]}),y.jsxs("div",{className:"space-y-3",children:[y.jsx(qi,{label:"Name",children:y.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${Bs} w-48`})}),t.targetType==="squad"&&y.jsx(qi,{label:"Squad",children:y.jsx("select",{value:p,onChange:b=>f(b.target.value),className:`${Bs} w-48`,children:e.map(b=>y.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),y.jsx(qi,{label:"Cron Expression",children:y.jsx("input",{value:o,onChange:b=>c(b.target.value),placeholder:"0 9 * * 1-5",className:`${Bs} w-40`})}),y.jsx(qi,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("textarea",{value:u,onChange:b=>d(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${yR} leading-relaxed resize-y`,style:{minHeight:"360px"}}),y.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function bq(){const[t,e]=P.useState("squad"),[r,n]=P.useState([]),[i,a]=P.useState([]),[o,c]=P.useState(!1),[u,d]=P.useState(null),p=qa();P.useEffect(()=>{f(),g()},[]);function f(){Ve.get("/schedules").then(R=>n(R.schedules)).catch(()=>{})}function g(){Ve.get("/squads").then(R=>a(R.squads)).catch(()=>{})}const v=r.filter(R=>R.targetType==="squad"),x=r.filter(R=>R.targetType==="orchestrator"),_=t==="squad"?v:x;async function b(R){try{await Ve.post("/schedules",R),at.success("Schedule created"),c(!1),f()}catch(M){at.error(M instanceof Error?M.message:"Failed to create")}}async function S(R){if(u)try{await Ve.patch(`/schedules/${u.id}`,R),at.success("Schedule saved"),d(null),f()}catch{at.error("Failed to save schedule")}}const[A,O]=P.useState(null);async function j(R,M){O(R);try{await Ve.patch(`/schedules/${R}`,{enabled:!M}),at.success(M?"Schedule paused":"Schedule resumed"),f()}catch{at.error("Failed to toggle schedule")}finally{O(null)}}async function E(R){O(R);try{await Ve.post(`/schedules/${R}/run`,{}),at.success("Schedule triggered")}catch{at.error("Failed to trigger schedule")}finally{O(null)}}async function T(R){O(R);try{await Ve.delete(`/schedules/${R}`),at.success("Schedule deleted"),f()}catch{at.error("Failed to delete")}finally{O(null)}}if(u)return y.jsx(vq,{sched:u,squads:i,onSave:S,onBack:()=>d(null)});const N=t==="squad"?["Squad","Name","Cron","Next Run","Status",""]:["Name","Cron","Next Run","Status",""];return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&y.jsx(yq,{onSave:b,onCancel:()=>c(!1),squads:i}),y.jsxs("div",{className:"flex items-center justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(R=>R.enabled).length," active · ",r.filter(R=>!R.enabled).length," paused"]})]}),y.jsxs(za,{onClick:()=>c(!0),className:"px-3 py-1.5",children:[y.jsx(zw,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),y.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([R,M])=>y.jsx("button",{type:"button",onClick:()=>e(R),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===R?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===R?{background:"rgba(228,58,156,0.12)"}:void 0,children:M},R))}),y.jsx("div",{className:"overflow-x-auto rounded-2xl border border-white/[0.07] glass-card",children:_.length===0?y.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):y.jsxs("table",{className:"w-full text-[11px] font-mono min-w-[640px]",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:N.map(R=>y.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:R},R))})}),y.jsx("tbody",{children:_.map(R=>{var M,J;return y.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${R.enabled?"":"opacity-50"}`,children:[t==="squad"?y.jsx("td",{className:"px-4 py-3",children:y.jsx(qB,{name:((M=i.find(F=>F.id===R.targetId))==null?void 0:M.name)??"Unknown",color:(J=i.find(F=>F.id===R.targetId))==null?void 0:J.color})}):null,y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:R.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600 text-[10px]",children:R.cron}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(Mw,{className:"w-3 h-3"}),R.enabled&&R.nextRun?Ws(R.nextRun,p):"—"]})}),y.jsx("td",{className:"px-4 py-3",children:y.jsx(jt,{variant:R.enabled?"success":"muted",children:R.enabled?"active":"paused"})}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:`flex items-center gap-1 ${A===R.id?"opacity-50 pointer-events-none":""}`,children:[y.jsxs(_i,{onClick:()=>E(R.id),children:[y.jsx(j4,{className:"w-3 h-3"}),"Run now"]}),y.jsx(FB,{onClick:()=>j(R.id,R.enabled),children:R.enabled?y.jsxs(y.Fragment,{children:[y.jsx(k4,{className:"w-3 h-3"}),"Pause"]}):y.jsxs(y.Fragment,{children:[y.jsx(Ds,{className:"w-3 h-3"}),"Resume"]})}),y.jsxs(_i,{onClick:()=>d(R),children:[y.jsx(O4,{className:"w-3 h-3"}),"Edit"]}),y.jsxs(zf,{onClick:()=>T(R.id),children:[y.jsx(Ma,{className:"w-3 h-3"}),"Delete"]})]})})]},R.id)})})]})})]})}const xq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],Uo="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",ME=`${Uo} w-[72px]`,wq=`${Uo} w-[100px]`,LE=`${Uo} w-[200px]`,DE=`${Uo} w-[320px]`,_q=`${Uo} 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 Sq(){const[t,e]=P.useState(null),[r,n]=P.useState("general");P.useEffect(()=>{Ve.get("/config").then(o=>e(o.config)).catch(()=>{})},[]);function i(o){t&&e({...t,...o})}async function a(){if(t)try{const{dataDir:o,...c}=t;await Ve.patch("/config",c),at.success("Settings saved")}catch{at.error("Failed to save settings")}}return t?y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:y.jsxs("div",{className:"max-w-3xl",children:[y.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),y.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:xq.map(o=>y.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))}),y.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Log Level",children:y.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:_q,children:["trace","debug","info","warn","error","fatal"].map(o=>y.jsx("option",{value:o,children:o},o))})}),y.jsx(_n,{label:"Default Model",children:y.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:LE})}),y.jsx(_n,{label:"Timezone",children:y.jsx("select",{value:t.timezone,onChange:o=>i({timezone:o.target.value}),className:`${Uo} w-[200px] 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`,children:J4.map(o=>y.jsx("option",{value:o.value,children:o.label},o.value))})}),y.jsx(_n,{label:"Max Instances",children:y.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:ME,min:1,max:10})}),y.jsx(_n,{label:"API Port",children:y.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:ME})}),y.jsx(_n,{label:"Pricing Refresh (hrs)",children:y.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:wq,min:1})}),y.jsx(_n,{label:"Data Dir",children:y.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${DE} cursor-default text-zinc-500`})})]}),r==="telegram"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Bot Token",children:y.jsx(Ig,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),y.jsx(_n,{label:"Allowed Chat IDs",children:y.jsx("input",{type:"text",value:t.telegram.allowedChatIds.join(", "),onChange:o=>i({telegram:{...t.telegram,allowedChatIds:o.target.value.split(",").map(c=>Number(c.trim())).filter(c=>!Number.isNaN(c))}}),className:LE})})]}),r==="auth"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Project URL",children:y.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:DE})}),y.jsx(_n,{label:"Anon Key",children:y.jsx(Ig,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),y.jsx(_n,{label:"JWT Secret",children:y.jsx(Ig,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),y.jsx("div",{className:"flex justify-end pt-6",children:y.jsx(za,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):y.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function _n({label:t,children:e}){return y.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),y.jsx("div",{className:"flex justify-end",children:e})]})}function Ig({value:t,onChange:e,size:r="lg"}){const[n,i]=P.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${Uo} ${a} pr-9`}),y.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?y.jsx(t4,{size:14}):y.jsx(zb,{size:14})})]})}const kq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function zE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function BE(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 Eq(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 c of r.split(`
|
|
434
|
+
`)){const u=c.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(u){a&&o&&(i[a]=o,o=null),a=u[1]??"";const d=(u[2]??"").trim();d===""||d==="[]"?o=[]:d.startsWith("[")&&d.endsWith("]")?i[a]=d.slice(1,-1).split(",").map(p=>p.trim().replace(/^["']|["']$/g,"")):i[a]=d.replace(/^["']|["']$/g,"")}else c.match(/^\s+-\s+(.+)/)&&a&&(o||(o=[]),o.push(c.replace(/^\s+-\s+/,"").trim()))}return a&&o&&(i[a]=o),{frontMatter:i,body:n}}const UE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function Oq({content:t}){const{frontMatter:e,body:r}=Eq(t),n=UE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!UE.includes(o)),a=[...n,...i];return y.jsxs("div",{children:[a.length>0&&y.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),y.jsx("div",{className:"space-y-2",children:a.map(o=>{const c=e[o];return c==null||Array.isArray(c)&&c.length===0?null:y.jsxs("div",{className:"flex gap-3 items-start",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),y.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(c)?y.jsx("div",{className:"flex flex-wrap gap-1",children:c.map((u,d)=>y.jsx(jt,{variant:"muted",children:u},d))}):typeof c=="object"?y.jsx("div",{className:"space-y-0.5",children:Object.entries(c).map(([u,d])=>y.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[y.jsxs("span",{className:"text-zinc-600",children:[u,":"]})," ",d]},u))}):o==="use_when"||o==="use-when"?y.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:c}):o==="argument_hint"||o==="argument-hint"?y.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:c}):y.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:c})})]},o)})})]}),r.trim()&&y.jsxs("div",{children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),y.jsx(sp,{content:r})]})]})}function Aq(){const[t,e]=P.useState("installed"),[r,n]=P.useState([]),[i,a]=P.useState([]),[o,c]=P.useState(null);function u($){return"url"in $&&$.url?$.url:$.name}const[d,p]=P.useState(null),[f,g]=P.useState(""),[v,x]=P.useState(!1),[_,b]=P.useState(!1),[S,A]=P.useState(!1),[O,j]=P.useState(""),[E,T]=P.useState(null),[N,R]=P.useState(null),M=P.useCallback(async()=>{try{const $=await Ve.get("/skills"),V=new Set($.skills.map(oe=>oe.name.toLowerCase()));n($.skills),a(oe=>oe.map(le=>({...le,installed:V.has(le.name.toLowerCase())})))}catch($){at.error($ instanceof Error?$.message:"Failed to load skills")}},[]),J=P.useCallback(async $=>{b(!0);try{const V=await Ve.get(`/skills/${encodeURIComponent($)}`);p(V),j(V.content)}catch(V){at.error(V instanceof Error?V.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);P.useEffect(()=>{M()},[M]),P.useEffect(()=>{if(t==="installed"){R(null);return}const $=f.trim();if(t==="skillssh"&&!$){a([]),R(null),x(!1);return}let V=!1;x(!0);const oe=window.setTimeout(async()=>{try{const le=await Ve.get(`/skills/discover?source=${t}&q=${encodeURIComponent($)}`);if(V)return;a(le.skills),R(null)}catch(le){if(V)return;a([]),R(le instanceof Error?le.message:"Discovery failed")}finally{V||x(!1)}},250);return()=>{V=!0,window.clearTimeout(oe)}},[f,t]);const F=P.useMemo(()=>{const $=f.trim().toLowerCase();return $?r.filter(V=>[V.name,V.description,V.preview].some(oe=>oe.toLowerCase().includes($))):r},[r,f]),B=t==="installed"?F:i,K=F.find($=>$.name===o)??null,W=i.find($=>u($)===o)??null,X=(K==null?void 0:K.name)??(W==null?void 0:W.name)??null;P.useEffect(()=>{if(A(!1),!B.length){c(null),t!=="installed"&&p(null);return}if(!o||!B.some($=>u($)===o)){const $=B[0];$&&c(u($))}},[o,t,B]),P.useEffect(()=>{if(t!=="installed"||!X){p(null);return}J(X)},[J,X,t]);async function Y($){if(!$.url&&!$.registrySource){at.error("Install source is not available for this skill yet");return}T($.name);try{await Ve.post("/skills/install",{name:$.name,source:$.source,url:$.url,registrySource:$.registrySource,skillId:$.skillId}),at.success(`Installed ${$.title||$.name}`),await M(),a(V=>V.map(oe=>oe.name===$.name?{...oe,installed:!0}:oe))}catch(V){at.error(V instanceof Error?V.message:"Install failed")}finally{T(null)}}async function te($){T($);try{await Ve.delete(`/skills/${encodeURIComponent($)}`),at.success(`Removed ${$}`),await M(),a(V=>V.map(oe=>oe.name===$?{...oe,installed:!1}:oe))}catch(V){at.error(V instanceof Error?V.message:"Failed to remove skill")}finally{T(null)}}async function H(){if(d){T(d.name);try{await Ve.put(`/skills/${encodeURIComponent(d.name)}`,{content:O}),at.success(`Updated ${d.name}`),A(!1),await Promise.all([M(),J(d.name)])}catch($){at.error($ instanceof Error?$.message:"Failed to save skill")}finally{T(null)}}}const Q=!!(K!=null&&K.activatedForOrchestrator),U=E===(d==null?void 0:d.name),I=E===(W==null?void 0:W.name);return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[y.jsxs("div",{className:"relative",children:[y.jsx(eP,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),y.jsx("input",{type:"text",value:f,onChange:$=>g($.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"})]}),y.jsx("div",{className:"flex flex-col gap-0.5",children:kq.map($=>y.jsxs("button",{type:"button",onClick:()=>e($.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===$.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===$.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[y.jsx("span",{children:$.label}),$.id==="installed"&&y.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},$.id))})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[v&&t!=="installed"?y.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:[y.jsx(js,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,B.map($=>{const V=u($),oe=o===V,le=$.description||("preview"in $?$.preview:"No description available.");return y.jsxs("button",{type:"button",onClick:()=>{A(!1),c(V)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${oe?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[y.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[y.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:$.name}),"installed"in $&&$.installed?y.jsx(jt,{variant:"success",children:"installed"}):null]}),y.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:le})]},`${t}:${V}`)}),!v&&B.length===0?y.jsx("div",{className:"px-4 py-8",children:y.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:N||(t==="skillssh"&&!f.trim()?"Start typing to search the skills.sh registry.":f.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),y.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&K?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(qb,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:K.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(jt,{variant:"success",children:"installed"}),Q?y.jsx(jt,{variant:"warning",children:"active"}):y.jsx(jt,{variant:"muted",children:"inactive"}),y.jsx(jt,{variant:"muted",children:"local skill"})]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["path: ",K.filePath]}),y.jsxs("p",{children:["orchestrator: ",Q?"enabled":"disabled"]})]})]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[S?y.jsxs(za,{onClick:H,disabled:U||O===(d==null?void 0:d.content),className:"px-3 py-2",children:[U?y.jsx(js,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Ub,{className:"h-3.5 w-3.5"}),"Save"]}):y.jsxs(_i,{onClick:()=>A(!0),className:"px-3 py-2",children:[y.jsx(Ub,{className:"h-3.5 w-3.5"})," Edit"]}),y.jsxs(zf,{onClick:()=>te(K.name),className:"px-3 py-2",children:[U?y.jsx(js,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Ma,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:_&&!d?y.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[y.jsx(js,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):S?y.jsxs("div",{className:"space-y-3",children:[y.jsx("textarea",{value:O,onChange:$=>j($.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"}),y.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[y.jsx("span",{children:"Editing raw SKILL.md"}),y.jsx(_i,{onClick:()=>{A(!1),j((d==null?void 0:d.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):d?y.jsx(Oq,{content:d.content}):y.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&W?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(z4,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:W.title||W.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(jt,{variant:W.installed?"success":"default",children:W.installed?"installed":"available"}),y.jsx(jt,{variant:"muted",children:zE(W.source)}),BE(W.installs)?y.jsx(jt,{variant:"info",children:BE(W.installs)}):null]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["registry: ",zE(W.source)]}),W.registrySource?y.jsxs("p",{children:["source: ",W.registrySource]}):null,W.url?y.jsxs("p",{children:["url: ",W.url]}):null]})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:W.installed?y.jsx(_i,{onClick:()=>{e("installed"),c(W.name)},className:"px-3 py-2",children:"Open installed"}):y.jsxs(za,{onClick:()=>Y(W),disabled:I||!W.url&&!W.registrySource,className:"px-3 py-2",children:[I?y.jsx(js,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Z5,{className:"h-3.5 w-3.5"}),"Install"]})})]}),y.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[y.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:y.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:W.description||"No registry description is available for this skill yet."})}),y.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."})]})]}):y.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:y.jsxs("div",{children:[y.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(qb,{className:"h-6 w-6"})}),y.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),y.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."})]})})})]})}function Tq(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return`hsl(${(e%360+360)%360}, 70%, 65%)`}function $g(){const{name:t,instanceId:e}=eD();return t&&e?y.jsx(Rq,{squadName:t,instanceId:e}):t?y.jsx(Nq,{name:t}):y.jsx(jq,{})}function jq(){const[t,e]=P.useState([]),[r,n]=P.useState(null),i=Nu();return P.useEffect(()=>{Promise.all([Ve.get("/squads"),Ve.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsx("div",{className:"mb-6",children:y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),y.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"]})]})}),y.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map(a=>{const o=a.color||"#38bdf8";return y.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 ${o}30`,background:`${o}08`,backdropFilter:"blur(20px)"},onMouseEnter:c=>{c.currentTarget.style.borderColor=`${o}70`,c.currentTarget.style.background=`${o}12`},onMouseLeave:c=>{c.currentTarget.style.borderColor=`${o}30`,c.currentTarget.style.background=`${o}08`},children:[y.jsxs("div",{className:"flex items-start justify-between mb-1",children:[y.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:o},children:a.name}),y.jsx(jt,{variant:Co(a.status),children:a.status})]}),y.jsxs("div",{className:"flex items-center justify-between mb-3",children:[y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),y.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[y.jsx(X5,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&y.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono mb-4",children:[y.jsx(YN,{className:"w-3 h-3 flex-shrink-0"}),y.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]}),a.recentActivity&&a.recentActivity.length>0&&y.jsxs("div",{className:"border-t pt-3",style:{borderColor:`${o}15`},children:[y.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider mb-2",style:{color:`${o}80`},children:"Recent Work"}),y.jsx("ul",{className:"space-y-1.5",children:a.recentActivity.map(c=>{const u={className:"w-3.5 h-3.5 flex-shrink-0 mt-px"},d=Cq(c.status,u),p=c.objective?c.objective.length>60?`${c.objective.slice(0,60)}…`:c.objective:c.issueRef||"Instance";return y.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] font-mono text-zinc-600",children:[d,y.jsx("span",{className:"truncate",children:p})]},c.id)})})]})]},a.id)}),t.length===0&&y.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[y.jsx(Zh,{size:48,className:"mx-auto mb-3 opacity-30"}),y.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function Cq(t,e){const r=t.toLowerCase();return r.includes("complete")||r.includes("success")||r.includes("done")?y.jsx(VN,{...e,style:{color:"#34d399"}}):r.includes("warning")||r.includes("review")?y.jsx(H4,{...e,style:{color:"#fbbf24"}}):r.includes("error")||r.includes("fail")?y.jsx(XN,{...e,style:{color:"#f87171"}}):r.includes("working")||r.includes("progress")||r.includes("running")?y.jsx(ZN,{...e,style:{color:"#E43A9C"}}):y.jsx(p4,{...e,style:{color:"#60a5fa"}})}function Kf(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?y.jsx(Lw,{className:r,style:n}):i.includes("qa")||i.includes("test")?y.jsx(M5,{className:r,style:n}):i.includes("scribe")?y.jsx(R4,{className:r,style:n}):y.jsx(Uc,{className:r,style:n})}function Nq({name:t}){const[e,r]=P.useState(null),[n,i]=P.useState("agents"),[a,o]=P.useState([]),[c,u]=P.useState(0),[d,p]=P.useState(null),[f,g]=P.useState([]),v=Nu(),x=qa();P.useEffect(()=>{Ve.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),P.useEffect(()=>{n==="history"&&Ve.get(`/squads/${t}/history`).then(S=>{o(S.items),u(S.total)}).catch(()=>{}),n==="schedules"&&e&&Ve.get(`/schedules?targetId=${e.squad.id}`).then(S=>g(S.schedules)).catch(()=>{})},[n,t,e]);const _=S=>{Ve.get(`/squads/${t}/history/${S.id}`).then(p).catch(()=>at.error("Failed to load activity detail"))};if(!e)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const b=e.squad.color||"#38bdf8";return d?y.jsx(Pq,{activity:d,squadColor:b,squadName:e.squad.name,onBack:()=>p(null)}):y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${b}06`},children:[y.jsxs("button",{type:"button",onClick:()=>v("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(vl,{className:"w-3.5 h-3.5"})," All Squads"]}),y.jsxs("div",{className:"flex items-start justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-3xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:b},children:e.squad.name}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&y.jsxs("a",{href:e.squad.repoUrl,target:"_blank",rel:"noreferrer",className:"text-[11px] font-mono text-[#E43A9C] hover:text-[#F041FF] flex items-center gap-1 mt-1 transition-colors",children:[y.jsx(YN,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),y.jsx(jt,{variant:Co(e.squad.status),children:e.squad.status})]}),y.jsx("div",{className:"flex gap-0 mb-5 border-b border-white/[0.06]",children:["agents","instances","schedules","history"].map(S=>y.jsx("button",{type:"button",onClick:()=>i(S),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px ${n===S?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:S},S))}),n==="agents"&&y.jsx("div",{className:"space-y-2",children:e.members.map(S=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${b}30`,background:`${b}12`},children:Kf(S.roleName||S.role,b)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:S.displayName}),y.jsx(jt,{variant:Co(S.status),children:S.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:S.role}),S.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:S.currentTask})]})]},S.id))}),n==="instances"&&y.jsx("div",{className:"space-y-2",children:e.instances.length===0?y.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No active instances"}):e.instances.map(S=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-4",children:[y.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 text-[11px] font-mono",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"ID"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.id.slice(0,8)})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Branch"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:S.branch||"—"})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Status"}),y.jsx("p",{className:"text-zinc-300 mt-0.5",children:y.jsx(jt,{variant:Co(S.status),children:S.status})})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Tasks"}),y.jsxs("p",{className:"text-zinc-300 mt-0.5",children:[S.tasksComplete,"/",S.taskCount]})]})]}),y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>v(`/squads/${t}/instances/${S.id}`),title:"View instance agents",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:b},children:y.jsx(Ds,{className:"w-4 h-4"})}),y.jsx("button",{type:"button",onClick:()=>at.info("Stop not yet implemented"),title:"Stop instance",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Jh,{className:"w-4 h-4"})})]})]},S.id))}),n==="schedules"&&y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:f.length===0?y.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No schedules for this squad"}):y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:["Schedule","Next Run","Status"].map(S=>y.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:S},S))})}),y.jsx("tbody",{children:f.map(S=>y.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${S.enabled?"":"opacity-50"}`,children:[y.jsxs("td",{className:"px-4 py-3",children:[y.jsx("div",{className:"text-zinc-300",children:S.name||S.prompt}),y.jsx("div",{className:"text-zinc-700 text-[10px] mt-0.5",children:S.cron})]}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(Mw,{className:"w-3 h-3"}),S.enabled&&S.nextRun?Ws(S.nextRun,x):"—"]})}),y.jsx("td",{className:"px-4 py-3",children:y.jsx(jt,{variant:S.enabled?"success":"muted",children:S.enabled?"active":"paused"})})]},S.id))})]})}),n==="history"&&y.jsxs("div",{className:"space-y-2",children:[a.length===0?y.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No history yet"}):a.map(S=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex items-center gap-3",children:[y.jsx("div",{className:"flex-shrink-0",children:S.status==="completed"?y.jsx(VN,{className:"w-4 h-4",style:{color:"#34d399"}}):y.jsx(XN,{className:"w-4 h-4",style:{color:"#f87171"}})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("p",{className:"text-[12px] text-zinc-300 font-mono truncate",children:S.title}),y.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[y.jsx("span",{className:"text-[10px] text-zinc-700 font-mono",children:Ws(S.completedAt||S.createdAt,x)}),y.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[y.jsx(Ds,{className:"w-2.5 h-2.5"}),S.duration||"—"]}),y.jsxs("span",{className:"text-[10px] text-zinc-700 font-mono flex items-center gap-1",children:[y.jsx(Uc,{className:"w-2.5 h-2.5"}),S.agentCount," agent",S.agentCount!==1?"s":""]})]})]}),y.jsx(jt,{variant:S.status==="completed"?"success":"error",children:S.status}),y.jsx("button",{type:"button",onClick:()=>_(S),title:"View activity detail",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors flex-shrink-0 cursor-pointer",style:{color:b},children:y.jsx(Ds,{className:"w-4 h-4"})})]},S.id)),a.length<c&&y.jsx("button",{type:"button",onClick:()=>{Ve.get(`/squads/${t}/history?offset=${a.length}`).then(S=>{o(A=>[...A,...S.items])}).catch(()=>{})},className:"w-full text-center py-3 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:"Load more"})]})]})}function Pq({activity:t,squadColor:e,squadName:r,onBack:n}){const i=qa(),a=P.useMemo(()=>{const p={};for(const f of t.agentEntries)p[f.agentId]=Tq(f.agentName);return p},[t]),o={thought:{label:"Thinking",icon:Dw},tool_call:{label:"Tool Call",icon:rP},tool_result:{label:"Tool Result",icon:JN},message:{label:"Message",icon:Uc},decision:{label:"Decision",icon:Lw}},c={label:"Message",icon:Uc},u=p=>o[p]??c,d=P.useMemo(()=>{const p=t.agentEntries.flatMap(f=>f.events.map(g=>({ev:g,entry:f})));return p.sort((f,g)=>f.ev.timestamp.localeCompare(g.ev.timestamp)),p},[t]);return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${e}06`},children:[y.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors cursor-pointer",children:[y.jsx(vl,{className:"w-3.5 h-3.5"})," Back to ",r]}),y.jsxs("div",{className:"flex items-start justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:e},children:t.title}),y.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[y.jsx("span",{className:"text-[11px] text-zinc-600 font-mono",children:Ws(t.completedAt||t.createdAt,i)}),y.jsxs("span",{className:"text-[11px] text-zinc-700 font-mono flex items-center gap-1",children:[y.jsx(Mw,{className:"w-3 h-3"}),t.duration||"—"]})]})]}),y.jsx(jt,{variant:t.status==="completed"?"success":"error",children:t.status})]}),y.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:t.agentEntries.map(p=>{const f=a[p.agentId];return y.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border",style:{borderColor:`${f}30`,background:`${f}10`},children:[Kf(p.roleType||p.role,f),y.jsx("span",{className:"text-[11px] font-mono",style:{color:f},children:p.agentName}),y.jsxs("span",{className:"text-[10px] font-mono text-zinc-500",children:["— ",p.role]})]},p.agentId)})}),y.jsxs("div",{className:"relative pl-10",children:[y.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),y.jsx("div",{className:"space-y-3",children:d.map(({ev:p,entry:f})=>{const g=a[f.agentId],{label:v,icon:x}=u(p.kind),_=p.kind==="tool_call"||p.kind==="tool_result";return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${g}15`,border:`1px solid ${g}35`},children:y.jsx(x,{className:"w-3.5 h-3.5",style:{color:g}})}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[y.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.jsxs("div",{className:"flex items-center gap-1",children:[Kf(f.roleType||f.role,g),y.jsx("span",{className:"text-[10px] font-mono",style:{color:g},children:f.agentName})]}),y.jsx("span",{className:"text-zinc-700 text-[10px]",children:"·"}),y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-zinc-500",children:v}),p.label&&y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:p.label}),p.status==="error"&&y.jsx(jt,{variant:"error",children:"failed"}),p.status==="ok"&&p.kind==="tool_result"&&y.jsx(jt,{variant:"success",children:"ok"})]}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700 flex-shrink-0 ml-2",children:Qh(p.timestamp,i)})]}),_?y.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2 mt-1 bg-black/20",children:p.content}):y.jsx(sp,{content:p.content,className:"text-[12px] [&_pre]:text-[10px]"})]})]},p.id)})})]})]})}function Rq({squadName:t,instanceId:e}){const[r,n]=P.useState(null),[i,a]=P.useState(null),o=Nu();if(P.useEffect(()=>{Ve.get(`/squads/${t}/instances/${e}`).then(n).catch(()=>{at.error("Failed to load instance")})},[t,e]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const c=r.squadColor||"#38bdf8";if(i){const u=r.members.find(p=>p.roleName===i),d=r.activity.filter(p=>p.agent===i);return y.jsx(Mq,{agentName:(u==null?void 0:u.displayName)||i,agentRole:i,agentStatus:(u==null?void 0:u.status)||"idle",currentTask:(u==null?void 0:u.currentTask)||null,events:d,color:c,onBack:()=>a(null),squadName:t})}return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${c}06`},children:[y.jsxs("button",{type:"button",onClick:()=>o(`/squads/${t}`),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(vl,{className:"w-3.5 h-3.5"})," Back to ",t]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:c},children:"Instance"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:r.instance.id.slice(0,8)}),r.instance.branch&&y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:r.instance.branch})]}),y.jsx(jt,{variant:Co(r.instance.status),children:r.instance.status})]}),y.jsx("div",{className:"space-y-2",children:r.members.map(u=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${c}30`,background:`${c}12`},children:Kf(u.roleName||u.role,c)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:u.displayName}),y.jsx(jt,{variant:Co(u.status),children:u.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:u.role}),u.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:u.currentTask})]}),(u.status==="working"||u.status==="in meeting")&&y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>a(u.roleName||u.role),title:"View work in progress",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:c},children:y.jsx(Ds,{className:"w-4 h-4"})}),u.status==="working"&&y.jsx("button",{type:"button",onClick:()=>at.success(`${u.displayName} stopped`),title:"Stop agent",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Jh,{className:"w-4 h-4"})})]})]},u.id))}),(r.instance.status==="meeting"||r.instance.status==="planning")&&r.instance.meetingLog&&r.instance.meetingLog.length>0&&y.jsxs("div",{className:"mt-6",children:[y.jsx("h3",{className:"text-lg tracking-wide mb-3",style:{fontFamily:"'Bebas Neue', sans-serif",color:c},children:"Meeting Discussion"}),y.jsx("div",{className:"space-y-2",children:r.instance.meetingLog.map((u,d)=>{const p=u.match(/^\[([^\]]+)\]\s*(.*)/s),f=p?p[1]:"unknown",g=p?p[2]??u:u;return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[y.jsx(Zh,{className:"w-3.5 h-3.5",style:{color:"#818cf8"}}),y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-indigo-400",children:f})]}),y.jsx(sp,{content:g,className:"text-xs [&_pre]:text-[10px]"})]},`meeting-${d}`)})})]})]})}const Iq={thought:{label:"Thinking",icon:Dw,color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool_call:{label:"Tool Call",icon:rP,color:"#38bdf8",bg:"rgba(56,189,248,0.1)"},tool_result:{label:"Tool Result",icon:JN,color:"#34d399",bg:"rgba(52,211,153,0.1)"},message:{label:"Message",icon:Uc,color:"#E43A9C",bg:"rgba(228,58,156,0.15)"},decision:{label:"Decision",icon:Lw,color:"#fbbf24",bg:"rgba(251,191,36,0.1)"},meeting:{label:"Meeting",icon:Zh,color:"#818cf8",bg:"rgba(129,140,248,0.1)"}};function $q(t){const e=t.toLowerCase();return e.includes("meeting")?"meeting":e.includes("tool_call")||e.includes("tool-call")?"tool_call":e.includes("tool_result")||e.includes("tool-result")?"tool_result":e.includes("thought")||e.includes("thinking")||e.includes("reason")?"thought":e.includes("decision")?"decision":"message"}function Mq({agentName:t,agentRole:e,agentStatus:r,currentTask:n,events:i,color:a,onBack:o,squadName:c}){const u=qa();return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${a}06`},children:[y.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(vl,{className:"w-3.5 h-3.5"})," Back to ",c]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:a},children:t}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:e}),n&&y.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:n})]}),y.jsx(jt,{variant:Co(r),children:r})]}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),y.jsxs("div",{className:"space-y-3 pl-10",children:[i.length===0&&y.jsx("div",{className:"text-center py-12 text-zinc-700 font-mono text-sm",children:"No activity recorded yet"}),i.map(d=>{const p=$q(d.type),f=Iq[p],g=f.icon,v=p==="tool_call"||p==="tool_result",x=d.type.toLowerCase().includes("error")||d.type.toLowerCase().includes("fail");return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:f.bg,border:`1px solid ${f.color}30`},children:y.jsx(g,{className:"w-3.5 h-3.5",style:{color:f.color}})}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider",style:{color:f.color},children:f.label}),d.model&&y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:d.model}),x&&y.jsx(jt,{variant:"error",children:"failed"})]}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:Qh(d.timestamp,u)})]}),v?y.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2.5 bg-black/20",children:d.content}):y.jsx("p",{className:"text-[12px] text-zinc-400 leading-relaxed",children:d.content})]})]},d.id)}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${a}15`,border:`1px solid ${a}40`},children:y.jsx(ZN,{className:"w-3.5 h-3.5 animate-spin",style:{color:a}})}),y.jsx("div",{className:"glass-card border rounded-2xl px-4 py-3",style:{borderColor:`${a}20`},children:y.jsx("span",{className:"text-[11px] font-mono",style:{color:a},children:"Agent is working…"})})]})]})]})]})}var Mg,qE;function Zr(){if(qE)return Mg;qE=1;var t=Array.isArray;return Mg=t,Mg}var Lg,FE;function vR(){if(FE)return Lg;FE=1;var t=typeof Zd=="object"&&Zd&&Zd.Object===Object&&Zd;return Lg=t,Lg}var Dg,HE;function Oi(){if(HE)return Dg;HE=1;var t=vR(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Dg=r,Dg}var zg,WE;function $u(){if(WE)return zg;WE=1;var t=Oi(),e=t.Symbol;return zg=e,zg}var Bg,GE;function Lq(){if(GE)return Bg;GE=1;var t=$u(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var c=r.call(o,i),u=o[i];try{o[i]=void 0;var d=!0}catch{}var p=n.call(o);return d&&(c?o[i]=u:delete o[i]),p}return Bg=a,Bg}var Ug,KE;function Dq(){if(KE)return Ug;KE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Ug=r,Ug}var qg,VE;function ra(){if(VE)return qg;VE=1;var t=$u(),e=Lq(),r=Dq(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(c){return c==null?c===void 0?i:n:a&&a in Object(c)?e(c):r(c)}return qg=o,qg}var Fg,XE;function na(){if(XE)return Fg;XE=1;function t(e){return e!=null&&typeof e=="object"}return Fg=t,Fg}var Hg,YE;function wl(){if(YE)return Hg;YE=1;var t=ra(),e=na(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return Hg=n,Hg}var Wg,JE;function t1(){if(JE)return Wg;JE=1;var t=Zr(),e=wl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var c=typeof a;return c=="number"||c=="symbol"||c=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Wg=i,Wg}var Gg,ZE;function Ha(){if(ZE)return Gg;ZE=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Gg=t,Gg}var Kg,QE;function r1(){if(QE)return Kg;QE=1;var t=ra(),e=Ha(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(c){if(!e(c))return!1;var u=t(c);return u==n||u==i||u==r||u==a}return Kg=o,Kg}var Vg,eO;function zq(){if(eO)return Vg;eO=1;var t=Oi(),e=t["__core-js_shared__"];return Vg=e,Vg}var Xg,tO;function Bq(){if(tO)return Xg;tO=1;var t=zq(),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 Xg=r,Xg}var Yg,rO;function bR(){if(rO)return Yg;rO=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 Yg=r,Yg}var Jg,nO;function Uq(){if(nO)return Jg;nO=1;var t=r1(),e=Bq(),r=Ha(),n=bR(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,u=o.toString,d=c.hasOwnProperty,p=RegExp("^"+u.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(g){if(!r(g)||e(g))return!1;var v=t(g)?p:a;return v.test(n(g))}return Jg=f,Jg}var Zg,iO;function qq(){if(iO)return Zg;iO=1;function t(e,r){return e==null?void 0:e[r]}return Zg=t,Zg}var Qg,aO;function qo(){if(aO)return Qg;aO=1;var t=Uq(),e=qq();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Qg=r,Qg}var ey,oO;function lp(){if(oO)return ey;oO=1;var t=qo(),e=t(Object,"create");return ey=e,ey}var ty,sO;function Fq(){if(sO)return ty;sO=1;var t=lp();function e(){this.__data__=t?t(null):{},this.size=0}return ty=e,ty}var ry,lO;function Hq(){if(lO)return ry;lO=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return ry=t,ry}var ny,cO;function Wq(){if(cO)return ny;cO=1;var t=lp(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var c=o[a];return c===e?void 0:c}return n.call(o,a)?o[a]:void 0}return ny=i,ny}var iy,uO;function Gq(){if(uO)return iy;uO=1;var t=lp(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return iy=n,iy}var ay,dO;function Kq(){if(dO)return ay;dO=1;var t=lp(),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 ay=r,ay}var oy,fO;function Vq(){if(fO)return oy;fO=1;var t=Fq(),e=Hq(),r=Wq(),n=Gq(),i=Kq();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,oy=a,oy}var sy,hO;function Xq(){if(hO)return sy;hO=1;function t(){this.__data__=[],this.size=0}return sy=t,sy}var ly,pO;function n1(){if(pO)return ly;pO=1;function t(e,r){return e===r||e!==e&&r!==r}return ly=t,ly}var cy,mO;function cp(){if(mO)return cy;mO=1;var t=n1();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return cy=e,cy}var uy,gO;function Yq(){if(gO)return uy;gO=1;var t=cp(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var c=a.length-1;return o==c?a.pop():r.call(a,o,1),--this.size,!0}return uy=n,uy}var dy,yO;function Jq(){if(yO)return dy;yO=1;var t=cp();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return dy=e,dy}var fy,vO;function Zq(){if(vO)return fy;vO=1;var t=cp();function e(r){return t(this.__data__,r)>-1}return fy=e,fy}var hy,bO;function Qq(){if(bO)return hy;bO=1;var t=cp();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 hy=e,hy}var py,xO;function up(){if(xO)return py;xO=1;var t=Xq(),e=Yq(),r=Jq(),n=Zq(),i=Qq();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,py=a,py}var my,wO;function i1(){if(wO)return my;wO=1;var t=qo(),e=Oi(),r=t(e,"Map");return my=r,my}var gy,_O;function e9(){if(_O)return gy;_O=1;var t=Vq(),e=up(),r=i1();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return gy=n,gy}var yy,SO;function t9(){if(SO)return yy;SO=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return yy=t,yy}var vy,kO;function dp(){if(kO)return vy;kO=1;var t=t9();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return vy=e,vy}var by,EO;function r9(){if(EO)return by;EO=1;var t=dp();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return by=e,by}var xy,OO;function n9(){if(OO)return xy;OO=1;var t=dp();function e(r){return t(this,r).get(r)}return xy=e,xy}var wy,AO;function i9(){if(AO)return wy;AO=1;var t=dp();function e(r){return t(this,r).has(r)}return wy=e,wy}var _y,TO;function a9(){if(TO)return _y;TO=1;var t=dp();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 _y=e,_y}var Sy,jO;function a1(){if(jO)return Sy;jO=1;var t=e9(),e=r9(),r=n9(),n=i9(),i=a9();function a(o){var c=-1,u=o==null?0:o.length;for(this.clear();++c<u;){var d=o[c];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,Sy=a,Sy}var ky,CO;function xR(){if(CO)return ky;CO=1;var t=a1(),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,c=i?i.apply(this,o):o[0],u=a.cache;if(u.has(c))return u.get(c);var d=n.apply(this,o);return a.cache=u.set(c,d)||u,d};return a.cache=new(r.Cache||t),a}return r.Cache=t,ky=r,ky}var Ey,NO;function o9(){if(NO)return Ey;NO=1;var t=xR(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return Ey=r,Ey}var Oy,PO;function s9(){if(PO)return Oy;PO=1;var t=o9(),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,c,u,d){a.push(u?d.replace(r,"$1"):c||o)}),a});return Oy=n,Oy}var Ay,RO;function o1(){if(RO)return Ay;RO=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 Ay=t,Ay}var Ty,IO;function l9(){if(IO)return Ty;IO=1;var t=$u(),e=o1(),r=Zr(),n=wl(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(c){if(typeof c=="string")return c;if(r(c))return e(c,o)+"";if(n(c))return a?a.call(c):"";var u=c+"";return u=="0"&&1/c==-1/0?"-0":u}return Ty=o,Ty}var jy,$O;function wR(){if($O)return jy;$O=1;var t=l9();function e(r){return r==null?"":t(r)}return jy=e,jy}var Cy,MO;function _R(){if(MO)return Cy;MO=1;var t=Zr(),e=t1(),r=s9(),n=wR();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Cy=i,Cy}var Ny,LO;function fp(){if(LO)return Ny;LO=1;var t=wl();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Ny=e,Ny}var Py,DO;function s1(){if(DO)return Py;DO=1;var t=_R(),e=fp();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 Py=r,Py}var Ry,zO;function SR(){if(zO)return Ry;zO=1;var t=s1();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Ry=e,Ry}var c9=SR();const Tn=vt(c9);var Iy,BO;function u9(){if(BO)return Iy;BO=1;function t(e){return e==null}return Iy=t,Iy}var d9=u9();const et=vt(d9);var $y,UO;function f9(){if(UO)return $y;UO=1;var t=ra(),e=Zr(),r=na(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return $y=i,$y}var h9=f9();const Io=vt(h9);var p9=r1();const Je=vt(p9);var m9=Ha();const _l=vt(m9);var My={exports:{}},pt={};/**
|
|
435
|
+
* @license React
|
|
436
|
+
* react-is.production.min.js
|
|
437
|
+
*
|
|
438
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the MIT license found in the
|
|
441
|
+
* LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/var qO;function g9(){if(qO)return pt;qO=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"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function _(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){case t:switch(b=b.type,b){case r:case i:case n:case d:case p:return b;default:switch(b=b&&b.$$typeof,b){case c:case o:case u:case g:case f:case a:return b;default:return S}}case e:return S}}}return pt.ContextConsumer=o,pt.ContextProvider=a,pt.Element=t,pt.ForwardRef=u,pt.Fragment=r,pt.Lazy=g,pt.Memo=f,pt.Portal=e,pt.Profiler=i,pt.StrictMode=n,pt.Suspense=d,pt.SuspenseList=p,pt.isAsyncMode=function(){return!1},pt.isConcurrentMode=function(){return!1},pt.isContextConsumer=function(b){return _(b)===o},pt.isContextProvider=function(b){return _(b)===a},pt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},pt.isForwardRef=function(b){return _(b)===u},pt.isFragment=function(b){return _(b)===r},pt.isLazy=function(b){return _(b)===g},pt.isMemo=function(b){return _(b)===f},pt.isPortal=function(b){return _(b)===e},pt.isProfiler=function(b){return _(b)===i},pt.isStrictMode=function(b){return _(b)===n},pt.isSuspense=function(b){return _(b)===d},pt.isSuspenseList=function(b){return _(b)===p},pt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===i||b===n||b===d||b===p||b===v||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===f||b.$$typeof===a||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.getModuleId!==void 0)},pt.typeOf=_,pt}var FO;function y9(){return FO||(FO=1,My.exports=g9()),My.exports}var v9=y9(),Ly,HO;function kR(){if(HO)return Ly;HO=1;var t=ra(),e=na(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return Ly=n,Ly}var Dy,WO;function b9(){if(WO)return Dy;WO=1;var t=kR();function e(r){return t(r)&&r!=+r}return Dy=e,Dy}var x9=b9();const Mu=vt(x9);var w9=kR();const _9=vt(w9);var Jn=function(e){return e===0?0:e>0?1:-1},Eo=function(e){return Io(e)&&e.indexOf("%")===e.length-1},ge=function(e){return _9(e)&&!Mu(e)},S9=function(e){return et(e)},or=function(e){return ge(e)||Io(e)},k9=0,Lu=function(e){var r=++k9;return"".concat(e||"").concat(r)},$o=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(!ge(e)&&!Io(e))return n;var a;if(Eo(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Mu(a)&&(a=n),i&&a>r&&(a=r),a},Pa=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},E9=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},Vn=function(e,r){return ge(e)&&ge(r)?function(n){return e+n*(r-e)}:function(){return r}};function Vf(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Tn(n,e))===r})}var O9=function(e,r){return ge(e)&&ge(r)?e-r:Io(e)&&Io(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Us(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 ox(t){"@babel/helpers - typeof";return ox=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},ox(t)}var A9=["viewBox","children"],T9=["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"],GO=["points","pathLength"],zy={svg:A9,polygon:GO,polyline:GO},l1=["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"],Xf=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(P.isValidElement(e)&&(n=e.props),!_l(n))return null;var i={};return Object.keys(n).forEach(function(a){l1.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},j9=function(e,r,n){return function(i){return e(r,n,i),null}},Yf=function(e,r,n){if(!_l(e)||ox(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];l1.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=j9(o,r,n))}),i},C9=["children"],N9=["children"];function KO(t,e){if(t==null)return{};var r=P9(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 P9(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 sx(t){"@babel/helpers - typeof";return sx=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},sx(t)}var VO={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"},Gi=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},XO=null,By=null,c1=function t(e){if(e===XO&&Array.isArray(By))return By;var r=[];return P.Children.forEach(e,function(n){et(n)||(v9.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),By=r,XO=e,r};function jn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Gi(i)}):n=[Gi(e)],c1(t).forEach(function(i){var a=Tn(i,"type.displayName")||Tn(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(t,e){var r=jn(t,e);return r&&r[0]}var YO=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!ge(n)||n<=0||!ge(i)||i<=0)},R9=["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"],I9=function(e){return e&&e.type&&Io(e.type)&&R9.indexOf(e.type)>=0},$9=function(e){return e&&sx(e)==="object"&&"clipDot"in e},M9=function(e,r,n,i){var a,o=(a=zy==null?void 0:zy[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Je(e)&&(i&&o.includes(r)||T9.includes(r))||n&&l1.includes(r)},it=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(P.isValidElement(e)&&(i=e.props),!_l(i))return null;var a={};return Object.keys(i).forEach(function(o){var c;M9((c=i)===null||c===void 0?void 0:c[o],o,r,n)&&(a[o]=i[o])}),a},lx=function t(e,r){if(e===r)return!0;var n=P.Children.count(e);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return JO(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(!JO(a,o))return!1}return!0},JO=function(e,r){if(et(e)&&et(r))return!0;if(!et(e)&&!et(r)){var n=e.props||{},i=n.children,a=KO(n,C9),o=r.props||{},c=o.children,u=KO(o,N9);return i&&c?Us(a,u)&&lx(i,c):!i&&!c?Us(a,u):!1}return!1},ZO=function(e,r){var n=[],i={};return c1(e).forEach(function(a,o){if(I9(a))n.push(a);else if(a){var c=Gi(a.type),u=r[c]||{},d=u.handler,p=u.once;if(d&&(!p||!i[c])){var f=d(a,c,o);n.push(f),i[c]=!0}}}),n},L9=function(e){var r=e&&e.type;return r&&VO[r]?VO[r]:null},D9=function(e,r){return c1(r).indexOf(e)},z9=["children","width","height","viewBox","className","style","title","desc"];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)}function B9(t,e){if(t==null)return{};var r=U9(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 U9(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 ux(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,c=t.title,u=t.desc,d=B9(t,z9),p=i||{width:r,height:n,x:0,y:0},f=ot("recharts-surface",a);return L.createElement("svg",cx({},it(d,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),L.createElement("title",null,c),L.createElement("desc",null,u),e)}var q9=["children","className"];function dx(){return dx=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},dx.apply(this,arguments)}function F9(t,e){if(t==null)return{};var r=H9(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 H9(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 Xt=L.forwardRef(function(t,e){var r=t.children,n=t.className,i=F9(t,q9),a=ot("recharts-layer",n);return L.createElement("g",dx({className:a},it(i,!0),{ref:e}),r)}),Ki=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]},Uy,QO;function W9(){if(QO)return Uy;QO=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 Uy=t,Uy}var qy,eA;function G9(){if(eA)return qy;eA=1;var t=W9();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 qy=e,qy}var Fy,tA;function ER(){if(tA)return Fy;tA=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+t+i+a+"]");function u(d){return c.test(d)}return Fy=u,Fy}var Hy,rA;function K9(){if(rA)return Hy;rA=1;function t(e){return e.split("")}return Hy=t,Hy}var Wy,nA;function V9(){if(nA)return Wy;nA=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="["+t+"]",c="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+u+")",p="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=d+"?",_="["+a+"]?",b="(?:"+v+"(?:"+[p,f,g].join("|")+")"+_+x+")*",S=_+x+b,A="(?:"+[p+c+"?",c,f,g,o].join("|")+")",O=RegExp(u+"(?="+u+")|"+A+S,"g");function j(E){return E.match(O)||[]}return Wy=j,Wy}var Gy,iA;function X9(){if(iA)return Gy;iA=1;var t=K9(),e=ER(),r=V9();function n(i){return e(i)?r(i):t(i)}return Gy=n,Gy}var Ky,aA;function Y9(){if(aA)return Ky;aA=1;var t=G9(),e=ER(),r=X9(),n=wR();function i(a){return function(o){o=n(o);var c=e(o)?r(o):void 0,u=c?c[0]:o.charAt(0),d=c?t(c,1).join(""):o.slice(1);return u[a]()+d}}return Ky=i,Ky}var Vy,oA;function J9(){if(oA)return Vy;oA=1;var t=Y9(),e=t("toUpperCase");return Vy=e,Vy}var Z9=J9();const hp=vt(Z9);function Tt(t){return function(){return t}}const OR=Math.cos,Jf=Math.sin,ri=Math.sqrt,Zf=Math.PI,pp=2*Zf,fx=Math.PI,hx=2*fx,wo=1e-6,Q9=hx-wo;function AR(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function eF(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return AR;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 tF{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?AR:eF(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,c=this._y1,u=n-e,d=i-r,p=o-e,f=c-r,g=p*p+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(g>wo)if(!(Math.abs(f*u-d*p)>wo)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,x=i-c,_=u*u+d*d,b=v*v+x*x,S=Math.sqrt(_),A=Math.sqrt(g),O=a*Math.tan((fx-Math.acos((_+g-b)/(2*S*A)))/2),j=O/A,E=O/S;Math.abs(j-1)>wo&&this._append`L${e+j*p},${r+j*f}`,this._append`A${a},${a},0,0,${+(f*v>p*x)},${this._x1=e+E*u},${this._y1=r+E*d}`}}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 c=n*Math.cos(i),u=n*Math.sin(i),d=e+c,p=r+u,f=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>wo||Math.abs(this._y1-p)>wo)&&this._append`L${d},${p}`,n&&(g<0&&(g=g%hx+hx),g>Q9?this._append`A${n},${n},0,1,${f},${e-c},${r-u}A${n},${n},0,1,${f},${this._x1=d},${this._y1=p}`:g>wo&&this._append`A${n},${n},0,${+(g>=fx)},${f},${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 u1(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 tF(e)}function d1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function TR(t){this._context=t}TR.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 mp(t){return new TR(t)}function jR(t){return t[0]}function CR(t){return t[1]}function NR(t,e){var r=Tt(!0),n=null,i=mp,a=null,o=u1(c);t=typeof t=="function"?t:t===void 0?jR:Tt(t),e=typeof e=="function"?e:e===void 0?CR:Tt(e);function c(u){var d,p=(u=d1(u)).length,f,g=!1,v;for(n==null&&(a=i(v=o())),d=0;d<=p;++d)!(d<p&&r(f=u[d],d,u))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+t(f,d,u),+e(f,d,u));if(v)return a=null,v+""||null}return c.x=function(u){return arguments.length?(t=typeof u=="function"?u:Tt(+u),c):t},c.y=function(u){return arguments.length?(e=typeof u=="function"?u:Tt(+u),c):e},c.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Tt(!!u),c):r},c.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),c):i},c.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),c):n},c}function pf(t,e,r){var n=null,i=Tt(!0),a=null,o=mp,c=null,u=u1(d);t=typeof t=="function"?t:t===void 0?jR:Tt(+t),e=typeof e=="function"?e:Tt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?CR:Tt(+r);function d(f){var g,v,x,_=(f=d1(f)).length,b,S=!1,A,O=new Array(_),j=new Array(_);for(a==null&&(c=o(A=u())),g=0;g<=_;++g){if(!(g<_&&i(b=f[g],g,f))===S)if(S=!S)v=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),x=g-1;x>=v;--x)c.point(O[x],j[x]);c.lineEnd(),c.areaEnd()}S&&(O[g]=+t(b,g,f),j[g]=+e(b,g,f),c.point(n?+n(b,g,f):O[g],r?+r(b,g,f):j[g]))}if(A)return c=null,A+""||null}function p(){return NR().defined(i).curve(o).context(a)}return d.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),n=null,d):t},d.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),d):t},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tt(+f),d):n},d.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),r=null,d):e},d.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),d):e},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tt(+f),d):r},d.lineX0=d.lineY0=function(){return p().x(t).y(e)},d.lineY1=function(){return p().x(t).y(r)},d.lineX1=function(){return p().x(n).y(e)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Tt(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,a!=null&&(c=o(a)),d):o},d.context=function(f){return arguments.length?(f==null?a=c=null:c=o(a=f),d):a},d}class PR{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 rF(t){return new PR(t,!0)}function nF(t){return new PR(t,!1)}const f1={draw(t,e){const r=ri(e/Zf);t.moveTo(r,0),t.arc(0,0,r,0,pp)}},iF={draw(t,e){const r=ri(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()}},RR=ri(1/3),aF=RR*2,oF={draw(t,e){const r=ri(e/aF),n=r*RR;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},sF={draw(t,e){const r=ri(e),n=-r/2;t.rect(n,n,r,r)}},lF=.8908130915292852,IR=Jf(Zf/10)/Jf(7*Zf/10),cF=Jf(pp/10)*IR,uF=-OR(pp/10)*IR,dF={draw(t,e){const r=ri(e*lF),n=cF*r,i=uF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=pp*a/5,c=OR(o),u=Jf(o);t.lineTo(u*r,-c*r),t.lineTo(c*n-u*i,u*n+c*i)}t.closePath()}},Xy=ri(3),fF={draw(t,e){const r=-ri(e/(Xy*3));t.moveTo(0,r*2),t.lineTo(-Xy*r,-r),t.lineTo(Xy*r,-r),t.closePath()}},Sn=-.5,kn=ri(3)/2,px=1/ri(12),hF=(px/2+1)*3,pF={draw(t,e){const r=ri(e/hF),n=r/2,i=r*px,a=n,o=r*px+r,c=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(c,u),t.lineTo(Sn*n-kn*i,kn*n+Sn*i),t.lineTo(Sn*a-kn*o,kn*a+Sn*o),t.lineTo(Sn*c-kn*u,kn*c+Sn*u),t.lineTo(Sn*n+kn*i,Sn*i-kn*n),t.lineTo(Sn*a+kn*o,Sn*o-kn*a),t.lineTo(Sn*c+kn*u,Sn*u-kn*c),t.closePath()}};function mF(t,e){let r=null,n=u1(i);t=typeof t=="function"?t:Tt(t||f1),e=typeof e=="function"?e:Tt(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:Tt(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Tt(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Qf(){}function eh(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 $R(t){this._context=t}$R.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:eh(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:eh(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function gF(t){return new $R(t)}function MR(t){this._context=t}MR.prototype={areaStart:Qf,areaEnd:Qf,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:eh(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function yF(t){return new MR(t)}function LR(t){this._context=t}LR.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:eh(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function vF(t){return new LR(t)}function DR(t){this._context=t}DR.prototype={areaStart:Qf,areaEnd:Qf,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 bF(t){return new DR(t)}function sA(t){return t<0?-1:1}function lA(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),c=(a*i+o*n)/(n+i);return(sA(a)+sA(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function cA(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Yy(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,c=(a-n)/3;t._context.bezierCurveTo(n+c,i+c*e,a-c,o-c*r,a,o)}function th(t){this._context=t}th.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:Yy(this,this._t0,cA(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,Yy(this,cA(this,r=lA(this,t,e)),r);break;default:Yy(this,this._t0,r=lA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function zR(t){this._context=new BR(t)}(zR.prototype=Object.create(th.prototype)).point=function(t,e){th.prototype.point.call(this,e,t)};function BR(t){this._context=t}BR.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 xF(t){return new th(t)}function wF(t){return new zR(t)}function UR(t){this._context=t}UR.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=uA(t),i=uA(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 uA(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 _F(t){return new UR(t)}function gp(t,e){this._context=t,this._t=e}gp.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 SF(t){return new gp(t,.5)}function kF(t){return new gp(t,0)}function EF(t){return new gp(t,1)}function Ks(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,c=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<c;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function mx(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function OF(t,e){return t[e]}function AF(t){const e=[];return e.key=t,e}function TF(){var t=Tt([]),e=mx,r=Ks,n=OF;function i(a){var o=Array.from(t.apply(this,arguments),AF),c,u=o.length,d=-1,p;for(const f of a)for(c=0,++d;c<u;++c)(o[c][d]=[0,+n(f,o[c].key,d,a)]).data=f;for(c=0,p=d1(e(o));c<u;++c)o[p[c]].index=c;return r(o,p),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Tt(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?mx:typeof a=="function"?a:Tt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Ks,i):r},i}function jF(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}Ks(t,e)}}function CF(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,c=0;o<i;++o)c+=t[o][r][1]||0;n[r][1]+=n[r][0]=-c/2}Ks(t,e)}}function NF(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 c=0,u=0,d=0;c<o;++c){for(var p=t[e[c]],f=p[n][1]||0,g=p[n-1][1]||0,v=(f-g)/2,x=0;x<c;++x){var _=t[e[x]],b=_[n][1]||0,S=_[n-1][1]||0;v+=b-S}u+=f,d+=v*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=d/u)}i[n-1][1]+=i[n-1][0]=r,Ks(t,e)}}function Vc(t){"@babel/helpers - typeof";return Vc=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},Vc(t)}var PF=["type","size","sizeType"];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)}function dA(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 fA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dA(Object(r),!0).forEach(function(n){RF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RF(t,e,r){return e=IF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IF(t){var e=$F(t,"string");return Vc(e)=="symbol"?e:e+""}function $F(t,e){if(Vc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function MF(t,e){if(t==null)return{};var r=LF(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 LF(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 qR={symbolCircle:f1,symbolCross:iF,symbolDiamond:oF,symbolSquare:sF,symbolStar:dF,symbolTriangle:fF,symbolWye:pF},DF=Math.PI/180,zF=function(e){var r="symbol".concat(hp(e));return qR[r]||f1},BF=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*DF;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}},UF=function(e,r){qR["symbol".concat(hp(e))]=r},h1=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,c=o===void 0?"area":o,u=MF(e,PF),d=fA(fA({},u),{},{type:n,size:a,sizeType:c}),p=function(){var b=zF(n),S=mF().type(b).size(BF(a,c,n));return S()},f=d.className,g=d.cx,v=d.cy,x=it(d,!0);return g===+g&&v===+v&&a===+a?L.createElement("path",gx({},x,{className:ot("recharts-symbols",f),transform:"translate(".concat(g,", ").concat(v,")"),d:p()})):null};h1.registerSymbol=UF;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 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 hA(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 qF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hA(Object(r),!0).forEach(function(n){Xc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function HF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,HR(n.key),n)}}function WF(t,e,r){return e&&HF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function GF(t,e,r){return e=rh(e),KF(t,FR()?Reflect.construct(e,r||[],rh(t).constructor):e.apply(t,r))}function KF(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 VF(t)}function VF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function FR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FR=function(){return!!t})()}function rh(t){return rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rh(t)}function XF(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 Xc(t,e,r){return e=HR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HR(t){var e=YF(t,"string");return Vs(e)=="symbol"?e:e+""}function YF(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 En=32,p1=(function(t){function e(){return FF(this,e),GF(this,e,arguments)}return XF(e,t),WF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=En/2,o=En/6,c=En/3,u=n.inactive?i:n.color;if(n.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:En,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(c,`
|
|
443
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(a,`
|
|
444
|
+
H`).concat(En,"M").concat(2*c,",").concat(a,`
|
|
445
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return L.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(En/8,"h").concat(En,"v").concat(En*3/4,"h").concat(-En,"z"),className:"recharts-legend-icon"});if(L.isValidElement(n.legendIcon)){var d=qF({},n);return delete d.legendIcon,L.cloneElement(n.legendIcon,d)}return L.createElement(h1,{fill:u,cx:a,cy:a,size:En,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,c=i.layout,u=i.formatter,d=i.inactiveColor,p={x:0,y:0,width:En,height:En},f={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(v,x){var _=v.formatter||u,b=ot(Xc(Xc({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",v.inactive));if(v.type==="none")return null;var S=Je(v.value)?null:v.value;Ki(!Je(v.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 A=v.inactive?d:v.color;return L.createElement("li",yx({className:b,style:f,key:"legend-item-".concat(x)},Yf(n.props,v,x)),L.createElement(ux,{width:o,height:o,viewBox:p,style:g},n.renderIcon(v)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},_?_(S,v,x):S))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return L.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(P.PureComponent);Xc(p1,"displayName","Legend");Xc(p1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Jy,pA;function JF(){if(pA)return Jy;pA=1;var t=up();function e(){this.__data__=new t,this.size=0}return Jy=e,Jy}var Zy,mA;function ZF(){if(mA)return Zy;mA=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Zy=t,Zy}var Qy,gA;function QF(){if(gA)return Qy;gA=1;function t(e){return this.__data__.get(e)}return Qy=t,Qy}var ev,yA;function e7(){if(yA)return ev;yA=1;function t(e){return this.__data__.has(e)}return ev=t,ev}var tv,vA;function t7(){if(vA)return tv;vA=1;var t=up(),e=i1(),r=a1(),n=200;function i(a,o){var c=this.__data__;if(c instanceof t){var u=c.__data__;if(!e||u.length<n-1)return u.push([a,o]),this.size=++c.size,this;c=this.__data__=new r(u)}return c.set(a,o),this.size=c.size,this}return tv=i,tv}var rv,bA;function WR(){if(bA)return rv;bA=1;var t=up(),e=JF(),r=ZF(),n=QF(),i=e7(),a=t7();function o(c){var u=this.__data__=new t(c);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,rv=o,rv}var nv,xA;function r7(){if(xA)return nv;xA=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return nv=e,nv}var iv,wA;function n7(){if(wA)return iv;wA=1;function t(e){return this.__data__.has(e)}return iv=t,iv}var av,_A;function GR(){if(_A)return av;_A=1;var t=a1(),e=r7(),r=n7();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,av=n,av}var ov,SA;function KR(){if(SA)return ov;SA=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 ov=t,ov}var sv,kA;function VR(){if(kA)return sv;kA=1;function t(e,r){return e.has(r)}return sv=t,sv}var lv,EA;function XR(){if(EA)return lv;EA=1;var t=GR(),e=KR(),r=VR(),n=1,i=2;function a(o,c,u,d,p,f){var g=u&n,v=o.length,x=c.length;if(v!=x&&!(g&&x>v))return!1;var _=f.get(o),b=f.get(c);if(_&&b)return _==c&&b==o;var S=-1,A=!0,O=u&i?new t:void 0;for(f.set(o,c),f.set(c,o);++S<v;){var j=o[S],E=c[S];if(d)var T=g?d(E,j,S,c,o,f):d(j,E,S,o,c,f);if(T!==void 0){if(T)continue;A=!1;break}if(O){if(!e(c,function(N,R){if(!r(O,R)&&(j===N||p(j,N,u,d,f)))return O.push(R)})){A=!1;break}}else if(!(j===E||p(j,E,u,d,f))){A=!1;break}}return f.delete(o),f.delete(c),A}return lv=a,lv}var cv,OA;function i7(){if(OA)return cv;OA=1;var t=Oi(),e=t.Uint8Array;return cv=e,cv}var uv,AA;function a7(){if(AA)return uv;AA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return uv=t,uv}var dv,TA;function m1(){if(TA)return dv;TA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return dv=t,dv}var fv,jA;function o7(){if(jA)return fv;jA=1;var t=$u(),e=i7(),r=n1(),n=XR(),i=a7(),a=m1(),o=1,c=2,u="[object Boolean]",d="[object Date]",p="[object Error]",f="[object Map]",g="[object Number]",v="[object RegExp]",x="[object Set]",_="[object String]",b="[object Symbol]",S="[object ArrayBuffer]",A="[object DataView]",O=t?t.prototype:void 0,j=O?O.valueOf:void 0;function E(T,N,R,M,J,F,B){switch(R){case A:if(T.byteLength!=N.byteLength||T.byteOffset!=N.byteOffset)return!1;T=T.buffer,N=N.buffer;case S:return!(T.byteLength!=N.byteLength||!F(new e(T),new e(N)));case u:case d:case g:return r(+T,+N);case p:return T.name==N.name&&T.message==N.message;case v:case _:return T==N+"";case f:var K=i;case x:var W=M&o;if(K||(K=a),T.size!=N.size&&!W)return!1;var X=B.get(T);if(X)return X==N;M|=c,B.set(T,N);var Y=n(K(T),K(N),M,J,F,B);return B.delete(T),Y;case b:if(j)return j.call(T)==j.call(N)}return!1}return fv=E,fv}var hv,CA;function YR(){if(CA)return hv;CA=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 hv=t,hv}var pv,NA;function s7(){if(NA)return pv;NA=1;var t=YR(),e=Zr();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return pv=r,pv}var mv,PA;function l7(){if(PA)return mv;PA=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var c=e[n];r(c,n,e)&&(o[a++]=c)}return o}return mv=t,mv}var gv,RA;function c7(){if(RA)return gv;RA=1;function t(){return[]}return gv=t,gv}var yv,IA;function u7(){if(IA)return yv;IA=1;var t=l7(),e=c7(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(c){return n.call(o,c)}))}:e;return yv=a,yv}var vv,$A;function d7(){if($A)return vv;$A=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return vv=t,vv}var bv,MA;function f7(){if(MA)return bv;MA=1;var t=ra(),e=na(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return bv=n,bv}var xv,LA;function g1(){if(LA)return xv;LA=1;var t=f7(),e=na(),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 xv=a,xv}var jc={exports:{}},wv,DA;function h7(){if(DA)return wv;DA=1;function t(){return!1}return wv=t,wv}jc.exports;var zA;function JR(){return zA||(zA=1,(function(t,e){var r=Oi(),n=h7(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,c=o?r.Buffer:void 0,u=c?c.isBuffer:void 0,d=u||n;t.exports=d})(jc,jc.exports)),jc.exports}var _v,BA;function y1(){if(BA)return _v;BA=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 _v=r,_v}var Sv,UA;function v1(){if(UA)return Sv;UA=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return Sv=e,Sv}var kv,qA;function p7(){if(qA)return kv;qA=1;var t=ra(),e=v1(),r=na(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",c="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",f="[object Object]",g="[object RegExp]",v="[object Set]",x="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",S="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",j="[object Int8Array]",E="[object Int16Array]",T="[object Int32Array]",N="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",J="[object Uint32Array]",F={};F[A]=F[O]=F[j]=F[E]=F[T]=F[N]=F[R]=F[M]=F[J]=!0,F[n]=F[i]=F[b]=F[a]=F[S]=F[o]=F[c]=F[u]=F[d]=F[p]=F[f]=F[g]=F[v]=F[x]=F[_]=!1;function B(K){return r(K)&&e(K.length)&&!!F[t(K)]}return kv=B,kv}var Ev,FA;function ZR(){if(FA)return Ev;FA=1;function t(e){return function(r){return e(r)}}return Ev=t,Ev}var Cc={exports:{}};Cc.exports;var HA;function m7(){return HA||(HA=1,(function(t,e){var r=vR(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,c=(function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();t.exports=c})(Cc,Cc.exports)),Cc.exports}var Ov,WA;function QR(){if(WA)return Ov;WA=1;var t=p7(),e=ZR(),r=m7(),n=r&&r.isTypedArray,i=n?e(n):t;return Ov=i,Ov}var Av,GA;function g7(){if(GA)return Av;GA=1;var t=d7(),e=g1(),r=Zr(),n=JR(),i=y1(),a=QR(),o=Object.prototype,c=o.hasOwnProperty;function u(d,p){var f=r(d),g=!f&&e(d),v=!f&&!g&&n(d),x=!f&&!g&&!v&&a(d),_=f||g||v||x,b=_?t(d.length,String):[],S=b.length;for(var A in d)(p||c.call(d,A))&&!(_&&(A=="length"||v&&(A=="offset"||A=="parent")||x&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||i(A,S)))&&b.push(A);return b}return Av=u,Av}var Tv,KA;function y7(){if(KA)return Tv;KA=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return Tv=e,Tv}var jv,VA;function eI(){if(VA)return jv;VA=1;function t(e,r){return function(n){return e(r(n))}}return jv=t,jv}var Cv,XA;function v7(){if(XA)return Cv;XA=1;var t=eI(),e=t(Object.keys,Object);return Cv=e,Cv}var Nv,YA;function b7(){if(YA)return Nv;YA=1;var t=y7(),e=v7(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var c in Object(a))n.call(a,c)&&c!="constructor"&&o.push(c);return o}return Nv=i,Nv}var Pv,JA;function Du(){if(JA)return Pv;JA=1;var t=r1(),e=v1();function r(n){return n!=null&&e(n.length)&&!t(n)}return Pv=r,Pv}var Rv,ZA;function yp(){if(ZA)return Rv;ZA=1;var t=g7(),e=b7(),r=Du();function n(i){return r(i)?t(i):e(i)}return Rv=n,Rv}var Iv,QA;function x7(){if(QA)return Iv;QA=1;var t=s7(),e=u7(),r=yp();function n(i){return t(i,r,e)}return Iv=n,Iv}var $v,eT;function w7(){if(eT)return $v;eT=1;var t=x7(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,c,u,d,p){var f=c&e,g=t(a),v=g.length,x=t(o),_=x.length;if(v!=_&&!f)return!1;for(var b=v;b--;){var S=g[b];if(!(f?S in o:n.call(o,S)))return!1}var A=p.get(a),O=p.get(o);if(A&&O)return A==o&&O==a;var j=!0;p.set(a,o),p.set(o,a);for(var E=f;++b<v;){S=g[b];var T=a[S],N=o[S];if(u)var R=f?u(N,T,S,o,a,p):u(T,N,S,a,o,p);if(!(R===void 0?T===N||d(T,N,c,u,p):R)){j=!1;break}E||(E=S=="constructor")}if(j&&!E){var M=a.constructor,J=o.constructor;M!=J&&"constructor"in a&&"constructor"in o&&!(typeof M=="function"&&M instanceof M&&typeof J=="function"&&J instanceof J)&&(j=!1)}return p.delete(a),p.delete(o),j}return $v=i,$v}var Mv,tT;function _7(){if(tT)return Mv;tT=1;var t=qo(),e=Oi(),r=t(e,"DataView");return Mv=r,Mv}var Lv,rT;function S7(){if(rT)return Lv;rT=1;var t=qo(),e=Oi(),r=t(e,"Promise");return Lv=r,Lv}var Dv,nT;function tI(){if(nT)return Dv;nT=1;var t=qo(),e=Oi(),r=t(e,"Set");return Dv=r,Dv}var zv,iT;function k7(){if(iT)return zv;iT=1;var t=qo(),e=Oi(),r=t(e,"WeakMap");return zv=r,zv}var Bv,aT;function E7(){if(aT)return Bv;aT=1;var t=_7(),e=i1(),r=S7(),n=tI(),i=k7(),a=ra(),o=bR(),c="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",f="[object WeakMap]",g="[object DataView]",v=o(t),x=o(e),_=o(r),b=o(n),S=o(i),A=a;return(t&&A(new t(new ArrayBuffer(1)))!=g||e&&A(new e)!=c||r&&A(r.resolve())!=d||n&&A(new n)!=p||i&&A(new i)!=f)&&(A=function(O){var j=a(O),E=j==u?O.constructor:void 0,T=E?o(E):"";if(T)switch(T){case v:return g;case x:return c;case _:return d;case b:return p;case S:return f}return j}),Bv=A,Bv}var Uv,oT;function O7(){if(oT)return Uv;oT=1;var t=WR(),e=XR(),r=o7(),n=w7(),i=E7(),a=Zr(),o=JR(),c=QR(),u=1,d="[object Arguments]",p="[object Array]",f="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function x(_,b,S,A,O,j){var E=a(_),T=a(b),N=E?p:i(_),R=T?p:i(b);N=N==d?f:N,R=R==d?f:R;var M=N==f,J=R==f,F=N==R;if(F&&o(_)){if(!o(b))return!1;E=!0,M=!1}if(F&&!M)return j||(j=new t),E||c(_)?e(_,b,S,A,O,j):r(_,b,N,S,A,O,j);if(!(S&u)){var B=M&&v.call(_,"__wrapped__"),K=J&&v.call(b,"__wrapped__");if(B||K){var W=B?_.value():_,X=K?b.value():b;return j||(j=new t),O(W,X,S,A,j)}}return F?(j||(j=new t),n(_,b,S,A,O,j)):!1}return Uv=x,Uv}var qv,sT;function b1(){if(sT)return qv;sT=1;var t=O7(),e=na();function r(n,i,a,o,c){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,c)}return qv=r,qv}var Fv,lT;function A7(){if(lT)return Fv;lT=1;var t=WR(),e=b1(),r=1,n=2;function i(a,o,c,u){var d=c.length,p=d,f=!u;if(a==null)return!p;for(a=Object(a);d--;){var g=c[d];if(f&&g[2]?g[1]!==a[g[0]]:!(g[0]in a))return!1}for(;++d<p;){g=c[d];var v=g[0],x=a[v],_=g[1];if(f&&g[2]){if(x===void 0&&!(v in a))return!1}else{var b=new t;if(u)var S=u(x,_,v,a,o,b);if(!(S===void 0?e(_,x,r|n,u,b):S))return!1}}return!0}return Fv=i,Fv}var Hv,cT;function rI(){if(cT)return Hv;cT=1;var t=Ha();function e(r){return r===r&&!t(r)}return Hv=e,Hv}var Wv,uT;function T7(){if(uT)return Wv;uT=1;var t=rI(),e=yp();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],c=n[o];i[a]=[o,c,t(c)]}return i}return Wv=r,Wv}var Gv,dT;function nI(){if(dT)return Gv;dT=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return Gv=t,Gv}var Kv,fT;function j7(){if(fT)return Kv;fT=1;var t=A7(),e=T7(),r=nI();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 Kv=n,Kv}var Vv,hT;function C7(){if(hT)return Vv;hT=1;function t(e,r){return e!=null&&r in Object(e)}return Vv=t,Vv}var Xv,pT;function N7(){if(pT)return Xv;pT=1;var t=_R(),e=g1(),r=Zr(),n=y1(),i=v1(),a=fp();function o(c,u,d){u=t(u,c);for(var p=-1,f=u.length,g=!1;++p<f;){var v=a(u[p]);if(!(g=c!=null&&d(c,v)))break;c=c[v]}return g||++p!=f?g:(f=c==null?0:c.length,!!f&&i(f)&&n(v,f)&&(r(c)||e(c)))}return Xv=o,Xv}var Yv,mT;function P7(){if(mT)return Yv;mT=1;var t=C7(),e=N7();function r(n,i){return n!=null&&e(n,i,t)}return Yv=r,Yv}var Jv,gT;function R7(){if(gT)return Jv;gT=1;var t=b1(),e=SR(),r=P7(),n=t1(),i=rI(),a=nI(),o=fp(),c=1,u=2;function d(p,f){return n(p)&&i(f)?a(o(p),f):function(g){var v=e(g,p);return v===void 0&&v===f?r(g,p):t(f,v,c|u)}}return Jv=d,Jv}var Zv,yT;function Sl(){if(yT)return Zv;yT=1;function t(e){return e}return Zv=t,Zv}var Qv,vT;function I7(){if(vT)return Qv;vT=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Qv=t,Qv}var e0,bT;function $7(){if(bT)return e0;bT=1;var t=s1();function e(r){return function(n){return t(n,r)}}return e0=e,e0}var t0,xT;function M7(){if(xT)return t0;xT=1;var t=I7(),e=$7(),r=t1(),n=fp();function i(a){return r(a)?t(n(a)):e(a)}return t0=i,t0}var r0,wT;function Wa(){if(wT)return r0;wT=1;var t=j7(),e=R7(),r=Sl(),n=Zr(),i=M7();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 r0=a,r0}var n0,_T;function iI(){if(_T)return n0;_T=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 n0=t,n0}var i0,ST;function L7(){if(ST)return i0;ST=1;function t(e){return e!==e}return i0=t,i0}var a0,kT;function D7(){if(kT)return a0;kT=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 a0=t,a0}var o0,ET;function z7(){if(ET)return o0;ET=1;var t=iI(),e=L7(),r=D7();function n(i,a,o){return a===a?r(i,a,o):t(i,e,o)}return o0=n,o0}var s0,OT;function B7(){if(OT)return s0;OT=1;var t=z7();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return s0=e,s0}var l0,AT;function U7(){if(AT)return l0;AT=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 l0=t,l0}var c0,TT;function q7(){if(TT)return c0;TT=1;function t(){}return c0=t,c0}var u0,jT;function F7(){if(jT)return u0;jT=1;var t=tI(),e=q7(),r=m1(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(a){return new t(a)}:e;return u0=i,u0}var d0,CT;function H7(){if(CT)return d0;CT=1;var t=GR(),e=B7(),r=U7(),n=VR(),i=F7(),a=m1(),o=200;function c(u,d,p){var f=-1,g=e,v=u.length,x=!0,_=[],b=_;if(p)x=!1,g=r;else if(v>=o){var S=d?null:i(u);if(S)return a(S);x=!1,g=n,b=new t}else b=d?[]:_;e:for(;++f<v;){var A=u[f],O=d?d(A):A;if(A=p||A!==0?A:0,x&&O===O){for(var j=b.length;j--;)if(b[j]===O)continue e;d&&b.push(O),_.push(A)}else g(b,O,p)||(b!==_&&b.push(O),_.push(A))}return _}return d0=c,d0}var f0,NT;function W7(){if(NT)return f0;NT=1;var t=Wa(),e=H7();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return f0=r,f0}var G7=W7();const PT=vt(G7);function aI(t,e,r){return e===!0?PT(t,r):Je(e)?PT(t,e):t}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)}var K7=["ref"];function RT(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 zi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RT(Object(r),!0).forEach(function(n){vp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function V7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function IT(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 X7(t,e,r){return e&&IT(t.prototype,e),r&&IT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Y7(t,e,r){return e=nh(e),J7(t,oI()?Reflect.construct(e,r||[],nh(t).constructor):e.apply(t,r))}function J7(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 Z7(t)}function Z7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oI=function(){return!!t})()}function nh(t){return nh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nh(t)}function Q7(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&&bx(t,e)}function bx(t,e){return bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bx(t,e)}function vp(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=eH(t,"string");return Xs(e)=="symbol"?e:e+""}function eH(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)}function tH(t,e){if(t==null)return{};var r=rH(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 rH(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 nH(t){return t.value}function iH(t,e){if(L.isValidElement(t))return L.cloneElement(t,e);if(typeof t=="function")return L.createElement(t,e);e.ref;var r=tH(e,K7);return L.createElement(p1,r)}var $T=1,qs=(function(t){function e(){var r;V7(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=Y7(this,e,[].concat(i)),vp(r,"lastBoundingBox",{width:-1,height:-1}),r}return Q7(e,t),X7(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)>$T||Math.abs(i.height-this.lastBoundingBox.height)>$T)&&(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?zi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,c=i.verticalAlign,u=i.margin,d=i.chartWidth,p=i.chartHeight,f,g;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var v=this.getBBoxSnapshot();f={left:((d||0)-v.width)/2}}else f=o==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(c==="middle"){var x=this.getBBoxSnapshot();g={top:((p||0)-x.height)/2}}else g=c==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return zi(zi({},f),g)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,c=i.height,u=i.wrapperStyle,d=i.payloadUniqBy,p=i.payload,f=zi(zi({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(u)),u);return L.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(v){n.wrapperNode=v}},iH(a,zi(zi({},this.props),{},{payload:aI(p,d,nH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=zi(zi({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ge(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(P.PureComponent);vp(qs,"displayName","Legend");vp(qs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var h0,MT;function aH(){if(MT)return h0;MT=1;var t=$u(),e=g1(),r=Zr(),n=t?t.isConcatSpreadable:void 0;function i(a){return r(a)||e(a)||!!(n&&a&&a[n])}return h0=i,h0}var p0,LT;function lI(){if(LT)return p0;LT=1;var t=YR(),e=aH();function r(n,i,a,o,c){var u=-1,d=n.length;for(a||(a=e),c||(c=[]);++u<d;){var p=n[u];i>0&&a(p)?i>1?r(p,i-1,a,o,c):t(c,p):o||(c[c.length]=p)}return c}return p0=r,p0}var m0,DT;function oH(){if(DT)return m0;DT=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),c=i(r),u=c.length;u--;){var d=c[e?u:++a];if(n(o[d],d,o)===!1)break}return r}}return m0=t,m0}var g0,zT;function sH(){if(zT)return g0;zT=1;var t=oH(),e=t();return g0=e,g0}var y0,BT;function cI(){if(BT)return y0;BT=1;var t=sH(),e=yp();function r(n,i){return n&&t(n,i,e)}return y0=r,y0}var v0,UT;function lH(){if(UT)return v0;UT=1;var t=Du();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,c=n?o:-1,u=Object(i);(n?c--:++c<o)&&a(u[c],c,u)!==!1;);return i}}return v0=e,v0}var b0,qT;function x1(){if(qT)return b0;qT=1;var t=cI(),e=lH(),r=e(t);return b0=r,b0}var x0,FT;function uI(){if(FT)return x0;FT=1;var t=x1(),e=Du();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(c,u,d){o[++a]=i(c,u,d)}),o}return x0=r,x0}var w0,HT;function cH(){if(HT)return w0;HT=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return w0=t,w0}var _0,WT;function uH(){if(WT)return _0;WT=1;var t=wl();function e(r,n){if(r!==n){var i=r!==void 0,a=r===null,o=r===r,c=t(r),u=n!==void 0,d=n===null,p=n===n,f=t(n);if(!d&&!f&&!c&&r>n||c&&u&&p&&!d&&!f||a&&u&&p||!i&&p||!o)return 1;if(!a&&!c&&!f&&r<n||f&&i&&o&&!a&&!c||d&&i&&o||!u&&o||!p)return-1}return 0}return _0=e,_0}var S0,GT;function dH(){if(GT)return S0;GT=1;var t=uH();function e(r,n,i){for(var a=-1,o=r.criteria,c=n.criteria,u=o.length,d=i.length;++a<u;){var p=t(o[a],c[a]);if(p){if(a>=d)return p;var f=i[a];return p*(f=="desc"?-1:1)}}return r.index-n.index}return S0=e,S0}var k0,KT;function fH(){if(KT)return k0;KT=1;var t=o1(),e=s1(),r=Wa(),n=uI(),i=cH(),a=ZR(),o=dH(),c=Sl(),u=Zr();function d(p,f,g){f.length?f=t(f,function(_){return u(_)?function(b){return e(b,_.length===1?_[0]:_)}:_}):f=[c];var v=-1;f=t(f,a(r));var x=n(p,function(_,b,S){var A=t(f,function(O){return O(_)});return{criteria:A,index:++v,value:_}});return i(x,function(_,b){return o(_,b,g)})}return k0=d,k0}var E0,VT;function hH(){if(VT)return E0;VT=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 E0=t,E0}var O0,XT;function pH(){if(XT)return O0;XT=1;var t=hH(),e=Math.max;function r(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var o=arguments,c=-1,u=e(o.length-i,0),d=Array(u);++c<u;)d[c]=o[i+c];c=-1;for(var p=Array(i+1);++c<i;)p[c]=o[c];return p[i]=a(d),t(n,this,p)}}return O0=r,O0}var A0,YT;function mH(){if(YT)return A0;YT=1;function t(e){return function(){return e}}return A0=t,A0}var T0,JT;function dI(){if(JT)return T0;JT=1;var t=qo(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return T0=e,T0}var j0,ZT;function gH(){if(ZT)return j0;ZT=1;var t=mH(),e=dI(),r=Sl(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return j0=n,j0}var C0,QT;function yH(){if(QT)return C0;QT=1;var t=800,e=16,r=Date.now;function n(i){var a=0,o=0;return function(){var c=r(),u=e-(c-o);if(o=c,u>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return C0=n,C0}var N0,e2;function vH(){if(e2)return N0;e2=1;var t=gH(),e=yH(),r=e(t);return N0=r,N0}var P0,t2;function bH(){if(t2)return P0;t2=1;var t=Sl(),e=pH(),r=vH();function n(i,a){return r(e(i,a,t),i+"")}return P0=n,P0}var R0,r2;function bp(){if(r2)return R0;r2=1;var t=n1(),e=Du(),r=y1(),n=Ha();function i(a,o,c){if(!n(c))return!1;var u=typeof o;return(u=="number"?e(c)&&r(o,c.length):u=="string"&&o in c)?t(c[o],a):!1}return R0=i,R0}var I0,n2;function xH(){if(n2)return I0;n2=1;var t=lI(),e=fH(),r=bH(),n=bp(),i=r(function(a,o){if(a==null)return[];var c=o.length;return c>1&&n(a,o[0],o[1])?o=[]:c>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(a,t(o,1),[])});return I0=i,I0}var wH=xH();const w1=vt(wH);function Yc(t){"@babel/helpers - typeof";return Yc=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},Yc(t)}function xx(){return xx=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},xx.apply(this,arguments)}function _H(t,e){return OH(t)||EH(t,e)||kH(t,e)||SH()}function SH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
446
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kH(t,e){if(t){if(typeof t=="string")return i2(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 i2(t,e)}}function i2(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 EH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function OH(t){if(Array.isArray(t))return 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 $0(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){AH(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 AH(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=jH(t,"string");return Yc(e)=="symbol"?e:e+""}function jH(t,e){if(Yc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CH(t){return Array.isArray(t)&&or(t[0])&&or(t[1])?t.join(" ~ "):t}var NH=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,c=o===void 0?{}:o,u=e.labelStyle,d=u===void 0?{}:u,p=e.payload,f=e.formatter,g=e.itemSorter,v=e.wrapperClassName,x=e.labelClassName,_=e.label,b=e.labelFormatter,S=e.accessibilityLayer,A=S===void 0?!1:S,O=function(){if(p&&p.length){var B={padding:0,margin:0},K=(g?w1(p,g):p).map(function(W,X){if(W.type==="none")return null;var Y=$0({display:"block",paddingTop:4,paddingBottom:4,color:W.color||"#000"},c),te=W.formatter||f||CH,H=W.value,Q=W.name,U=H,I=Q;if(te&&U!=null&&I!=null){var $=te(H,Q,W,X,p);if(Array.isArray($)){var V=_H($,2);U=V[0],I=V[1]}else U=$}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(X),style:Y},or(I)?L.createElement("span",{className:"recharts-tooltip-item-name"},I):null,or(I)?L.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,L.createElement("span",{className:"recharts-tooltip-item-value"},U),L.createElement("span",{className:"recharts-tooltip-item-unit"},W.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:B},K)}return null},j=$0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),E=$0({margin:0},d),T=!et(_),N=T?_:"",R=ot("recharts-default-tooltip",v),M=ot("recharts-tooltip-label",x);T&&b&&p!==void 0&&p!==null&&(N=b(_,p));var J=A?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",xx({className:R,style:j},J),L.createElement("p",{className:M,style:E},L.isValidElement(N)?N:"".concat(N)),O())};function Jc(t){"@babel/helpers - typeof";return Jc=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},Jc(t)}function mf(t,e,r){return e=PH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PH(t){var e=RH(t,"string");return Jc(e)=="symbol"?e:e+""}function RH(t,e){if(Jc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var gc="recharts-tooltip-wrapper",IH={visibility:"hidden"};function $H(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return ot(gc,mf(mf(mf(mf({},"".concat(gc,"-right"),ge(r)&&e&&ge(e.x)&&r>=e.x),"".concat(gc,"-left"),ge(r)&&e&&ge(e.x)&&r<e.x),"".concat(gc,"-bottom"),ge(n)&&e&&ge(e.y)&&n>=e.y),"".concat(gc,"-top"),ge(n)&&e&&ge(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,c=t.tooltipDimension,u=t.viewBox,d=t.viewBoxDimension;if(a&&ge(a[n]))return a[n];var p=r[n]-c-i,f=r[n]+i;if(e[n])return o[n]?p:f;if(o[n]){var g=p,v=u[n];return g<v?Math.max(f,u[n]):Math.max(p,u[n])}var x=f+c,_=u[n]+d;return x>_?Math.max(p,u[n]):Math.max(f,u[n])}function MH(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 LH(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,c=t.useTranslate3d,u=t.viewBox,d,p,f;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:u,viewBoxDimension:u.width}),f=o2({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=MH({translateX:p,translateY:f,useTranslate3d:c})):d=IH,{cssProperties:d,cssClasses:$H({translateX:p,translateY:f,coordinate:r})}}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 s2(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 l2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?s2(Object(r),!0).forEach(function(n){_x(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function DH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zH(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,hI(n.key),n)}}function BH(t,e,r){return e&&zH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function UH(t,e,r){return e=ih(e),qH(t,fI()?Reflect.construct(e,r||[],ih(t).constructor):e.apply(t,r))}function qH(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 FH(t)}function FH(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 ih(t){return ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ih(t)}function HH(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 _x(t,e,r){return e=hI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hI(t){var e=WH(t,"string");return Ys(e)=="symbol"?e:e+""}function WH(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 c2=1,GH=(function(t){function e(){var r;DH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=UH(this,e,[].concat(i)),_x(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),_x(r,"handleKeyDown",function(o){if(o.key==="Escape"){var c,u,d,p;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(u=r.props.coordinate)===null||u===void 0?void 0:u.x)!==null&&c!==void 0?c:0,y:(d=(p=r.props.coordinate)===null||p===void 0?void 0:p.y)!==null&&d!==void 0?d:0}})}}),r}return HH(e,t),BH(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>c2||Math.abs(n.height-this.state.lastBoundingBox.height)>c2)&&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,c=i.animationDuration,u=i.animationEasing,d=i.children,p=i.coordinate,f=i.hasPayload,g=i.isAnimationActive,v=i.offset,x=i.position,_=i.reverseDirection,b=i.useTranslate3d,S=i.viewBox,A=i.wrapperStyle,O=LH({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:v,position:x,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:S}),j=O.cssClasses,E=O.cssProperties,T=l2(l2({transition:g&&a?"transform ".concat(c,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},A);return L.createElement("div",{tabIndex:-1,className:j,style:T,ref:function(R){n.wrapperNode=R}},d)}}])})(P.PureComponent),KH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},kl={isSsr:KH()};function Js(t){"@babel/helpers - typeof";return Js=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},Js(t)}function u2(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 d2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?u2(Object(r),!0).forEach(function(n){_1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function VH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function XH(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 YH(t,e,r){return e&&XH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function JH(t,e,r){return e=ah(e),ZH(t,pI()?Reflect.construct(e,r||[],ah(t).constructor):e.apply(t,r))}function ZH(t,e){if(e&&(Js(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QH(t)}function QH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pI=function(){return!!t})()}function ah(t){return ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ah(t)}function eW(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 _1(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=tW(t,"string");return Js(e)=="symbol"?e:e+""}function tW(t,e){if(Js(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function rW(t){return t.dataKey}function nW(t,e){return L.isValidElement(t)?L.cloneElement(t,e):typeof t=="function"?L.createElement(t,e):L.createElement(NH,e)}var ln=(function(t){function e(){return VH(this,e),JH(this,e,arguments)}return eW(e,t),YH(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,c=i.animationDuration,u=i.animationEasing,d=i.content,p=i.coordinate,f=i.filterNull,g=i.isAnimationActive,v=i.offset,x=i.payload,_=i.payloadUniqBy,b=i.position,S=i.reverseDirection,A=i.useTranslate3d,O=i.viewBox,j=i.wrapperStyle,E=x??[];f&&E.length&&(E=aI(x.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),_,rW));var T=E.length>0;return L.createElement(GH,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:g,active:a,coordinate:p,hasPayload:T,offset:v,position:b,reverseDirection:S,useTranslate3d:A,viewBox:O,wrapperStyle:j},nW(d,d2(d2({},this.props),{},{payload:E})))}}])})(P.PureComponent);_1(ln,"displayName","Tooltip");_1(ln,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!kl.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 M0,f2;function iW(){if(f2)return M0;f2=1;var t=Oi(),e=function(){return t.Date.now()};return M0=e,M0}var L0,h2;function aW(){if(h2)return L0;h2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return L0=e,L0}var D0,p2;function oW(){if(p2)return D0;p2=1;var t=aW(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return D0=r,D0}var z0,m2;function gI(){if(m2)return z0;m2=1;var t=oW(),e=Ha(),r=wl(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function u(d){if(typeof d=="number")return d;if(r(d))return n;if(e(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=e(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=t(d);var f=a.test(d);return f||o.test(d)?c(d.slice(2),f?2:8):i.test(d)?n:+d}return z0=u,z0}var B0,g2;function sW(){if(g2)return B0;g2=1;var t=Ha(),e=iW(),r=gI(),n="Expected a function",i=Math.max,a=Math.min;function o(c,u,d){var p,f,g,v,x,_,b=0,S=!1,A=!1,O=!0;if(typeof c!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(S=!!d.leading,A="maxWait"in d,g=A?i(r(d.maxWait)||0,u):g,O="trailing"in d?!!d.trailing:O);function j(K){var W=p,X=f;return p=f=void 0,b=K,v=c.apply(X,W),v}function E(K){return b=K,x=setTimeout(R,u),S?j(K):v}function T(K){var W=K-_,X=K-b,Y=u-W;return A?a(Y,g-X):Y}function N(K){var W=K-_,X=K-b;return _===void 0||W>=u||W<0||A&&X>=g}function R(){var K=e();if(N(K))return M(K);x=setTimeout(R,T(K))}function M(K){return x=void 0,O&&p?j(K):(p=f=void 0,v)}function J(){x!==void 0&&clearTimeout(x),b=0,p=_=f=x=void 0}function F(){return x===void 0?v:M(e())}function B(){var K=e(),W=N(K);if(p=arguments,f=this,_=K,W){if(x===void 0)return E(_);if(A)return clearTimeout(x),x=setTimeout(R,u),j(_)}return x===void 0&&(x=setTimeout(R,u)),v}return B.cancel=J,B.flush=F,B}return B0=o,B0}var U0,y2;function lW(){if(y2)return U0;y2=1;var t=sW(),e=Ha(),r="Expected a function";function n(i,a,o){var c=!0,u=!0;if(typeof i!="function")throw new TypeError(r);return e(o)&&(c="leading"in o?!!o.leading:c,u="trailing"in o?!!o.trailing:u),t(i,a,{leading:c,maxWait:a,trailing:u})}return U0=n,U0}var cW=lW();const yI=vt(cW);function Zc(t){"@babel/helpers - typeof";return Zc=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},Zc(t)}function v2(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 gf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?v2(Object(r),!0).forEach(function(n){uW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uW(t,e,r){return e=dW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dW(t){var e=fW(t,"string");return Zc(e)=="symbol"?e:e+""}function fW(t,e){if(Zc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hW(t,e){return yW(t)||gW(t,e)||mW(t,e)||pW()}function pW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
447
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mW(t,e){if(t){if(typeof t=="string")return b2(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 b2(t,e)}}function b2(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 gW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function yW(t){if(Array.isArray(t))return t}var oh=P.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,c=t.height,u=c===void 0?"100%":c,d=t.minWidth,p=d===void 0?0:d,f=t.minHeight,g=t.maxHeight,v=t.children,x=t.debounce,_=x===void 0?0:x,b=t.id,S=t.className,A=t.onResize,O=t.style,j=O===void 0?{}:O,E=P.useRef(null),T=P.useRef();T.current=A,P.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 N=P.useState({containerWidth:i.width,containerHeight:i.height}),R=hW(N,2),M=R[0],J=R[1],F=P.useCallback(function(K,W){J(function(X){var Y=Math.round(K),te=Math.round(W);return X.containerWidth===Y&&X.containerHeight===te?X:{containerWidth:Y,containerHeight:te}})},[]);P.useEffect(function(){var K=function(Q){var U,I=Q[0].contentRect,$=I.width,V=I.height;F($,V),(U=T.current)===null||U===void 0||U.call(T,$,V)};_>0&&(K=yI(K,_,{trailing:!0,leading:!1}));var W=new ResizeObserver(K),X=E.current.getBoundingClientRect(),Y=X.width,te=X.height;return F(Y,te),W.observe(E.current),function(){W.disconnect()}},[F,_]);var B=P.useMemo(function(){var K=M.containerWidth,W=M.containerHeight;if(K<0||W<0)return null;Ki(Eo(o)||Eo(u),`The width(%s) and height(%s) are both fixed numbers,
|
|
448
|
+
maybe you don't need to use a ResponsiveContainer.`,o,u),Ki(!r||r>0,"The aspect(%s) must be greater than zero.",r);var X=Eo(o)?K:o,Y=Eo(u)?W:u;r&&r>0&&(X?Y=X/r:Y&&(X=Y*r),g&&Y>g&&(Y=g)),Ki(X>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
449
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
450
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
451
|
+
height and width.`,X,Y,o,u,p,f,r);var te=!Array.isArray(v)&&Gi(v.type).endsWith("Chart");return L.Children.map(v,function(H){return L.isValidElement(H)?P.cloneElement(H,gf({width:X,height:Y},te?{style:gf({height:"100%",width:"100%",maxHeight:Y,maxWidth:X},H.props.style)}:{})):H})},[r,v,u,g,f,p,M,o]);return L.createElement("div",{id:b?"".concat(b):void 0,className:ot("recharts-responsive-container",S),style:gf(gf({},j),{},{width:o,height:u,minWidth:p,minHeight:f,maxHeight:g}),ref:E},B)}),vI=function(e){return null};vI.displayName="Cell";function Qc(t){"@babel/helpers - typeof";return Qc=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},Qc(t)}function x2(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 kx(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x2(Object(r),!0).forEach(function(n){vW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vW(t,e,r){return e=bW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bW(t){var e=xW(t,"string");return Qc(e)=="symbol"?e:e+""}function xW(t,e){if(Qc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Es={widthCache:{},cacheCount:0},wW=2e3,_W={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},w2="recharts_measurement_span";function SW(t){var e=kx({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var $c=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||kl.isSsr)return{width:0,height:0};var n=SW(r),i=JSON.stringify({text:e,copyStyle:n});if(Es.widthCache[i])return Es.widthCache[i];try{var a=document.getElementById(w2);a||(a=document.createElement("span"),a.setAttribute("id",w2),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=kx(kx({},_W),n);Object.assign(a.style,o),a.textContent="".concat(e);var c=a.getBoundingClientRect(),u={width:c.width,height:c.height};return Es.widthCache[i]=u,++Es.cacheCount>wW&&(Es.cacheCount=0,Es.widthCache={}),u}catch{return{width:0,height:0}}},kW=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};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)}function sh(t,e){return TW(t)||AW(t,e)||OW(t,e)||EW()}function EW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
452
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OW(t,e){if(t){if(typeof t=="string")return _2(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 _2(t,e)}}function _2(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 AW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function TW(t){if(Array.isArray(t))return t}function jW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S2(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,NW(n.key),n)}}function CW(t,e,r){return e&&S2(t.prototype,e),r&&S2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function NW(t){var e=PW(t,"string");return eu(e)=="symbol"?e:e+""}function PW(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 String(t)}var k2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,E2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,RW=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,IW=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,bI={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},$W=Object.keys(bI),$s="NaN";function MW(t,e){return t*bI[e]}var yf=(function(){function t(e,r){jW(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!RW.test(r)&&(this.num=NaN,this.unit=""),$W.includes(r)&&(this.num=MW(e,r),this.unit="px")}return CW(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=IW.exec(r))!==null&&n!==void 0?n:[],a=sh(i,3),o=a[1],c=a[2];return new t(parseFloat(o),c??"")}}])})();function xI(t){if(t.includes($s))return $s;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=k2.exec(e))!==null&&r!==void 0?r:[],i=sh(n,4),a=i[1],o=i[2],c=i[3],u=yf.parse(a??""),d=yf.parse(c??""),p=o==="*"?u.multiply(d):u.divide(d);if(p.isNaN())return $s;e=e.replace(k2,p.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,g=(f=E2.exec(e))!==null&&f!==void 0?f:[],v=sh(g,4),x=v[1],_=v[2],b=v[3],S=yf.parse(x??""),A=yf.parse(b??""),O=_==="+"?S.add(A):S.subtract(A);if(O.isNaN())return $s;e=e.replace(E2,O.toString())}return e}var O2=/\(([^()]*)\)/;function LW(t){for(var e=t;e.includes("(");){var r=O2.exec(e),n=sh(r,2),i=n[1];e=e.replace(O2,xI(i))}return e}function DW(t){var e=t.replace(/\s+/g,"");return e=LW(e),e=xI(e),e}function zW(t){try{return DW(t)}catch{return $s}}function q0(t){var e=zW(t.slice(5,-1));return e===$s?"":e}var BW=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],UW=["dx","dy","angle","className","breakAll"];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 A2(t,e){if(t==null)return{};var r=qW(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 qW(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 T2(t,e){return GW(t)||WW(t,e)||HW(t,e)||FW()}function FW(){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 HW(t,e){if(t){if(typeof t=="string")return j2(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 j2(t,e)}}function j2(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 WW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function GW(t){if(Array.isArray(t))return t}var wI=/[ \f\n\r\t\v\u2028\u2029]+/,_I=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];et(r)||(n?a=r.toString().split(""):a=r.toString().split(wI));var o=a.map(function(u){return{word:u,width:$c(u,i).width}}),c=n?0:$c(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},KW=function(e,r,n,i,a){var o=e.maxLines,c=e.children,u=e.style,d=e.breakAll,p=ge(o),f=c,g=function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return X.reduce(function(Y,te){var H=te.word,Q=te.width,U=Y[Y.length-1];if(U&&(i==null||a||U.width+Q+n<Number(i)))U.words.push(H),U.width+=Q+n;else{var I={words:[H],width:Q};Y.push(I)}return Y},[])},v=g(r),x=function(X){return X.reduce(function(Y,te){return Y.width>te.width?Y:te})};if(!p)return v;for(var _="…",b=function(X){var Y=f.slice(0,X),te=_I({breakAll:d,style:u,children:Y+_}).wordsWithComputedWidth,H=g(te),Q=H.length>o||x(H).width>Number(i);return[Q,H]},S=0,A=f.length-1,O=0,j;S<=A&&O<=f.length-1;){var E=Math.floor((S+A)/2),T=E-1,N=b(T),R=T2(N,2),M=R[0],J=R[1],F=b(E),B=T2(F,1),K=B[0];if(!M&&!K&&(S=E+1),M&&K&&(A=E-1),!M&&K){j=J;break}O++}return j||v},C2=function(e){var r=et(e)?[]:e.toString().split(wI);return[{words:r}]},VW=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,c=e.maxLines;if((r||n)&&!kl.isSsr){var u,d,p=_I({breakAll:o,children:i,style:a});if(p){var f=p.wordsWithComputedWidth,g=p.spaceWidth;u=f,d=g}else return C2(i);return KW({breakAll:o,children:i,maxLines:c,style:a},u,d,r,n)}return C2(i)},N2="#808080",lh=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,c=o===void 0?"1em":o,u=e.capHeight,d=u===void 0?"0.71em":u,p=e.scaleToFit,f=p===void 0?!1:p,g=e.textAnchor,v=g===void 0?"start":g,x=e.verticalAnchor,_=x===void 0?"end":x,b=e.fill,S=b===void 0?N2:b,A=A2(e,BW),O=P.useMemo(function(){return VW({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:f,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,f,A.style,A.width]),j=A.dx,E=A.dy,T=A.angle,N=A.className,R=A.breakAll,M=A2(A,UW);if(!or(n)||!or(a))return null;var J=n+(ge(j)?j:0),F=a+(ge(E)?E:0),B;switch(_){case"start":B=q0("calc(".concat(d,")"));break;case"middle":B=q0("calc(".concat((O.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=q0("calc(".concat(O.length-1," * -").concat(c,")"));break}var K=[];if(f){var W=O[0].width,X=A.width;K.push("scale(".concat((ge(X)?X/W:1)/W,")"))}return T&&K.push("rotate(".concat(T,", ").concat(J,", ").concat(F,")")),K.length&&(M.transform=K.join(" ")),L.createElement("text",Ex({},it(M,!0),{x:J,y:F,className:ot("recharts-text",N),textAnchor:v,fill:S.includes("url")?N2:S}),O.map(function(Y,te){var H=Y.words.join(R?"":" ");return L.createElement("tspan",{x:J,dy:te===0?B:c,key:"".concat(H,"-").concat(te)},H)}))};function La(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function XW(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function S1(t){let e,r,n;t.length!==2?(e=La,r=(c,u)=>La(t(c),u),n=(c,u)=>t(c)-u):(e=t===La||t===XW?t:YW,r=t,n=t);function i(c,u,d=0,p=c.length){if(d<p){if(e(u,u)!==0)return p;do{const f=d+p>>>1;r(c[f],u)<0?d=f+1:p=f}while(d<p)}return d}function a(c,u,d=0,p=c.length){if(d<p){if(e(u,u)!==0)return p;do{const f=d+p>>>1;r(c[f],u)<=0?d=f+1:p=f}while(d<p)}return d}function o(c,u,d=0,p=c.length){const f=i(c,u,d,p-1);return f>d&&n(c[f-1],u)>-n(c[f],u)?f-1:f}return{left:i,center:o,right:a}}function YW(){return 0}function SI(t){return t===null?NaN:+t}function*JW(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const ZW=S1(La),zu=ZW.right;S1(SI).center;class P2 extends Map{constructor(e,r=tG){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(R2(this,e))}has(e){return super.has(R2(this,e))}set(e,r){return super.set(QW(this,e),r)}delete(e){return super.delete(eG(this,e))}}function R2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function QW({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function eG({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function tG(t){return t!==null&&typeof t=="object"?t.valueOf():t}function rG(t=La){if(t===La)return kI;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 kI(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const nG=Math.sqrt(50),iG=Math.sqrt(10),aG=Math.sqrt(2);function ch(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>=nG?10:a>=iG?5:a>=aG?2:1;let c,u,d;return i<0?(d=Math.pow(10,-i)/o,c=Math.round(t*d),u=Math.round(e*d),c/d<t&&++c,u/d>e&&--u,d=-d):(d=Math.pow(10,i)*o,c=Math.round(t/d),u=Math.round(e/d),c*d<t&&++c,u*d>e&&--u),u<c&&.5<=r&&r<2?ch(t,e,r*2):[c,u,d]}function Ox(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?ch(e,t,r):ch(t,e,r);if(!(a>=i))return[];const c=a-i+1,u=new Array(c);if(n)if(o<0)for(let d=0;d<c;++d)u[d]=(a-d)/-o;else for(let d=0;d<c;++d)u[d]=(a-d)*o;else if(o<0)for(let d=0;d<c;++d)u[d]=(i+d)/-o;else for(let d=0;d<c;++d)u[d]=(i+d)*o;return u}function Ax(t,e,r){return e=+e,t=+t,r=+r,ch(t,e,r)[2]}function Tx(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Ax(e,t,r):Ax(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function I2(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function $2(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function EI(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?kI:rG(i);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,p=Math.log(u),f=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*f*(u-f)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*f/u+g)),x=Math.min(n,Math.floor(e+(u-d)*f/u+g));EI(t,e,v,x,i)}const a=t[e];let o=r,c=n;for(yc(t,r,e),i(t[n],a)>0&&yc(t,r,n);o<c;){for(yc(t,o,c),++o,--c;i(t[o],a)<0;)++o;for(;i(t[c],a)>0;)--c}i(t[r],a)===0?yc(t,r,c):(++c,yc(t,c,n)),c<=e&&(r=c+1),e<=c&&(n=c-1)}return t}function yc(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function oG(t,e,r){if(t=Float64Array.from(JW(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return $2(t);if(e>=1)return I2(t);var n,i=(n-1)*e,a=Math.floor(i),o=I2(EI(t,a).subarray(0,a+1)),c=$2(t.subarray(a+1));return o+(c-o)*(i-a)}}function sG(t,e,r=SI){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),c=+r(t[a+1],a+1,t);return o+(c-o)*(i-a)}}function lG(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 Pn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ia(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 jx=Symbol("implicit");function k1(){var t=new P2,e=[],r=[],n=jx;function i(a){let o=t.get(a);if(o===void 0){if(n!==jx)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 P2;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 k1(e,r).unknown(n)},Pn.apply(i,arguments),i}function tu(){var t=k1().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,c=!1,u=0,d=0,p=.5;delete t.unknown;function f(){var g=e().length,v=i<n,x=v?i:n,_=v?n:i;a=(_-x)/Math.max(1,g-u+d*2),c&&(a=Math.floor(a)),x+=(_-x-a*(g-u))*p,o=a*(1-u),c&&(x=Math.round(x),o=Math.round(o));var b=lG(g).map(function(S){return x+a*S});return r(v?b.reverse():b)}return t.domain=function(g){return arguments.length?(e(g),f()):e()},t.range=function(g){return arguments.length?([n,i]=g,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(g){return[n,i]=g,n=+n,i=+i,c=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(g){return arguments.length?(c=!!g,f()):c},t.padding=function(g){return arguments.length?(u=Math.min(1,d=+g),f()):u},t.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),f()):u},t.paddingOuter=function(g){return arguments.length?(d=+g,f()):d},t.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),f()):p},t.copy=function(){return tu(e(),[n,i]).round(c).paddingInner(u).paddingOuter(d).align(p)},Pn.apply(f(),arguments)}function OI(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return OI(e())},t}function Mc(){return OI(tu.apply(null,arguments).paddingInner(1))}function E1(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function AI(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Bu(){}var ru=.7,uh=1/ru,Fs="\\s*([+-]?\\d+)\\s*",nu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cG=/^#([0-9a-f]{3,8})$/,uG=new RegExp(`^rgb\\(${Fs},${Fs},${Fs}\\)$`),dG=new RegExp(`^rgb\\(${Si},${Si},${Si}\\)$`),fG=new RegExp(`^rgba\\(${Fs},${Fs},${Fs},${nu}\\)$`),hG=new RegExp(`^rgba\\(${Si},${Si},${Si},${nu}\\)$`),pG=new RegExp(`^hsl\\(${nu},${Si},${Si}\\)$`),mG=new RegExp(`^hsla\\(${nu},${Si},${Si},${nu}\\)$`),M2={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};E1(Bu,iu,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:L2,formatHex:L2,formatHex8:gG,formatHsl:yG,formatRgb:D2,toString:D2});function L2(){return this.rgb().formatHex()}function gG(){return this.rgb().formatHex8()}function yG(){return TI(this).formatHsl()}function D2(){return this.rgb().formatRgb()}function iu(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=cG.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?z2(e):r===3?new Jr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?vf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?vf(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=uG.exec(t))?new Jr(e[1],e[2],e[3],1):(e=dG.exec(t))?new Jr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=fG.exec(t))?vf(e[1],e[2],e[3],e[4]):(e=hG.exec(t))?vf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pG.exec(t))?q2(e[1],e[2]/100,e[3]/100,1):(e=mG.exec(t))?q2(e[1],e[2]/100,e[3]/100,e[4]):M2.hasOwnProperty(t)?z2(M2[t]):t==="transparent"?new Jr(NaN,NaN,NaN,0):null}function z2(t){return new Jr(t>>16&255,t>>8&255,t&255,1)}function vf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Jr(t,e,r,n)}function vG(t){return t instanceof Bu||(t=iu(t)),t?(t=t.rgb(),new Jr(t.r,t.g,t.b,t.opacity)):new Jr}function Cx(t,e,r,n){return arguments.length===1?vG(t):new Jr(t,e,r,n??1)}function Jr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}E1(Jr,Cx,AI(Bu,{brighter(t){return t=t==null?uh:Math.pow(uh,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ru:Math.pow(ru,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jr(No(this.r),No(this.g),No(this.b),dh(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:B2,formatHex:B2,formatHex8:bG,formatRgb:U2,toString:U2}));function B2(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}`}function bG(){return`#${Oo(this.r)}${Oo(this.g)}${Oo(this.b)}${Oo((isNaN(this.opacity)?1:this.opacity)*255)}`}function U2(){const t=dh(this.opacity);return`${t===1?"rgb(":"rgba("}${No(this.r)}, ${No(this.g)}, ${No(this.b)}${t===1?")":`, ${t})`}`}function dh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function No(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Oo(t){return t=No(t),(t<16?"0":"")+t.toString(16)}function q2(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Yn(t,e,r,n)}function TI(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof Bu||(t=iu(t)),!t)return new Yn;if(t instanceof Yn)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,c=a-i,u=(a+i)/2;return c?(e===a?o=(r-n)/c+(r<n)*6:r===a?o=(n-e)/c+2:o=(e-r)/c+4,c/=u<.5?a+i:2-a-i,o*=60):c=u>0&&u<1?0:o,new Yn(o,c,u,t.opacity)}function xG(t,e,r,n){return arguments.length===1?TI(t):new Yn(t,e,r,n??1)}function Yn(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}E1(Yn,xG,AI(Bu,{brighter(t){return t=t==null?uh:Math.pow(uh,t),new Yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ru:Math.pow(ru,t),new Yn(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 Jr(F0(t>=240?t-240:t+120,i,n),F0(t,i,n),F0(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Yn(F2(this.h),bf(this.s),bf(this.l),dh(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=dh(this.opacity);return`${t===1?"hsl(":"hsla("}${F2(this.h)}, ${bf(this.s)*100}%, ${bf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function F2(t){return t=(t||0)%360,t<0?t+360:t}function bf(t){return Math.max(0,Math.min(1,t||0))}function F0(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 O1=t=>()=>t;function wG(t,e){return function(r){return t+r*e}}function _G(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 SG(t){return(t=+t)==1?jI:function(e,r){return r-e?_G(e,r,t):O1(isNaN(e)?r:e)}}function jI(t,e){var r=e-t;return r?wG(t,r):O1(isNaN(t)?e:t)}const H2=(function t(e){var r=SG(e);function n(i,a){var o=r((i=Cx(i)).r,(a=Cx(a)).r),c=r(i.g,a.g),u=r(i.b,a.b),d=jI(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=u(p),i.opacity=d(p),i+""}}return n.gamma=t,n})(1);function kG(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 EG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function OG(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]=El(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(c){for(o=0;o<n;++o)a[o]=i[o](c);return a}}function AG(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function fh(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function TG(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]=El(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Nx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,H0=new RegExp(Nx.source,"g");function jG(t){return function(){return t}}function CG(t){return function(e){return t(e)+""}}function NG(t,e){var r=Nx.lastIndex=H0.lastIndex=0,n,i,a,o=-1,c=[],u=[];for(t=t+"",e=e+"";(n=Nx.exec(t))&&(i=H0.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),c[o]?c[o]+=a:c[++o]=a),(n=n[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,u.push({i:o,x:fh(n,i)})),r=H0.lastIndex;return r<e.length&&(a=e.slice(r),c[o]?c[o]+=a:c[++o]=a),c.length<2?u[0]?CG(u[0].x):jG(e):(e=u.length,function(d){for(var p=0,f;p<e;++p)c[(f=u[p]).i]=f.x(d);return c.join("")})}function El(t,e){var r=typeof e,n;return e==null||r==="boolean"?O1(e):(r==="number"?fh:r==="string"?(n=iu(e))?(e=n,H2):NG:e instanceof iu?H2:e instanceof Date?AG:EG(e)?kG:Array.isArray(e)?OG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?TG:fh)(t,e)}function A1(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function PG(t,e){e===void 0&&(e=t,t=El);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 c=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[c](o-c)}}function RG(t){return function(){return t}}function hh(t){return+t}var W2=[0,1];function Br(t){return t}function Px(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:RG(isNaN(e)?NaN:.5)}function IG(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function $G(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Px(i,n),a=r(o,a)):(n=Px(n,i),a=r(a,o)),function(c){return a(n(c))}}function MG(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]=Px(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(c){var u=zu(t,c,1,n)-1;return a[u](i[u](c))}}function Uu(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function xp(){var t=W2,e=W2,r=El,n,i,a,o=Br,c,u,d;function p(){var g=Math.min(t.length,e.length);return o!==Br&&(o=IG(t[0],t[g-1])),c=g>2?MG:$G,u=d=null,f}function f(g){return g==null||isNaN(g=+g)?a:(u||(u=c(t.map(n),e,r)))(n(o(g)))}return f.invert=function(g){return o(i((d||(d=c(e,t.map(n),fh)))(g)))},f.domain=function(g){return arguments.length?(t=Array.from(g,hh),p()):t.slice()},f.range=function(g){return arguments.length?(e=Array.from(g),p()):e.slice()},f.rangeRound=function(g){return e=Array.from(g),r=A1,p()},f.clamp=function(g){return arguments.length?(o=g?!0:Br,p()):o!==Br},f.interpolate=function(g){return arguments.length?(r=g,p()):r},f.unknown=function(g){return arguments.length?(a=g,f):a},function(g,v){return n=g,i=v,p()}}function T1(){return xp()(Br,Br)}function LG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ph(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 Zs(t){return t=ph(Math.abs(t)),t?t[1]:NaN}function DG(t,e){return function(r,n){for(var i=r.length,a=[],o=0,c=t[0],u=0;i>0&&c>0&&(u+c+1>n&&(c=Math.max(1,n-u)),a.push(r.substring(i-=c,i+c)),!((u+=c+1)>n));)c=t[o=(o+1)%t.length];return a.reverse().join(e)}}function zG(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var BG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function au(t){if(!(e=BG.exec(t)))throw new Error("invalid format: "+t);var e;return new j1({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]})}au.prototype=j1.prototype;function j1(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+""}j1.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 UG(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 mh;function qG(t,e){var r=ph(t,e);if(!r)return mh=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(mh=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")+ph(t,Math.max(0,e+a-1))[0]}function G2(t,e){var r=ph(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 K2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:LG,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)=>G2(t*100,e),r:G2,s:qG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function V2(t){return t}var X2=Array.prototype.map,Y2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function FG(t){var e=t.grouping===void 0||t.thousands===void 0?V2:DG(X2.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?V2:zG(X2.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",c=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function d(f,g){f=au(f);var v=f.fill,x=f.align,_=f.sign,b=f.symbol,S=f.zero,A=f.width,O=f.comma,j=f.precision,E=f.trim,T=f.type;T==="n"?(O=!0,T="g"):K2[T]||(j===void 0&&(j=12),E=!0,T="g"),(S||v==="0"&&x==="=")&&(S=!0,v="0",x="=");var N=(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:""),M=K2[T],J=/[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 F(B){var K=N,W=R,X,Y,te;if(T==="c")W=M(B)+W,B="";else{B=+B;var H=B<0||1/B<0;if(B=isNaN(B)?u:M(Math.abs(B),j),E&&(B=UG(B)),H&&+B==0&&_!=="+"&&(H=!1),K=(H?_==="("?_:c:_==="-"||_==="("?"":_)+K,W=(T==="s"&&!isNaN(B)&&mh!==void 0?Y2[8+mh/3]:"")+W+(H&&_==="("?")":""),J){for(X=-1,Y=B.length;++X<Y;)if(te=B.charCodeAt(X),48>te||te>57){W=(te===46?i+B.slice(X+1):B.slice(X))+W,B=B.slice(0,X);break}}}O&&!S&&(B=e(B,1/0));var Q=K.length+B.length+W.length,U=Q<A?new Array(A-Q+1).join(v):"";switch(O&&S&&(B=e(U+B,U.length?A-W.length:1/0),U=""),x){case"<":B=K+B+W+U;break;case"=":B=K+U+B+W;break;case"^":B=U.slice(0,Q=U.length>>1)+K+B+W+U.slice(Q);break;default:B=U+K+B+W;break}return a(B)}return F.toString=function(){return f+""},F}function p(f,g){var v=Math.max(-8,Math.min(8,Math.floor(Zs(g)/3)))*3,x=Math.pow(10,-v),_=d((f=au(f),f.type="f",f),{suffix:Y2[8+v/3]});return function(b){return _(x*b)}}return{format:d,formatPrefix:p}}var xf,C1,CI;HG({thousands:",",grouping:[3],currency:["$",""]});function HG(t){return xf=FG(t),C1=xf.format,CI=xf.formatPrefix,xf}function WG(t){return Math.max(0,-Zs(Math.abs(t)))}function GG(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zs(e)/3)))*3-Zs(Math.abs(t)))}function KG(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zs(e)-Zs(t))+1}function NI(t,e,r,n){var i=Tx(t,e,r),a;switch(n=au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=GG(i,o))&&(n.precision=a),CI(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=KG(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=WG(i))&&(n.precision=a-(n.type==="%")*2);break}}return C1(n)}function Ga(t){var e=t.domain;return t.ticks=function(r){var n=e();return Ox(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return NI(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],c=n[a],u,d,p=10;for(c<o&&(d=o,o=c,c=d,d=i,i=a,a=d);p-- >0;){if(d=Ax(o,c,r),d===u)return n[i]=o,n[a]=c,e(n);if(d>0)o=Math.floor(o/d)*d,c=Math.ceil(c/d)*d;else if(d<0)o=Math.ceil(o*d)/d,c=Math.floor(c*d)/d;else break;u=d}return t},t}function gh(){var t=T1();return t.copy=function(){return Uu(t,gh())},Pn.apply(t,arguments),Ga(t)}function PI(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,hh),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return PI(t).unknown(e)},t=arguments.length?Array.from(t,hh):[0,1],Ga(r)}function RI(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 J2(t){return Math.log(t)}function Z2(t){return Math.exp(t)}function VG(t){return-Math.log(-t)}function XG(t){return-Math.exp(-t)}function YG(t){return isFinite(t)?+("1e"+t):t<0?0:t}function JG(t){return t===10?YG:t===Math.E?Math.exp:e=>Math.pow(t,e)}function ZG(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 Q2(t){return(e,r)=>-t(-e,r)}function N1(t){const e=t(J2,Z2),r=e.domain;let n=10,i,a;function o(){return i=ZG(n),a=JG(n),r()[0]<0?(i=Q2(i),a=Q2(a),t(VG,XG)):t(J2,Z2),e}return e.base=function(c){return arguments.length?(n=+c,o()):n},e.domain=function(c){return arguments.length?(r(c),o()):r()},e.ticks=c=>{const u=r();let d=u[0],p=u[u.length-1];const f=p<d;f&&([d,p]=[p,d]);let g=i(d),v=i(p),x,_;const b=c==null?10:+c;let S=[];if(!(n%1)&&v-g<b){if(g=Math.floor(g),v=Math.ceil(v),d>0){for(;g<=v;++g)for(x=1;x<n;++x)if(_=g<0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;S.push(_)}}else for(;g<=v;++g)for(x=n-1;x>=1;--x)if(_=g>0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;S.push(_)}S.length*2<b&&(S=Ox(d,p,b))}else S=Ox(g,v,Math.min(v-g,b)).map(a);return f?S.reverse():S},e.tickFormat=(c,u)=>{if(c==null&&(c=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=au(u)).precision==null&&(u.trim=!0),u=C1(u)),c===1/0)return u;const d=Math.max(1,n*c/e.ticks().length);return p=>{let f=p/a(Math.round(i(p)));return f*n<n-.5&&(f*=n),f<=d?u(p):""}},e.nice=()=>r(RI(r(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),e}function II(){const t=N1(xp()).domain([1,10]);return t.copy=()=>Uu(t,II()).base(t.base()),Pn.apply(t,arguments),t}function ej(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tj(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function P1(t){var e=1,r=t(ej(e),tj(e));return r.constant=function(n){return arguments.length?t(ej(e=+n),tj(e)):e},Ga(r)}function $I(){var t=P1(xp());return t.copy=function(){return Uu(t,$I()).constant(t.constant())},Pn.apply(t,arguments)}function rj(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function QG(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function eK(t){return t<0?-t*t:t*t}function R1(t){var e=t(Br,Br),r=1;function n(){return r===1?t(Br,Br):r===.5?t(QG,eK):t(rj(r),rj(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Ga(e)}function I1(){var t=R1(xp());return t.copy=function(){return Uu(t,I1()).exponent(t.exponent())},Pn.apply(t,arguments),t}function tK(){return I1.apply(null,arguments).exponent(.5)}function nj(t){return Math.sign(t)*t*t}function rK(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function MI(){var t=T1(),e=[0,1],r=!1,n;function i(a){var o=rK(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(nj(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,hh)).map(nj)),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 MI(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Pn.apply(i,arguments),Ga(i)}function LI(){var t=[],e=[],r=[],n;function i(){var o=0,c=Math.max(1,e.length);for(r=new Array(c-1);++o<c;)r[o-1]=sG(t,o/c);return a}function a(o){return o==null||isNaN(o=+o)?n:e[zu(r,o)]}return a.invertExtent=function(o){var c=e.indexOf(o);return c<0?[NaN,NaN]:[c>0?r[c-1]:t[0],c<r.length?r[c]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let c of o)c!=null&&!isNaN(c=+c)&&t.push(c);return t.sort(La),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 LI().domain(t).range(e).unknown(n)},Pn.apply(a,arguments)}function DI(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[zu(n,u,0,r)]:a}function c(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*e-(u-r)*t)/(r+1);return o}return o.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,c()):[t,e]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,c()):i.slice()},o.invertExtent=function(u){var d=i.indexOf(u);return d<0?[NaN,NaN]:d<1?[t,n[0]]:d>=r?[n[r-1],e]:[n[d-1],n[d]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return DI().domain([t,e]).range(i).unknown(a)},Pn.apply(Ga(o),arguments)}function zI(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[zu(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 zI().domain(t).range(e).unknown(r)},Pn.apply(i,arguments)}const W0=new Date,G0=new Date;function sr(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),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const u=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return u;let d;do u.push(d=new Date(+a)),e(a,c),t(a);while(d<a&&a<o);return u},i.filter=a=>sr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;e(o,-1),!a(o););else for(;--c>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(W0.setTime(+a),G0.setTime(+o),t(W0),t(G0),Math.floor(r(W0,G0))),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 yh=sr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);yh.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?sr(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):yh);yh.range;const Fi=1e3,An=Fi*60,Hi=An*60,Yi=Hi*24,$1=Yi*7,ij=Yi*30,K0=Yi*365,Ao=sr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getUTCSeconds());Ao.range;const M1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getMinutes());M1.range;const L1=sr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getUTCMinutes());L1.range;const D1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Fi-t.getMinutes()*An)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getHours());D1.range;const z1=sr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hi)},(t,e)=>(e-t)/Hi,t=>t.getUTCHours());z1.range;const qu=sr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*An)/Yi,t=>t.getDate()-1);qu.range;const wp=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>t.getUTCDate()-1);wp.range;const BI=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>Math.floor(t/Yi));BI.range;function Fo(t){return sr(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())*An)/$1)}const _p=Fo(0),vh=Fo(1),nK=Fo(2),iK=Fo(3),Qs=Fo(4),aK=Fo(5),oK=Fo(6);_p.range;vh.range;nK.range;iK.range;Qs.range;aK.range;oK.range;function Ho(t){return sr(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)/$1)}const Sp=Ho(0),bh=Ho(1),sK=Ho(2),lK=Ho(3),el=Ho(4),cK=Ho(5),uK=Ho(6);Sp.range;bh.range;sK.range;lK.range;el.range;cK.range;uK.range;const B1=sr(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());B1.range;const U1=sr(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());U1.range;const Ji=sr(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());Ji.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(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)});Ji.range;const Zi=sr(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());Zi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(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)});Zi.range;function UI(t,e,r,n,i,a){const o=[[Ao,1,Fi],[Ao,5,5*Fi],[Ao,15,15*Fi],[Ao,30,30*Fi],[a,1,An],[a,5,5*An],[a,15,15*An],[a,30,30*An],[i,1,Hi],[i,3,3*Hi],[i,6,6*Hi],[i,12,12*Hi],[n,1,Yi],[n,2,2*Yi],[r,1,$1],[e,1,ij],[e,3,3*ij],[t,1,K0]];function c(d,p,f){const g=p<d;g&&([d,p]=[p,d]);const v=f&&typeof f.range=="function"?f:u(d,p,f),x=v?v.range(d,+p+1):[];return g?x.reverse():x}function u(d,p,f){const g=Math.abs(p-d)/f,v=S1(([,,b])=>b).right(o,g);if(v===o.length)return t.every(Tx(d/K0,p/K0,f));if(v===0)return yh.every(Math.max(Tx(d,p,f),1));const[x,_]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return x.every(_)}return[c,u]}const[dK,fK]=UI(Zi,U1,Sp,BI,z1,L1),[hK,pK]=UI(Ji,B1,_p,qu,D1,M1);function V0(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 X0(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 vc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function mK(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,c=t.months,u=t.shortMonths,d=bc(i),p=xc(i),f=bc(a),g=xc(a),v=bc(o),x=xc(o),_=bc(c),b=xc(c),S=bc(u),A=xc(u),O={a:te,A:H,b:Q,B:U,c:null,d:uj,e:uj,f:DK,g:VK,G:YK,H:$K,I:MK,j:LK,L:qI,m:zK,M:BK,p:I,q:$,Q:hj,s:pj,S:UK,u:qK,U:FK,V:HK,w:WK,W:GK,x:null,X:null,y:KK,Y:XK,Z:JK,"%":fj},j={a:V,A:oe,b:le,B:ve,c:null,d:dj,e:dj,f:tV,g:dV,G:hV,H:ZK,I:QK,j:eV,L:HI,m:rV,M:nV,p:qe,q:xe,Q:hj,s:pj,S:iV,u:aV,U:oV,V:sV,w:lV,W:cV,x:null,X:null,y:uV,Y:fV,Z:pV,"%":fj},E={a:J,A:F,b:B,B:K,c:W,d:lj,e:lj,f:NK,g:sj,G:oj,H:cj,I:cj,j:AK,L:CK,m:OK,M:TK,p:M,q:EK,Q:RK,s:IK,S:jK,u:xK,U:wK,V:_K,w:bK,W:SK,x:X,X:Y,y:sj,Y:oj,Z:kK,"%":PK};O.x=T(r,O),O.X=T(n,O),O.c=T(e,O),j.x=T(r,j),j.X=T(n,j),j.c=T(e,j);function T(ae,Se){return function(Me){var se=[],tt=-1,Fe=0,kt=ae.length,wt,Et,Sr;for(Me instanceof Date||(Me=new Date(+Me));++tt<kt;)ae.charCodeAt(tt)===37&&(se.push(ae.slice(Fe,tt)),(Et=aj[wt=ae.charAt(++tt)])!=null?wt=ae.charAt(++tt):Et=wt==="e"?" ":"0",(Sr=Se[wt])&&(wt=Sr(Me,Et)),se.push(wt),Fe=tt+1);return se.push(ae.slice(Fe,tt)),se.join("")}}function N(ae,Se){return function(Me){var se=vc(1900,void 0,1),tt=R(se,ae,Me+="",0),Fe,kt;if(tt!=Me.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(Se&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(Fe=X0(vc(se.y,0,1)),kt=Fe.getUTCDay(),Fe=kt>4||kt===0?bh.ceil(Fe):bh(Fe),Fe=wp.offset(Fe,(se.V-1)*7),se.y=Fe.getUTCFullYear(),se.m=Fe.getUTCMonth(),se.d=Fe.getUTCDate()+(se.w+6)%7):(Fe=V0(vc(se.y,0,1)),kt=Fe.getDay(),Fe=kt>4||kt===0?vh.ceil(Fe):vh(Fe),Fe=qu.offset(Fe,(se.V-1)*7),se.y=Fe.getFullYear(),se.m=Fe.getMonth(),se.d=Fe.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),kt="Z"in se?X0(vc(se.y,0,1)).getUTCDay():V0(vc(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(kt+5)%7:se.w+se.U*7-(kt+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,X0(se)):V0(se)}}function R(ae,Se,Me,se){for(var tt=0,Fe=Se.length,kt=Me.length,wt,Et;tt<Fe;){if(se>=kt)return-1;if(wt=Se.charCodeAt(tt++),wt===37){if(wt=Se.charAt(tt++),Et=E[wt in aj?Se.charAt(tt++):wt],!Et||(se=Et(ae,Me,se))<0)return-1}else if(wt!=Me.charCodeAt(se++))return-1}return se}function M(ae,Se,Me){var se=d.exec(Se.slice(Me));return se?(ae.p=p.get(se[0].toLowerCase()),Me+se[0].length):-1}function J(ae,Se,Me){var se=v.exec(Se.slice(Me));return se?(ae.w=x.get(se[0].toLowerCase()),Me+se[0].length):-1}function F(ae,Se,Me){var se=f.exec(Se.slice(Me));return se?(ae.w=g.get(se[0].toLowerCase()),Me+se[0].length):-1}function B(ae,Se,Me){var se=S.exec(Se.slice(Me));return se?(ae.m=A.get(se[0].toLowerCase()),Me+se[0].length):-1}function K(ae,Se,Me){var se=_.exec(Se.slice(Me));return se?(ae.m=b.get(se[0].toLowerCase()),Me+se[0].length):-1}function W(ae,Se,Me){return R(ae,e,Se,Me)}function X(ae,Se,Me){return R(ae,r,Se,Me)}function Y(ae,Se,Me){return R(ae,n,Se,Me)}function te(ae){return o[ae.getDay()]}function H(ae){return a[ae.getDay()]}function Q(ae){return u[ae.getMonth()]}function U(ae){return c[ae.getMonth()]}function I(ae){return i[+(ae.getHours()>=12)]}function $(ae){return 1+~~(ae.getMonth()/3)}function V(ae){return o[ae.getUTCDay()]}function oe(ae){return a[ae.getUTCDay()]}function le(ae){return u[ae.getUTCMonth()]}function ve(ae){return c[ae.getUTCMonth()]}function qe(ae){return i[+(ae.getUTCHours()>=12)]}function xe(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var Se=T(ae+="",O);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=N(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=T(ae+="",j);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=N(ae+="",!0);return Se.toString=function(){return ae},Se}}}var aj={"-":"",_:" ",0:"0"},gr=/^\s*\d+/,gK=/^%/,yK=/[\\^$*+?|[\]().{}]/g;function ft(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 vK(t){return t.replace(yK,"\\$&")}function bc(t){return new RegExp("^(?:"+t.map(vK).join("|")+")","i")}function xc(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function bK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function xK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function wK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function _K(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function SK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function oj(t,e,r){var n=gr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function sj(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function kK(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 EK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function OK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function lj(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function AK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function cj(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function TK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function jK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function CK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function NK(t,e,r){var n=gr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function PK(t,e,r){var n=gK.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function RK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function IK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function uj(t,e){return ft(t.getDate(),e,2)}function $K(t,e){return ft(t.getHours(),e,2)}function MK(t,e){return ft(t.getHours()%12||12,e,2)}function LK(t,e){return ft(1+qu.count(Ji(t),t),e,3)}function qI(t,e){return ft(t.getMilliseconds(),e,3)}function DK(t,e){return qI(t,e)+"000"}function zK(t,e){return ft(t.getMonth()+1,e,2)}function BK(t,e){return ft(t.getMinutes(),e,2)}function UK(t,e){return ft(t.getSeconds(),e,2)}function qK(t){var e=t.getDay();return e===0?7:e}function FK(t,e){return ft(_p.count(Ji(t)-1,t),e,2)}function FI(t){var e=t.getDay();return e>=4||e===0?Qs(t):Qs.ceil(t)}function HK(t,e){return t=FI(t),ft(Qs.count(Ji(t),t)+(Ji(t).getDay()===4),e,2)}function WK(t){return t.getDay()}function GK(t,e){return ft(vh.count(Ji(t)-1,t),e,2)}function KK(t,e){return ft(t.getFullYear()%100,e,2)}function VK(t,e){return t=FI(t),ft(t.getFullYear()%100,e,2)}function XK(t,e){return ft(t.getFullYear()%1e4,e,4)}function YK(t,e){var r=t.getDay();return t=r>=4||r===0?Qs(t):Qs.ceil(t),ft(t.getFullYear()%1e4,e,4)}function JK(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ft(e/60|0,"0",2)+ft(e%60,"0",2)}function dj(t,e){return ft(t.getUTCDate(),e,2)}function ZK(t,e){return ft(t.getUTCHours(),e,2)}function QK(t,e){return ft(t.getUTCHours()%12||12,e,2)}function eV(t,e){return ft(1+wp.count(Zi(t),t),e,3)}function HI(t,e){return ft(t.getUTCMilliseconds(),e,3)}function tV(t,e){return HI(t,e)+"000"}function rV(t,e){return ft(t.getUTCMonth()+1,e,2)}function nV(t,e){return ft(t.getUTCMinutes(),e,2)}function iV(t,e){return ft(t.getUTCSeconds(),e,2)}function aV(t){var e=t.getUTCDay();return e===0?7:e}function oV(t,e){return ft(Sp.count(Zi(t)-1,t),e,2)}function WI(t){var e=t.getUTCDay();return e>=4||e===0?el(t):el.ceil(t)}function sV(t,e){return t=WI(t),ft(el.count(Zi(t),t)+(Zi(t).getUTCDay()===4),e,2)}function lV(t){return t.getUTCDay()}function cV(t,e){return ft(bh.count(Zi(t)-1,t),e,2)}function uV(t,e){return ft(t.getUTCFullYear()%100,e,2)}function dV(t,e){return t=WI(t),ft(t.getUTCFullYear()%100,e,2)}function fV(t,e){return ft(t.getUTCFullYear()%1e4,e,4)}function hV(t,e){var r=t.getUTCDay();return t=r>=4||r===0?el(t):el.ceil(t),ft(t.getUTCFullYear()%1e4,e,4)}function pV(){return"+0000"}function fj(){return"%"}function hj(t){return+t}function pj(t){return Math.floor(+t/1e3)}var Os,GI,KI;mV({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 mV(t){return Os=mK(t),GI=Os.format,Os.parse,KI=Os.utcFormat,Os.utcParse,Os}function gV(t){return new Date(t)}function yV(t){return t instanceof Date?+t:+new Date(+t)}function q1(t,e,r,n,i,a,o,c,u,d){var p=T1(),f=p.invert,g=p.domain,v=d(".%L"),x=d(":%S"),_=d("%I:%M"),b=d("%I %p"),S=d("%a %d"),A=d("%b %d"),O=d("%B"),j=d("%Y");function E(T){return(u(T)<T?v:c(T)<T?x:o(T)<T?_:a(T)<T?b:n(T)<T?i(T)<T?S:A:r(T)<T?O:j)(T)}return p.invert=function(T){return new Date(f(T))},p.domain=function(T){return arguments.length?g(Array.from(T,yV)):g().map(gV)},p.ticks=function(T){var N=g();return t(N[0],N[N.length-1],T??10)},p.tickFormat=function(T,N){return N==null?E:d(N)},p.nice=function(T){var N=g();return(!T||typeof T.range!="function")&&(T=e(N[0],N[N.length-1],T??10)),T?g(RI(N,T)):p},p.copy=function(){return Uu(p,q1(t,e,r,n,i,a,o,c,u,d))},p}function vV(){return Pn.apply(q1(hK,pK,Ji,B1,_p,qu,D1,M1,Ao,GI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function bV(){return Pn.apply(q1(dK,fK,Zi,U1,Sp,wp,z1,L1,Ao,KI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function kp(){var t=0,e=1,r,n,i,a,o=Br,c=!1,u;function d(f){return f==null||isNaN(f=+f)?u:o(i===0?.5:(f=(a(f)-r)*i,c?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(f){return arguments.length?(c=!!f,d):c},d.interpolator=function(f){return arguments.length?(o=f,d):o};function p(f){return function(g){var v,x;return arguments.length?([v,x]=g,o=f(v,x),d):[o(0),o(1)]}}return d.range=p(El),d.rangeRound=p(A1),d.unknown=function(f){return arguments.length?(u=f,d):u},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),d}}function Ka(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function VI(){var t=Ga(kp()(Br));return t.copy=function(){return Ka(t,VI())},ia.apply(t,arguments)}function XI(){var t=N1(kp()).domain([1,10]);return t.copy=function(){return Ka(t,XI()).base(t.base())},ia.apply(t,arguments)}function YI(){var t=P1(kp());return t.copy=function(){return Ka(t,YI()).constant(t.constant())},ia.apply(t,arguments)}function F1(){var t=R1(kp());return t.copy=function(){return Ka(t,F1()).exponent(t.exponent())},ia.apply(t,arguments)}function xV(){return F1.apply(null,arguments).exponent(.5)}function JI(){var t=[],e=Br;function r(n){if(n!=null&&!isNaN(n=+n))return e((zu(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(La),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)=>oG(t,a/n))},r.copy=function(){return JI(e).domain(t)},ia.apply(r,arguments)}function Ep(){var t=0,e=.5,r=1,n=1,i,a,o,c,u,d=Br,p,f=!1,g;function v(_){return isNaN(_=+_)?g:(_=.5+((_=+p(_))-a)*(n*_<n*a?c:u),d(f?Math.max(0,Math.min(1,_)):_))}v.domain=function(_){return arguments.length?([t,e,r]=_,i=p(t=+t),a=p(e=+e),o=p(r=+r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[t,e,r]},v.clamp=function(_){return arguments.length?(f=!!_,v):f},v.interpolator=function(_){return arguments.length?(d=_,v):d};function x(_){return function(b){var S,A,O;return arguments.length?([S,A,O]=b,d=PG(_,[S,A,O]),v):[d(0),d(.5),d(1)]}}return v.range=x(El),v.rangeRound=x(A1),v.unknown=function(_){return arguments.length?(g=_,v):g},function(_){return p=_,i=_(t),a=_(e),o=_(r),c=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function ZI(){var t=Ga(Ep()(Br));return t.copy=function(){return Ka(t,ZI())},ia.apply(t,arguments)}function QI(){var t=N1(Ep()).domain([.1,1,10]);return t.copy=function(){return Ka(t,QI()).base(t.base())},ia.apply(t,arguments)}function e$(){var t=P1(Ep());return t.copy=function(){return Ka(t,e$()).constant(t.constant())},ia.apply(t,arguments)}function H1(){var t=R1(Ep());return t.copy=function(){return Ka(t,H1()).exponent(t.exponent())},ia.apply(t,arguments)}function wV(){return H1.apply(null,arguments).exponent(.5)}const mj=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:tu,scaleDiverging:ZI,scaleDivergingLog:QI,scaleDivergingPow:H1,scaleDivergingSqrt:wV,scaleDivergingSymlog:e$,scaleIdentity:PI,scaleImplicit:jx,scaleLinear:gh,scaleLog:II,scaleOrdinal:k1,scalePoint:Mc,scalePow:I1,scaleQuantile:LI,scaleQuantize:DI,scaleRadial:MI,scaleSequential:VI,scaleSequentialLog:XI,scaleSequentialPow:F1,scaleSequentialQuantile:JI,scaleSequentialSqrt:xV,scaleSequentialSymlog:YI,scaleSqrt:tK,scaleSymlog:$I,scaleThreshold:zI,scaleTime:vV,scaleUtc:bV,tickFormat:NI},Symbol.toStringTag,{value:"Module"}));var Y0,gj;function t$(){if(gj)return Y0;gj=1;var t=wl();function e(r,n,i){for(var a=-1,o=r.length;++a<o;){var c=r[a],u=n(c);if(u!=null&&(d===void 0?u===u&&!t(u):i(u,d)))var d=u,p=c}return p}return Y0=e,Y0}var J0,yj;function _V(){if(yj)return J0;yj=1;function t(e,r){return e>r}return J0=t,J0}var Z0,vj;function SV(){if(vj)return Z0;vj=1;var t=t$(),e=_V(),r=Sl();function n(i){return i&&i.length?t(i,r,e):void 0}return Z0=n,Z0}var kV=SV();const Op=vt(kV);var Q0,bj;function EV(){if(bj)return Q0;bj=1;function t(e,r){return e<r}return Q0=t,Q0}var eb,xj;function OV(){if(xj)return eb;xj=1;var t=t$(),e=EV(),r=Sl();function n(i){return i&&i.length?t(i,r,e):void 0}return eb=n,eb}var AV=OV();const Ap=vt(AV);var tb,wj;function TV(){if(wj)return tb;wj=1;var t=o1(),e=Wa(),r=uI(),n=Zr();function i(a,o){var c=n(a)?t:r;return c(a,e(o,3))}return tb=i,tb}var rb,_j;function jV(){if(_j)return rb;_j=1;var t=lI(),e=TV();function r(n,i){return t(e(n,i),1)}return rb=r,rb}var CV=jV();const NV=vt(CV);var nb,Sj;function PV(){if(Sj)return nb;Sj=1;var t=b1();function e(r,n){return t(r,n)}return nb=e,nb}var RV=PV();const Tp=vt(RV);var Ol=1e9,IV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},G1,$t=!0,Cn="[DecimalError] ",Po=Cn+"Invalid argument: ",W1=Cn+"Exponent out of range: ",Al=Math.floor,_o=Math.pow,$V=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,mr=1e7,Pt=7,r$=9007199254740991,xh=Al(r$/Pt),Te={};Te.absoluteValue=Te.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Te.comparedTo=Te.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};Te.decimalPlaces=Te.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*Pt;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};Te.dividedBy=Te.div=function(t){return Vi(this,new this.constructor(t))};Te.dividedToIntegerBy=Te.idiv=function(t){var e=this,r=e.constructor;return St(Vi(e,new r(t),0,1),r.precision)};Te.equals=Te.eq=function(t){return!this.cmp(t)};Te.exponent=function(){return er(this)};Te.greaterThan=Te.gt=function(t){return this.cmp(t)>0};Te.greaterThanOrEqualTo=Te.gte=function(t){return this.cmp(t)>=0};Te.isInteger=Te.isint=function(){return this.e>this.d.length-2};Te.isNegative=Te.isneg=function(){return this.s<0};Te.isPositive=Te.ispos=function(){return this.s>0};Te.isZero=function(){return this.s===0};Te.lessThan=Te.lt=function(t){return this.cmp(t)<0};Te.lessThanOrEqualTo=Te.lte=function(t){return this.cmp(t)<1};Te.logarithm=Te.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(un))throw Error(Cn+"NaN");if(r.s<1)throw Error(Cn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):($t=!1,e=Vi(ou(r,a),ou(t,a),a),$t=!0,St(e,i))};Te.minus=Te.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?a$(e,t):n$(e,(t.s=-t.s,t))};Te.modulo=Te.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Cn+"NaN");return r.s?($t=!1,e=Vi(r,t,0,1).times(t),$t=!0,r.minus(e)):St(new n(r),i)};Te.naturalExponential=Te.exp=function(){return i$(this)};Te.naturalLogarithm=Te.ln=function(){return ou(this)};Te.negated=Te.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Te.plus=Te.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?n$(e,t):a$(e,(t.s=-t.s,t))};Te.precision=Te.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Po+t);if(e=er(i)+1,n=i.d.length-1,r=n*Pt+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};Te.squareRoot=Te.sqrt=function(){var t,e,r,n,i,a,o,c=this,u=c.constructor;if(c.s<1){if(!c.s)return new u(0);throw Error(Cn+"NaN")}for(t=er(c),$t=!1,i=Math.sqrt(+c),i==0||i==1/0?(e=wi(c.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Al((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 u(e)):n=new u(i.toString()),r=u.precision,i=o=r+3;;)if(a=n,n=a.plus(Vi(c,a,o+2)).times(.5),wi(a.d).slice(0,o)===(e=wi(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(St(a,r+1,0),a.times(a).eq(c)){n=a;break}}else if(e!="9999")break;o+=4}return $t=!0,St(n,r)};Te.times=Te.mul=function(t){var e,r,n,i,a,o,c,u,d,p=this,f=p.constructor,g=p.d,v=(t=new f(t)).d;if(!p.s||!t.s)return new f(0);for(t.s*=p.s,r=p.e+t.e,u=g.length,d=v.length,u<d&&(a=g,g=v,v=a,o=u,u=d,d=o),a=[],o=u+d,n=o;n--;)a.push(0);for(n=d;--n>=0;){for(e=0,i=u+n;i>n;)c=a[i]+v[n]*g[i-n-1]+e,a[i--]=c%mr|0,e=c/mr|0;a[i]=(a[i]+e)%mr|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,$t?St(t,f.precision):t};Te.toDecimalPlaces=Te.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ei(t,0,Ol),e===void 0?e=n.rounding:Ei(e,0,8),St(r,t+er(r)+1,e))};Te.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Mo(n,!0):(Ei(t,0,Ol),e===void 0?e=i.rounding:Ei(e,0,8),n=St(new i(n),t+1,e),r=Mo(n,!0,t+1)),r};Te.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?Mo(i):(Ei(t,0,Ol),e===void 0?e=a.rounding:Ei(e,0,8),n=St(new a(i),t+er(i)+1,e),r=Mo(n.abs(),!1,t+er(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Te.toInteger=Te.toint=function(){var t=this,e=t.constructor;return St(new e(t),er(t)+1,e.rounding)};Te.toNumber=function(){return+this};Te.toPower=Te.pow=function(t){var e,r,n,i,a,o,c=this,u=c.constructor,d=12,p=+(t=new u(t));if(!t.s)return new u(un);if(c=new u(c),!c.s){if(t.s<1)throw Error(Cn+"Infinity");return c}if(c.eq(un))return c;if(n=u.precision,t.eq(un))return St(c,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=c.s,o){if((r=p<0?-p:p)<=r$){for(i=new u(un),e=Math.ceil(n/Pt+4),$t=!1;r%2&&(i=i.times(c),Ej(i.d,e)),r=Al(r/2),r!==0;)c=c.times(c),Ej(c.d,e);return $t=!0,t.s<0?new u(un).div(i):St(i,n)}}else if(a<0)throw Error(Cn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,c.s=1,$t=!1,i=t.times(ou(c,n+d)),$t=!0,i=i$(i),i.s=a,i};Te.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=er(i),n=Mo(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ei(t,1,Ol),e===void 0?e=a.rounding:Ei(e,0,8),i=St(new a(i),t,e),r=er(i),n=Mo(i,t<=r||r<=a.toExpNeg,t)),n};Te.toSignificantDigits=Te.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Ei(t,1,Ol),e===void 0?e=n.rounding:Ei(e,0,8)),St(new n(r),t,e)};Te.toString=Te.valueOf=Te.val=Te.toJSON=Te[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=er(t),r=t.constructor;return Mo(t,e<=r.toExpNeg||e>=r.toExpPos)};function n$(t,e){var r,n,i,a,o,c,u,d,p=t.constructor,f=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),$t?St(e,f):e;if(u=t.d,d=e.d,o=t.e,i=e.e,u=u.slice(),a=o-i,a){for(a<0?(n=u,a=-a,c=d.length):(n=d,i=o,c=u.length),o=Math.ceil(f/Pt),c=o>c?o+1:c+1,a>c&&(a=c,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(c=u.length,a=d.length,c-a<0&&(a=c,n=d,d=u,u=n),r=0;a;)r=(u[--a]=u[a]+d[a]+r)/mr|0,u[a]%=mr;for(r&&(u.unshift(r),++i),c=u.length;u[--c]==0;)u.pop();return e.d=u,e.e=i,$t?St(e,f):e}function Ei(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Po+t)}function wi(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=Pt-n.length,r&&(a+=ja(r)),a+=n;o=t[e],n=o+"",r=Pt-n.length,r&&(a+=ja(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Vi=(function(){function t(n,i){var a,o=0,c=n.length;for(n=n.slice();c--;)a=n[c]*i+o,n[c]=a%mr|0,o=a/mr|0;return o&&n.unshift(o),n}function e(n,i,a,o){var c,u;if(a!=o)u=a>o?1:-1;else for(c=u=0;c<a;c++)if(n[c]!=i[c]){u=n[c]>i[c]?1:-1;break}return u}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*mr+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var c,u,d,p,f,g,v,x,_,b,S,A,O,j,E,T,N,R,M=n.constructor,J=n.s==i.s?1:-1,F=n.d,B=i.d;if(!n.s)return new M(n);if(!i.s)throw Error(Cn+"Division by zero");for(u=n.e-i.e,N=B.length,E=F.length,v=new M(J),x=v.d=[],d=0;B[d]==(F[d]||0);)++d;if(B[d]>(F[d]||0)&&--u,a==null?A=a=M.precision:o?A=a+(er(n)-er(i))+1:A=a,A<0)return new M(0);if(A=A/Pt+2|0,d=0,N==1)for(p=0,B=B[0],A++;(d<E||p)&&A--;d++)O=p*mr+(F[d]||0),x[d]=O/B|0,p=O%B|0;else{for(p=mr/(B[0]+1)|0,p>1&&(B=t(B,p),F=t(F,p),N=B.length,E=F.length),j=N,_=F.slice(0,N),b=_.length;b<N;)_[b++]=0;R=B.slice(),R.unshift(0),T=B[0],B[1]>=mr/2&&++T;do p=0,c=e(B,_,N,b),c<0?(S=_[0],N!=b&&(S=S*mr+(_[1]||0)),p=S/T|0,p>1?(p>=mr&&(p=mr-1),f=t(B,p),g=f.length,b=_.length,c=e(f,_,g,b),c==1&&(p--,r(f,N<g?R:B,g))):(p==0&&(c=p=1),f=B.slice()),g=f.length,g<b&&f.unshift(0),r(_,f,b),c==-1&&(b=_.length,c=e(B,_,N,b),c<1&&(p++,r(_,N<b?R:B,b))),b=_.length):c===0&&(p++,_=[0]),x[d++]=p,c&&_[0]?_[b++]=F[j]||0:(_=[F[j]],b=1);while((j++<E||_[0]!==void 0)&&A--)}return x[0]||x.shift(),v.e=u,St(v,o?a+er(v)+1:a)}})();function i$(t,e){var r,n,i,a,o,c,u=0,d=0,p=t.constructor,f=p.precision;if(er(t)>16)throw Error(W1+er(t));if(!t.s)return new p(un);for($t=!1,c=f,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(_o(2,d))/Math.LN10*2+5|0,c+=n,r=i=a=new p(un),p.precision=c;;){if(i=St(i.times(t),c),r=r.times(++u),o=a.plus(Vi(i,r,c)),wi(o.d).slice(0,c)===wi(a.d).slice(0,c)){for(;d--;)a=St(a.times(a),c);return p.precision=f,e==null?($t=!0,St(a,f)):a}a=o}}function er(t){for(var e=t.e*Pt,r=t.d[0];r>=10;r/=10)e++;return e}function ib(t,e,r){if(e>t.LN10.sd())throw $t=!0,r&&(t.precision=r),Error(Cn+"LN10 precision limit exceeded");return St(new t(t.LN10),e)}function ja(t){for(var e="";t--;)e+="0";return e}function ou(t,e){var r,n,i,a,o,c,u,d,p,f=1,g=10,v=t,x=v.d,_=v.constructor,b=_.precision;if(v.s<1)throw Error(Cn+(v.s?"NaN":"-Infinity"));if(v.eq(un))return new _(0);if(e==null?($t=!1,d=b):d=e,v.eq(10))return e==null&&($t=!0),ib(_,d);if(d+=g,_.precision=d,r=wi(x),n=r.charAt(0),a=er(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(t),r=wi(v.d),n=r.charAt(0),f++;a=er(v),n>1?(v=new _("0."+r),a++):v=new _(n+"."+r.slice(1))}else return u=ib(_,d+2,b).times(a+""),v=ou(new _(n+"."+r.slice(1)),d-g).plus(u),_.precision=b,e==null?($t=!0,St(v,b)):v;for(c=o=v=Vi(v.minus(un),v.plus(un),d),p=St(v.times(v),d),i=3;;){if(o=St(o.times(p),d),u=c.plus(Vi(o,new _(i),d)),wi(u.d).slice(0,d)===wi(c.d).slice(0,d))return c=c.times(2),a!==0&&(c=c.plus(ib(_,d+2,b).times(a+""))),c=Vi(c,new _(f),d),_.precision=b,e==null?($t=!0,St(c,b)):c;c=u,i+=2}}function kj(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=Al(r/Pt),t.d=[],n=(r+1)%Pt,r<0&&(n+=Pt),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Pt;n<i;)t.d.push(+e.slice(n,n+=Pt));e=e.slice(n),n=Pt-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),$t&&(t.e>xh||t.e<-xh))throw Error(W1+r)}else t.s=0,t.e=0,t.d=[0];return t}function St(t,e,r){var n,i,a,o,c,u,d,p,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Pt,i=e,d=f[p=0];else{if(p=Math.ceil((n+1)/Pt),a=f.length,p>=a)return t;for(d=a=f[p],o=1;a>=10;a/=10)o++;n%=Pt,i=n-Pt+o}if(r!==void 0&&(a=_o(10,o-i-1),c=d/a%10|0,u=e<0||f[p+1]!==void 0||d%a,u=r<4?(c||u)&&(r==0||r==(t.s<0?3:2)):c>5||c==5&&(r==4||u||r==6&&(n>0?i>0?d/_o(10,o-i):0:f[p-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return u?(a=er(t),f.length=1,e=e-a-1,f[0]=_o(10,(Pt-e%Pt)%Pt),t.e=Al(-e/Pt)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=p,a=1,p--):(f.length=p+1,a=_o(10,Pt-n),f[p]=i>0?(d/_o(10,o-i)%_o(10,i)|0)*a:0),u)for(;;)if(p==0){(f[0]+=a)==mr&&(f[0]=1,++t.e);break}else{if(f[p]+=a,f[p]!=mr)break;f[p--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if($t&&(t.e>xh||t.e<-xh))throw Error(W1+er(t));return t}function a$(t,e){var r,n,i,a,o,c,u,d,p,f,g=t.constructor,v=g.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new g(t),$t?St(e,v):e;if(u=t.d,f=e.d,n=e.e,d=t.e,u=u.slice(),o=d-n,o){for(p=o<0,p?(r=u,o=-o,c=f.length):(r=f,n=d,c=u.length),i=Math.max(Math.ceil(v/Pt),c)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=u.length,c=f.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(u[i]!=f[i]){p=u[i]<f[i];break}o=0}for(p&&(r=u,u=f,f=r,e.s=-e.s),c=u.length,i=f.length-c;i>0;--i)u[c++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(a=i;a&&u[--a]===0;)u[a]=mr-1;--u[a],u[i]+=mr}u[i]-=f[i]}for(;u[--c]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,$t?St(e,v):e):new g(0)}function Mo(t,e,r){var n,i=er(t),a=wi(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+ja(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ja(-i-1)+a,r&&(n=r-o)>0&&(a+=ja(n))):i>=o?(a+=ja(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ja(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=ja(n))),t.s<0?"-"+a:a}function Ej(t,e){if(t.length>e)return t.length=e,!0}function o$(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(Po+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 kj(o,a.toString())}else if(typeof a!="string")throw Error(Po+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,$V.test(a))kj(o,a);else throw Error(Po+a)}if(i.prototype=Te,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=o$,i.config=i.set=MV,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 MV(t){if(!t||typeof t!="object")throw Error(Cn+"Object expected");var e,r,n,i=["precision",1,Ol,"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(Al(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Po+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Po+r+": "+n);return this}var G1=o$(IV);un=new G1(1);const xt=G1;function LV(t){return UV(t)||BV(t)||zV(t)||DV()}function DV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
454
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zV(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 BV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function UV(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 qV=function(e){return e},s$={},l$=function(e){return e===s$},Oj=function(e){return function r(){return arguments.length===0||arguments.length===1&&l$(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},FV=function t(e,r){return e===1?r:Oj(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(c){return c!==s$}).length;return o>=e?r.apply(void 0,i):t(e-o,Oj(function(){for(var c=arguments.length,u=new Array(c),d=0;d<c;d++)u[d]=arguments[d];var p=i.map(function(f){return l$(f)?u.shift():f});return r.apply(void 0,LV(p).concat(u))}))})},jp=function(e){return FV(e.length,e)},Ix=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},HV=jp(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),WV=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return qV;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(c,u){return u(c)},a.apply(void 0,arguments))}},$x=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},c$=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(c,u){return c===r[u]})||(r=a,n=e.apply(void 0,a)),n}};function GV(t){var e;return t===0?e=1:e=Math.floor(new xt(t).abs().log(10).toNumber())+1,e}function KV(t,e,r){for(var n=new xt(t),i=0,a=[];n.lt(e)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var VV=jp(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),XV=jp(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),YV=jp(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const Cp={rangeStep:KV,getDigitCount:GV,interpolateNumber:VV,uninterpolateNumber:XV,uninterpolateTruncation:YV};function Mx(t){return QV(t)||ZV(t)||u$(t)||JV()}function JV(){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 ZV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function QV(t){if(Array.isArray(t))return Lx(t)}function su(t,e){return rX(t)||tX(t,e)||u$(t,e)||eX()}function eX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
456
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u$(t,e){if(t){if(typeof t=="string")return Lx(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 Lx(t,e)}}function Lx(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 tX(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](),c;!(n=(c=o.next()).done)&&(r.push(c.value),!(e&&r.length===e));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function rX(t){if(Array.isArray(t))return t}function d$(t){var e=su(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function f$(t,e,r){if(t.lte(0))return new xt(0);var n=Cp.getDigitCount(t.toNumber()),i=new xt(10).pow(n),a=t.div(i),o=n!==1?.05:.1,c=new xt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),u=c.mul(i);return e?u:new xt(Math.ceil(u))}function nX(t,e,r){var n=1,i=new xt(t);if(!i.isint()&&r){var a=Math.abs(t);a<1?(n=new xt(10).pow(Cp.getDigitCount(t)-1),i=new xt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new xt(Math.floor(t)))}else t===0?i=new xt(Math.floor((e-1)/2)):r||(i=new xt(Math.floor(t)));var o=Math.floor((e-1)/2),c=WV(HV(function(u){return i.add(new xt(u-o).mul(n)).toNumber()}),Ix);return c(0,e)}function h$(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 xt(0),tickMin:new xt(0),tickMax:new xt(0)};var a=f$(new xt(e).sub(t).div(r-1),n,i),o;t<=0&&e>=0?o=new xt(0):(o=new xt(t).add(e).div(2),o=o.sub(new xt(o).mod(a)));var c=Math.ceil(o.sub(t).div(a).toNumber()),u=Math.ceil(new xt(e).sub(o).div(a).toNumber()),d=c+u+1;return d>r?h$(t,e,r,n,i+1):(d<r&&(u=e>0?u+(r-d):u,c=e>0?c:c+(r-d)),{step:a,tickMin:o.sub(new xt(c).mul(a)),tickMax:o.add(new xt(u).mul(a))})}function iX(t){var e=su(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),c=d$([r,n]),u=su(c,2),d=u[0],p=u[1];if(d===-1/0||p===1/0){var f=p===1/0?[d].concat(Mx(Ix(0,i-1).map(function(){return 1/0}))):[].concat(Mx(Ix(0,i-1).map(function(){return-1/0})),[p]);return r>n?$x(f):f}if(d===p)return nX(d,i,a);var g=h$(d,p,o,a),v=g.step,x=g.tickMin,_=g.tickMax,b=Cp.rangeStep(x,_.add(new xt(.1).mul(v)),v);return r>n?$x(b):b}function aX(t,e){var r=su(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=d$([n,i]),c=su(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0)return[n,i];if(u===d)return[u];var p=Math.max(e,2),f=f$(new xt(d).sub(u).div(p-1),a,0),g=[].concat(Mx(Cp.rangeStep(new xt(u),new xt(d).sub(new xt(.99).mul(f)),f)),[d]);return n>i?$x(g):g}var oX=c$(iX),sX=c$(aX),lX="Invariant failed";function Lo(t,e){throw new Error(lX)}var cX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function tl(t){"@babel/helpers - typeof";return tl=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},tl(t)}function wh(){return wh=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},wh.apply(this,arguments)}function uX(t,e){return pX(t)||hX(t,e)||fX(t,e)||dX()}function dX(){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 fX(t,e){if(t){if(typeof t=="string")return Aj(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 Aj(t,e)}}function Aj(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 hX(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function pX(t){if(Array.isArray(t))return t}function mX(t,e){if(t==null)return{};var r=gX(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 gX(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 yX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vX(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,g$(n.key),n)}}function bX(t,e,r){return e&&vX(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xX(t,e,r){return e=_h(e),wX(t,p$()?Reflect.construct(e,r||[],_h(t).constructor):e.apply(t,r))}function wX(t,e){if(e&&(tl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _X(t)}function _X(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p$=function(){return!!t})()}function _h(t){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_h(t)}function SX(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 m$(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=kX(t,"string");return tl(e)=="symbol"?e:e+""}function kX(t,e){if(tl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Fu=(function(t){function e(){return yX(this,e),xX(this,e,arguments)}return SX(e,t),bX(e,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,c=n.dataKey,u=n.data,d=n.dataPointFormatter,p=n.xAxis,f=n.yAxis,g=mX(n,cX),v=it(g,!1);this.props.direction==="x"&&p.type!=="number"&&Lo();var x=u.map(function(_){var b=d(_,c),S=b.x,A=b.y,O=b.value,j=b.errorVal;if(!j)return null;var E=[],T,N;if(Array.isArray(j)){var R=uX(j,2);T=R[0],N=R[1]}else T=N=j;if(a==="vertical"){var M=p.scale,J=A+i,F=J+o,B=J-o,K=M(O-T),W=M(O+N);E.push({x1:W,y1:F,x2:W,y2:B}),E.push({x1:K,y1:J,x2:W,y2:J}),E.push({x1:K,y1:F,x2:K,y2:B})}else if(a==="horizontal"){var X=f.scale,Y=S+i,te=Y-o,H=Y+o,Q=X(O-T),U=X(O+N);E.push({x1:te,y1:U,x2:H,y2:U}),E.push({x1:Y,y1:Q,x2:Y,y2:U}),E.push({x1:te,y1:Q,x2:H,y2:Q})}return L.createElement(Xt,wh({className:"recharts-errorBar",key:"bar-".concat(E.map(function(I){return"".concat(I.x1,"-").concat(I.x2,"-").concat(I.y1,"-").concat(I.y2)}))},v),E.map(function(I){return L.createElement("line",wh({},I,{key:"line-".concat(I.x1,"-").concat(I.x2,"-").concat(I.y1,"-").concat(I.y2)}))}))});return L.createElement(Xt,{className:"recharts-errorBars"},x)}}])})(L.Component);m$(Fu,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});m$(Fu,"displayName","ErrorBar");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 Tj(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 bo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tj(Object(r),!0).forEach(function(n){EX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function EX(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=AX(t,"string");return lu(e)=="symbol"?e:e+""}function AX(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)}var y$=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=sn(r,qs);if(!o)return null;var c=qs.defaultProps,u=c!==void 0?bo(bo({},c),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:a==="children"?d=(n||[]).reduce(function(p,f){var g=f.item,v=f.props,x=v.sectors||v.data||[];return p.concat(x.map(function(_){return{type:o.props.iconType||g.props.legendType,value:_.name,color:_.fill,payload:_}}))},[]):d=(n||[]).map(function(p){var f=p.item,g=f.type.defaultProps,v=g!==void 0?bo(bo({},g),f.props):{},x=v.dataKey,_=v.name,b=v.legendType,S=v.hide;return{inactive:S,dataKey:x,type:u.iconType||b||"square",color:K1(f),value:_||x,payload:v}}),bo(bo(bo({},u),qs.getWithHeight(o,i)),{},{payload:d,item:o})};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 jj(t){return NX(t)||CX(t)||jX(t)||TX()}function TX(){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 jX(t,e){if(t){if(typeof t=="string")return zx(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 zx(t,e)}}function CX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function NX(t){if(Array.isArray(t))return zx(t)}function zx(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 Cj(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 Wt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cj(Object(r),!0).forEach(function(n){Hs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hs(t,e,r){return e=PX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PX(t){var e=RX(t,"string");return cu(e)=="symbol"?e:e+""}function RX(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 dn(t,e,r){return et(t)||et(e)?r:or(e)?Tn(t,e,r):Je(e)?e(t):r}function Lc(t,e,r,n){var i=NV(t,function(c){return dn(c,e)});if(r==="number"){var a=i.filter(function(c){return ge(c)||parseFloat(c)});return a.length?[Ap(a),Op(a)]:[1/0,-1/0]}var o=n?i.filter(function(c){return!et(c)}):i;return o.map(function(c){return or(c)||c instanceof Date?c:""})}var IX=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,c=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(c<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var u=a.range,d=0;d<c;d++){var p=d>0?i[d-1].coordinate:i[c-1].coordinate,f=i[d].coordinate,g=d>=c-1?i[0].coordinate:i[d+1].coordinate,v=void 0;if(Jn(f-p)!==Jn(g-f)){var x=[];if(Jn(g-f)===Jn(u[1]-u[0])){v=g;var _=f+u[1]-u[0];x[0]=Math.min(_,(_+p)/2),x[1]=Math.max(_,(_+p)/2)}else{v=p;var b=g+u[1]-u[0];x[0]=Math.min(f,(b+f)/2),x[1]=Math.max(f,(b+f)/2)}var S=[Math.min(f,(v+f)/2),Math.max(f,(v+f)/2)];if(e>S[0]&&e<=S[1]||e>=x[0]&&e<=x[1]){o=i[d].index;break}}else{var A=Math.min(p,g),O=Math.max(p,g);if(e>(A+f)/2&&e<=(O+f)/2){o=i[d].index;break}}}else for(var j=0;j<c;j++)if(j===0&&e<=(n[j].coordinate+n[j+1].coordinate)/2||j>0&&j<c-1&&e>(n[j].coordinate+n[j-1].coordinate)/2&&e<=(n[j].coordinate+n[j+1].coordinate)/2||j===c-1&&e>(n[j].coordinate+n[j-1].coordinate)/2){o=n[j].index;break}return o},K1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Wt(Wt({},e.type.defaultProps),e.props):e.props,o=a.stroke,c=a.fill,u;switch(i){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:c;break;default:u=c;break}return u},$X=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},c=Object.keys(a),u=0,d=c.length;u<d;u++)for(var p=a[c[u]].stackGroups,f=Object.keys(p),g=0,v=f.length;g<v;g++){var x=p[f[g]],_=x.items,b=x.cateAxisId,S=_.filter(function(N){return Gi(N.type).indexOf("Bar")>=0});if(S&&S.length){var A=S[0].type.defaultProps,O=A!==void 0?Wt(Wt({},A),S[0].props):S[0].props,j=O.barSize,E=O[b];o[E]||(o[E]=[]);var T=et(j)?r:j;o[E].push({item:S[0],stackList:S.slice(1),barSize:et(T)?void 0:$o(T,n,0)})}}return o},MX=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,c=e.maxBarSize,u=o.length;if(u<1)return null;var d=$o(r,i,0,!0),p,f=[];if(o[0].barSize===+o[0].barSize){var g=!1,v=i/u,x=o.reduce(function(j,E){return j+E.barSize||0},0);x+=(u-1)*d,x>=i&&(x-=(u-1)*d,d=0),x>=i&&v>0&&(g=!0,v*=.9,x=u*v);var _=(i-x)/2>>0,b={offset:_-d,size:0};p=o.reduce(function(j,E){var T={item:E.item,position:{offset:b.offset+b.size+d,size:g?v:E.barSize}},N=[].concat(jj(j),[T]);return b=N[N.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:b})}),N},f)}else{var S=$o(n,i,0,!0);i-2*S-(u-1)*d<=0&&(d=0);var A=(i-2*S-(u-1)*d)/u;A>1&&(A>>=0);var O=c===+c?Math.min(A,c):A;p=o.reduce(function(j,E,T){var N=[].concat(jj(j),[{item:E.item,position:{offset:S+(A+d)*T+(A-O)/2,size:O}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){N.push({item:R,position:N[N.length-1].position})}),N},f)}return p},LX=function(e,r,n,i){var a=n.children,o=n.width,c=n.margin,u=o-(c.left||0)-(c.right||0),d=y$({children:a,legendWidth:u});if(d){var p=i||{},f=p.width,g=p.height,v=d.align,x=d.verticalAlign,_=d.layout;if((_==="vertical"||_==="horizontal"&&x==="middle")&&v!=="center"&&ge(e[v]))return Wt(Wt({},e),{},Hs({},v,e[v]+(f||0)));if((_==="horizontal"||_==="vertical"&&v==="center")&&x!=="middle"&&ge(e[x]))return Wt(Wt({},e),{},Hs({},x,e[x]+(g||0)))}return e},DX=function(e,r,n){return et(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},v$=function(e,r,n,i,a){var o=r.props.children,c=jn(o,Fu).filter(function(d){return DX(i,a,d.props.direction)});if(c&&c.length){var u=c.map(function(d){return d.props.dataKey});return e.reduce(function(d,p){var f=dn(p,n);if(et(f))return d;var g=Array.isArray(f)?[Ap(f),Op(f)]:[f,f],v=u.reduce(function(x,_){var b=dn(p,_,0),S=g[0]-Math.abs(Array.isArray(b)?b[0]:b),A=g[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(S,x[0]),Math.max(A,x[1])]},[1/0,-1/0]);return[Math.min(v[0],d[0]),Math.max(v[1],d[1])]},[1/0,-1/0])}return null},zX=function(e,r,n,i,a){var o=r.map(function(c){return v$(e,c,n,a,i)}).filter(function(c){return!et(c)});return o&&o.length?o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]):null},b$=function(e,r,n,i,a){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&v$(e,u,d,i)||Lc(e,d,n,a)});if(n==="number")return o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);var c={};return o.reduce(function(u,d){for(var p=0,f=d.length;p<f;p++)c[d[p]]||(c[d[p]]=!0,u.push(d[p]));return u},[])},x$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},w$=function(e,r,n,i){if(i)return e.map(function(u){return u.coordinate});var a,o,c=e.map(function(u){return u.coordinate===r&&(a=!0),u.coordinate===n&&(o=!0),u.coordinate});return a||c.push(r),o||c.push(n),c},Wi=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,c=e.range,u=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,d=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/u:0;if(d=e.axisType==="angleAxis"&&(c==null?void 0:c.length)>=2?Jn(c[0]-c[1])*2*d:d,r&&(e.ticks||e.niceTicks)){var p=(e.ticks||e.niceTicks).map(function(f){var g=a?a.indexOf(f):f;return{coordinate:i(g)+d,value:f,offset:d}});return p.filter(function(f){return!Mu(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,g){return{coordinate:i(f)+d,value:f,index:g,offset:d}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+d,value:f,offset:d}}):i.domain().map(function(f,g){return{coordinate:i(f)+d,value:a?a[f]:f,index:g,offset:d}})},ab=new WeakMap,wf=function(e,r){if(typeof r!="function")return e;ab.has(e)||ab.set(e,new WeakMap);var n=ab.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},BX=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,c=e.axisType;if(i==="auto")return o==="radial"&&c==="radiusAxis"?{scale:tu(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:gh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Mc(),realScaleType:"point"}:a==="category"?{scale:tu(),realScaleType:"band"}:{scale:gh(),realScaleType:"linear"};if(Io(i)){var u="scale".concat(hp(i));return{scale:(mj[u]||Mc)(),realScaleType:mj[u]?u:"point"}}return Je(i)?{scale:i}:{scale:Mc(),realScaleType:"point"}},Nj=1e-4,UX=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])-Nj,o=Math.max(i[0],i[1])+Nj,c=e(r[0]),u=e(r[n-1]);(c<a||c>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},qX=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},FX=function(e,r){if(!r||r.length!==2||!ge(r[0])||!ge(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(!ge(e[0])||e[0]<n)&&(a[0]=n),(!ge(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},HX=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,c=0;c<r;++c){var u=Mu(e[c][n][1])?e[c][n][0]:e[c][n][1];u>=0?(e[c][n][0]=a,e[c][n][1]=a+u,a=e[c][n][1]):(e[c][n][0]=o,e[c][n][1]=o+u,o=e[c][n][1])}},WX=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 c=Mu(e[o][n][1])?e[o][n][0]:e[o][n][1];c>=0?(e[o][n][0]=a,e[o][n][1]=a+c,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},GX={sign:HX,expand:jF,none:Ks,silhouette:CF,wiggle:NF,positive:WX},KX=function(e,r,n){var i=r.map(function(c){return c.props.dataKey}),a=GX[n],o=TF().keys(i).value(function(c,u){return+dn(c,u,0)}).order(mx).offset(a);return o(e)},VX=function(e,r,n,i,a,o){if(!e)return null;var c=o?r.reverse():r,u={},d=c.reduce(function(f,g){var v,x=(v=g.type)!==null&&v!==void 0&&v.defaultProps?Wt(Wt({},g.type.defaultProps),g.props):g.props,_=x.stackId,b=x.hide;if(b)return f;var S=x[n],A=f[S]||{hasStack:!1,stackGroups:{}};if(or(_)){var O=A.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};O.items.push(g),A.hasStack=!0,A.stackGroups[_]=O}else A.stackGroups[Lu("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[g]};return Wt(Wt({},f),{},Hs({},S,A))},u),p={};return Object.keys(d).reduce(function(f,g){var v=d[g];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(_,b){var S=v.stackGroups[b];return Wt(Wt({},_),{},Hs({},b,{numericAxisId:n,cateAxisId:i,items:S.items,stackedData:KX(e,S.items,a)}))},x)}return Wt(Wt({},f),{},Hs({},g,v))},p)},XX=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,c=r.allowDecimals,u=n||r.scale;if(u!=="auto"&&u!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=e.domain();if(!d.length)return null;var p=oX(d,a,c);return e.domain([Ap(p),Op(p)]),{niceTicks:p}}if(a&&i==="number"){var f=e.domain(),g=sX(f,a,c);return{niceTicks:g}}return null};function Pj(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&&!et(i[e.dataKey])){var c=Vf(r,"value",i[e.dataKey]);if(c)return c.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var u=dn(i,et(o)?e.dataKey:o);return et(u)?null:e.scale(u)}var Rj=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,c=e.index;if(r.type==="category")return n[c]?n[c].coordinate+i:null;var u=dn(o,r.dataKey,r.domain[c]);return et(u)?null:r.scale(u)-a/2+i},YX=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]},JX=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Wt(Wt({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(or(a)){var o=r[a];if(o){var c=o.items.indexOf(e);return c>=0?o.stackedData[c]:null}}return null},ZX=function(e){return e.reduce(function(r,n){return[Ap(n.concat([r[0]]).filter(ge)),Op(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},_$=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],c=o.stackedData,u=c.reduce(function(d,p){var f=ZX(p.slice(r,n+1));return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},Ij=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$j=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Bx=function(e,r,n){if(Je(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(ge(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(Ij.test(e[0])){var a=+Ij.exec(e[0])[1];i[0]=r[0]-a}else Je(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(ge(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if($j.test(e[1])){var o=+$j.exec(e[1])[1];i[1]=r[1]+o}else Je(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Sh=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=w1(r,function(f){return f.coordinate}),o=1/0,c=1,u=a.length;c<u;c++){var d=a[c],p=a[c-1];o=Math.min((d.coordinate||0)-(p.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},Mj=function(e,r,n){return!e||!e.length||Tp(e,Tn(n,"type.defaultProps.domain"))?r:e},S$=function(e,r){var n=e.type.defaultProps?Wt(Wt({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,c=n.formatter,u=n.tooltipType,d=n.chartType,p=n.hide;return Wt(Wt({},it(e,!1)),{},{dataKey:i,unit:o,formatter:c,name:a||i,color:K1(e),value:dn(r,i),type:u,payload:r,chartType:d,hide:p})};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 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 Dj(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){QX(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 QX(t,e,r){return e=eY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eY(t){var e=tY(t,"string");return uu(e)=="symbol"?e:e+""}function tY(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(e==="string"?String:Number)(t)}var kh=Math.PI/180,rY=function(e){return e*180/Math.PI},_r=function(e,r,n,i){return{x:e+Math.cos(-kh*i)*n,y:r+Math.sin(-kh*i)*n}},nY=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))},iY=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,c=nY({x:n,y:i},{x:a,y:o});if(c<=0)return{radius:c};var u=(n-a)/c,d=Math.acos(u);return i>o&&(d=2*Math.PI-d),{radius:c,angle:rY(d),angleInRadian:d}},aY=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}},oY=function(e,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),c=Math.min(a,o);return e+c*360},zj=function(e,r){var n=e.x,i=e.y,a=iY({x:n,y:i},r),o=a.radius,c=a.angle,u=r.innerRadius,d=r.outerRadius;if(o<u||o>d)return!1;if(o===0)return!0;var p=aY(r),f=p.startAngle,g=p.endAngle,v=c,x;if(f<=g){for(;v>g;)v-=360;for(;v<f;)v+=360;x=v>=f&&v<=g}else{for(;v>f;)v-=360;for(;v<g;)v+=360;x=v>=g&&v<=f}return x?Dj(Dj({},r),{},{radius:o,angle:oY(v,r)}):null};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)}var sY=["offset"];function lY(t){return fY(t)||dY(t)||uY(t)||cY()}function cY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uY(t,e){if(t){if(typeof t=="string")return Ux(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 Ux(t,e)}}function dY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function fY(t){if(Array.isArray(t))return Ux(t)}function Ux(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 hY(t,e){if(t==null)return{};var r=pY(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 pY(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 Bj(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 ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Bj(Object(r),!0).forEach(function(n){mY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mY(t,e,r){return e=gY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gY(t){var e=yY(t,"string");return du(e)=="symbol"?e:e+""}function yY(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 fu(){return fu=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},fu.apply(this,arguments)}var vY=function(e){var r=e.value,n=e.formatter,i=et(e.children)?r:e.children;return Je(n)?n(i):i},bY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},xY=function(e,r,n){var i=e.position,a=e.viewBox,o=e.offset,c=e.className,u=a,d=u.cx,p=u.cy,f=u.innerRadius,g=u.outerRadius,v=u.startAngle,x=u.endAngle,_=u.clockWise,b=(f+g)/2,S=bY(v,x),A=S>=0?1:-1,O,j;i==="insideStart"?(O=v+A*o,j=_):i==="insideEnd"?(O=x-A*o,j=!_):i==="end"&&(O=x+A*o,j=_),j=S<=0?j:!j;var E=_r(d,p,b,O),T=_r(d,p,b,O+(j?1:-1)*359),N="M".concat(E.x,",").concat(E.y,`
|
|
460
|
+
A`).concat(b,",").concat(b,",0,1,").concat(j?0:1,`,
|
|
461
|
+
`).concat(T.x,",").concat(T.y),R=et(e.id)?Lu("recharts-radial-line-"):e.id;return L.createElement("text",fu({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",c)}),L.createElement("defs",null,L.createElement("path",{id:R,d:N})),L.createElement("textPath",{xlinkHref:"#".concat(R)},r))},wY=function(e){var r=e.viewBox,n=e.offset,i=e.position,a=r,o=a.cx,c=a.cy,u=a.innerRadius,d=a.outerRadius,p=a.startAngle,f=a.endAngle,g=(p+f)/2;if(i==="outside"){var v=_r(o,c,d+n,g),x=v.x,_=v.y;return{x,y:_,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var b=(u+d)/2,S=_r(o,c,b,g),A=S.x,O=S.y;return{x:A,y:O,textAnchor:"middle",verticalAnchor:"middle"}},_Y=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,a=e.position,o=r,c=o.x,u=o.y,d=o.width,p=o.height,f=p>=0?1:-1,g=f*i,v=f>0?"end":"start",x=f>0?"start":"end",_=d>=0?1:-1,b=_*i,S=_>0?"end":"start",A=_>0?"start":"end";if(a==="top"){var O={x:c+d/2,y:u-f*i,textAnchor:"middle",verticalAnchor:v};return ar(ar({},O),n?{height:Math.max(u-n.y,0),width:d}:{})}if(a==="bottom"){var j={x:c+d/2,y:u+p+g,textAnchor:"middle",verticalAnchor:x};return ar(ar({},j),n?{height:Math.max(n.y+n.height-(u+p),0),width:d}:{})}if(a==="left"){var E={x:c-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"};return ar(ar({},E),n?{width:Math.max(E.x-n.x,0),height:p}:{})}if(a==="right"){var T={x:c+d+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"};return ar(ar({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:p}:{})}var N=n?{width:d,height:p}:{};return a==="insideLeft"?ar({x:c+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"},N):a==="insideRight"?ar({x:c+d-b,y:u+p/2,textAnchor:S,verticalAnchor:"middle"},N):a==="insideTop"?ar({x:c+d/2,y:u+g,textAnchor:"middle",verticalAnchor:x},N):a==="insideBottom"?ar({x:c+d/2,y:u+p-g,textAnchor:"middle",verticalAnchor:v},N):a==="insideTopLeft"?ar({x:c+b,y:u+g,textAnchor:A,verticalAnchor:x},N):a==="insideTopRight"?ar({x:c+d-b,y:u+g,textAnchor:S,verticalAnchor:x},N):a==="insideBottomLeft"?ar({x:c+b,y:u+p-g,textAnchor:A,verticalAnchor:v},N):a==="insideBottomRight"?ar({x:c+d-b,y:u+p-g,textAnchor:S,verticalAnchor:v},N):_l(a)&&(ge(a.x)||Eo(a.x))&&(ge(a.y)||Eo(a.y))?ar({x:c+$o(a.x,d),y:u+$o(a.y,p),textAnchor:"end",verticalAnchor:"end"},N):ar({x:c+d/2,y:u+p/2,textAnchor:"middle",verticalAnchor:"middle"},N)},SY=function(e){return"cx"in e&&ge(e.cx)};function Cr(t){var e=t.offset,r=e===void 0?5:e,n=hY(t,sY),i=ar({offset:r},n),a=i.viewBox,o=i.position,c=i.value,u=i.children,d=i.content,p=i.className,f=p===void 0?"":p,g=i.textBreakAll;if(!a||et(c)&&et(u)&&!P.isValidElement(d)&&!Je(d))return null;if(P.isValidElement(d))return P.cloneElement(d,i);var v;if(Je(d)){if(v=P.createElement(d,i),P.isValidElement(v))return v}else v=vY(i);var x=SY(a),_=it(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return xY(i,v,_);var b=x?wY(i):_Y(i);return L.createElement(lh,fu({className:ot("recharts-label",f)},_,b,{breakAll:g}),v)}Cr.displayName="Label";var k$=function(e){var r=e.cx,n=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,c=e.r,u=e.radius,d=e.innerRadius,p=e.outerRadius,f=e.x,g=e.y,v=e.top,x=e.left,_=e.width,b=e.height,S=e.clockWise,A=e.labelViewBox;if(A)return A;if(ge(_)&&ge(b)){if(ge(f)&&ge(g))return{x:f,y:g,width:_,height:b};if(ge(v)&&ge(x))return{x:v,y:x,width:_,height:b}}return ge(f)&&ge(g)?{x:f,y:g,width:0,height:0}:ge(r)&&ge(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:d||0,outerRadius:p||u||c||0,clockWise:S}:e.viewBox?e.viewBox:{}},kY=function(e,r){return e?e===!0?L.createElement(Cr,{key:"label-implicit",viewBox:r}):or(e)?L.createElement(Cr,{key:"label-implicit",viewBox:r,value:e}):P.isValidElement(e)?e.type===Cr?P.cloneElement(e,{key:"label-implicit",viewBox:r}):L.createElement(Cr,{key:"label-implicit",content:e,viewBox:r}):Je(e)?L.createElement(Cr,{key:"label-implicit",content:e,viewBox:r}):_l(e)?L.createElement(Cr,fu({viewBox:r},e,{key:"label-implicit"})):null:null},EY=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=k$(e),o=jn(i,Cr).map(function(u,d){return P.cloneElement(u,{viewBox:r||a,key:"label-".concat(d)})});if(!n)return o;var c=kY(e.label,r||a);return[c].concat(lY(o))};Cr.parseViewBox=k$;Cr.renderCallByParent=EY;var ob,Uj;function OY(){if(Uj)return ob;Uj=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return ob=t,ob}var AY=OY();const TY=vt(AY);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)}var jY=["valueAccessor"],CY=["data","dataKey","clockWise","id","textBreakAll"];function NY(t){return $Y(t)||IY(t)||RY(t)||PY()}function PY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
462
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RY(t,e){if(t){if(typeof t=="string")return qx(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 qx(t,e)}}function IY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $Y(t){if(Array.isArray(t))return qx(t)}function qx(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 Eh(){return Eh=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},Eh.apply(this,arguments)}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 Fj(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){MY(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 MY(t,e,r){return e=LY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LY(t){var e=DY(t,"string");return hu(e)=="symbol"?e:e+""}function DY(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)}function Hj(t,e){if(t==null)return{};var r=zY(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 zY(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 BY=function(e){return Array.isArray(e.value)?TY(e.value):e.value};function Da(t){var e=t.valueAccessor,r=e===void 0?BY:e,n=Hj(t,jY),i=n.data,a=n.dataKey,o=n.clockWise,c=n.id,u=n.textBreakAll,d=Hj(n,CY);return!i||!i.length?null:L.createElement(Xt,{className:"recharts-label-list"},i.map(function(p,f){var g=et(a)?r(p,f):dn(p&&p.payload,a),v=et(c)?{}:{id:"".concat(c,"-").concat(f)};return L.createElement(Cr,Eh({},it(p,!0),d,v,{parentViewBox:p.parentViewBox,value:g,textBreakAll:u,viewBox:Cr.parseViewBox(et(o)?p:Fj(Fj({},p),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Da.displayName="LabelList";function UY(t,e){return t?t===!0?L.createElement(Da,{key:"labelList-implicit",data:e}):L.isValidElement(t)||Je(t)?L.createElement(Da,{key:"labelList-implicit",data:e,content:t}):_l(t)?L.createElement(Da,Eh({data:e},t,{key:"labelList-implicit"})):null:null}function qY(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=jn(n,Da).map(function(o,c){return P.cloneElement(o,{data:e,key:"labelList-".concat(c)})});if(!r)return i;var a=UY(t.label,e);return[a].concat(NY(i))}Da.renderCallByParent=qY;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 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 Wj(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 Gj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wj(Object(r),!0).forEach(function(n){FY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FY(t,e,r){return e=HY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HY(t){var e=WY(t,"string");return pu(e)=="symbol"?e:e+""}function WY(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(e==="string"?String:Number)(t)}var GY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},_f=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.angle,o=e.sign,c=e.isExternal,u=e.cornerRadius,d=e.cornerIsExternal,p=u*(c?1:-1)+i,f=Math.asin(u/p)/kh,g=d?a:a+o*f,v=_r(r,n,p,g),x=_r(r,n,i,g),_=d?a-o*f:a,b=_r(r,n,p*Math.cos(f*kh),_);return{center:v,circleTangency:x,lineTangency:b,theta:f}},E$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,c=e.endAngle,u=GY(o,c),d=o+u,p=_r(r,n,a,o),f=_r(r,n,a,d),g="M ".concat(p.x,",").concat(p.y,`
|
|
463
|
+
A `).concat(a,",").concat(a,`,0,
|
|
464
|
+
`).concat(+(Math.abs(u)>180),",").concat(+(o>d),`,
|
|
465
|
+
`).concat(f.x,",").concat(f.y,`
|
|
466
|
+
`);if(i>0){var v=_r(r,n,i,o),x=_r(r,n,i,d);g+="L ".concat(x.x,",").concat(x.y,`
|
|
467
|
+
A `).concat(i,",").concat(i,`,0,
|
|
468
|
+
`).concat(+(Math.abs(u)>180),",").concat(+(o<=d),`,
|
|
469
|
+
`).concat(v.x,",").concat(v.y," Z")}else g+="L ".concat(r,",").concat(n," Z");return g},KY=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,u=e.cornerIsExternal,d=e.startAngle,p=e.endAngle,f=Jn(p-d),g=_f({cx:r,cy:n,radius:a,angle:d,sign:f,cornerRadius:o,cornerIsExternal:u}),v=g.circleTangency,x=g.lineTangency,_=g.theta,b=_f({cx:r,cy:n,radius:a,angle:p,sign:-f,cornerRadius:o,cornerIsExternal:u}),S=b.circleTangency,A=b.lineTangency,O=b.theta,j=u?Math.abs(d-p):Math.abs(d-p)-_-O;if(j<0)return c?"M ".concat(x.x,",").concat(x.y,`
|
|
470
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
471
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
472
|
+
`):E$({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:d,endAngle:p});var E="M ".concat(x.x,",").concat(x.y,`
|
|
473
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
|
|
474
|
+
A`).concat(a,",").concat(a,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(S.x,",").concat(S.y,`
|
|
475
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,`
|
|
476
|
+
`);if(i>0){var T=_f({cx:r,cy:n,radius:i,angle:d,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),N=T.circleTangency,R=T.lineTangency,M=T.theta,J=_f({cx:r,cy:n,radius:i,angle:p,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),F=J.circleTangency,B=J.lineTangency,K=J.theta,W=u?Math.abs(d-p):Math.abs(d-p)-M-K;if(W<0&&o===0)return"".concat(E,"L").concat(r,",").concat(n,"Z");E+="L".concat(B.x,",").concat(B.y,`
|
|
477
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(F.x,",").concat(F.y,`
|
|
478
|
+
A`).concat(i,",").concat(i,",0,").concat(+(W>180),",").concat(+(f>0),",").concat(N.x,",").concat(N.y,`
|
|
479
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(R.x,",").concat(R.y,"Z")}else E+="L".concat(r,",").concat(n,"Z");return E},VY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},O$=function(e){var r=Gj(Gj({},VY),e),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,c=r.cornerRadius,u=r.forceCornerRadius,d=r.cornerIsExternal,p=r.startAngle,f=r.endAngle,g=r.className;if(o<a||p===f)return null;var v=ot("recharts-sector",g),x=o-a,_=$o(c,x,0,!0),b;return _>0&&Math.abs(p-f)<360?b=KY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,x/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:f}):b=E$({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:p,endAngle:f}),L.createElement("path",Fx({},it(r,!0),{className:v,d:b,role:"img"}))};function mu(t){"@babel/helpers - typeof";return mu=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},mu(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 Kj(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 Vj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kj(Object(r),!0).forEach(function(n){XY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function XY(t,e,r){return e=YY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YY(t){var e=JY(t,"string");return mu(e)=="symbol"?e:e+""}function JY(t,e){if(mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xj={curveBasisClosed:yF,curveBasisOpen:vF,curveBasis:gF,curveBumpX:rF,curveBumpY:nF,curveLinearClosed:bF,curveLinear:mp,curveMonotoneX:xF,curveMonotoneY:wF,curveNatural:_F,curveStep:SF,curveStepAfter:EF,curveStepBefore:kF},Sf=function(e){return e.x===+e.x&&e.y===+e.y},wc=function(e){return e.x},_c=function(e){return e.y},ZY=function(e,r){if(Je(e))return e;var n="curve".concat(hp(e));return(n==="curveMonotone"||n==="curveBump")&&r?Xj["".concat(n).concat(r==="vertical"?"Y":"X")]:Xj[n]||mp},QY=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,a=i===void 0?[]:i,o=e.baseLine,c=e.layout,u=e.connectNulls,d=u===void 0?!1:u,p=ZY(n,c),f=d?a.filter(function(_){return Sf(_)}):a,g;if(Array.isArray(o)){var v=d?o.filter(function(_){return Sf(_)}):o,x=f.map(function(_,b){return Vj(Vj({},_),{},{base:v[b]})});return c==="vertical"?g=pf().y(_c).x1(wc).x0(function(_){return _.base.x}):g=pf().x(wc).y1(_c).y0(function(_){return _.base.y}),g.defined(Sf).curve(p),g(x)}return c==="vertical"&&ge(o)?g=pf().y(_c).x1(wc).x0(o):ge(o)?g=pf().x(wc).y1(_c).y0(o):g=NR().x(wc).y(_c),g.defined(Sf).curve(p),g(f)},Wx=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?QY(e):i;return P.createElement("path",Hx({},it(e,!1),Xf(e),{className:ot("recharts-curve",r),d:o,ref:a}))},sb={exports:{}},lb,Yj;function eJ(){if(Yj)return lb;Yj=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lb=t,lb}var cb,Jj;function tJ(){if(Jj)return cb;Jj=1;var t=eJ();function e(){}function r(){}return r.resetWarningCache=e,cb=function(){function n(o,c,u,d,p,f){if(f!==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},cb}var Zj;function rJ(){return Zj||(Zj=1,sb.exports=tJ()()),sb.exports}var nJ=rJ();const mt=vt(nJ),{getOwnPropertyNames:iJ,getOwnPropertySymbols:aJ}=Object,{hasOwnProperty:oJ}=Object.prototype;function ub(t,e){return function(n,i,a){return t(n,i,a)&&e(n,i,a)}}function kf(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),c=a.get(n);if(o&&c)return o===n&&c===r;a.set(r,n),a.set(n,r);const u=t(r,n,i);return a.delete(r),a.delete(n),u}}function sJ(t){return t!=null?t[Symbol.toStringTag]:void 0}function Qj(t){return iJ(t).concat(aJ(t))}const lJ=Object.hasOwn||((t,e)=>oJ.call(t,e));function Wo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const cJ="__v",uJ="__o",dJ="_owner",{getOwnPropertyDescriptor:eC,keys:tC}=Object;function fJ(t,e){return t.byteLength===e.byteLength&&Oh(new Uint8Array(t),new Uint8Array(e))}function hJ(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 pJ(t,e){return t.byteLength===e.byteLength&&Oh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function mJ(t,e){return Wo(t.getTime(),e.getTime())}function gJ(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function yJ(t,e){return t===e}function rC(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,c,u=0;for(;(o=a.next())&&!o.done;){const d=e.entries();let p=!1,f=0;for(;(c=d.next())&&!c.done;){if(i[f]){f++;continue}const g=o.value,v=c.value;if(r.equals(g[0],v[0],u,f,t,e,r)&&r.equals(g[1],v[1],g[0],v[0],t,e,r)){p=i[f]=!0;break}f++}if(!p)return!1;u++}return!0}const vJ=Wo;function bJ(t,e,r){const n=tC(t);let i=n.length;if(tC(e).length!==i)return!1;for(;i-- >0;)if(!A$(t,e,r,n[i]))return!1;return!0}function Sc(t,e,r){const n=Qj(t);let i=n.length;if(Qj(e).length!==i)return!1;let a,o,c;for(;i-- >0;)if(a=n[i],!A$(t,e,r,a)||(o=eC(t,a),c=eC(e,a),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function xJ(t,e){return Wo(t.valueOf(),e.valueOf())}function wJ(t,e){return t.source===e.source&&t.flags===e.flags}function nC(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,c;for(;(o=a.next())&&!o.done;){const u=e.values();let d=!1,p=0;for(;(c=u.next())&&!c.done;){if(!i[p]&&r.equals(o.value,c.value,o.value,c.value,t,e,r)){d=i[p]=!0;break}p++}if(!d)return!1}return!0}function Oh(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 _J(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 A$(t,e,r,n){return(n===dJ||n===uJ||n===cJ)&&(t.$$typeof||e.$$typeof)?!0:lJ(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}const SJ="[object ArrayBuffer]",kJ="[object Arguments]",EJ="[object Boolean]",OJ="[object DataView]",AJ="[object Date]",TJ="[object Error]",jJ="[object Map]",CJ="[object Number]",NJ="[object Object]",PJ="[object RegExp]",RJ="[object Set]",IJ="[object String]",$J={"[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},MJ="[object URL]",LJ=Object.prototype.toString;function DJ({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:p,areSetsEqual:f,areTypedArraysEqual:g,areUrlsEqual:v,unknownTagComparators:x}){return function(b,S,A){if(b===S)return!0;if(b==null||S==null)return!1;const O=typeof b;if(O!==typeof S)return!1;if(O!=="object")return O==="number"?c(b,S,A):O==="function"?a(b,S,A):!1;const j=b.constructor;if(j!==S.constructor)return!1;if(j===Object)return u(b,S,A);if(Array.isArray(b))return e(b,S,A);if(j===Date)return n(b,S,A);if(j===RegExp)return p(b,S,A);if(j===Map)return o(b,S,A);if(j===Set)return f(b,S,A);const E=LJ.call(b);if(E===AJ)return n(b,S,A);if(E===PJ)return p(b,S,A);if(E===jJ)return o(b,S,A);if(E===RJ)return f(b,S,A);if(E===NJ)return typeof b.then!="function"&&typeof S.then!="function"&&u(b,S,A);if(E===MJ)return v(b,S,A);if(E===TJ)return i(b,S,A);if(E===kJ)return u(b,S,A);if($J[E])return g(b,S,A);if(E===SJ)return t(b,S,A);if(E===OJ)return r(b,S,A);if(E===EJ||E===CJ||E===IJ)return d(b,S,A);if(x){let T=x[E];if(!T){const N=sJ(b);N&&(T=x[N])}if(T)return T(b,S,A)}return!1}}function zJ({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:fJ,areArraysEqual:r?Sc:hJ,areDataViewsEqual:pJ,areDatesEqual:mJ,areErrorsEqual:gJ,areFunctionsEqual:yJ,areMapsEqual:r?ub(rC,Sc):rC,areNumbersEqual:vJ,areObjectsEqual:r?Sc:bJ,arePrimitiveWrappersEqual:xJ,areRegExpsEqual:wJ,areSetsEqual:r?ub(nC,Sc):nC,areTypedArraysEqual:r?ub(Oh,Sc):Oh,areUrlsEqual:_J,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const i=kf(n.areArraysEqual),a=kf(n.areMapsEqual),o=kf(n.areObjectsEqual),c=kf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return n}function BJ(t){return function(e,r,n,i,a,o,c){return t(e,r,c)}}function UJ({circular:t,comparator:e,createState:r,equals:n,strict:i}){if(r)return function(c,u){const{cache:d=t?new WeakMap:void 0,meta:p}=r();return e(c,u,{cache:d,equals:n,meta:p,strict:i})};if(t)return function(c,u){return e(c,u,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(c,u){return e(c,u,a)}}const qJ=Va();Va({strict:!0});Va({circular:!0});Va({circular:!0,strict:!0});Va({createInternalComparator:()=>Wo});Va({strict:!0,createInternalComparator:()=>Wo});Va({circular:!0,createInternalComparator:()=>Wo});Va({circular:!0,createInternalComparator:()=>Wo,strict:!0});function Va(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:i=!1}=t,a=zJ(t),o=DJ(a),c=r?r(o):BJ(o);return UJ({circular:e,comparator:o,createState:n,equals:c,strict:i})}function FJ(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function iC(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):FJ(i)};requestAnimationFrame(n)}function Gx(t){"@babel/helpers - typeof";return Gx=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},Gx(t)}function HJ(t){return VJ(t)||KJ(t)||GJ(t)||WJ()}function WJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
480
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GJ(t,e){if(t){if(typeof t=="string")return aC(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 aC(t,e)}}function aC(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 KJ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function VJ(t){if(Array.isArray(t))return t}function XJ(){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,c=HJ(o),u=c[0],d=c.slice(1);if(typeof u=="number"){iC(i.bind(null,d),u);return}i(u),iC(i.bind(null,d));return}Gx(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 gu(t){"@babel/helpers - typeof";return gu=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},gu(t)}function oC(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 sC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oC(Object(r),!0).forEach(function(n){T$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function T$(t,e,r){return e=YJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YJ(t){var e=JJ(t,"string");return gu(e)==="symbol"?e:String(e)}function JJ(t,e){if(gu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ZJ=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},QJ=function(e){return e},eZ=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Dc=function(e,r){return Object.keys(r).reduce(function(n,i){return sC(sC({},n),{},T$({},i,e(i,r[i])))},{})},lC=function(e,r,n){return e.map(function(i){return"".concat(eZ(i)," ").concat(r,"ms ").concat(n)}).join(",")};function tZ(t,e){return iZ(t)||nZ(t,e)||j$(t,e)||rZ()}function rZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
481
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function iZ(t){if(Array.isArray(t))return t}function aZ(t){return lZ(t)||sZ(t)||j$(t)||oZ()}function oZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
482
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j$(t,e){if(t){if(typeof t=="string")return Kx(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 Kx(t,e)}}function sZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lZ(t){if(Array.isArray(t))return Kx(t)}function Kx(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 Ah=1e-4,C$=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},N$=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},cC=function(e,r){return function(n){var i=C$(e,r);return N$(i,n)}},cZ=function(e,r){return function(n){var i=C$(e,r),a=[].concat(aZ(i.map(function(o,c){return o*c}).slice(1)),[0]);return N$(a,n)}},uC=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],c=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,c=1;break;case"ease":i=.25,a=.1,o=.25,c=1;break;case"ease-in":i=.42,a=0,o=1,c=1;break;case"ease-out":i=.42,a=0,o=.58,c=1;break;case"ease-in-out":i=0,a=0,o=.58,c=1;break;default:{var u=r[0].split("(");if(u[0]==="cubic-bezier"&&u[1].split(")")[0].split(",").length===4){var d=u[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),p=tZ(d,4);i=p[0],a=p[1],o=p[2],c=p[3]}}}var f=cC(i,o),g=cC(a,c),v=cZ(i,o),x=function(S){return S>1?1:S<0?0:S},_=function(S){for(var A=S>1?1:S,O=A,j=0;j<8;++j){var E=f(O)-A,T=v(O);if(Math.abs(E-A)<Ah||T<Ah)return g(O);O=x(O-E/T)}return g(O)};return _.isStepper=!1,_},uZ=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,c=o===void 0?17:o,u=function(p,f,g){var v=-(p-f)*n,x=g*a,_=g+(v-x)*c/1e3,b=g*c/1e3+p;return Math.abs(b-f)<Ah&&Math.abs(_)<Ah?[f,0]:[b,_]};return u.isStepper=!0,u.dt=c,u},dZ=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 uC(i);case"spring":return uZ();default:if(i.split("(")[0]==="cubic-bezier")return uC(i)}return typeof i=="function"?i:null};function yu(t){"@babel/helpers - typeof";return yu=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},yu(t)}function dC(t){return pZ(t)||hZ(t)||P$(t)||fZ()}function fZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
483
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function pZ(t){if(Array.isArray(t))return Xx(t)}function fC(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 wr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fC(Object(r),!0).forEach(function(n){Vx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Vx(t,e,r){return e=mZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mZ(t){var e=gZ(t,"string");return yu(e)==="symbol"?e:String(e)}function gZ(t,e){if(yu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(yu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yZ(t,e){return xZ(t)||bZ(t,e)||P$(t,e)||vZ()}function vZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
484
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P$(t,e){if(t){if(typeof t=="string")return Xx(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 Xx(t,e)}}function Xx(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 bZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function xZ(t){if(Array.isArray(t))return t}var Th=function(e,r,n){return e+(r-e)*n},Yx=function(e){var r=e.from,n=e.to;return r!==n},wZ=function t(e,r,n){var i=Dc(function(a,o){if(Yx(o)){var c=e(o.from,o.to,o.velocity),u=yZ(c,2),d=u[0],p=u[1];return wr(wr({},o),{},{from:d,velocity:p})}return o},r);return n<1?Dc(function(a,o){return Yx(o)?wr(wr({},o),{},{velocity:Th(o.velocity,i[a].velocity,n),from:Th(o.from,i[a].from,n)}):o},r):t(e,i,n-1)};const _Z=(function(t,e,r,n,i){var a=ZJ(t,e),o=a.reduce(function(b,S){return wr(wr({},b),{},Vx({},S,[t[S],e[S]]))},{}),c=a.reduce(function(b,S){return wr(wr({},b),{},Vx({},S,{from:t[S],velocity:0,to:e[S]}))},{}),u=-1,d,p,f=function(){return null},g=function(){return Dc(function(S,A){return A.from},c)},v=function(){return!Object.values(c).filter(Yx).length},x=function(S){d||(d=S);var A=S-d,O=A/r.dt;c=wZ(r,c,O),i(wr(wr(wr({},t),e),g())),d=S,v()||(u=requestAnimationFrame(f))},_=function(S){p||(p=S);var A=(S-p)/n,O=Dc(function(E,T){return Th.apply(void 0,dC(T).concat([r(A)]))},o);if(i(wr(wr(wr({},t),e),O)),A<1)u=requestAnimationFrame(f);else{var j=Dc(function(E,T){return Th.apply(void 0,dC(T).concat([r(1)]))},o);i(wr(wr(wr({},t),e),j))}};return f=r.isStepper?x:_,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(u)}}});function rl(t){"@babel/helpers - typeof";return rl=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},rl(t)}var SZ=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function kZ(t,e){if(t==null)return{};var r=EZ(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 EZ(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 db(t){return jZ(t)||TZ(t)||AZ(t)||OZ()}function OZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
485
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AZ(t,e){if(t){if(typeof t=="string")return Jx(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 Jx(t,e)}}function TZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jZ(t){if(Array.isArray(t))return Jx(t)}function Jx(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 hC(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 Un(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hC(Object(r),!0).forEach(function(n){Nc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Nc(t,e,r){return e=R$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NZ(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,R$(n.key),n)}}function PZ(t,e,r){return e&&NZ(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function R$(t){var e=RZ(t,"string");return rl(e)==="symbol"?e:String(e)}function RZ(t,e){if(rl(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rl(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IZ(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&&Zx(t,e)}function Zx(t,e){return Zx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Zx(t,e)}function $Z(t){var e=MZ();return function(){var n=jh(t),i;if(e){var a=jh(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Qx(this,i)}}function Qx(t,e){if(e&&(rl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ew(t)}function ew(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function MZ(){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 jh(t){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jh(t)}var Qi=(function(t){IZ(r,t);var e=$Z(r);function r(n,i){var a;CZ(this,r),a=e.call(this,n,i);var o=a.props,c=o.isActive,u=o.attributeName,d=o.from,p=o.to,f=o.steps,g=o.children,v=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(ew(a)),a.changeStyle=a.changeStyle.bind(ew(a)),!c||v<=0)return a.state={style:{}},typeof g=="function"&&(a.state={style:p}),Qx(a);if(f&&f.length)a.state={style:f[0].style};else if(d){if(typeof g=="function")return a.state={style:d},Qx(a);a.state={style:u?Nc({},u,d):d}}else a.state={style:{}};return a}return PZ(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,c=a.canBegin,u=a.attributeName,d=a.shouldReAnimate,p=a.to,f=a.from,g=this.state.style;if(c){if(!o){var v={style:u?Nc({},u,p):p};this.state&&g&&(u&&g[u]!==p||!u&&g!==p)&&this.setState(v);return}if(!(qJ(i.to,p)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=x||d?f:i.to;if(this.state&&g){var b={style:u?Nc({},u,_):_};(u&&g[u]!==_||!u&&g!==_)&&this.setState(b)}this.runAnimation(Un(Un({},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,c=i.to,u=i.duration,d=i.easing,p=i.begin,f=i.onAnimationEnd,g=i.onAnimationStart,v=_Z(o,c,dZ(d),u,this.changeStyle),x=function(){a.stopJSAnimation=v()};this.manager.start([g,p,x,u,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,c=i.begin,u=i.onAnimationStart,d=o[0],p=d.style,f=d.duration,g=f===void 0?0:f,v=function(_,b,S){if(S===0)return _;var A=b.duration,O=b.easing,j=O===void 0?"ease":O,E=b.style,T=b.properties,N=b.onAnimationEnd,R=S>0?o[S-1]:b,M=T||Object.keys(E);if(typeof j=="function"||j==="spring")return[].concat(db(_),[a.runJSAnimation.bind(a,{from:R.style,to:E,duration:A,easing:j}),A]);var J=lC(M,A,j),F=Un(Un(Un({},R.style),E),{},{transition:J});return[].concat(db(_),[F,A,N]).filter(QJ)};return this.manager.start([u].concat(db(o.reduce(v,[p,Math.max(g,c)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XJ());var a=i.begin,o=i.duration,c=i.attributeName,u=i.to,d=i.easing,p=i.onAnimationStart,f=i.onAnimationEnd,g=i.steps,v=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof d=="function"||typeof v=="function"||d==="spring"){this.runJSAnimation(i);return}if(g.length>1){this.runStepAnimation(i);return}var _=c?Nc({},c,u):u,b=lC(Object.keys(_),o,d);x.start([p,a,Un(Un({},_),{},{transition:b}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var c=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var u=kZ(i,SZ),d=P.Children.count(a),p=this.state.style;if(typeof a=="function")return a(p);if(!c||d===0||o<=0)return a;var f=function(v){var x=v.props,_=x.style,b=_===void 0?{}:_,S=x.className,A=P.cloneElement(v,Un(Un({},u),{},{style:Un(Un({},b),p),className:S}));return A};return d===1?f(P.Children.only(a)):L.createElement("div",null,P.Children.map(a,function(g){return f(g)}))}}]),r})(P.PureComponent);Qi.displayName="Animate";Qi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Qi.propTypes={from:mt.oneOfType([mt.object,mt.string]),to:mt.oneOfType([mt.object,mt.string]),attributeName:mt.string,duration:mt.number,begin:mt.number,easing:mt.oneOfType([mt.string,mt.func]),steps:mt.arrayOf(mt.shape({duration:mt.number.isRequired,style:mt.object.isRequired,easing:mt.oneOfType([mt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),mt.func]),properties:mt.arrayOf("string"),onAnimationEnd:mt.func})),children:mt.oneOfType([mt.node,mt.func]),isActive:mt.bool,canBegin:mt.bool,onAnimationEnd:mt.func,shouldReAnimate:mt.bool,onAnimationStart:mt.func,onAnimationReStart:mt.func};function vu(t){"@babel/helpers - typeof";return vu=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},vu(t)}function Ch(){return Ch=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},Ch.apply(this,arguments)}function LZ(t,e){return UZ(t)||BZ(t,e)||zZ(t,e)||DZ()}function DZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
486
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zZ(t,e){if(t){if(typeof t=="string")return pC(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 pC(t,e)}}function pC(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 BZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function UZ(t){if(Array.isArray(t))return t}function mC(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 gC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mC(Object(r),!0).forEach(function(n){qZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qZ(t,e,r){return e=FZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FZ(t){var e=HZ(t,"string");return vu(e)=="symbol"?e:e+""}function HZ(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yC=function(e,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),c=i>=0?1:-1,u=n>=0?1:-1,d=i>=0&&n>=0||i<0&&n<0?1:0,p;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],g=0,v=4;g<v;g++)f[g]=a[g]>o?o:a[g];p="M".concat(e,",").concat(r+c*f[0]),f[0]>0&&(p+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(d,",").concat(e+u*f[0],",").concat(r)),p+="L ".concat(e+n-u*f[1],",").concat(r),f[1]>0&&(p+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(d,`,
|
|
487
|
+
`).concat(e+n,",").concat(r+c*f[1])),p+="L ".concat(e+n,",").concat(r+i-c*f[2]),f[2]>0&&(p+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(d,`,
|
|
488
|
+
`).concat(e+n-u*f[2],",").concat(r+i)),p+="L ".concat(e+u*f[3],",").concat(r+i),f[3]>0&&(p+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(d,`,
|
|
489
|
+
`).concat(e,",").concat(r+i-c*f[3])),p+="Z"}else if(o>0&&a===+a&&a>0){var x=Math.min(o,a);p="M ".concat(e,",").concat(r+c*x,`
|
|
490
|
+
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+u*x,",").concat(r,`
|
|
491
|
+
L `).concat(e+n-u*x,",").concat(r,`
|
|
492
|
+
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n,",").concat(r+c*x,`
|
|
493
|
+
L `).concat(e+n,",").concat(r+i-c*x,`
|
|
494
|
+
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n-u*x,",").concat(r+i,`
|
|
495
|
+
L `).concat(e+u*x,",").concat(r+i,`
|
|
496
|
+
A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e,",").concat(r+i-c*x," Z")}else p="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return p},WZ=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,a=r.x,o=r.y,c=r.width,u=r.height;if(Math.abs(c)>0&&Math.abs(u)>0){var d=Math.min(a,a+c),p=Math.max(a,a+c),f=Math.min(o,o+u),g=Math.max(o,o+u);return n>=d&&n<=p&&i>=f&&i<=g}return!1},GZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},V1=function(e){var r=gC(gC({},GZ),e),n=P.useRef(),i=P.useState(-1),a=LZ(i,2),o=a[0],c=a[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var j=n.current.getTotalLength();j&&c(j)}catch{}},[]);var u=r.x,d=r.y,p=r.width,f=r.height,g=r.radius,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,S=r.isAnimationActive,A=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||p===0||f===0)return null;var O=ot("recharts-rectangle",v);return A?L.createElement(Qi,{canBegin:o>0,from:{width:p,height:f,x:u,y:d},to:{width:p,height:f,x:u,y:d},duration:_,animationEasing:x,isActive:A},function(j){var E=j.width,T=j.height,N=j.x,R=j.y;return L.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,isActive:S,easing:x},L.createElement("path",Ch({},it(r,!0),{className:O,d:yC(N,R,E,T,g),ref:n})))}):L.createElement("path",Ch({},it(r,!0),{className:O,d:yC(u,d,p,f,g)}))};function tw(){return tw=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},tw.apply(this,arguments)}var X1=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=ot("recharts-dot",a);return r===+r&&n===+n&&i===+i?P.createElement("circle",tw({},it(e,!1),Xf(e),{className:o,cx:r,cy:n,r:i})):null};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)}var KZ=["x","y","top","left","width","height","className"];function rw(){return rw=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},rw.apply(this,arguments)}function vC(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 VZ(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vC(Object(r),!0).forEach(function(n){XZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function XZ(t,e,r){return e=YZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YZ(t){var e=JZ(t,"string");return bu(e)=="symbol"?e:e+""}function JZ(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 ZZ(t,e){if(t==null)return{};var r=QZ(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 QZ(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 eQ=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},tQ=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,c=o===void 0?0:o,u=e.left,d=u===void 0?0:u,p=e.width,f=p===void 0?0:p,g=e.height,v=g===void 0?0:g,x=e.className,_=ZZ(e,KZ),b=VZ({x:n,y:a,top:c,left:d,width:f,height:v},_);return!ge(n)||!ge(a)||!ge(f)||!ge(v)||!ge(c)||!ge(d)?null:L.createElement("path",rw({},it(b,!0),{className:ot("recharts-cross",x),d:eQ(n,a,f,v,c,d)}))},fb,bC;function rQ(){if(bC)return fb;bC=1;var t=eI(),e=t(Object.getPrototypeOf,Object);return fb=e,fb}var hb,xC;function nQ(){if(xC)return hb;xC=1;var t=ra(),e=rQ(),r=na(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,c=a.hasOwnProperty,u=o.call(Object);function d(p){if(!r(p)||t(p)!=n)return!1;var f=e(p);if(f===null)return!0;var g=c.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==u}return hb=d,hb}var iQ=nQ();const aQ=vt(iQ);var pb,wC;function oQ(){if(wC)return pb;wC=1;var t=ra(),e=na(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return pb=n,pb}var sQ=oQ();const lQ=vt(sQ);function xu(t){"@babel/helpers - typeof";return xu=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},xu(t)}function Nh(){return Nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Nh.apply(this,arguments)}function cQ(t,e){return hQ(t)||fQ(t,e)||dQ(t,e)||uQ()}function uQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
497
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dQ(t,e){if(t){if(typeof t=="string")return _C(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 _C(t,e)}}function _C(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 fQ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function hQ(t){if(Array.isArray(t))return t}function SC(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 kC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?SC(Object(r),!0).forEach(function(n){pQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):SC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pQ(t,e,r){return e=mQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mQ(t){var e=gQ(t,"string");return xu(e)=="symbol"?e:e+""}function gQ(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var EC=function(e,r,n,i,a){var o=n-i,c;return c="M ".concat(e,",").concat(r),c+="L ".concat(e+n,",").concat(r),c+="L ".concat(e+n-o/2,",").concat(r+a),c+="L ".concat(e+n-o/2-i,",").concat(r+a),c+="L ".concat(e,",").concat(r," Z"),c},yQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vQ=function(e){var r=kC(kC({},yQ),e),n=P.useRef(),i=P.useState(-1),a=cQ(i,2),o=a[0],c=a[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&c(O)}catch{}},[]);var u=r.x,d=r.y,p=r.upperWidth,f=r.lowerWidth,g=r.height,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,S=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||g!==+g||p===0&&f===0||g===0)return null;var A=ot("recharts-trapezoid",v);return S?L.createElement(Qi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:u,y:d},to:{upperWidth:p,lowerWidth:f,height:g,x:u,y:d},duration:_,animationEasing:x,isActive:S},function(O){var j=O.upperWidth,E=O.lowerWidth,T=O.height,N=O.x,R=O.y;return L.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,easing:x},L.createElement("path",Nh({},it(r,!0),{className:A,d:EC(N,R,j,E,T),ref:n})))}):L.createElement("g",null,L.createElement("path",Nh({},it(r,!0),{className:A,d:EC(u,d,p,f,g)})))},bQ=["option","shapeType","propTransformer","activeClassName","isActive"];function wu(t){"@babel/helpers - typeof";return wu=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},wu(t)}function xQ(t,e){if(t==null)return{};var r=wQ(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 wQ(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 OC(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 Ph(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?OC(Object(r),!0).forEach(function(n){_Q(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):OC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _Q(t,e,r){return e=SQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SQ(t){var e=kQ(t,"string");return wu(e)=="symbol"?e:e+""}function kQ(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EQ(t,e){return Ph(Ph({},e),t)}function OQ(t,e){return t==="symbols"}function AC(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return L.createElement(V1,r);case"trapezoid":return L.createElement(vQ,r);case"sector":return L.createElement(O$,r);case"symbols":if(OQ(e))return L.createElement(h1,r);break;default:return null}}function AQ(t){return P.isValidElement(t)?t.props:t}function TQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?EQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,c=t.isActive,u=xQ(t,bQ),d;if(P.isValidElement(e))d=P.cloneElement(e,Ph(Ph({},u),AQ(e)));else if(Je(e))d=e(u);else if(aQ(e)&&!lQ(e)){var p=i(e,u);d=L.createElement(AC,{shapeType:r,elementProps:p})}else{var f=u;d=L.createElement(AC,{shapeType:r,elementProps:f})}return c?L.createElement(Xt,{className:o},d):d}function Np(t,e){return e!=null&&"trapezoids"in t.props}function Pp(t,e){return e!=null&&"sectors"in t.props}function _u(t,e){return e!=null&&"points"in t.props}function jQ(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 CQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function NQ(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function PQ(t,e){var r;return Np(t,e)?r=jQ:Pp(t,e)?r=CQ:_u(t,e)&&(r=NQ),r}function RQ(t,e){var r;return Np(t,e)?r="trapezoids":Pp(t,e)?r="sectors":_u(t,e)&&(r="points"),r}function IQ(t,e){if(Np(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(Pp(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 _u(t,e)?e.payload:{}}function $Q(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=RQ(r,e),a=IQ(r,e),o=n.filter(function(u,d){var p=Tp(a,u),f=r.props[i].filter(function(x){var _=PQ(r,e);return _(x,e)}),g=r.props[i].indexOf(f[f.length-1]),v=d===g;return p&&v}),c=n.indexOf(o[o.length-1]);return c}var mb,TC;function MQ(){if(TC)return mb;TC=1;var t=Math.ceil,e=Math.max;function r(n,i,a,o){for(var c=-1,u=e(t((i-n)/(a||1)),0),d=Array(u);u--;)d[o?u:++c]=n,n+=a;return d}return mb=r,mb}var gb,jC;function I$(){if(jC)return gb;jC=1;var t=gI(),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 gb=n,gb}var yb,CC;function LQ(){if(CC)return yb;CC=1;var t=MQ(),e=bp(),r=I$();function n(i){return function(a,o,c){return c&&typeof c!="number"&&e(a,o,c)&&(o=c=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),c=c===void 0?a<o?1:-1:r(c),t(a,o,c,i)}}return yb=n,yb}var vb,NC;function DQ(){if(NC)return vb;NC=1;var t=LQ(),e=t();return vb=e,vb}var zQ=DQ();const Rh=vt(zQ);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 PC(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 RC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?PC(Object(r),!0).forEach(function(n){$$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):PC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $$(t,e,r){return e=BQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BQ(t){var e=UQ(t,"string");return Su(e)=="symbol"?e:e+""}function UQ(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)}var qQ=["Webkit","Moz","O","ms"],FQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=qQ.reduce(function(a,o){return RC(RC({},a),{},$$({},o+n,r))},{});return i[e]=r,i};function nl(t){"@babel/helpers - typeof";return nl=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},nl(t)}function Ih(){return Ih=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},Ih.apply(this,arguments)}function IC(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 bb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IC(Object(r),!0).forEach(function(n){on(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $C(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,L$(n.key),n)}}function WQ(t,e,r){return e&&$C(t.prototype,e),r&&$C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function GQ(t,e,r){return e=$h(e),KQ(t,M$()?Reflect.construct(e,r||[],$h(t).constructor):e.apply(t,r))}function KQ(t,e){if(e&&(nl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VQ(t)}function VQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function M$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M$=function(){return!!t})()}function $h(t){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$h(t)}function XQ(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&&nw(t,e)}function nw(t,e){return nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},nw(t,e)}function on(t,e,r){return e=L$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L$(t){var e=YQ(t,"string");return nl(e)=="symbol"?e:e+""}function YQ(t,e){if(nl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var JQ=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,c=e.travellerWidth;if(!r||!r.length)return{};var u=r.length,d=Mc().domain(Rh(0,u)).range([a,a+o-c]),p=d.domain().map(function(f){return d(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(i),scale:d,scaleValues:p}},MC=function(e){return e.changedTouches&&!!e.changedTouches.length},il=(function(t){function e(r){var n;return HQ(this,e),n=GQ(this,e,[r]),on(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),on(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),on(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,c=i.startIndex;o==null||o({endIndex:a,startIndex:c})}),n.detachDragEndListener()}),on(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),on(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),on(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),on(n,"handleSlideDragStart",function(i){var a=MC(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 XQ(e,t),WQ(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,c=this.props,u=c.gap,d=c.data,p=d.length-1,f=Math.min(i,a),g=Math.max(i,a),v=e.getIndexInRange(o,f),x=e.getIndexInRange(o,g);return{startIndex:v-v%u,endIndex:x===p?p:x-x%u}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,c=i.dataKey,u=dn(a[n],c,n);return Je(o)?o(u,n):u}},{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,c=i.endX,u=this.props,d=u.x,p=u.width,f=u.travellerWidth,g=u.startIndex,v=u.endIndex,x=u.onChange,_=n.pageX-a;_>0?_=Math.min(_,d+p-f-c,d+p-f-o):_<0&&(_=Math.max(_,d-o,d-c));var b=this.getIndex({startX:o+_,endX:c+_});(b.startIndex!==g||b.endIndex!==v)&&x&&x(b),this.setState({startX:o+_,endX:c+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=MC(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,c=i.endX,u=i.startX,d=this.state[o],p=this.props,f=p.x,g=p.width,v=p.travellerWidth,x=p.onChange,_=p.gap,b=p.data,S={startX:this.state.startX,endX:this.state.endX},A=n.pageX-a;A>0?A=Math.min(A,f+g-v-d):A<0&&(A=Math.max(A,f-d)),S[o]=d+A;var O=this.getIndex(S),j=O.startIndex,E=O.endIndex,T=function(){var R=b.length-1;return o==="startX"&&(c>u?j%_===0:E%_===0)||c<u&&E===R||o==="endX"&&(c>u?E%_===0:j%_===0)||c>u&&E===R};this.setState(on(on({},o,d+A),"brushMoveStartX",n.pageX),function(){x&&T()&&x(O)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,c=o.scaleValues,u=o.startX,d=o.endX,p=this.state[i],f=c.indexOf(p);if(f!==-1){var g=f+n;if(!(g===-1||g>=c.length)){var v=c[g];i==="startX"&&v>=d||i==="endX"&&v<=u||this.setState(on({},i,v),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,c=n.height,u=n.fill,d=n.stroke;return L.createElement("rect",{stroke:d,fill:u,x:i,y:a,width:o,height:c})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,c=n.height,u=n.data,d=n.children,p=n.padding,f=P.Children.only(d);return f?L.cloneElement(f,{x:i,y:a,width:o,height:c,margin:p,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,c=this,u=this.props,d=u.y,p=u.travellerWidth,f=u.height,g=u.traveller,v=u.ariaLabel,x=u.data,_=u.startIndex,b=u.endIndex,S=Math.max(n,this.props.x),A=bb(bb({},it(this.props,!1)),{},{x:S,y:d,width:p,height:f}),O=v||"Min value: ".concat((a=x[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[b])===null||o===void 0?void 0:o.name);return L.createElement(Xt,{tabIndex:0,role:"slider","aria-label":O,"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(),c.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(g,A))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,c=a.height,u=a.stroke,d=a.travellerWidth,p=Math.min(n,i)+d,f=Math.max(Math.abs(i-n)-d,0);return L.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:p,y:o,width:f,height:c})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,c=n.height,u=n.travellerWidth,d=n.stroke,p=this.state,f=p.startX,g=p.endX,v=5,x={pointerEvents:"none",fill:d};return L.createElement(Xt,{className:"recharts-brush-texts"},L.createElement(lh,Ih({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,g)-v,y:o+c/2},x),this.getTextOfTick(i)),L.createElement(lh,Ih({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,g)+u+v,y:o+c/2},x),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,c=n.x,u=n.y,d=n.width,p=n.height,f=n.alwaysShowText,g=this.state,v=g.startX,x=g.endX,_=g.isTextActive,b=g.isSlideMoving,S=g.isTravellerMoving,A=g.isTravellerFocused;if(!i||!i.length||!ge(c)||!ge(u)||!ge(d)||!ge(p)||d<=0||p<=0)return null;var O=ot("recharts-brush",a),j=L.Children.count(o)===1,E=FQ("userSelect","none");return L.createElement(Xt,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(_||b||S||A||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,c=n.height,u=n.stroke,d=Math.floor(a+c/2)-1;return L.createElement(L.Fragment,null,L.createElement("rect",{x:i,y:a,width:o,height:c,fill:u,stroke:"none"}),L.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),L.createElement("line",{x1:i+1,y1:d+2,x2:i+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return L.isValidElement(n)?a=L.cloneElement(n,i):Je(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,c=n.x,u=n.travellerWidth,d=n.updateId,p=n.startIndex,f=n.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return bb({prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,prevWidth:o},a&&a.length?JQ({data:a,width:o,x:c,travellerWidth:u,startIndex:p,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||c!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([c,c+o-u]);var g=i.scale.domain().map(function(v){return i.scale(v)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:c,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,c=a-1;c-o>1;){var u=Math.floor((o+c)/2);n[u]>i?c=u:o=u}return i>=n[c]?c:o}}])})(P.PureComponent);on(il,"displayName","Brush");on(il,"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 xb,LC;function ZQ(){if(LC)return xb;LC=1;var t=x1();function e(r,n){var i;return t(r,function(a,o,c){return i=n(a,o,c),!i}),!!i}return xb=e,xb}var wb,DC;function QQ(){if(DC)return wb;DC=1;var t=KR(),e=Wa(),r=ZQ(),n=Zr(),i=bp();function a(o,c,u){var d=n(o)?t:r;return u&&i(o,c,u)&&(c=void 0),d(o,e(c,3))}return wb=a,wb}var eee=QQ();const tee=vt(eee);var ki=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},_b,zC;function ree(){if(zC)return _b;zC=1;var t=dI();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return _b=e,_b}var Sb,BC;function nee(){if(BC)return Sb;BC=1;var t=ree(),e=cI(),r=Wa();function n(i,a){var o={};return a=r(a,3),e(i,function(c,u,d){t(o,u,a(c,u,d))}),o}return Sb=n,Sb}var iee=nee();const aee=vt(iee);var kb,UC;function oee(){if(UC)return kb;UC=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 kb=t,kb}var Eb,qC;function see(){if(qC)return Eb;qC=1;var t=x1();function e(r,n){var i=!0;return t(r,function(a,o,c){return i=!!n(a,o,c),i}),i}return Eb=e,Eb}var Ob,FC;function lee(){if(FC)return Ob;FC=1;var t=oee(),e=see(),r=Wa(),n=Zr(),i=bp();function a(o,c,u){var d=n(o)?t:e;return u&&i(o,c,u)&&(c=void 0),d(o,r(c,3))}return Ob=a,Ob}var cee=lee();const D$=vt(cee);var uee=["x","y"];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 iw(){return iw=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},iw.apply(this,arguments)}function HC(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 kc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?HC(Object(r),!0).forEach(function(n){dee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):HC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dee(t,e,r){return e=fee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fee(t){var e=hee(t,"string");return ku(e)=="symbol"?e:e+""}function hee(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)}function pee(t,e){if(t==null)return{};var r=mee(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 mee(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 gee(t,e){var r=t.x,n=t.y,i=pee(t,uee),a="".concat(r),o=parseInt(a,10),c="".concat(n),u=parseInt(c,10),d="".concat(e.height||i.height),p=parseInt(d,10),f="".concat(e.width||i.width),g=parseInt(f,10);return kc(kc(kc(kc(kc({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:p,width:g,name:e.name,radius:e.radius})}function WC(t){return L.createElement(TQ,iw({shapeType:"rectangle",propTransformer:gee,activeClassName:"recharts-active-bar"},t))}var yee=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=ge(n)||S9(n);return a?e(n,i):(a||Lo(),r)}},vee=["value","background"],z$;function al(t){"@babel/helpers - typeof";return al=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},al(t)}function bee(t,e){if(t==null)return{};var r=xee(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 xee(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 Mh(){return Mh=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},Mh.apply(this,arguments)}function GC(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?GC(Object(r),!0).forEach(function(n){Ia(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):GC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KC(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,U$(n.key),n)}}function _ee(t,e,r){return e&&KC(t.prototype,e),r&&KC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function See(t,e,r){return e=Lh(e),kee(t,B$()?Reflect.construct(e,r||[],Lh(t).constructor):e.apply(t,r))}function kee(t,e){if(e&&(al(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eee(t)}function Eee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B$=function(){return!!t})()}function Lh(t){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lh(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&&aw(t,e)}function aw(t,e){return aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aw(t,e)}function Ia(t,e,r){return e=U$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function U$(t){var e=Aee(t,"string");return al(e)=="symbol"?e:e+""}function Aee(t,e){if(al(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(al(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ea=(function(t){function e(){var r;wee(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=See(this,e,[].concat(i)),Ia(r,"state",{isAnimationFinished:!1}),Ia(r,"id",Lu("recharts-bar-")),Ia(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ia(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return Oee(e,t),_ee(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,c=a.dataKey,u=a.activeIndex,d=a.activeBar,p=it(this.props,!1);return n&&n.map(function(f,g){var v=g===u,x=v?d:o,_=Jt(Jt(Jt({},p),f),{},{isActive:v,option:x,index:g,dataKey:c,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return L.createElement(Xt,Mh({className:"recharts-bar-rectangle"},Yf(i.props,f,g),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(g)}),L.createElement(WC,_))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,c=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,p=i.animationEasing,f=i.animationId,g=this.state.prevData;return L.createElement(Qi,{begin:u,duration:d,isActive:c,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t,_=a.map(function(b,S){var A=g&&g[S];if(A){var O=Vn(A.x,b.x),j=Vn(A.y,b.y),E=Vn(A.width,b.width),T=Vn(A.height,b.height);return Jt(Jt({},b),{},{x:O(x),y:j(x),width:E(x),height:T(x)})}if(o==="horizontal"){var N=Vn(0,b.height),R=N(x);return Jt(Jt({},b),{},{y:b.y+b.height-R,height:R})}var M=Vn(0,b.width),J=M(x);return Jt(Jt({},b),{},{width:J})});return L.createElement(Xt,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||!Tp(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,c=i.activeIndex,u=it(this.props.background,!1);return a.map(function(d,p){d.value;var f=d.background,g=bee(d,vee);if(!f)return null;var v=Jt(Jt(Jt(Jt(Jt({},g),{},{fill:"#eee"},f),u),Yf(n.props,d,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return L.createElement(WC,Mh({key:"background-bar-".concat(p),option:n.props.background,isActive:p===c},v))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,c=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,f=jn(p,Fu);if(!f)return null;var g=d==="vertical"?o[0].height/2:o[0].width/2,v=function(b,S){var A=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:A,errorVal:dn(b,S)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,x,f.map(function(_){return L.cloneElement(_,{key:"error-bar-".concat(i,"-").concat(_.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,offset:g,dataPointFormatter:v})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,c=n.xAxis,u=n.yAxis,d=n.left,p=n.top,f=n.width,g=n.height,v=n.isAnimationActive,x=n.background,_=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,S=ot("recharts-bar",o),A=c&&c.allowDataOverflow,O=u&&u.allowDataOverflow,j=A||O,E=et(_)?this.id:_;return L.createElement(Xt,{className:S},A||O?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(E)},L.createElement("rect",{x:A?d:d-f/2,y:O?p:p-g/2,width:A?f:f*2,height:O?g:g*2}))):null,L.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(E,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,E),(!v||b)&&Da.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}}])})(P.PureComponent);z$=ea;Ia(ea,"displayName","Bar");Ia(ea,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!kl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ia(ea,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,c=t.xAxisTicks,u=t.yAxisTicks,d=t.stackedData,p=t.dataStartIndex,f=t.displayedData,g=t.offset,v=qX(n,r);if(!v)return null;var x=e.layout,_=r.type.defaultProps,b=_!==void 0?Jt(Jt({},_),r.props):r.props,S=b.dataKey,A=b.children,O=b.minPointSize,j=x==="horizontal"?o:a,E=d?j.scale.domain():null,T=YX({numericAxis:j}),N=jn(A,vI),R=f.map(function(M,J){var F,B,K,W,X,Y;d?F=FX(d[p+J],E):(F=dn(M,S),Array.isArray(F)||(F=[T,F]));var te=yee(O,z$.defaultProps.minPointSize)(F[1],J);if(x==="horizontal"){var H,Q=[o.scale(F[0]),o.scale(F[1])],U=Q[0],I=Q[1];B=Rj({axis:a,ticks:c,bandSize:i,offset:v.offset,entry:M,index:J}),K=(H=I??U)!==null&&H!==void 0?H:void 0,W=v.size;var $=U-I;if(X=Number.isNaN($)?0:$,Y={x:B,y:o.y,width:W,height:o.height},Math.abs(te)>0&&Math.abs(X)<Math.abs(te)){var V=Jn(X||te)*(Math.abs(te)-Math.abs(X));K-=V,X+=V}}else{var oe=[a.scale(F[0]),a.scale(F[1])],le=oe[0],ve=oe[1];if(B=le,K=Rj({axis:o,ticks:u,bandSize:i,offset:v.offset,entry:M,index:J}),W=ve-le,X=v.size,Y={x:a.x,y:K,width:a.width,height:X},Math.abs(te)>0&&Math.abs(W)<Math.abs(te)){var qe=Jn(W||te)*(Math.abs(te)-Math.abs(W));W+=qe}}return Jt(Jt(Jt({},M),{},{x:B,y:K,width:W,height:X,value:d?F:F[1],payload:M,background:Y},N&&N[J]&&N[J].props),{},{tooltipPayload:[S$(r,M)],tooltipPosition:{x:B+W/2,y:K+X/2}})});return Jt({data:R,layout:x},g)});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)}function Tee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function VC(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,q$(n.key),n)}}function jee(t,e,r){return e&&VC(t.prototype,e),r&&VC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function XC(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 Hn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?XC(Object(r),!0).forEach(function(n){Rp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Rp(t,e,r){return e=q$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function q$(t){var e=Cee(t,"string");return Eu(e)=="symbol"?e:e+""}function Cee(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)}var F$=function(e,r,n,i,a){var o=e.width,c=e.height,u=e.layout,d=e.children,p=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:c-n.bottom,bottomMirror:c-n.bottom},g=!!sn(d,ea);return p.reduce(function(v,x){var _=r[x],b=_.orientation,S=_.domain,A=_.padding,O=A===void 0?{}:A,j=_.mirror,E=_.reversed,T="".concat(b).concat(j?"Mirror":""),N,R,M,J,F;if(_.type==="number"&&(_.padding==="gap"||_.padding==="no-gap")){var B=S[1]-S[0],K=1/0,W=_.categoricalDomain.sort(O9);if(W.forEach(function(oe,le){le>0&&(K=Math.min((oe||0)-(W[le-1]||0),K))}),Number.isFinite(K)){var X=K/B,Y=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(N=X*Y/2),_.padding==="no-gap"){var te=$o(e.barCategoryGap,X*Y),H=X*Y/2;N=H-te-(H-te)/Y*te}}}i==="xAxis"?R=[n.left+(O.left||0)+(N||0),n.left+n.width-(O.right||0)-(N||0)]:i==="yAxis"?R=u==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(N||0),n.top+n.height-(O.bottom||0)-(N||0)]:R=_.range,E&&(R=[R[1],R[0]]);var Q=BX(_,a,g),U=Q.scale,I=Q.realScaleType;U.domain(S).range(R),UX(U);var $=XX(U,Hn(Hn({},_),{},{realScaleType:I}));i==="xAxis"?(F=b==="top"&&!j||b==="bottom"&&j,M=n.left,J=f[T]-F*_.height):i==="yAxis"&&(F=b==="left"&&!j||b==="right"&&j,M=f[T]-F*_.width,J=n.top);var V=Hn(Hn(Hn({},_),$),{},{realScaleType:I,x:M,y:J,scale:U,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return V.bandSize=Sh(V,$),!_.hide&&i==="xAxis"?f[T]+=(F?-1:1)*V.height:_.hide||(f[T]+=(F?-1:1)*V.width),Hn(Hn({},v),{},Rp({},x,V))},{})},H$=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)}},Nee=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return H$({x:r,y:n},{x:i,y:a})},W$=(function(){function t(e){Tee(this,t),this.scale=e}return jee(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 c=this.bandwidth?this.bandwidth():0;return this.scale(r)+c}default:return this.scale(r)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+u}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)}}])})();Rp(W$,"EPS",1e-4);var Y1=function(e){var r=Object.keys(e).reduce(function(n,i){return Hn(Hn({},n),{},Rp({},i,W$.create(e[i])))},{});return Hn(Hn({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,c=a.position;return aee(i,function(u,d){return r[d].apply(u,{bandAware:o,position:c})})},isInRange:function(i){return D$(i,function(a,o){return r[o].isInRange(a)})}})};function Pee(t){return(t%180+180)%180}var Ree=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Pee(i),o=a*Math.PI/180,c=Math.atan(n/r),u=o>c&&o<Math.PI-c?n/Math.sin(o):r/Math.cos(o);return Math.abs(u)},Ab,YC;function Iee(){if(YC)return Ab;YC=1;var t=Wa(),e=Du(),r=yp();function n(i){return function(a,o,c){var u=Object(a);if(!e(a)){var d=t(o,3);a=r(a),o=function(f){return d(u[f],f,u)}}var p=i(a,o,c);return p>-1?u[d?a[p]:p]:void 0}}return Ab=n,Ab}var Tb,JC;function $ee(){if(JC)return Tb;JC=1;var t=I$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return Tb=e,Tb}var jb,ZC;function Mee(){if(ZC)return jb;ZC=1;var t=iI(),e=Wa(),r=$ee(),n=Math.max;function i(a,o,c){var u=a==null?0:a.length;if(!u)return-1;var d=c==null?0:r(c);return d<0&&(d=n(u+d,0)),t(a,e(o,3),d)}return jb=i,jb}var Cb,QC;function Lee(){if(QC)return Cb;QC=1;var t=Iee(),e=Mee(),r=t(e);return Cb=r,Cb}var Dee=Lee();const zee=vt(Dee);var Bee=xR();const Uee=vt(Bee);var qee=Uee(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("")}),J1=P.createContext(void 0),Z1=P.createContext(void 0),G$=P.createContext(void 0),K$=P.createContext({}),V$=P.createContext(void 0),X$=P.createContext(0),Y$=P.createContext(0),eN=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,c=e.children,u=e.width,d=e.height,p=qee(a);return L.createElement(J1.Provider,{value:n},L.createElement(Z1.Provider,{value:i},L.createElement(K$.Provider,{value:a},L.createElement(G$.Provider,{value:p},L.createElement(V$.Provider,{value:o},L.createElement(X$.Provider,{value:d},L.createElement(Y$.Provider,{value:u},c)))))))},Fee=function(){return P.useContext(V$)},J$=function(e){var r=P.useContext(J1);r==null&&Lo();var n=r[e];return n==null&&Lo(),n},Hee=function(){var e=P.useContext(J1);return Pa(e)},Wee=function(){var e=P.useContext(Z1),r=zee(e,function(n){return D$(n.domain,Number.isFinite)});return r||Pa(e)},Z$=function(e){var r=P.useContext(Z1);r==null&&Lo();var n=r[e];return n==null&&Lo(),n},Gee=function(){var e=P.useContext(G$);return e},Kee=function(){return P.useContext(K$)},Q1=function(){return P.useContext(Y$)},e_=function(){return P.useContext(X$)};function ol(t){"@babel/helpers - typeof";return ol=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},ol(t)}function Vee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xee(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,eM(n.key),n)}}function Yee(t,e,r){return e&&Xee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jee(t,e,r){return e=Dh(e),Zee(t,Q$()?Reflect.construct(e,r||[],Dh(t).constructor):e.apply(t,r))}function Zee(t,e){if(e&&(ol(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qee(t)}function Qee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Q$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q$=function(){return!!t})()}function Dh(t){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dh(t)}function ete(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&&ow(t,e)}function ow(t,e){return ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ow(t,e)}function tN(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 rN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tN(Object(r),!0).forEach(function(n){t_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function t_(t,e,r){return e=eM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function eM(t){var e=tte(t,"string");return ol(e)=="symbol"?e:e+""}function tte(t,e){if(ol(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function rte(t,e){return ote(t)||ate(t,e)||ite(t,e)||nte()}function nte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
498
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ite(t,e){if(t){if(typeof t=="string")return nN(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 nN(t,e)}}function nN(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 ate(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function ote(t){if(Array.isArray(t))return t}function sw(){return sw=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},sw.apply(this,arguments)}var ste=function(e,r){var n;return L.isValidElement(e)?n=L.cloneElement(e,r):Je(e)?n=e(r):n=L.createElement("line",sw({},r,{className:"recharts-reference-line-line"})),n},lte=function(e,r,n,i,a,o,c,u,d){var p=a.x,f=a.y,g=a.width,v=a.height;if(n){var x=d.y,_=e.y.apply(x,{position:o});if(ki(d,"discard")&&!e.y.isInRange(_))return null;var b=[{x:p+g,y:_},{x:p,y:_}];return u==="left"?b.reverse():b}if(r){var S=d.x,A=e.x.apply(S,{position:o});if(ki(d,"discard")&&!e.x.isInRange(A))return null;var O=[{x:A,y:f+v},{x:A,y:f}];return c==="top"?O.reverse():O}if(i){var j=d.segment,E=j.map(function(T){return e.apply(T,{position:o})});return ki(d,"discard")&&tee(E,function(T){return!e.isInRange(T)})?null:E}return null};function cte(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,c=t.className,u=t.alwaysShow,d=Fee(),p=J$(i),f=Z$(a),g=Gee();if(!d||!g)return null;Ki(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=Y1({x:p.scale,y:f.scale}),x=or(e),_=or(r),b=n&&n.length===2,S=lte(v,x,_,b,g,t.position,p.orientation,f.orientation,t);if(!S)return null;var A=rte(S,2),O=A[0],j=O.x,E=O.y,T=A[1],N=T.x,R=T.y,M=ki(t,"hidden")?"url(#".concat(d,")"):void 0,J=rN(rN({clipPath:M},it(t,!0)),{},{x1:j,y1:E,x2:N,y2:R});return L.createElement(Xt,{className:ot("recharts-reference-line",c)},ste(o,J),Cr.renderCallByParent(t,Nee({x1:j,y1:E,x2:N,y2:R})))}var r_=(function(t){function e(){return Vee(this,e),Jee(this,e,arguments)}return ete(e,t),Yee(e,[{key:"render",value:function(){return L.createElement(cte,this.props)}}])})(L.Component);t_(r_,"displayName","ReferenceLine");t_(r_,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function lw(){return lw=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},lw.apply(this,arguments)}function sl(t){"@babel/helpers - typeof";return sl=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},sl(t)}function iN(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 aN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iN(Object(r),!0).forEach(function(n){Ip(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ute(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,rM(n.key),n)}}function fte(t,e,r){return e&&dte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hte(t,e,r){return e=zh(e),pte(t,tM()?Reflect.construct(e,r||[],zh(t).constructor):e.apply(t,r))}function pte(t,e){if(e&&(sl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mte(t)}function mte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tM=function(){return!!t})()}function zh(t){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(t)}function gte(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&&cw(t,e)}function cw(t,e){return cw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cw(t,e)}function Ip(t,e,r){return e=rM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rM(t){var e=yte(t,"string");return sl(e)=="symbol"?e:e+""}function yte(t,e){if(sl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var vte=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=Y1({x:i.scale,y:a.scale}),c=o.apply({x:r,y:n},{bandAware:!0});return ki(e,"discard")&&!o.isInRange(c)?null:c},$p=(function(t){function e(){return ute(this,e),hte(this,e,arguments)}return gte(e,t),fte(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,c=n.alwaysShow,u=n.clipPathId,d=or(i),p=or(a);if(Ki(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!p)return null;var f=vte(this.props);if(!f)return null;var g=f.x,v=f.y,x=this.props,_=x.shape,b=x.className,S=ki(this.props,"hidden")?"url(#".concat(u,")"):void 0,A=aN(aN({clipPath:S},it(this.props,!0)),{},{cx:g,cy:v});return L.createElement(Xt,{className:ot("recharts-reference-dot",b)},e.renderDot(_,A),Cr.renderCallByParent(this.props,{x:g-o,y:v-o,width:2*o,height:2*o}))}}])})(L.Component);Ip($p,"displayName","ReferenceDot");Ip($p,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Ip($p,"renderDot",function(t,e){var r;return L.isValidElement(t)?r=L.cloneElement(t,e):Je(t)?r=t(e):r=L.createElement(X1,lw({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function uw(){return uw=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},uw.apply(this,arguments)}function ll(t){"@babel/helpers - typeof";return ll=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},ll(t)}function oN(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 sN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oN(Object(r),!0).forEach(function(n){Mp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xte(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,iM(n.key),n)}}function wte(t,e,r){return e&&xte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _te(t,e,r){return e=Bh(e),Ste(t,nM()?Reflect.construct(e,r||[],Bh(t).constructor):e.apply(t,r))}function Ste(t,e){if(e&&(ll(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kte(t)}function kte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nM=function(){return!!t})()}function Bh(t){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bh(t)}function Ete(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&&dw(t,e)}function dw(t,e){return dw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dw(t,e)}function Mp(t,e,r){return e=iM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iM(t){var e=Ote(t,"string");return ll(e)=="symbol"?e:e+""}function Ote(t,e){if(ll(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ll(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ate=function(e,r,n,i,a){var o=a.x1,c=a.x2,u=a.y1,d=a.y2,p=a.xAxis,f=a.yAxis;if(!p||!f)return null;var g=Y1({x:p.scale,y:f.scale}),v={x:e?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:n?g.y.apply(u,{position:"start"}):g.y.rangeMin},x={x:r?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:i?g.y.apply(d,{position:"end"}):g.y.rangeMax};return ki(a,"discard")&&(!g.isInRange(v)||!g.isInRange(x))?null:H$(v,x)},Lp=(function(t){function e(){return bte(this,e),_te(this,e,arguments)}return Ete(e,t),wte(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,c=n.y2,u=n.className,d=n.alwaysShow,p=n.clipPathId;Ki(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=or(i),g=or(a),v=or(o),x=or(c),_=this.props.shape;if(!f&&!g&&!v&&!x&&!_)return null;var b=Ate(f,g,v,x,this.props);if(!b&&!_)return null;var S=ki(this.props,"hidden")?"url(#".concat(p,")"):void 0;return L.createElement(Xt,{className:ot("recharts-reference-area",u)},e.renderRect(_,sN(sN({clipPath:S},it(this.props,!0)),b)),Cr.renderCallByParent(this.props,b))}}])})(L.Component);Mp(Lp,"displayName","ReferenceArea");Mp(Lp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Mp(Lp,"renderRect",function(t,e){var r;return L.isValidElement(t)?r=L.cloneElement(t,e):Je(t)?r=t(e):r=L.createElement(V1,uw({},e,{className:"recharts-reference-area-rect"})),r});function aM(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 Tte(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Ree(n,r)}function jte(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,c=t.height;return e===1?{start:n?i:a,end:n?i+o:a+c}:{start:n?i+o:a+c,end:n?i:a}}function Uh(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 Cte(t,e){return aM(t,e+1)}function Nte(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,c=e.end,u=0,d=1,p=o,f=function(){var x=n==null?void 0:n[u];if(x===void 0)return{v:aM(n,d)};var _=u,b,S=function(){return b===void 0&&(b=r(x,_)),b},A=x.coordinate,O=u===0||Uh(t,A,S,p,c);O||(u=0,p=o,d+=1),O&&(p=A+t*(S()/2+i),u+=d)},g;d<=a.length;)if(g=f(),g)return g.v;return[]}function Ou(t){"@babel/helpers - typeof";return Ou=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},Ou(t)}function lN(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 jr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lN(Object(r),!0).forEach(function(n){Pte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pte(t,e,r){return e=Rte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rte(t){var e=Ite(t,"string");return Ou(e)=="symbol"?e:e+""}function Ite(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $te(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,c=e.start,u=e.end,d=function(g){var v=a[g],x,_=function(){return x===void 0&&(x=r(v,g)),x};if(g===o-1){var b=t*(v.coordinate+t*_()/2-u);a[g]=v=jr(jr({},v),{},{tickCoord:b>0?v.coordinate-b*t:v.coordinate})}else a[g]=v=jr(jr({},v),{},{tickCoord:v.coordinate});var S=Uh(t,v.tickCoord,_,c,u);S&&(u=v.tickCoord-t*(_()/2+i),a[g]=jr(jr({},v),{},{isShow:!0}))},p=o-1;p>=0;p--)d(p);return a}function Mte(t,e,r,n,i,a){var o=(n||[]).slice(),c=o.length,u=e.start,d=e.end;if(a){var p=n[c-1],f=r(p,c-1),g=t*(p.coordinate+t*f/2-d);o[c-1]=p=jr(jr({},p),{},{tickCoord:g>0?p.coordinate-g*t:p.coordinate});var v=Uh(t,p.tickCoord,function(){return f},u,d);v&&(d=p.tickCoord-t*(f/2+i),o[c-1]=jr(jr({},p),{},{isShow:!0}))}for(var x=a?c-1:c,_=function(A){var O=o[A],j,E=function(){return j===void 0&&(j=r(O,A)),j};if(A===0){var T=t*(O.coordinate-t*E()/2-u);o[A]=O=jr(jr({},O),{},{tickCoord:T<0?O.coordinate-T*t:O.coordinate})}else o[A]=O=jr(jr({},O),{},{tickCoord:O.coordinate});var N=Uh(t,O.tickCoord,E,u,d);N&&(u=O.tickCoord+t*(E()/2+i),o[A]=jr(jr({},O),{},{isShow:!0}))},b=0;b<x;b++)_(b);return o}function n_(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,c=t.orientation,u=t.interval,d=t.tickFormatter,p=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(ge(u)||kl.isSsr)return Cte(i,typeof u=="number"&&ge(u)?u:0);var g=[],v=c==="top"||c==="bottom"?"width":"height",x=p&&v==="width"?$c(p,{fontSize:e,letterSpacing:r}):{width:0,height:0},_=function(O,j){var E=Je(d)?d(O.value,j):O.value;return v==="width"?Tte($c(E,{fontSize:e,letterSpacing:r}),x,f):$c(E,{fontSize:e,letterSpacing:r})[v]},b=i.length>=2?Jn(i[1].coordinate-i[0].coordinate):1,S=jte(a,b,v);return u==="equidistantPreserveStart"?Nte(b,S,_,i,o):(u==="preserveStart"||u==="preserveStartEnd"?g=Mte(b,S,_,i,o,u==="preserveStartEnd"):g=$te(b,S,_,i,o),g.filter(function(A){return A.isShow}))}var Lte=["viewBox"],Dte=["viewBox"],zte=["ticks"];function cl(t){"@babel/helpers - typeof";return cl=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},cl(t)}function Ms(){return Ms=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},Ms.apply(this,arguments)}function cN(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 ir(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cN(Object(r),!0).forEach(function(n){i_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Nb(t,e){if(t==null)return{};var r=Bte(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 Bte(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 Ute(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uN(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,sM(n.key),n)}}function qte(t,e,r){return e&&uN(t.prototype,e),r&&uN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fte(t,e,r){return e=qh(e),Hte(t,oM()?Reflect.construct(e,r||[],qh(t).constructor):e.apply(t,r))}function Hte(t,e){if(e&&(cl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wte(t)}function Wte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oM=function(){return!!t})()}function qh(t){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qh(t)}function Gte(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&&fw(t,e)}function fw(t,e){return fw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fw(t,e)}function i_(t,e,r){return e=sM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sM(t){var e=Kte(t,"string");return cl(e)=="symbol"?e:e+""}function Kte(t,e){if(cl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Tl=(function(t){function e(r){var n;return Ute(this,e),n=Fte(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return Gte(e,t),qte(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Nb(n,Lte),c=this.props,u=c.viewBox,d=Nb(c,Dte);return!Us(a,u)||!Us(o,d)||!Us(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,c=i.width,u=i.height,d=i.orientation,p=i.tickSize,f=i.mirror,g=i.tickMargin,v,x,_,b,S,A,O=f?-1:1,j=n.tickSize||p,E=ge(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":v=x=n.coordinate,b=o+ +!f*u,_=b-O*j,A=_-O*g,S=E;break;case"left":_=b=n.coordinate,x=a+ +!f*c,v=x-O*j,S=v-O*g,A=E;break;case"right":_=b=n.coordinate,x=a+ +f*c,v=x+O*j,S=v+O*g,A=E;break;default:v=x=n.coordinate,b=o+ +f*u,_=b+O*j,A=_+O*g,S=E;break}return{line:{x1:v,y1:_,x2:x,y2:b},tick:{x:S,y:A}}}},{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,c=n.height,u=n.orientation,d=n.mirror,p=n.axisLine,f=ir(ir(ir({},it(this.props,!1)),it(p,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var g=+(u==="top"&&!d||u==="bottom"&&d);f=ir(ir({},f),{},{x1:i,y1:a+g*c,x2:i+o,y2:a+g*c})}else{var v=+(u==="left"&&!d||u==="right"&&d);f=ir(ir({},f),{},{x1:i+v*o,y1:a,x2:i+v*o,y2:a+c})}return L.createElement("line",Ms({},f,{className:ot("recharts-cartesian-axis-line",Tn(p,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,c=this.props,u=c.tickLine,d=c.stroke,p=c.tick,f=c.tickFormatter,g=c.unit,v=n_(ir(ir({},this.props),{},{ticks:n}),i,a),x=this.getTickTextAnchor(),_=this.getTickVerticalAnchor(),b=it(this.props,!1),S=it(p,!1),A=ir(ir({},b),{},{fill:"none"},it(u,!1)),O=v.map(function(j,E){var T=o.getTickLineCoord(j),N=T.line,R=T.tick,M=ir(ir(ir(ir({textAnchor:x,verticalAnchor:_},b),{},{stroke:"none",fill:d},S),R),{},{index:E,payload:j,visibleTicksCount:v.length,tickFormatter:f});return L.createElement(Xt,Ms({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},Yf(o.props,j,E)),u&&L.createElement("line",Ms({},A,N,{className:ot("recharts-cartesian-axis-tick-line",Tn(u,"className"))})),p&&e.renderTickItem(p,M,"".concat(Je(f)?f(j.value,E):j.value).concat(g||"")))});return L.createElement("g",{className:"recharts-cartesian-axis-ticks"},O)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,c=i.height,u=i.ticksGenerator,d=i.className,p=i.hide;if(p)return null;var f=this.props,g=f.ticks,v=Nb(f,zte),x=g;return Je(u)&&(x=g&&g.length>0?u(this.props):u(v)),o<=0||c<=0||!x||!x.length?null:L.createElement(Xt,{className:ot("recharts-cartesian-axis",d),ref:function(b){n.layerReference=b}},a&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),Cr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,c=ot(i.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(n)?o=L.cloneElement(n,ir(ir({},i),{},{className:c})):Je(n)?o=n(ir(ir({},i),{},{className:c})):o=L.createElement(lh,Ms({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(P.Component);i_(Tl,"displayName","CartesianAxis");i_(Tl,"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 Vte=["x1","y1","x2","y2","key"],Xte=["offset"];function Do(t){"@babel/helpers - typeof";return Do=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},Do(t)}function dN(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 Nr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dN(Object(r),!0).forEach(function(n){Yte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yte(t,e,r){return e=Jte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jte(t){var e=Zte(t,"string");return Do(e)=="symbol"?e:e+""}function Zte(t,e){if(Do(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Do(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function To(){return To=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},To.apply(this,arguments)}function fN(t,e){if(t==null)return{};var r=Qte(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 Qte(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 ere=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,c=e.height,u=e.ry;return L.createElement("rect",{x:i,y:a,ry:u,width:o,height:c,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function lM(t,e){var r;if(L.isValidElement(t))r=L.cloneElement(t,e);else if(Je(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,c=e.key,u=fN(e,Vte),d=it(u,!1);d.offset;var p=fN(d,Xte);r=L.createElement("line",To({},p,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:c}))}return r}function tre(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(c,u){var d=Nr(Nr({},t),{},{x1:e,y1:c,x2:e+r,y2:c,key:"line-".concat(u),index:u});return lM(i,d)});return L.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function rre(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(c,u){var d=Nr(Nr({},t),{},{x1:c,y1:e,x2:c,y2:e+r,key:"line-".concat(u),index:u});return lM(i,d)});return L.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function nre(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,c=t.horizontalPoints,u=t.horizontal,d=u===void 0?!0:u;if(!d||!e||!e.length)return null;var p=c.map(function(g){return Math.round(g+i-i)}).sort(function(g,v){return g-v});i!==p[0]&&p.unshift(0);var f=p.map(function(g,v){var x=!p[v+1],_=x?i+o-g:p[v+1]-g;if(_<=0)return null;var b=v%e.length;return L.createElement("rect",{key:"react-".concat(v),y:g,x:n,height:_,width:a,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function ire(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,c=t.width,u=t.height,d=t.verticalPoints;if(!r||!n||!n.length)return null;var p=d.map(function(g){return Math.round(g+a-a)}).sort(function(g,v){return g-v});a!==p[0]&&p.unshift(0);var f=p.map(function(g,v){var x=!p[v+1],_=x?a+c-g:p[v+1]-g;if(_<=0)return null;var b=v%n.length;return L.createElement("rect",{key:"react-".concat(v),x:g,y:o,width:_,height:u,stroke:"none",fill:n[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var are=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return w$(n_(Nr(Nr(Nr({},Tl.defaultProps),n),{},{ticks:Wi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},ore=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return w$(n_(Nr(Nr(Nr({},Tl.defaultProps),n),{},{ticks:Wi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},As={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Au(t){var e,r,n,i,a,o,c=Q1(),u=e_(),d=Kee(),p=Nr(Nr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:As.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:As.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:As.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:As.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:As.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:As.verticalFill,x:ge(t.x)?t.x:d.left,y:ge(t.y)?t.y:d.top,width:ge(t.width)?t.width:d.width,height:ge(t.height)?t.height:d.height}),f=p.x,g=p.y,v=p.width,x=p.height,_=p.syncWithTicks,b=p.horizontalValues,S=p.verticalValues,A=Hee(),O=Wee();if(!ge(v)||v<=0||!ge(x)||x<=0||!ge(f)||f!==+f||!ge(g)||g!==+g)return null;var j=p.verticalCoordinatesGenerator||are,E=p.horizontalCoordinatesGenerator||ore,T=p.horizontalPoints,N=p.verticalPoints;if((!T||!T.length)&&Je(E)){var R=b&&b.length,M=E({yAxis:O?Nr(Nr({},O),{},{ticks:R?b:O.ticks}):void 0,width:c,height:u,offset:d},R?!0:_);Ki(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Do(M),"]")),Array.isArray(M)&&(T=M)}if((!N||!N.length)&&Je(j)){var J=S&&S.length,F=j({xAxis:A?Nr(Nr({},A),{},{ticks:J?S:A.ticks}):void 0,width:c,height:u,offset:d},J?!0:_);Ki(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Do(F),"]")),Array.isArray(F)&&(N=F)}return L.createElement("g",{className:"recharts-cartesian-grid"},L.createElement(ere,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),L.createElement(tre,To({},p,{offset:d,horizontalPoints:T,xAxis:A,yAxis:O})),L.createElement(rre,To({},p,{offset:d,verticalPoints:N,xAxis:A,yAxis:O})),L.createElement(nre,To({},p,{horizontalPoints:T})),L.createElement(ire,To({},p,{verticalPoints:N})))}Au.displayName="CartesianGrid";var sre=["type","layout","connectNulls","ref"],lre=["key"];function ul(t){"@babel/helpers - typeof";return ul=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},ul(t)}function hN(t,e){if(t==null)return{};var r=cre(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 cre(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 zc(){return zc=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},zc.apply(this,arguments)}function pN(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 an(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pN(Object(r),!0).forEach(function(n){Wn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ts(t){return hre(t)||fre(t)||dre(t)||ure()}function ure(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
499
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dre(t,e){if(t){if(typeof t=="string")return hw(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 hw(t,e)}}function fre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hre(t){if(Array.isArray(t))return hw(t)}function hw(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 pre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mN(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,uM(n.key),n)}}function mre(t,e,r){return e&&mN(t.prototype,e),r&&mN(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function gre(t,e,r){return e=Fh(e),yre(t,cM()?Reflect.construct(e,r||[],Fh(t).constructor):e.apply(t,r))}function yre(t,e){if(e&&(ul(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vre(t)}function vre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cM=function(){return!!t})()}function Fh(t){return Fh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fh(t)}function bre(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&&pw(t,e)}function pw(t,e){return pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pw(t,e)}function Wn(t,e,r){return e=uM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uM(t){var e=xre(t,"string");return ul(e)=="symbol"?e:e+""}function xre(t,e){if(ul(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Hu=(function(t){function e(){var r;pre(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=gre(this,e,[].concat(i)),Wn(r,"state",{isAnimationFinished:!0,totalLength:0}),Wn(r,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Wn(r,"getStrokeDasharray",function(o,c,u){var d=u.reduce(function(S,A){return S+A});if(!d)return r.generateSimpleStrokeDasharray(c,o);for(var p=Math.floor(o/d),f=o%d,g=c-o,v=[],x=0,_=0;x<u.length;_+=u[x],++x)if(_+u[x]>f){v=[].concat(Ts(u.slice(0,x)),[f-_]);break}var b=v.length%2===0?[0,g]:[g];return[].concat(Ts(e.repeat(u,p)),Ts(v),b).map(function(S){return"".concat(S,"px")}).join(", ")}),Wn(r,"id",Lu("recharts-line-")),Wn(r,"pathRef",function(o){r.mainCurve=o}),Wn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Wn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return bre(e,t),mre(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,c=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,f=jn(p,Fu);if(!f)return null;var g=function(_,b){return{x:_.x,y:_.y,value:_.value,errorVal:dn(_.payload,b)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return L.createElement(Xt,v,f.map(function(x){return L.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:c,yAxis:u,layout:d,dataPointFormatter:g})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,u=c.dot,d=c.points,p=c.dataKey,f=it(this.props,!1),g=it(u,!0),v=d.map(function(_,b){var S=an(an(an({key:"dot-".concat(b),r:3},f),g),{},{index:b,cx:_.x,cy:_.y,value:_.value,dataKey:p,payload:_.payload,points:d});return e.renderDotItem(u,S)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return L.createElement(Xt,zc({className:"recharts-line-dots",key:"dots"},x),v)}},{key:"renderCurveStatically",value:function(n,i,a,o){var c=this.props,u=c.type,d=c.layout,p=c.connectNulls;c.ref;var f=hN(c,sre),g=an(an(an({},it(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:d,connectNulls:p});return L.createElement(Wx,zc({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,c=o.points,u=o.strokeDasharray,d=o.isAnimationActive,p=o.animationBegin,f=o.animationDuration,g=o.animationEasing,v=o.animationId,x=o.animateNewValues,_=o.width,b=o.height,S=this.state,A=S.prevPoints,O=S.totalLength;return L.createElement(Qi,{begin:p,duration:f,isActive:d,easing:g,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var E=j.t;if(A){var T=A.length/c.length,N=c.map(function(B,K){var W=Math.floor(K*T);if(A[W]){var X=A[W],Y=Vn(X.x,B.x),te=Vn(X.y,B.y);return an(an({},B),{},{x:Y(E),y:te(E)})}if(x){var H=Vn(_*2,B.x),Q=Vn(b/2,B.y);return an(an({},B),{},{x:H(E),y:Q(E)})}return an(an({},B),{},{x:B.x,y:B.y})});return a.renderCurveStatically(N,n,i)}var R=Vn(0,O),M=R(E),J;if(u){var F="".concat(u).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});J=a.getStrokeDasharray(M,O,F)}else J=a.generateSimpleStrokeDasharray(O,M);return a.renderCurveStatically(c,n,i,{strokeDasharray:J})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,c=a.isAnimationActive,u=this.state,d=u.prevPoints,p=u.totalLength;return c&&o&&o.length&&(!d&&p>0||!Tp(d,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,c=i.points,u=i.className,d=i.xAxis,p=i.yAxis,f=i.top,g=i.left,v=i.width,x=i.height,_=i.isAnimationActive,b=i.id;if(a||!c||!c.length)return null;var S=this.state.isAnimationFinished,A=c.length===1,O=ot("recharts-line",u),j=d&&d.allowDataOverflow,E=p&&p.allowDataOverflow,T=j||E,N=et(b)?this.id:b,R=(n=it(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},M=R.r,J=M===void 0?3:M,F=R.strokeWidth,B=F===void 0?2:F,K=$9(o)?o:{},W=K.clipDot,X=W===void 0?!0:W,Y=J*2+B;return L.createElement(Xt,{className:O},j||E?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(N)},L.createElement("rect",{x:j?g:g-v/2,y:E?f:f-x/2,width:j?v:v*2,height:E?x:x*2})),!X&&L.createElement("clipPath",{id:"clipPath-dots-".concat(N)},L.createElement("rect",{x:g-Y/2,y:f-Y/2,width:v+Y,height:x+Y}))):null,!A&&this.renderCurve(T,N),this.renderErrorBar(T,N),(A||o)&&this.renderDots(T,X,N),(!_||S)&&Da.renderCallByParent(this.props,c))}}],[{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(Ts(n),[0]):n,o=[],c=0;c<i;++c)o=[].concat(Ts(o),Ts(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(L.isValidElement(n))a=L.cloneElement(n,i);else if(Je(n))a=n(i);else{var o=i.key,c=hN(i,lre),u=ot("recharts-line-dot",typeof n!="boolean"?n.className:"");a=L.createElement(X1,zc({key:o},c,{className:u}))}return a}}])})(P.PureComponent);Wn(Hu,"displayName","Line");Wn(Hu,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!kl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Hu,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,c=t.bandSize,u=t.displayedData,d=t.offset,p=e.layout,f=u.map(function(g,v){var x=dn(g,o);return p==="horizontal"?{x:Pj({axis:r,ticks:i,bandSize:c,entry:g,index:v}),y:et(x)?null:n.scale(x),value:x,payload:g}:{x:et(x)?null:r.scale(x),y:Pj({axis:n,ticks:a,bandSize:c,entry:g,index:v}),value:x,payload:g}});return an({points:f,layout:p},d)});function dl(t){"@babel/helpers - typeof";return dl=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},dl(t)}function wre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _re(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,hM(n.key),n)}}function Sre(t,e,r){return e&&_re(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kre(t,e,r){return e=Hh(e),Ere(t,dM()?Reflect.construct(e,r||[],Hh(t).constructor):e.apply(t,r))}function Ere(t,e){if(e&&(dl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ore(t)}function Ore(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dM=function(){return!!t})()}function Hh(t){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hh(t)}function Are(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&&mw(t,e)}function mw(t,e){return mw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mw(t,e)}function fM(t,e,r){return e=hM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hM(t){var e=Tre(t,"string");return dl(e)=="symbol"?e:e+""}function Tre(t,e){if(dl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function gw(){return gw=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},gw.apply(this,arguments)}function jre(t){var e=t.xAxisId,r=Q1(),n=e_(),i=J$(e);return i==null?null:P.createElement(Tl,gw({},i,{className:ot("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Wi(o,!0)}}))}var Ba=(function(t){function e(){return wre(this,e),kre(this,e,arguments)}return Are(e,t),Sre(e,[{key:"render",value:function(){return P.createElement(jre,this.props)}}])})(P.Component);fM(Ba,"displayName","XAxis");fM(Ba,"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 fl(t){"@babel/helpers - typeof";return fl=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},fl(t)}function Cre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nre(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,gM(n.key),n)}}function Pre(t,e,r){return e&&Nre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rre(t,e,r){return e=Wh(e),Ire(t,pM()?Reflect.construct(e,r||[],Wh(t).constructor):e.apply(t,r))}function Ire(t,e){if(e&&(fl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $re(t)}function $re(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pM=function(){return!!t})()}function Wh(t){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wh(t)}function Mre(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&&yw(t,e)}function yw(t,e){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yw(t,e)}function mM(t,e,r){return e=gM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gM(t){var e=Lre(t,"string");return fl(e)=="symbol"?e:e+""}function Lre(t,e){if(fl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function vw(){return vw=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},vw.apply(this,arguments)}var Dre=function(e){var r=e.yAxisId,n=Q1(),i=e_(),a=Z$(r);return a==null?null:P.createElement(Tl,vw({},a,{className:ot("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(c){return Wi(c,!0)}}))},Ua=(function(t){function e(){return Cre(this,e),Rre(this,e,arguments)}return Mre(e,t),Pre(e,[{key:"render",value:function(){return P.createElement(Dre,this.props)}}])})(P.Component);mM(Ua,"displayName","YAxis");mM(Ua,"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 gN(t){return qre(t)||Ure(t)||Bre(t)||zre()}function zre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
500
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bre(t,e){if(t){if(typeof t=="string")return bw(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 bw(t,e)}}function Ure(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function qre(t){if(Array.isArray(t))return bw(t)}function bw(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 xw=function(e,r,n,i,a){var o=jn(e,r_),c=jn(e,$p),u=[].concat(gN(o),gN(c)),d=jn(e,Lp),p="".concat(i,"Id"),f=i[0],g=r;if(u.length&&(g=u.reduce(function(_,b){if(b.props[p]===n&&ki(b.props,"extendDomain")&&ge(b.props[f])){var S=b.props[f];return[Math.min(_[0],S),Math.max(_[1],S)]}return _},g)),d.length){var v="".concat(f,"1"),x="".concat(f,"2");g=d.reduce(function(_,b){if(b.props[p]===n&&ki(b.props,"extendDomain")&&ge(b.props[v])&&ge(b.props[x])){var S=b.props[v],A=b.props[x];return[Math.min(_[0],S,A),Math.max(_[1],S,A)]}return _},g)}return a&&a.length&&(g=a.reduce(function(_,b){return ge(b)?[Math.min(_[0],b),Math.max(_[1],b)]:_},g)),g},Pb={exports:{}},yN;function Fre(){return yN||(yN=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(u,d,p){this.fn=u,this.context=d,this.once=p||!1}function a(u,d,p,f,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,f||u,g),x=r?r+d:d;return u._events[x]?u._events[x].fn?u._events[x]=[u._events[x],v]:u._events[x].push(v):(u._events[x]=v,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],p,f;if(this._eventsCount===0)return d;for(f in p=this._events)e.call(p,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},c.prototype.listeners=function(d){var p=r?r+d:d,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,x=new Array(v);g<v;g++)x[g]=f[g].fn;return x},c.prototype.listenerCount=function(d){var p=r?r+d:d,f=this._events[p];return f?f.fn?1:f.length:0},c.prototype.emit=function(d,p,f,g,v,x){var _=r?r+d:d;if(!this._events[_])return!1;var b=this._events[_],S=arguments.length,A,O;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),S){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,f),!0;case 4:return b.fn.call(b.context,p,f,g),!0;case 5:return b.fn.call(b.context,p,f,g,v),!0;case 6:return b.fn.call(b.context,p,f,g,v,x),!0}for(O=1,A=new Array(S-1);O<S;O++)A[O-1]=arguments[O];b.fn.apply(b.context,A)}else{var j=b.length,E;for(O=0;O<j;O++)switch(b[O].once&&this.removeListener(d,b[O].fn,void 0,!0),S){case 1:b[O].fn.call(b[O].context);break;case 2:b[O].fn.call(b[O].context,p);break;case 3:b[O].fn.call(b[O].context,p,f);break;case 4:b[O].fn.call(b[O].context,p,f,g);break;default:if(!A)for(E=1,A=new Array(S-1);E<S;E++)A[E-1]=arguments[E];b[O].fn.apply(b[O].context,A)}}return!0},c.prototype.on=function(d,p,f){return a(this,d,p,f,!1)},c.prototype.once=function(d,p,f){return a(this,d,p,f,!0)},c.prototype.removeListener=function(d,p,f,g){var v=r?r+d:d;if(!this._events[v])return this;if(!p)return o(this,v),this;var x=this._events[v];if(x.fn)x.fn===p&&(!g||x.once)&&(!f||x.context===f)&&o(this,v);else{for(var _=0,b=[],S=x.length;_<S;_++)(x[_].fn!==p||g&&!x[_].once||f&&x[_].context!==f)&&b.push(x[_]);b.length?this._events[v]=b.length===1?b[0]:b:o(this,v)}return this},c.prototype.removeAllListeners=function(d){var p;return d?(p=r?r+d:d,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c})(Pb)),Pb.exports}var Hre=Fre();const Wre=vt(Hre);var Rb=new Wre,Ib="recharts.syncMouseEvents";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 Gre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kre(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,yM(n.key),n)}}function Vre(t,e,r){return e&&Kre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function $b(t,e,r){return e=yM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yM(t){var e=Xre(t,"string");return Tu(e)=="symbol"?e:e+""}function Xre(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 String(t)}var Yre=(function(){function t(){Gre(this,t),$b(this,"activeIndex",0),$b(this,"coordinateList",[]),$b(this,"layout","horizontal")}return Vre(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,c=o===void 0?null:o,u=r.layout,d=u===void 0?null:u,p=r.offset,f=p===void 0?null:p,g=r.mouseHandlerCallback,v=g===void 0?null:g;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=c??this.container,this.layout=d??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=v??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,c=i.height,u=this.coordinateList[this.activeIndex].coordinate,d=((r=window)===null||r===void 0?void 0:r.scrollX)||0,p=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+u+d,g=o+this.offset.top+c/2+p;this.mouseHandlerCallback({pageX:f,pageY:g})}}}])})();function Jre(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&&ge(n)&&ge(i))return!0}return!1}function Zre(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 vM(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=_r(e,r,n,i),c=_r(e,r,n,a);return{points:[o,c],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function Qre(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 c=e.cx,u=e.cy,d=e.innerRadius,p=e.outerRadius,f=e.angle,g=_r(c,u,d,f),v=_r(c,u,p,f);n=g.x,i=g.y,a=v.x,o=v.y}else return vM(e);return[{x:n,y:i},{x:a,y:o}]}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 vN(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 Ef(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vN(Object(r),!0).forEach(function(n){ene(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ene(t,e,r){return e=tne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tne(t){var e=rne(t,"string");return ju(e)=="symbol"?e:e+""}function rne(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)}function nne(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,c=t.activePayload,u=t.offset,d=t.activeTooltipIndex,p=t.tooltipAxisBandSize,f=t.layout,g=t.chartName,v=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!a||!o||g!=="ScatterChart"&&i!=="axis")return null;var x,_=Wx;if(g==="ScatterChart")x=o,_=tQ;else if(g==="BarChart")x=Zre(f,o,u,p),_=V1;else if(f==="radial"){var b=vM(o),S=b.cx,A=b.cy,O=b.radius,j=b.startAngle,E=b.endAngle;x={cx:S,cy:A,startAngle:j,endAngle:E,innerRadius:O,outerRadius:O},_=O$}else x={points:Qre(f,o,u)},_=Wx;var T=Ef(Ef(Ef(Ef({stroke:"#ccc",pointerEvents:"none"},u),x),it(v,!1)),{},{payload:c,payloadIndex:d,className:ot("recharts-tooltip-cursor",v.className)});return P.isValidElement(v)?P.cloneElement(v,T):P.createElement(_,T)}var ine=["item"],ane=["children","className","width","height","style","compact","title","desc"];function hl(t){"@babel/helpers - typeof";return hl=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},hl(t)}function Ls(){return Ls=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},Ls.apply(this,arguments)}function bN(t,e){return lne(t)||sne(t,e)||xM(t,e)||one()}function one(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
501
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sne(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,c=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return c}}function lne(t){if(Array.isArray(t))return t}function xN(t,e){if(t==null)return{};var r=cne(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 cne(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 une(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dne(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,wM(n.key),n)}}function fne(t,e,r){return e&&dne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hne(t,e,r){return e=Gh(e),pne(t,bM()?Reflect.construct(e,r||[],Gh(t).constructor):e.apply(t,r))}function pne(t,e){if(e&&(hl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mne(t)}function mne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bM=function(){return!!t})()}function Gh(t){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gh(t)}function gne(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&&ww(t,e)}function ww(t,e){return ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ww(t,e)}function pl(t){return bne(t)||vne(t)||xM(t)||yne()}function yne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
502
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xM(t,e){if(t){if(typeof t=="string")return _w(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 _w(t,e)}}function vne(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function bne(t){if(Array.isArray(t))return _w(t)}function _w(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 wN(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 ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wN(Object(r),!0).forEach(function(n){ze(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ze(t,e,r){return e=wM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wM(t){var e=xne(t,"string");return hl(e)=="symbol"?e:e+""}function xne(t,e){if(hl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wne={xAxis:["bottom","top"],yAxis:["left","right"]},_ne={width:"100%",height:"100%"},_M={x:0,y:0};function Of(t){return t}var Sne=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},kne=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,c=i.radius;return ie(ie(ie({},i),_r(i.cx,i.cy,c,o)),{},{angle:o,radius:c})}var u=a.coordinate,d=i.angle;return ie(ie(ie({},i),_r(i.cx,i.cy,u,d)),{},{angle:d,radius:u})}return _M},Dp=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(c,u){var d=u.props.data;return d&&d.length?[].concat(pl(c),pl(d)):c},[]);return o.length>0?o:e&&e.length&&ge(i)&&ge(a)?e.slice(i,a+1):[]};function SM(t){return t==="number"?[0,"auto"]:void 0}var Sw=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,c=Dp(r,e);return n<0||!a||!a.length||n>=c.length?null:a.reduce(function(u,d){var p,f=(p=d.props.data)!==null&&p!==void 0?p:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var v=f===void 0?c:f;g=Vf(v,o.dataKey,i)}else g=f&&f[n]||c[n];return g?[].concat(pl(u),[S$(d,g)]):u},[])},_N=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=Sne(a,n),c=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,p=IX(o,c,d,u);if(p>=0&&d){var f=d[p]&&d[p].value,g=Sw(e,r,p,f),v=kne(n,c,p,a);return{activeTooltipIndex:p,activeLabel:f,activePayload:g,activeCoordinate:v}}return null},Ene=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,f=e.children,g=e.stackOffset,v=x$(p,a);return n.reduce(function(x,_){var b,S=_.type.defaultProps!==void 0?ie(ie({},_.type.defaultProps),_.props):_.props,A=S.type,O=S.dataKey,j=S.allowDataOverflow,E=S.allowDuplicatedCategory,T=S.scale,N=S.ticks,R=S.includeHidden,M=S[o];if(x[M])return x;var J=Dp(e.data,{graphicalItems:i.filter(function($){var V,oe=o in $.props?$.props[o]:(V=$.type.defaultProps)===null||V===void 0?void 0:V[o];return oe===M}),dataStartIndex:u,dataEndIndex:d}),F=J.length,B,K,W;Jre(S.domain,j,A)&&(B=Bx(S.domain,null,j),v&&(A==="number"||T!=="auto")&&(W=Lc(J,O,"category")));var X=SM(A);if(!B||B.length===0){var Y,te=(Y=S.domain)!==null&&Y!==void 0?Y:X;if(O){if(B=Lc(J,O,A),A==="category"&&v){var H=E9(B);E&&H?(K=B,B=Rh(0,F)):E||(B=Mj(te,B,_).reduce(function($,V){return $.indexOf(V)>=0?$:[].concat(pl($),[V])},[]))}else if(A==="category")E?B=B.filter(function($){return $!==""&&!et($)}):B=Mj(te,B,_).reduce(function($,V){return $.indexOf(V)>=0||V===""||et(V)?$:[].concat(pl($),[V])},[]);else if(A==="number"){var Q=zX(J,i.filter(function($){var V,oe,le=o in $.props?$.props[o]:(V=$.type.defaultProps)===null||V===void 0?void 0:V[o],ve="hide"in $.props?$.props.hide:(oe=$.type.defaultProps)===null||oe===void 0?void 0:oe.hide;return le===M&&(R||!ve)}),O,a,p);Q&&(B=Q)}v&&(A==="number"||T!=="auto")&&(W=Lc(J,O,"category"))}else v?B=Rh(0,F):c&&c[M]&&c[M].hasStack&&A==="number"?B=g==="expand"?[0,1]:_$(c[M].stackGroups,u,d):B=b$(J,i.filter(function($){var V=o in $.props?$.props[o]:$.type.defaultProps[o],oe="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return V===M&&(R||!oe)}),A,p,!0);if(A==="number")B=xw(f,B,M,a,N),te&&(B=Bx(te,B,j));else if(A==="category"&&te){var U=te,I=B.every(function($){return U.indexOf($)>=0});I&&(B=U)}}return ie(ie({},x),{},ze({},M,ie(ie({},S),{},{axisType:a,domain:B,categoricalDomain:W,duplicateDomain:K,originalDomain:(b=S.domain)!==null&&b!==void 0?b:X,isCategorical:v,layout:p})))},{})},One=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,f=e.children,g=Dp(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=g.length,x=x$(p,a),_=-1;return n.reduce(function(b,S){var A=S.type.defaultProps!==void 0?ie(ie({},S.type.defaultProps),S.props):S.props,O=A[o],j=SM("number");if(!b[O]){_++;var E;return x?E=Rh(0,v):c&&c[O]&&c[O].hasStack?(E=_$(c[O].stackGroups,u,d),E=xw(f,E,O,a)):(E=Bx(j,b$(g,n.filter(function(T){var N,R,M=o in T.props?T.props[o]:(N=T.type.defaultProps)===null||N===void 0?void 0:N[o],J="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return M===O&&!J}),"number",p),i.defaultProps.allowDataOverflow),E=xw(f,E,O,a)),ie(ie({},b),{},ze({},O,ie(ie({axisType:a},i.defaultProps),{},{hide:!0,orientation:Tn(wne,"".concat(a,".").concat(_%2),null),domain:E,originalDomain:j,isCategorical:x,layout:p})))}return b},{})},Ane=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,c=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.children,f="".concat(i,"Id"),g=jn(p,a),v={};return g&&g.length?v=Ene(e,{axes:g,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=One(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:c,dataStartIndex:u,dataEndIndex:d})),v},Tne=function(e){var r=Pa(e),n=Wi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:w1(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Sh(r,n)}},SN=function(e){var r=e.children,n=e.defaultShowTooltip,i=sn(r,il),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}},jne=function(e){return!e||!e.length?!1:e.some(function(r){var n=Gi(r&&r.type);return n&&n.indexOf("Bar")>=0})},kN=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"}},Cne=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,c=e.yAxisMap,u=c===void 0?{}:c,d=n.width,p=n.height,f=n.children,g=n.margin||{},v=sn(f,il),x=sn(f,qs),_=Object.keys(u).reduce(function(E,T){var N=u[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},ze({},R,E[R]+N.width)):E},{left:g.left||0,right:g.right||0}),b=Object.keys(o).reduce(function(E,T){var N=o[T],R=N.orientation;return!N.mirror&&!N.hide?ie(ie({},E),{},ze({},R,Tn(E,"".concat(R))+N.height)):E},{top:g.top||0,bottom:g.bottom||0}),S=ie(ie({},b),_),A=S.bottom;v&&(S.bottom+=v.props.height||il.defaultProps.height),x&&r&&(S=LX(S,i,n,r));var O=d-S.left-S.right,j=p-S.top-S.bottom;return ie(ie({brushBottom:A},S),{},{width:Math.max(O,0),height:Math.max(j,0)})},Nne=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},kM=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,c=o===void 0?["axis"]:o,u=e.axisComponents,d=e.legendContent,p=e.formatAxisMap,f=e.defaultProps,g=function(S,A){var O=A.graphicalItems,j=A.stackGroups,E=A.offset,T=A.updateId,N=A.dataStartIndex,R=A.dataEndIndex,M=S.barSize,J=S.layout,F=S.barGap,B=S.barCategoryGap,K=S.maxBarSize,W=kN(J),X=W.numericAxisName,Y=W.cateAxisName,te=jne(O),H=[];return O.forEach(function(Q,U){var I=Dp(S.data,{graphicalItems:[Q],dataStartIndex:N,dataEndIndex:R}),$=Q.type.defaultProps!==void 0?ie(ie({},Q.type.defaultProps),Q.props):Q.props,V=$.dataKey,oe=$.maxBarSize,le=$["".concat(X,"Id")],ve=$["".concat(Y,"Id")],qe={},xe=u.reduce(function(lr,_t){var kr=A["".concat(_t.axisType,"Map")],Ir=$["".concat(_t.axisType,"Id")];kr&&kr[Ir]||_t.axisType==="zAxis"||Lo();var ni=kr[Ir];return ie(ie({},lr),{},ze(ze({},_t.axisType,ni),"".concat(_t.axisType,"Ticks"),Wi(ni)))},qe),ae=xe[Y],Se=xe["".concat(Y,"Ticks")],Me=j&&j[le]&&j[le].hasStack&&JX(Q,j[le].stackGroups),se=Gi(Q.type).indexOf("Bar")>=0,tt=Sh(ae,Se),Fe=[],kt=te&&$X({barSize:M,stackGroups:j,totalSize:Nne(xe,Y)});if(se){var wt,Et,Sr=et(oe)?K:oe,Ut=(wt=(Et=Sh(ae,Se,!0))!==null&&Et!==void 0?Et:Sr)!==null&&wt!==void 0?wt:0;Fe=MX({barGap:F,barCategoryGap:B,bandSize:Ut!==tt?Ut:tt,sizeList:kt[ve],maxBarSize:Sr}),Ut!==tt&&(Fe=Fe.map(function(lr){return ie(ie({},lr),{},{position:ie(ie({},lr.position),{},{offset:lr.position.offset-Ut/2})})}))}var Rr=Q&&Q.type&&Q.type.getComposedData;Rr&&H.push({props:ie(ie({},Rr(ie(ie({},xe),{},{displayedData:I,props:S,dataKey:V,item:Q,bandSize:tt,barPosition:Fe,offset:E,stackedData:Me,layout:J,dataStartIndex:N,dataEndIndex:R}))),{},ze(ze(ze({key:Q.key||"item-".concat(U)},X,xe[X]),Y,xe[Y]),"animationId",T)),childIndex:D9(Q,S.children),item:Q})}),H},v=function(S,A){var O=S.props,j=S.dataStartIndex,E=S.dataEndIndex,T=S.updateId;if(!YO({props:O}))return null;var N=O.children,R=O.layout,M=O.stackOffset,J=O.data,F=O.reverseStackOrder,B=kN(R),K=B.numericAxisName,W=B.cateAxisName,X=jn(N,n),Y=VX(J,X,"".concat(K,"Id"),"".concat(W,"Id"),M,F),te=u.reduce(function($,V){var oe="".concat(V.axisType,"Map");return ie(ie({},$),{},ze({},oe,Ane(O,ie(ie({},V),{},{graphicalItems:X,stackGroups:V.axisType===K&&Y,dataStartIndex:j,dataEndIndex:E}))))},{}),H=Cne(ie(ie({},te),{},{props:O,graphicalItems:X}),A==null?void 0:A.legendBBox);Object.keys(te).forEach(function($){te[$]=p(O,te[$],H,$.replace("Map",""),r)});var Q=te["".concat(W,"Map")],U=Tne(Q),I=g(O,ie(ie({},te),{},{dataStartIndex:j,dataEndIndex:E,updateId:T,graphicalItems:X,stackGroups:Y,offset:H}));return ie(ie({formattedGraphicalItems:I,graphicalItems:X,offset:H,stackGroups:Y},U),te)},x=(function(b){function S(A){var O,j,E;return une(this,S),E=hne(this,S,[A]),ze(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ze(E,"accessibilityManager",new Yre),ze(E,"handleLegendBBoxUpdate",function(T){if(T){var N=E.state,R=N.dataStartIndex,M=N.dataEndIndex,J=N.updateId;E.setState(ie({legendBBox:T},v({props:E.props,dataStartIndex:R,dataEndIndex:M,updateId:J},ie(ie({},E.state),{},{legendBBox:T}))))}}),ze(E,"handleReceiveSyncEvent",function(T,N,R){if(E.props.syncId===T){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(N)}}),ze(E,"handleBrushChange",function(T){var N=T.startIndex,R=T.endIndex;if(N!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var M=E.state.updateId;E.setState(function(){return ie({dataStartIndex:N,dataEndIndex:R},v({props:E.props,dataStartIndex:N,dataEndIndex:R,updateId:M},E.state))}),E.triggerSyncEvent({dataStartIndex:N,dataEndIndex:R})}}),ze(E,"handleMouseEnter",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var M=E.props.onMouseEnter;Je(M)&&M(R,T)}}),ze(E,"triggeredAfterMouseMove",function(T){var N=E.getMouseInfo(T),R=N?ie(ie({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var M=E.props.onMouseMove;Je(M)&&M(R,T)}),ze(E,"handleItemMouseEnter",function(T){E.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),ze(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),ze(E,"handleMouseMove",function(T){T.persist(),E.throttleTriggeredAfterMouseMove(T)}),ze(E,"handleMouseLeave",function(T){E.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};E.setState(N),E.triggerSyncEvent(N);var R=E.props.onMouseLeave;Je(R)&&R(N,T)}),ze(E,"handleOuterEvent",function(T){var N=L9(T),R=Tn(E.props,"".concat(N));if(N&&Je(R)){var M,J;/.*touch.*/i.test(N)?J=E.getMouseInfo(T.changedTouches[0]):J=E.getMouseInfo(T),R((M=J)!==null&&M!==void 0?M:{},T)}}),ze(E,"handleClick",function(T){var N=E.getMouseInfo(T);if(N){var R=ie(ie({},N),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var M=E.props.onClick;Je(M)&&M(R,T)}}),ze(E,"handleMouseDown",function(T){var N=E.props.onMouseDown;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),ze(E,"handleMouseUp",function(T){var N=E.props.onMouseUp;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),ze(E,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),ze(E,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseDown(T.changedTouches[0])}),ze(E,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseUp(T.changedTouches[0])}),ze(E,"handleDoubleClick",function(T){var N=E.props.onDoubleClick;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),ze(E,"handleContextMenu",function(T){var N=E.props.onContextMenu;if(Je(N)){var R=E.getMouseInfo(T);N(R,T)}}),ze(E,"triggerSyncEvent",function(T){E.props.syncId!==void 0&&Rb.emit(Ib,E.props.syncId,T,E.eventEmitterSymbol)}),ze(E,"applySyncEvent",function(T){var N=E.props,R=N.layout,M=N.syncMethod,J=E.state.updateId,F=T.dataStartIndex,B=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)E.setState(ie({dataStartIndex:F,dataEndIndex:B},v({props:E.props,dataStartIndex:F,dataEndIndex:B,updateId:J},E.state)));else if(T.activeTooltipIndex!==void 0){var K=T.chartX,W=T.chartY,X=T.activeTooltipIndex,Y=E.state,te=Y.offset,H=Y.tooltipTicks;if(!te)return;if(typeof M=="function")X=M(H,T);else if(M==="value"){X=-1;for(var Q=0;Q<H.length;Q++)if(H[Q].value===T.activeLabel){X=Q;break}}var U=ie(ie({},te),{},{x:te.left,y:te.top}),I=Math.min(K,U.x+U.width),$=Math.min(W,U.y+U.height),V=H[X]&&H[X].value,oe=Sw(E.state,E.props.data,X),le=H[X]?{x:R==="horizontal"?H[X].coordinate:I,y:R==="horizontal"?$:H[X].coordinate}:_M;E.setState(ie(ie({},T),{},{activeLabel:V,activeCoordinate:le,activePayload:oe,activeTooltipIndex:X}))}else E.setState(T)}),ze(E,"renderCursor",function(T){var N,R=E.state,M=R.isTooltipActive,J=R.activeCoordinate,F=R.activePayload,B=R.offset,K=R.activeTooltipIndex,W=R.tooltipAxisBandSize,X=E.getTooltipEventType(),Y=(N=T.props.active)!==null&&N!==void 0?N:M,te=E.props.layout,H=T.key||"_recharts-cursor";return L.createElement(nne,{key:H,activeCoordinate:J,activePayload:F,activeTooltipIndex:K,chartName:r,element:T,isActive:Y,layout:te,offset:B,tooltipAxisBandSize:W,tooltipEventType:X})}),ze(E,"renderPolarAxis",function(T,N,R){var M=Tn(T,"type.axisType"),J=Tn(E.state,"".concat(M,"Map")),F=T.type.defaultProps,B=F!==void 0?ie(ie({},F),T.props):T.props,K=J&&J[B["".concat(M,"Id")]];return P.cloneElement(T,ie(ie({},K),{},{className:ot(M,K.className),key:T.key||"".concat(N,"-").concat(R),ticks:Wi(K,!0)}))}),ze(E,"renderPolarGrid",function(T){var N=T.props,R=N.radialLines,M=N.polarAngles,J=N.polarRadius,F=E.state,B=F.radiusAxisMap,K=F.angleAxisMap,W=Pa(B),X=Pa(K),Y=X.cx,te=X.cy,H=X.innerRadius,Q=X.outerRadius;return P.cloneElement(T,{polarAngles:Array.isArray(M)?M:Wi(X,!0).map(function(U){return U.coordinate}),polarRadius:Array.isArray(J)?J:Wi(W,!0).map(function(U){return U.coordinate}),cx:Y,cy:te,innerRadius:H,outerRadius:Q,key:T.key||"polar-grid",radialLines:R})}),ze(E,"renderLegend",function(){var T=E.state.formattedGraphicalItems,N=E.props,R=N.children,M=N.width,J=N.height,F=E.props.margin||{},B=M-(F.left||0)-(F.right||0),K=y$({children:R,formattedGraphicalItems:T,legendWidth:B,legendContent:d});if(!K)return null;var W=K.item,X=xN(K,ine);return P.cloneElement(W,ie(ie({},X),{},{chartWidth:M,chartHeight:J,margin:F,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),ze(E,"renderTooltip",function(){var T,N=E.props,R=N.children,M=N.accessibilityLayer,J=sn(R,ln);if(!J)return null;var F=E.state,B=F.isTooltipActive,K=F.activeCoordinate,W=F.activePayload,X=F.activeLabel,Y=F.offset,te=(T=J.props.active)!==null&&T!==void 0?T:B;return P.cloneElement(J,{viewBox:ie(ie({},Y),{},{x:Y.left,y:Y.top}),active:te,label:X,payload:te?W:[],coordinate:K,accessibilityLayer:M})}),ze(E,"renderBrush",function(T){var N=E.props,R=N.margin,M=N.data,J=E.state,F=J.offset,B=J.dataStartIndex,K=J.dataEndIndex,W=J.updateId;return P.cloneElement(T,{key:T.key||"_recharts-brush",onChange:wf(E.handleBrushChange,T.props.onChange),data:M,x:ge(T.props.x)?T.props.x:F.left,y:ge(T.props.y)?T.props.y:F.top+F.height+F.brushBottom-(R.bottom||0),width:ge(T.props.width)?T.props.width:F.width,startIndex:B,endIndex:K,updateId:"brush-".concat(W)})}),ze(E,"renderReferenceElement",function(T,N,R){if(!T)return null;var M=E,J=M.clipPathId,F=E.state,B=F.xAxisMap,K=F.yAxisMap,W=F.offset,X=T.type.defaultProps||{},Y=T.props,te=Y.xAxisId,H=te===void 0?X.xAxisId:te,Q=Y.yAxisId,U=Q===void 0?X.yAxisId:Q;return P.cloneElement(T,{key:T.key||"".concat(N,"-").concat(R),xAxis:B[H],yAxis:K[U],viewBox:{x:W.left,y:W.top,width:W.width,height:W.height},clipPathId:J})}),ze(E,"renderActivePoints",function(T){var N=T.item,R=T.activePoint,M=T.basePoint,J=T.childIndex,F=T.isRange,B=[],K=N.props.key,W=N.item.type.defaultProps!==void 0?ie(ie({},N.item.type.defaultProps),N.item.props):N.item.props,X=W.activeDot,Y=W.dataKey,te=ie(ie({index:J,dataKey:Y,cx:R.x,cy:R.y,r:4,fill:K1(N.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},it(X,!1)),Xf(X));return B.push(S.renderActiveDot(X,te,"".concat(K,"-activePoint-").concat(J))),M?B.push(S.renderActiveDot(X,ie(ie({},te),{},{cx:M.x,cy:M.y}),"".concat(K,"-basePoint-").concat(J))):F&&B.push(null),B}),ze(E,"renderGraphicChild",function(T,N,R){var M=E.filterFormatItem(T,N,R);if(!M)return null;var J=E.getTooltipEventType(),F=E.state,B=F.isTooltipActive,K=F.tooltipAxis,W=F.activeTooltipIndex,X=F.activeLabel,Y=E.props.children,te=sn(Y,ln),H=M.props,Q=H.points,U=H.isRange,I=H.baseLine,$=M.item.type.defaultProps!==void 0?ie(ie({},M.item.type.defaultProps),M.item.props):M.item.props,V=$.activeDot,oe=$.hide,le=$.activeBar,ve=$.activeShape,qe=!!(!oe&&B&&te&&(V||le||ve)),xe={};J!=="axis"&&te&&te.props.trigger==="click"?xe={onClick:wf(E.handleItemMouseEnter,T.props.onClick)}:J!=="axis"&&(xe={onMouseLeave:wf(E.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:wf(E.handleItemMouseEnter,T.props.onMouseEnter)});var ae=P.cloneElement(T,ie(ie({},M.props),xe));function Se(_t){return typeof K.dataKey=="function"?K.dataKey(_t.payload):null}if(qe)if(W>=0){var Me,se;if(K.dataKey&&!K.allowDuplicatedCategory){var tt=typeof K.dataKey=="function"?Se:"payload.".concat(K.dataKey.toString());Me=Vf(Q,tt,X),se=U&&I&&Vf(I,tt,X)}else Me=Q==null?void 0:Q[W],se=U&&I&&I[W];if(ve||le){var Fe=T.props.activeIndex!==void 0?T.props.activeIndex:W;return[P.cloneElement(T,ie(ie(ie({},M.props),xe),{},{activeIndex:Fe})),null,null]}if(!et(Me))return[ae].concat(pl(E.renderActivePoints({item:M,activePoint:Me,basePoint:se,childIndex:W,isRange:U})))}else{var kt,wt=(kt=E.getItemByXY(E.state.activeCoordinate))!==null&&kt!==void 0?kt:{graphicalItem:ae},Et=wt.graphicalItem,Sr=Et.item,Ut=Sr===void 0?T:Sr,Rr=Et.childIndex,lr=ie(ie(ie({},M.props),xe),{},{activeIndex:Rr});return[P.cloneElement(Ut,lr),null,null]}return U?[ae,null,null]:[ae,null]}),ze(E,"renderCustomized",function(T,N,R){return P.cloneElement(T,ie(ie({key:"recharts-customized-".concat(R)},E.props),E.state))}),ze(E,"renderMap",{CartesianGrid:{handler:Of,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Of},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Of},YAxis:{handler:Of},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((O=A.id)!==null&&O!==void 0?O:Lu("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=yI(E.triggeredAfterMouseMove,(j=A.throttleDelay)!==null&&j!==void 0?j:1e3/60),E.state={},E}return gne(S,b),fne(S,[{key:"componentDidMount",value:function(){var O,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O: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 O=this.props,j=O.children,E=O.data,T=O.height,N=O.layout,R=sn(j,ln);if(R){var M=R.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var J=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,F=Sw(this.state,E,M,J),B=this.state.tooltipTicks[M].coordinate,K=(this.state.offset.top+T)/2,W=N==="horizontal",X=W?{x:B,y:K}:{y:B,x:K},Y=this.state.formattedGraphicalItems.find(function(H){var Q=H.item;return Q.type.name==="Scatter"});Y&&(X=ie(ie({},X),Y.props.points[M].tooltipPosition),F=Y.props.points[M].tooltipPayload);var te={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:J,activePayload:F,activeCoordinate:X};this.setState(te),this.renderCursor(R),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.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(O){lx([sn(O.children,ln)],[sn(this.props.children,ln)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=sn(this.props.children,ln);if(O&&typeof O.props.shared=="boolean"){var j=O.props.shared?"axis":"item";return c.indexOf(j)>=0?j:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var j=this.container,E=j.getBoundingClientRect(),T=kW(E),N={chartX:Math.round(O.pageX-T.left),chartY:Math.round(O.pageY-T.top)},R=E.width/j.offsetWidth||1,M=this.inRange(N.chartX,N.chartY,R);if(!M)return null;var J=this.state,F=J.xAxisMap,B=J.yAxisMap,K=this.getTooltipEventType(),W=_N(this.state,this.props.data,this.props.layout,M);if(K!=="axis"&&F&&B){var X=Pa(F).scale,Y=Pa(B).scale,te=X&&X.invert?X.invert(N.chartX):null,H=Y&&Y.invert?Y.invert(N.chartY):null;return ie(ie({},N),{},{xValue:te,yValue:H},W)}return W?ie(ie({},N),W):null}},{key:"inRange",value:function(O,j){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,N=O/E,R=j/E;if(T==="horizontal"||T==="vertical"){var M=this.state.offset,J=N>=M.left&&N<=M.left+M.width&&R>=M.top&&R<=M.top+M.height;return J?{x:N,y:R}:null}var F=this.state,B=F.angleAxisMap,K=F.radiusAxisMap;if(B&&K){var W=Pa(B);return zj({x:N,y:R},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,j=this.getTooltipEventType(),E=sn(O,ln),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 N=Xf(this.props,this.handleOuterEvent);return ie(ie({},N),T)}},{key:"addListener",value:function(){Rb.on(Ib,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Rb.removeListener(Ib,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,j,E){for(var T=this.state.formattedGraphicalItems,N=0,R=T.length;N<R;N++){var M=T[N];if(M.item===O||M.props.key===O.key||j===Gi(M.item.type)&&E===M.childIndex)return M}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,j=this.state.offset,E=j.left,T=j.top,N=j.height,R=j.width;return L.createElement("defs",null,L.createElement("clipPath",{id:O},L.createElement("rect",{x:E,y:T,height:N,width:R})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(j,E){var T=bN(E,2),N=T[0],R=T[1];return ie(ie({},j),{},ze({},N,R.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(j,E){var T=bN(E,2),N=T[0],R=T[1];return ie(ie({},j),{},ze({},N,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[O])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(O){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[O])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(O){var j=this.state,E=j.formattedGraphicalItems,T=j.activeItem;if(E&&E.length)for(var N=0,R=E.length;N<R;N++){var M=E[N],J=M.props,F=M.item,B=F.type.defaultProps!==void 0?ie(ie({},F.type.defaultProps),F.props):F.props,K=Gi(F.type);if(K==="Bar"){var W=(J.data||[]).find(function(H){return WZ(O,H)});if(W)return{graphicalItem:M,payload:W}}else if(K==="RadialBar"){var X=(J.data||[]).find(function(H){return zj(O,H)});if(X)return{graphicalItem:M,payload:X}}else if(Np(M,T)||Pp(M,T)||_u(M,T)){var Y=$Q({graphicalItem:M,activeTooltipItem:T,itemData:B.data}),te=B.activeIndex===void 0?Y:B.activeIndex;return{graphicalItem:ie(ie({},M),{},{childIndex:te}),payload:_u(M,T)?B.data[Y]:M.props.data[Y]}}}return null}},{key:"render",value:function(){var O=this;if(!YO(this))return null;var j=this.props,E=j.children,T=j.className,N=j.width,R=j.height,M=j.style,J=j.compact,F=j.title,B=j.desc,K=xN(j,ane),W=it(K,!1);if(J)return L.createElement(eN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(ux,Ls({},W,{width:N,height:R,title:F,desc:B}),this.renderClipPath(),ZO(E,this.renderMap)));if(this.props.accessibilityLayer){var X,Y;W.tabIndex=(X=this.props.tabIndex)!==null&&X!==void 0?X:0,W.role=(Y=this.props.role)!==null&&Y!==void 0?Y:"application",W.onKeyDown=function(H){O.accessibilityManager.keyboardEvent(H)},W.onFocus=function(){O.accessibilityManager.focus()}}var te=this.parseEventsOfWrapper();return L.createElement(eN,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Ls({className:ot("recharts-wrapper",T),style:ie({position:"relative",cursor:"default",width:N,height:R},M)},te,{ref:function(Q){O.container=Q}}),L.createElement(ux,Ls({},W,{width:N,height:R,title:F,desc:B,style:_ne}),this.renderClipPath(),ZO(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(P.Component);ze(x,"displayName",r),ze(x,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),ze(x,"getDerivedStateFromProps",function(b,S){var A=b.dataKey,O=b.data,j=b.children,E=b.width,T=b.height,N=b.layout,R=b.stackOffset,M=b.margin,J=S.dataStartIndex,F=S.dataEndIndex;if(S.updateId===void 0){var B=SN(b);return ie(ie(ie({},B),{},{updateId:0},v(ie(ie({props:b},B),{},{updateId:0}),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:M,prevChildren:j})}if(A!==S.prevDataKey||O!==S.prevData||E!==S.prevWidth||T!==S.prevHeight||N!==S.prevLayout||R!==S.prevStackOffset||!Us(M,S.prevMargin)){var K=SN(b),W={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},X=ie(ie({},_N(S,O,N)),{},{updateId:S.updateId+1}),Y=ie(ie(ie({},K),W),X);return ie(ie(ie({},Y),v(ie({props:b},Y),S)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:N,prevStackOffset:R,prevMargin:M,prevChildren:j})}if(!lx(j,S.prevChildren)){var te,H,Q,U,I=sn(j,il),$=I&&(te=(H=I.props)===null||H===void 0?void 0:H.startIndex)!==null&&te!==void 0?te:J,V=I&&(Q=(U=I.props)===null||U===void 0?void 0:U.endIndex)!==null&&Q!==void 0?Q:F,oe=$!==J||V!==F,le=!et(O),ve=le&&!oe?S.updateId:S.updateId+1;return ie(ie({updateId:ve},v(ie(ie({props:b},S),{},{updateId:ve,dataStartIndex:$,dataEndIndex:V}),S)),{},{prevChildren:j,dataStartIndex:$,dataEndIndex:V})}return null}),ze(x,"renderActiveDot",function(b,S,A){var O;return P.isValidElement(b)?O=P.cloneElement(b,S):Je(b)?O=b(S):O=L.createElement(X1,S),L.createElement(Xt,{className:"recharts-active-dot",key:A},O)});var _=P.forwardRef(function(S,A){return L.createElement(x,Ls({},S,{ref:A}))});return _.displayName=x.displayName,_},Pne=kM({chartName:"LineChart",GraphicalChild:Hu,axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:F$}),kw=kM({chartName:"BarChart",GraphicalChild:ea,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ba},{axisType:"yAxis",AxisComp:Ua}],formatAxisMap:F$});const Kh={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function It(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.round(t))}function Zn(t){return`$${t.toFixed(2)}`}function $a({label:t,value:e,sub:r,accent:n}){return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),y.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&y.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}const Rne={summary:"Summary","by squad":"By Squad","by agent":"By Agent",io:"IO",timeline:"Timeline"};function Ine({tabs:t,active:e,onChange:r}){return y.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>y.jsx("button",{type:"button",onClick:()=>r(n),className:`px-4 py-2 text-[11px] font-mono 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:Rne[n]??n},n))})}function $ne({records:t,totals:e}){const r=e.totalInputTokens+e.totalOutputTokens,n=new Map;for(const o of t){const c=o.squadId??"__io__",u=o.squadName??(o.squadId?`${o.squadId.slice(0,8)} (deleted)`:"IO Orchestrator"),d=n.get(c)??{name:u,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=o.inputTokens,d.outputTokens+=o.outputTokens,d.calls+=1,d.cost+=o.estimatedCostUsd??0,n.set(c,d)}const i=Array.from(n.values()).sort((o,c)=>c.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(2)),tokens:Math.round((o.inputTokens+o.outputTokens)/1e3)}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"Total Tokens",value:It(r),sub:`${It(e.totalInputTokens)} in · ${It(e.totalOutputTokens)} out`}),y.jsx($a,{label:"Total Cost",value:Zn(e.totalCostUsd),accent:!0}),y.jsx($a,{label:"API Calls",value:It(e.callCount),sub:"across all entities"}),y.jsx($a,{label:"Avg Cost / Call",value:e.callCount>0?Zn(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),y.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?y.jsx(oh,{width:"100%",height:180,children:y.jsxs(kw,{data:a,barCategoryGap:"35%",children:[y.jsx(Au,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),y.jsx(ln,{contentStyle:Kh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`$${o.toFixed(2)}`,"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?y.jsx(oh,{width:"100%",height:180,children:y.jsxs(kw,{data:a,barCategoryGap:"35%",children:[y.jsx(Au,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(Ba,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),y.jsx(ln,{contentStyle:Kh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`${o}k`,"Tokens"]}),y.jsx(ea,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),y.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsxs("tbody",{children:[i.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name)),y.jsxs("tr",{className:"bg-[#1a1a1a]",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalInputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:It(e.totalOutputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:Zn(e.totalCostUsd)})]})]})]})})]})}function Mne({records:t}){const[e,r]=P.useState([]),[n,i]=P.useState("cost"),[a,o]=P.useState("desc");function c(f){f===n?o(g=>g==="asc"?"desc":"asc"):(i(f),o("desc"))}const u=P.useMemo(()=>{const f=new Map;for(const v of t){if(!v.squadId)continue;const x=f.get(v.squadId)??{id:v.squadId,name:v.squadName??`${v.squadId.slice(0,8)} (deleted)`,agents:new Map,inputTokens:0,outputTokens:0,calls:0,cost:0};x.inputTokens+=v.inputTokens,x.outputTokens+=v.outputTokens,x.calls+=1,x.cost+=v.estimatedCostUsd??0;const _=`${v.agentRole??"unknown"}:${v.model}`,b=x.agents.get(_)??{role:v.agentRole??"unknown",model:v.model,inputTokens:0,outputTokens:0,calls:0,cost:0};b.inputTokens+=v.inputTokens,b.outputTokens+=v.outputTokens,b.calls+=1,b.cost+=v.estimatedCostUsd??0,x.agents.set(_,b),f.set(v.squadId,x)}return[...Array.from(f.values())].sort((v,x)=>{const _=v[n],b=x[n],S=typeof _=="string"?_.localeCompare(b):_-b;return a==="desc"?-S:S})},[t,n,a]),d=f=>r(g=>g.includes(f)?g.filter(v=>v!==f):[...g,f]),p=[{key:"name",label:"Squad"},{key:"inputTokens",label:"In"},{key:"outputTokens",label:"Out"},{key:"calls",label:"Calls"},{key:"cost",label:"Cost"}];return u.length===0?y.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-1 px-1 mb-1",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-700 mr-1",children:"sort by"}),p.map(f=>y.jsxs("button",{type:"button",onClick:()=>c(f.key),className:`flex items-center gap-0.5 px-2 py-1 rounded-lg text-[10px] font-mono transition-colors ${n===f.key?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400 hover:bg-white/[0.04]"}`,style:n===f.key?{background:"rgba(228,58,156,0.1)"}:void 0,children:[f.label,n===f.key&&y.jsx("span",{className:"text-[9px]",children:a==="desc"?"↓":"↑"})]},f.key))]}),u.map(f=>{const g=e.includes(f.id),v=Array.from(f.agents.values());return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[y.jsxs("button",{type:"button",onClick:()=>d(f.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:[y.jsx("div",{className:`transition-transform ${g?"rotate-90":""}`,children:y.jsx($w,{className:"w-3.5 h-3.5 text-zinc-600"})}),y.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:f.name}),y.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),It(f.inputTokens)]}),y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),It(f.outputTokens)]}),y.jsxs("span",{className:"text-zinc-500",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),f.calls]}),y.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:Zn(f.cost)})]})]}),g&&y.jsx("div",{className:"border-t border-white/[0.05]",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(x=>y.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${x==="Cost"?"text-right":""}`,children:x},x))})}),y.jsx("tbody",{children:v.map(x=>y.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:x.role}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:x.model}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.inputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:It(x.outputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:x.calls}),y.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:Zn(x.cost)})]},x.role))})]})})]},f.id)})]})}function Lne({records:t}){const e=P.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}:${i.model}`,o=n.get(a)??{name:i.agentRole??"orchestrator",squad:i.squadName??(i.squadId?i.squadId.slice(0,8):"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 y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),y.jsx("tbody",{children:e.map(n=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(n.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:y.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),y.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function Dne({records:t}){const e=P.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=P.useMemo(()=>{const o=new Map;for(const c of e){const u=`${c.agentRole??"orchestrator"}:${c.model}`,d=o.get(u)??{name:c.agentRole??"orchestrator",model:c.model,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=c.inputTokens,d.outputTokens+=c.outputTokens,d.calls+=1,d.cost+=c.estimatedCostUsd??0,o.set(u,d)}return Array.from(o.values()).sort((c,u)=>u.cost-c.cost)},[e]),n=e.reduce((o,c)=>o+c.inputTokens,0),i=e.reduce((o,c)=>o+c.outputTokens,0),a=e.reduce((o,c)=>o+(c.estimatedCostUsd??0),0);return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"IO Tokens",value:It(n+i),sub:`${It(n)} in · ${It(i)} out`}),y.jsx($a,{label:"IO Cost",value:Zn(a),accent:!0}),y.jsx($a,{label:"IO Calls",value:It(e.length)}),y.jsx($a,{label:"IO Roles",value:String(r.length)})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsx("tbody",{children:r.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name))})]})})]})}function zne({records:t}){const e=qa(),r=P.useMemo(()=>{const i=new Map;for(const a of t){const o=a.timestamp.slice(0,10),c=i.get(o)??{date:o,inputTokens:0,outputTokens:0,cost:0,calls:0};c.inputTokens+=a.inputTokens,c.outputTokens+=a.outputTokens,c.cost+=a.estimatedCostUsd??0,c.calls+=1,i.set(o,c)}return Array.from(i.values()).sort((a,o)=>a.date.localeCompare(o.date))},[t]),n=r.map(i=>({...i,label:Z4(i.date,e),tokens:i.inputTokens+i.outputTokens}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),n.length>0?y.jsx(oh,{width:"100%",height:220,children:y.jsxs(Pne,{data:n,children:[y.jsx(Au,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:It,width:44}),y.jsx(ln,{contentStyle:Kh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[It(i),"Tokens"]}),y.jsx(Hu,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):y.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),n.length>0?y.jsx(oh,{width:"100%",height:180,children:y.jsxs(kw,{data:n,barCategoryGap:"20%",children:[y.jsx(Au,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(Ba,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ua,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:i=>`$${i.toFixed(2)}`,width:44}),y.jsx(ln,{contentStyle:Kh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[Zn(i),"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(i=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${i==="Cost"?"text-right":""}`,children:i},i))})}),y.jsx("tbody",{children:r.map(i=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:i.date}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:It(i.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:i.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(i.cost)})]},i.date))})]})})]})}function Bne(){const[t,e]=P.useState("summary"),[r,n]=P.useState(null),[i,a]=P.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(P.useEffect(()=>{const u=new Date;i==="7d"?u.setDate(u.getDate()-7):i==="14d"?u.setDate(u.getDate()-14):i==="30d"?u.setDate(u.getDate()-30):u.setDate(u.getDate()-1),Ve.get(`/usage?since=${u.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600 font-mono text-[11px]",children:"Loading..."});const c=i==="1d"?"Today":`Last ${i}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:c})]}),y.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(u=>y.jsx("button",{type:"button",onClick:()=>a(u),className:`px-3 py-1.5 rounded-lg text-[11px] font-mono transition-colors cursor-pointer ${i===u?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400"}`,style:i===u?{background:"rgba(228,58,156,0.12)"}:void 0,children:u},u))})]}),y.jsx(Ine,{tabs:o,active:t,onChange:u=>e(u)}),t==="summary"&&y.jsx($ne,{records:r.records,totals:r.totals}),t==="by squad"&&y.jsx(Mne,{records:r.records}),t==="by agent"&&y.jsx(Lne,{records:r.records}),t==="io"&&y.jsx(Dne,{records:r.records}),t==="timeline"&&y.jsx(zne,{records:r.records})]})}function EM(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:EM(e.children)}))}function Une(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";if(r.isDir){for(const o of n){a=a?`${a}/${o}`:o;let c=i.find(u=>u.path===a);c||(c={name:o,path:a,isDir:!0,children:[]},i.push(c)),i=c.children}continue}for(const[o,c]of n.entries()){const u=o===n.length-1;a=a?`${a}/${c}`:c;let d=i.find(p=>p.path===a);d||(d={name:u&&r.name||c,path:a,isDir:!u,children:[]},i.push(d)),i=d.children}}return EM(e)}function OM(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=OM(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function Ew(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of Ew(r.children))e.add(n)}return e}function qne(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 AM({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u}){const d=r===t.path,p=t.isDir&&(n.has(t.path)||i.has(t.path)),f=12+e*16,g=t.isDir&&["io","shared","squads","templates"].includes(t.path);return t.isDir?y.jsxs("div",{children:[y.jsxs("div",{className:"flex w-full items-center group 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:[y.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex items-center gap-2 flex-1 min-w-0",children:[y.jsx($w,{size:14,className:`shrink-0 transition-transform ${p?"rotate-90":""}`}),p?y.jsx(o4,{size:14,className:"shrink-0 text-zinc-500"}):y.jsx(l4,{size:14,className:"shrink-0 text-zinc-500"}),y.jsx("span",{className:"truncate",children:t.name})]}),y.jsxs("div",{className:"flex items-center gap-0.5",children:[!g&&y.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),u(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-red-500/20 transition-opacity text-zinc-600 hover:text-red-400",title:`Delete ${t.name}`,children:y.jsx(Ma,{size:12})}),y.jsx("button",{type:"button",onClick:v=>{v.stopPropagation(),c(t.path)},className:"opacity-0 group-hover:opacity-100 p-0.5 rounded hover:bg-white/[0.08] transition-opacity text-zinc-600 hover:text-zinc-300",title:`Add page to ${t.name}`,children:y.jsx(zw,{size:12})})]})]}),p&&y.jsx("div",{children:t.children.map(v=>y.jsx(AM,{node:v,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o,onAddToFolder:c,onDeleteFolder:u},v.path))})]}):y.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 ${d?"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:[y.jsx(i4,{size:14,className:"shrink-0"}),y.jsx("span",{className:"truncate",children:t.name})]})}function Fne(){const[t,e]=P.useState([]),[r,n]=P.useState(null),[i,a]=P.useState(""),[o,c]=P.useState(!1),[u,d]=P.useState(""),[p,f]=P.useState(""),[g,v]=P.useState(""),[x,_]=P.useState(new Set),[b,S]=P.useState(!1),[A,O]=P.useState(null),j=P.useRef(null);P.useEffect(()=>{F()},[]);const E=P.useMemo(()=>Une(t),[t]),T=g.trim().toLowerCase(),N=P.useMemo(()=>OM(E,T),[E,T]),R=P.useMemo(()=>{const I=T?Ew(N):new Set;if(r)for(const $ of qne(r))I.add($);return I},[N,T,r]),M=r?(function I($){for(const V of $){if(V.path===r)return V;const oe=I(V.children);if(oe)return oe}return null})(N):null,J=(M==null?void 0:M.name)??(r?r.split("/").pop()??"":"");P.useEffect(()=>{const I=Ew(E);_($=>new Set([...$,...I]))},[E]);async function F(){try{const I=await Ve.get("/wiki/all");e(I.pages)}catch{e([])}}function B(I){if(I.startsWith("squads/")){const $=I.split("/"),V=$[1]??"",oe=$.slice(2).join("/");return{scope:V,relativePath:oe}}return I.startsWith("io/")?{scope:"io",relativePath:I.slice(3)}:I.startsWith("shared/")?{scope:"shared",relativePath:I.slice(7)}:{scope:"shared",relativePath:I}}async function K(I){try{const{scope:$,relativePath:V}=B(I),oe=await Ve.get(`/wiki/${$}/${V}`);a(oe.content),d(oe.content),n(I),c(!1)}catch{at.error("Failed to load page")}}async function W(){if(r)try{const{scope:I,relativePath:$}=B(r);await Ve.put(`/wiki/${I}/${$}`,{content:u}),a(u),c(!1),at.success("Page saved")}catch{at.error("Failed to save page")}}async function X(){if(r)try{const{scope:I,relativePath:$}=B(r);await Ve.delete(`/wiki/${I}/${$}`),at.success("Page deleted"),n(null),a(""),d(""),c(!1),F()}catch{at.error("Failed to delete page")}}function Y(I){f(`${I}/`),setTimeout(()=>{const $=j.current;$&&($.focus(),$.setSelectionRange($.value.length,$.value.length))},0)}function te(I){O(I)}async function H(){if(A)try{await Ve.delete(`/wiki/dir/${A}`),at.success(`Deleted ${A}`),r!=null&&r.startsWith(A)&&(n(null),a(""),d(""),c(!1)),F()}catch{at.error("Failed to delete directory")}finally{O(null)}}async function Q(){let I=p.trim().replace(/^\/+|\/+$/g,"");if(!I)return;I=I.replace(/\.md$/i,"");const $=I.startsWith("io/")||I.startsWith("shared/")||I.startsWith("squads/")?I:`shared/${I}`;S(!0);try{const{scope:V,relativePath:oe}=B($),le=oe.split("/").slice(-1)[0]??oe;await Ve.put(`/wiki/${V}/${oe}`,{content:`# ${le}
|
|
503
|
+
|
|
504
|
+
`}),at.success("Page created"),f(""),await F(),await K($)}catch{at.error("Failed to create page")}finally{S(!1)}}function U(I){_($=>{const V=new Set($);return V.has(I)?V.delete(I):V.add(I),V})}return y.jsxs("div",{className:"flex h-full",children:[y.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[y.jsx("div",{className:"border-b border-white/[0.07] p-3",children:y.jsxs("div",{className:"relative",children:[y.jsx(eP,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),y.jsx("input",{type:"text",value:g,onChange:I=>v(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"})]})}),y.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:N.length>0?N.map(I=>y.jsx(AM,{node:I,depth:0,selectedPage:r,expandedPaths:x,autoExpandedPaths:R,onToggle:U,onSelect:K,onAddToFolder:Y,onDeleteFolder:te},I.path)):y.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),y.jsx("div",{className:"border-t border-white/[0.07] p-3",children:y.jsxs("div",{className:"space-y-2",children:[y.jsx("input",{ref:j,type:"text",value:p,onChange:I=>f(I.target.value),onKeyDown:I=>{I.key==="Enter"&&Q(),I.key==="Escape"&&f("")},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"}),y.jsx(za,{onClick:Q,disabled:!p.trim()||b,className:"w-full justify-center px-3 py-2",children:b?y.jsxs(y.Fragment,{children:[y.jsx(js,{size:13,className:"animate-spin"})," Creating..."]}):y.jsxs(y.Fragment,{children:[y.jsx(zw,{size:13})," Add Page"]})})]})})]}),y.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:J}),y.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[o?y.jsxs(y.Fragment,{children:[y.jsxs(za,{onClick:W,className:"px-3 py-1.5",children:[y.jsx(Bw,{size:12})," Save"]}),y.jsx(_i,{onClick:()=>{c(!1),d(i)},className:"px-3 py-1.5",children:"Cancel"})]}):y.jsxs(_i,{onClick:()=>{c(!0),d(i)},className:"px-3 py-1.5",children:[y.jsx(Ub,{size:12})," Edit"]}),y.jsxs(zf,{onClick:X,className:"px-3 py-1.5",children:[y.jsx(Ma,{size:12})," Delete"]})]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o?y.jsx("textarea",{value:u,onChange:I=>d(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"}):y.jsx("div",{className:"mx-auto max-w-4xl",children:y.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:nt.parse(i)}})})})]}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"text-center",children:[y.jsx(KN,{size:48,className:"mx-auto mb-3 text-zinc-800"}),y.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})}),A&&y.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:y.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/[0.07] bg-[#1a1a1a] p-6 shadow-2xl",children:[y.jsx("h3",{className:"mb-2 text-sm font-medium text-zinc-100",children:"Delete directory?"}),y.jsxs("p",{className:"mb-4 text-xs text-zinc-400",children:["This will permanently delete ",y.jsx("span",{className:"font-mono text-zinc-200",children:A})," and all its contents."]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx(_i,{onClick:()=>O(null),className:"px-3 py-1.5",children:"Cancel"}),y.jsxs(zf,{onClick:H,className:"px-3 py-1.5",children:[y.jsx(Ma,{size:12})," Delete"]})]})]})})]})}function Hne({children:t}){const{session:e,supabase:r,loading:n}=op();return n?y.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?y.jsx(y.Fragment,{children:t}):y.jsx(gq,{}):y.jsx(y.Fragment,{children:t})}function Wne(){const{pathname:t}=ti(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return y.jsxs(y.Fragment,{children:[y.jsx(yD,{children:y.jsxs(nn,{element:y.jsx(KU,{}),children:[y.jsx(nn,{index:!0,element:y.jsx(VU,{})}),y.jsx(nn,{path:"squads",element:y.jsx($g,{})}),y.jsx(nn,{path:"squads/:name",element:y.jsx($g,{})}),y.jsx(nn,{path:"squads/:name/instances/:instanceId",element:y.jsx($g,{})}),y.jsx(nn,{path:"feed",element:y.jsx(mq,{})}),y.jsx(nn,{path:"skills",element:y.jsx(Aq,{})}),y.jsx(nn,{path:"schedules",element:y.jsx(bq,{})}),y.jsx(nn,{path:"wiki",element:y.jsx(Fne,{})}),y.jsx(nn,{path:"settings",element:y.jsx(Sq,{})}),y.jsx(nn,{path:"usage",element:y.jsx(Bne,{})}),y.jsx(nn,{path:"*",element:y.jsx(pD,{to:"/",replace:!0})})]})}),!e&&y.jsx(Xz,{})]})}function Gne(){return y.jsx(HU,{children:y.jsx(Hne,{children:y.jsx(Y4,{children:y.jsx(sz,{children:y.jsx(Wne,{})})})})})}pL.createRoot(document.getElementById("root")).render(y.jsx(P.StrictMode,{children:y.jsxs(UD,{children:[y.jsx(Gne,{}),y.jsx(k5,{theme:"dark",position:"bottom-right"})]})}));
|
|
505
|
+
//# sourceMappingURL=index-CnXqSrcz.js.map
|