var QG=Object.defineProperty;var IM=e=>{throw TypeError(e)};var ZG=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var V1=(e,t,n)=>ZG(e,typeof t!="symbol"?t+"":t,n),K1=(e,t,n)=>t.has(e)||IM("Cannot "+n);var W=(e,t,n)=>(K1(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>t.has(e)?IM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(K1(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),We=(e,t,n)=>(K1(e,t,"access private method"),n);var Sv=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return W(e,t,r)}});function JG(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(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"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function zi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y1={exports:{}},zh={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var LM;function eW(){if(LM)return zh;LM=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var l in i)l!=="key"&&(a[l]=i[l])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return zh.Fragment=t,zh.jsx=n,zh.jsxs=n,zh}var zM;function tW(){return zM||(zM=1,Y1.exports=eW()),Y1.exports}var g=tW(),X1={exports:{}},it={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var $M;function nW(){if($M)return it;$M=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function v(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function E(H,U,$){this.props=H,this.context=U,this.refs=S,this.updater=$||b}E.prototype.isReactComponent={},E.prototype.setState=function(H,U){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,U,"setState")},E.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function j(){}j.prototype=E.prototype;function C(H,U,$){this.props=H,this.context=U,this.refs=S,this.updater=$||b}var O=C.prototype=new j;O.constructor=C,w(O,E.prototype),O.isPureReactComponent=!0;var N=Array.isArray;function k(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function I(H,U,$){var Q=$.ref;return{$$typeof:e,type:H,key:U,ref:Q!==void 0?Q:null,props:$}}function L(H,U){return I(H.type,U,H.props)}function B(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function z(H){var U={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function($){return U[$]})}var G=/\/+/g;function F(H,U){return typeof H=="object"&&H!==null&&H.key!=null?z(""+H.key):U.toString(36)}function V(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(k,k):(H.status="pending",H.then(function(U){H.status==="pending"&&(H.status="fulfilled",H.value=U)},function(U){H.status==="pending"&&(H.status="rejected",H.reason=U)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function D(H,U,$,Q,J){var ne=typeof H;(ne==="undefined"||ne==="boolean")&&(H=null);var ae=!1;if(H===null)ae=!0;else switch(ne){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(H.$$typeof){case e:case t:ae=!0;break;case h:return ae=H._init,D(ae(H._payload),U,$,Q,J)}}if(ae)return J=J(H),ae=Q===""?"."+F(H,0):Q,N(J)?($="",ae!=null&&($=ae.replace(G,"$&/")+"/"),D(J,U,$,"",function(se){return se})):J!=null&&(B(J)&&(J=L(J,$+(J.key==null||H&&H.key===J.key?"":(""+J.key).replace(G,"$&/")+"/")+ae)),U.push(J)),1;ae=0;var re=Q===""?".":Q+":";if(N(H))for(var ee=0;ee<H.length;ee++)Q=H[ee],ne=re+F(Q,ee),ae+=D(Q,U,$,ne,J);else if(ee=v(H),typeof ee=="function")for(H=ee.call(H),ee=0;!(Q=H.next()).done;)Q=Q.value,ne=re+F(Q,ee++),ae+=D(Q,U,$,ne,J);else if(ne==="object"){if(typeof H.then=="function")return D(V(H),U,$,Q,J);throw U=String(H),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ae}function q(H,U,$){if(H==null)return H;var Q=[],J=0;return D(H,Q,"","",function(ne){return U.call($,ne,J++)}),Q}function X(H){if(H._status===-1){var U=H._result;U=U(),U.then(function($){(H._status===0||H._status===-1)&&(H._status=1,H._result=$)},function($){(H._status===0||H._status===-1)&&(H._status=2,H._result=$)}),H._status===-1&&(H._status=0,H._result=U)}if(H._status===1)return H._result.default;throw H._result}var Y=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},R={map:q,forEach:function(H,U,$){q(H,function(){U.apply(this,arguments)},$)},count:function(H){var U=0;return q(H,function(){U++}),U},toArray:function(H){return q(H,function(U){return U})||[]},only:function(H){if(!B(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return it.Activity=d,it.Children=R,it.Component=E,it.Fragment=n,it.Profiler=i,it.PureComponent=C,it.StrictMode=r,it.Suspense=c,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,it.__COMPILER_RUNTIME={__proto__:null,c:function(H){return T.H.useMemoCache(H)}},it.cache=function(H){return function(){return H.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(H,U,$){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var Q=w({},H.props),J=H.key;if(U!=null)for(ne in U.key!==void 0&&(J=""+U.key),U)!M.call(U,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&U.ref===void 0||(Q[ne]=U[ne]);var ne=arguments.length-2;if(ne===1)Q.children=$;else if(1<ne){for(var ae=Array(ne),re=0;re<ne;re++)ae[re]=arguments[re+2];Q.children=ae}return I(H.type,J,Q)},it.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:a,_context:H},H},it.createElement=function(H,U,$){var Q,J={},ne=null;if(U!=null)for(Q in U.key!==void 0&&(ne=""+U.key),U)M.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=U[Q]);var ae=arguments.length-2;if(ae===1)J.children=$;else if(1<ae){for(var re=Array(ae),ee=0;ee<ae;ee++)re[ee]=arguments[ee+2];J.children=re}if(H&&H.defaultProps)for(Q in ae=H.defaultProps,ae)J[Q]===void 0&&(J[Q]=ae[Q]);return I(H,ne,J)},it.createRef=function(){return{current:null}},it.forwardRef=function(H){return{$$typeof:l,render:H}},it.isValidElement=B,it.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:X}},it.memo=function(H,U){return{$$typeof:f,type:H,compare:U===void 0?null:U}},it.startTransition=function(H){var U=T.T,$={};T.T=$;try{var Q=H(),J=T.S;J!==null&&J($,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(k,Y)}catch(ne){Y(ne)}finally{U!==null&&$.types!==null&&(U.types=$.types),T.T=U}},it.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},it.use=function(H){return T.H.use(H)},it.useActionState=function(H,U,$){return T.H.useActionState(H,U,$)},it.useCallback=function(H,U){return T.H.useCallback(H,U)},it.useContext=function(H){return T.H.useContext(H)},it.useDebugValue=function(){},it.useDeferredValue=function(H,U){return T.H.useDeferredValue(H,U)},it.useEffect=function(H,U){return T.H.useEffect(H,U)},it.useEffectEvent=function(H){return T.H.useEffectEvent(H)},it.useId=function(){return T.H.useId()},it.useImperativeHandle=function(H,U,$){return T.H.useImperativeHandle(H,U,$)},it.useInsertionEffect=function(H,U){return T.H.useInsertionEffect(H,U)},it.useLayoutEffect=function(H,U){return T.H.useLayoutEffect(H,U)},it.useMemo=function(H,U){return T.H.useMemo(H,U)},it.useOptimistic=function(H,U){return T.H.useOptimistic(H,U)},it.useReducer=function(H,U,$){return T.H.useReducer(H,U,$)},it.useRef=function(H){return T.H.useRef(H)},it.useState=function(H){return T.H.useState(H)},it.useSyncExternalStore=function(H,U,$){return T.H.useSyncExternalStore(H,U,$)},it.useTransition=function(){return T.H.useTransition()},it.version="19.2.4",it}var BM;function jd(){return BM||(BM=1,X1.exports=nW()),X1.exports}var x=jd();const _e=zi(x),Hj=JG({__proto__:null,default:_e},[x]);var G1={exports:{}},$h={},W1={exports:{}},Q1={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var FM;function rW(){return FM||(FM=1,(function(e){function t(D,q){var X=D.length;D.push(q);e:for(;0<X;){var Y=X-1>>>1,R=D[Y];if(0<i(R,q))D[Y]=q,D[X]=R,X=Y;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var q=D[0],X=D.pop();if(X!==q){D[0]=X;e:for(var Y=0,R=D.length,H=R>>>1;Y<H;){var U=2*(Y+1)-1,$=D[U],Q=U+1,J=D[Q];if(0>i($,X))Q<R&&0>i(J,$)?(D[Y]=J,D[Q]=X,Y=Q):(D[Y]=$,D[U]=X,Y=U);else if(Q<R&&0>i(J,X))D[Y]=J,D[Q]=X,Y=Q;else break e}}return q}function i(D,q){var X=D.sortIndex-q.sortIndex;return X!==0?X:D.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],f=[],h=1,d=null,p=3,v=!1,b=!1,w=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=D)r(f),q.sortIndex=q.expirationTime,t(c,q);else break;q=n(f)}}function N(D){if(w=!1,O(D),!b)if(n(c)!==null)b=!0,k||(k=!0,z());else{var q=n(f);q!==null&&V(N,q.startTime-D)}}var k=!1,T=-1,M=5,I=-1;function L(){return S?!0:!(e.unstable_now()-I<M)}function B(){if(S=!1,k){var D=e.unstable_now();I=D;var q=!0;try{e:{b=!1,w&&(w=!1,j(T),T=-1),v=!0;var X=p;try{t:{for(O(D),d=n(c);d!==null&&!(d.expirationTime>D&&L());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var R=Y(d.expirationTime<=D);if(D=e.unstable_now(),typeof R=="function"){d.callback=R,O(D),q=!0;break t}d===n(c)&&r(c),O(D)}else r(c);d=n(c)}if(d!==null)q=!0;else{var H=n(f);H!==null&&V(N,H.startTime-D),q=!1}}break e}finally{d=null,p=X,v=!1}q=void 0}}finally{q?z():k=!1}}}var z;if(typeof C=="function")z=function(){C(B)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,F=G.port2;G.port1.onmessage=B,z=function(){F.postMessage(null)}}else z=function(){E(B,0)};function V(D,q){T=E(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(D){switch(p){case 1:case 2:case 3:var q=3;break;default:q=p}var X=p;p=q;try{return D()}finally{p=X}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var X=p;p=D;try{return q()}finally{p=X}},e.unstable_scheduleCallback=function(D,q,X){var Y=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?Y+X:Y):X=Y,D){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=X+R,D={id:h++,callback:q,priorityLevel:D,startTime:X,expirationTime:R,sortIndex:-1},X>Y?(D.sortIndex=X,t(f,D),n(c)===null&&D===n(f)&&(w?(j(T),T=-1):w=!0,V(N,X-Y))):(D.sortIndex=R,t(c,D),b||v||(b=!0,k||(k=!0,z()))),D},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(D){var q=p;return function(){var X=p;p=q;try{return D.apply(this,arguments)}finally{p=X}}}})(Q1)),Q1}var UM;function iW(){return UM||(UM=1,W1.exports=rW()),W1.exports}var Z1={exports:{}},kr={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var HM;function aW(){if(HM)return kr;HM=1;var e=jd();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(c,f,h){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:c,containerInfo:f,implementation:h}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,kr.createPortal=function(c,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(c,f,null,h)},kr.flushSync=function(c){var f=o.T,h=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=f,r.p=h,r.d.f()}},kr.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},kr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},kr.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var h=f.as,d=l(h,f.crossOrigin),p=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:v}):h==="script"&&r.d.X(c,{crossOrigin:d,integrity:p,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},kr.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=l(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},kr.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,d=l(h,f.crossOrigin);r.d.L(c,h,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},kr.preloadModule=function(c,f){if(typeof c=="string")if(f){var h=l(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},kr.requestFormReset=function(c){r.d.r(c)},kr.unstable_batchedUpdates=function(c,f){return c(f)},kr.useFormState=function(c,f,h){return o.H.useFormState(c,f,h)},kr.useFormStatus=function(){return o.H.useHostTransitionStatus()},kr.version="19.2.4",kr}var qM;function a$(){if(qM)return Z1.exports;qM=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Z1.exports=aW(),Z1.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var VM;function oW(){if(VM)return $h;VM=1;var e=iW(),t=jd(),n=a$();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var u=s,m=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(m=u.return),s=u.return;while(s)}return u.tag===3?m:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function l(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(a(s)!==s)throw Error(r(188))}function f(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var m=s,y=u;;){var _=m.return;if(_===null)break;var A=_.alternate;if(A===null){if(y=_.return,y!==null){m=y;continue}break}if(_.child===A.child){for(A=_.child;A;){if(A===m)return c(_),s;if(A===y)return c(_),u;A=A.sibling}throw Error(r(188))}if(m.return!==y.return)m=_,y=A;else{for(var P=!1,K=_.child;K;){if(K===m){P=!0,m=_,y=A;break}if(K===y){P=!0,y=_,m=A;break}K=K.sibling}if(!P){for(K=A.child;K;){if(K===m){P=!0,m=A,y=_;break}if(K===y){P=!0,y=A,m=_;break}K=K.sibling}if(!P)throw Error(r(189))}}if(m.alternate!==y)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:u}function h(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=h(s),u!==null)return u;s=s.sibling}return null}var d=Object.assign,p=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),C=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function z(s){return s===null||typeof s!="object"?null:(s=B&&s[B]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function F(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case E:return"Profiler";case S:return"StrictMode";case N:return"Suspense";case k:return"SuspenseList";case I:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case C:return s.displayName||"Context";case j:return(s._context.displayName||"Context")+".Consumer";case O:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return u=s.displayName||null,u!==null?u:F(s.type)||"Memo";case M:u=s._payload,s=s._init;try{return F(s(u))}catch{}}return null}var V=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Y=[],R=-1;function H(s){return{current:s}}function U(s){0>R||(s.current=Y[R],Y[R]=null,R--)}function $(s,u){R++,Y[R]=s.current,s.current=u}var Q=H(null),J=H(null),ne=H(null),ae=H(null);function re(s,u){switch($(ne,u),$(J,s),$(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?aM(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=aM(u),s=oM(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(Q),$(Q,s)}function ee(){U(Q),U(J),U(ne)}function se(s){s.memoizedState!==null&&$(ae,s);var u=Q.current,m=oM(u,s.type);u!==m&&($(J,s),$(Q,m))}function me(s){J.current===s&&(U(Q),U(J)),ae.current===s&&(U(ae),Dh._currentValue=X)}var ie,we;function be(s){if(ie===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);ie=u&&u[1]||"",we=-1<m.stack.indexOf(`
    at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ie+s+we}var $e=!1;function Ne(s,u){if(!s||$e)return"";$e=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(u){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(he){var fe=he}Reflect.construct(s,[],ye)}else{try{ye.call()}catch(he){fe=he}s.call(ye.prototype)}}else{try{throw Error()}catch(he){fe=he}(ye=s())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(he){if(he&&fe&&typeof he.stack=="string")return[he.stack,fe.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=y.DetermineComponentFrameRoot(),P=A[0],K=A[1];if(P&&K){var Z=P.split(`
`),ce=K.split(`
`);for(_=y=0;y<Z.length&&!Z[y].includes("DetermineComponentFrameRoot");)y++;for(;_<ce.length&&!ce[_].includes("DetermineComponentFrameRoot");)_++;if(y===Z.length||_===ce.length)for(y=Z.length-1,_=ce.length-1;1<=y&&0<=_&&Z[y]!==ce[_];)_--;for(;1<=y&&0<=_;y--,_--)if(Z[y]!==ce[_]){if(y!==1||_!==1)do if(y--,_--,0>_||Z[y]!==ce[_]){var pe=`
`+Z[y].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=y&&0<=_);break}}}finally{$e=!1,Error.prepareStackTrace=m}return(m=s?s.displayName||s.name:"")?be(m):""}function Je(s,u){switch(s.tag){case 26:case 27:case 5:return be(s.type);case 16:return be("Lazy");case 13:return s.child!==u&&u!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return Ne(s.type,!1);case 11:return Ne(s.type.render,!1);case 1:return Ne(s.type,!0);case 31:return be("Activity");default:return""}}function Qe(s){try{var u="",m=null;do u+=Je(s,m),m=s,s=s.return;while(s);return u}catch(y){return`
Error generating stack: `+y.message+`
`+y.stack}}var nt=Object.prototype.hasOwnProperty,Nn=e.unstable_scheduleCallback,Wn=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Tn=e.unstable_requestPaint,Rt=e.unstable_now,pn=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,ze=e.unstable_NormalPriority,Ke=e.unstable_LowPriority,et=e.unstable_IdlePriority,gn=e.log,on=e.unstable_setDisableYieldValue,Kt=null,Se=null;function lt(s){if(typeof gn=="function"&&on(s),Se&&typeof Se.setStrictMode=="function")try{Se.setStrictMode(Kt,s)}catch{}}var Xe=Math.clz32?Math.clz32:In,Pn=Math.log,vn=Math.LN2;function In(s){return s>>>=0,s===0?32:31-(Pn(s)/vn|0)|0}var $i=256,ca=262144,Bi=4194304;function Ur(s){var u=s&42;if(u!==0)return u;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ge(s,u,m){var y=s.pendingLanes;if(y===0)return 0;var _=0,A=s.suspendedLanes,P=s.pingedLanes;s=s.warmLanes;var K=y&134217727;return K!==0?(y=K&~A,y!==0?_=Ur(y):(P&=K,P!==0?_=Ur(P):m||(m=K&~s,m!==0&&(_=Ur(m))))):(K=y&~A,K!==0?_=Ur(K):P!==0?_=Ur(P):m||(m=y&~s,m!==0&&(_=Ur(m)))),_===0?0:u!==0&&u!==_&&(u&A)===0&&(A=_&-_,m=u&-u,A>=m||A===32&&(m&4194048)!==0)?u:_}function $t(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function wn(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ln(){var s=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),s}function mi(s){for(var u=[],m=0;31>m;m++)u.push(s);return u}function It(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ur(s,u,m,y,_,A){var P=s.pendingLanes;s.pendingLanes=m,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=m,s.entangledLanes&=m,s.errorRecoveryDisabledLanes&=m,s.shellSuspendCounter=0;var K=s.entanglements,Z=s.expirationTimes,ce=s.hiddenUpdates;for(m=P&~m;0<m;){var pe=31-Xe(m),ye=1<<pe;K[pe]=0,Z[pe]=-1;var fe=ce[pe];if(fe!==null)for(ce[pe]=null,pe=0;pe<fe.length;pe++){var he=fe[pe];he!==null&&(he.lane&=-536870913)}m&=~ye}y!==0&&fa(s,y,0),A!==0&&_===0&&s.tag!==0&&(s.suspendedLanes|=A&~(P&~u))}function fa(s,u,m){s.pendingLanes|=u,s.suspendedLanes&=~u;var y=31-Xe(u);s.entangledLanes|=u,s.entanglements[y]=s.entanglements[y]|1073741824|m&261930}function Qn(s,u){var m=s.entangledLanes|=u;for(s=s.entanglements;m;){var y=31-Xe(m),_=1<<y;_&u|s[y]&u&&(s[y]|=u),m&=~_}}function cr(s,u){var m=u&-u;return m=(m&42)!==0?1:$a(m),(m&(s.suspendedLanes|u))!==0?0:m}function $a(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Or(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ve(){var s=q.p;return s!==0?s:(s=window.event,s===void 0?32:kM(s.type))}function Ct(s,u){var m=q.p;try{return q.p=s,u()}finally{q.p=m}}var Mn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Mn,fr="__reactProps$"+Mn,pi="__reactContainer$"+Mn,Nc="__reactEvents$"+Mn,ag="__reactListeners$"+Mn,Ib="__reactHandles$"+Mn,og="__reactResources$"+Mn,nu="__reactMarker$"+Mn;function Xd(s){delete s[Yt],delete s[fr],delete s[Nc],delete s[ag],delete s[Ib]}function Os(s){var u=s[Yt];if(u)return u;for(var m=s.parentNode;m;){if(u=m[pi]||m[Yt]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(s=hM(s);s!==null;){if(m=s[Yt])return m;s=hM(s)}return u}s=m,m=s.parentNode}return null}function ks(s){if(s=s[Yt]||s[pi]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Ns(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function Ts(s){var u=s[og];return u||(u=s[og]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function zn(s){s[nu]=!0}var sg=new Set,lg={};function wo(s,u){Ps(s,u),Ps(s+"Capture",u)}function Ps(s,u){for(lg[s]=u,s=0;s<u.length;s++)sg.add(u[s])}var Lb=RegExp("^[: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]*$"),Gd={},ug={};function zb(s){return nt.call(ug,s)?!0:nt.call(Gd,s)?!1:Lb.test(s)?ug[s]=!0:(Gd[s]=!0,!1)}function Tc(s,u,m){if(zb(u))if(m===null)s.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var y=u.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+m)}}function Pc(s,u,m){if(m===null)s.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+m)}}function da(s,u,m,y){if(y===null)s.removeAttribute(m);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(m);return}s.setAttributeNS(u,m,""+y)}}function Zr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function cg(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function $b(s,u,m){var y=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var _=y.get,A=y.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return _.call(this)},set:function(P){m=""+P,A.call(this,P)}}),Object.defineProperty(s,u,{enumerable:y.enumerable}),{getValue:function(){return m},setValue:function(P){m=""+P},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function Ms(s){if(!s._valueTracker){var u=cg(s)?"checked":"value";s._valueTracker=$b(s,u,""+s[u])}}function fg(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var m=u.getValue(),y="";return s&&(y=cg(s)?s.checked?"true":"false":s.value),s=y,s!==m?(u.setValue(s),!0):!1}function ru(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}}var Bb=/[\n"\\]/g;function Jr(s){return s.replace(Bb,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function iu(s,u,m,y,_,A,P,K){s.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?s.type=P:s.removeAttribute("type"),u!=null?P==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+Zr(u)):s.value!==""+Zr(u)&&(s.value=""+Zr(u)):P!=="submit"&&P!=="reset"||s.removeAttribute("value"),u!=null?Wd(s,P,Zr(u)):m!=null?Wd(s,P,Zr(m)):y!=null&&s.removeAttribute("value"),_==null&&A!=null&&(s.defaultChecked=!!A),_!=null&&(s.checked=_&&typeof _!="function"&&typeof _!="symbol"),K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?s.name=""+Zr(K):s.removeAttribute("name")}function dg(s,u,m,y,_,A,P,K){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(s.type=A),u!=null||m!=null){if(!(A!=="submit"&&A!=="reset"||u!=null)){Ms(s);return}m=m!=null?""+Zr(m):"",u=u!=null?""+Zr(u):m,K||u===s.value||(s.value=u),s.defaultValue=u}y=y??_,y=typeof y!="function"&&typeof y!="symbol"&&!!y,s.checked=K?s.checked:!!y,s.defaultChecked=!!y,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(s.name=P),Ms(s)}function Wd(s,u,m){u==="number"&&ru(s.ownerDocument)===s||s.defaultValue===""+m||(s.defaultValue=""+m)}function So(s,u,m,y){if(s=s.options,u){u={};for(var _=0;_<m.length;_++)u["$"+m[_]]=!0;for(m=0;m<s.length;m++)_=u.hasOwnProperty("$"+s[m].value),s[m].selected!==_&&(s[m].selected=_),_&&y&&(s[m].defaultSelected=!0)}else{for(m=""+Zr(m),u=null,_=0;_<s.length;_++){if(s[_].value===m){s[_].selected=!0,y&&(s[_].defaultSelected=!0);return}u!==null||s[_].disabled||(u=s[_])}u!==null&&(u.selected=!0)}}function eT(s,u,m){if(u!=null&&(u=""+Zr(u),u!==s.value&&(s.value=u),m==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=m!=null?""+Zr(m):""}function tT(s,u,m,y){if(u==null){if(y!=null){if(m!=null)throw Error(r(92));if(V(y)){if(1<y.length)throw Error(r(93));y=y[0]}m=y}m==null&&(m=""),u=m}m=Zr(u),s.defaultValue=m,y=s.textContent,y===m&&y!==""&&y!==null&&(s.value=y),Ms(s)}function Mc(s,u){if(u){var m=s.firstChild;if(m&&m===s.lastChild&&m.nodeType===3){m.nodeValue=u;return}}s.textContent=u}var KY=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function nT(s,u,m){var y=u.indexOf("--")===0;m==null||typeof m=="boolean"||m===""?y?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":y?s.setProperty(u,m):typeof m!="number"||m===0||KY.has(u)?u==="float"?s.cssFloat=m:s[u]=(""+m).trim():s[u]=m+"px"}function rT(s,u,m){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,m!=null){for(var y in m)!m.hasOwnProperty(y)||u!=null&&u.hasOwnProperty(y)||(y.indexOf("--")===0?s.setProperty(y,""):y==="float"?s.cssFloat="":s[y]="");for(var _ in u)y=u[_],u.hasOwnProperty(_)&&m[_]!==y&&nT(s,_,y)}else for(var A in u)u.hasOwnProperty(A)&&nT(s,A,u[A])}function Fb(s){if(s.indexOf("-")===-1)return!1;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 YY=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),XY=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hg(s){return XY.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Eo(){}var Ub=null;function Hb(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Dc=null,Rc=null;function iT(s){var u=ks(s);if(u&&(s=u.stateNode)){var m=s[fr]||null;e:switch(s=u.stateNode,u.type){case"input":if(iu(s,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name),u=m.name,m.type==="radio"&&u!=null){for(m=s;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll('input[name="'+Jr(""+u)+'"][type="radio"]'),u=0;u<m.length;u++){var y=m[u];if(y!==s&&y.form===s.form){var _=y[fr]||null;if(!_)throw Error(r(90));iu(y,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(u=0;u<m.length;u++)y=m[u],y.form===s.form&&fg(y)}break e;case"textarea":eT(s,m.value,m.defaultValue);break e;case"select":u=m.value,u!=null&&So(s,!!m.multiple,u,!1)}}}var qb=!1;function aT(s,u,m){if(qb)return s(u,m);qb=!0;try{var y=s(u);return y}finally{if(qb=!1,(Dc!==null||Rc!==null)&&(ev(),Dc&&(u=Dc,s=Rc,Rc=Dc=null,iT(u),s)))for(u=0;u<s.length;u++)iT(s[u])}}function Qd(s,u){var m=s.stateNode;if(m===null)return null;var y=m[fr]||null;if(y===null)return null;m=y[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(s=s.type,y=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!y;break e;default:s=!1}if(s)return null;if(m&&typeof m!="function")throw Error(r(231,u,typeof m));return m}var _o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vb=!1;if(_o)try{var Zd={};Object.defineProperty(Zd,"passive",{get:function(){Vb=!0}}),window.addEventListener("test",Zd,Zd),window.removeEventListener("test",Zd,Zd)}catch{Vb=!1}var Ds=null,Kb=null,mg=null;function oT(){if(mg)return mg;var s,u=Kb,m=u.length,y,_="value"in Ds?Ds.value:Ds.textContent,A=_.length;for(s=0;s<m&&u[s]===_[s];s++);var P=m-s;for(y=1;y<=P&&u[m-y]===_[A-y];y++);return mg=_.slice(s,1<y?1-y:void 0)}function pg(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function gg(){return!0}function sT(){return!1}function ei(s){function u(m,y,_,A,P){this._reactName=m,this._targetInst=_,this.type=y,this.nativeEvent=A,this.target=P,this.currentTarget=null;for(var K in s)s.hasOwnProperty(K)&&(m=s[K],this[K]=m?m(A):A[K]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?gg:sT,this.isPropagationStopped=sT,this}return d(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=gg)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=gg)},persist:function(){},isPersistent:gg}),u}var au={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vg=ei(au),Jd=d({},au,{view:0,detail:0}),GY=ei(Jd),Yb,Xb,eh,yg=d({},Jd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wb,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!==eh&&(eh&&s.type==="mousemove"?(Yb=s.screenX-eh.screenX,Xb=s.screenY-eh.screenY):Xb=Yb=0,eh=s),Yb)},movementY:function(s){return"movementY"in s?s.movementY:Xb}}),lT=ei(yg),WY=d({},yg,{dataTransfer:0}),QY=ei(WY),ZY=d({},Jd,{relatedTarget:0}),Gb=ei(ZY),JY=d({},au,{animationName:0,elapsedTime:0,pseudoElement:0}),eX=ei(JY),tX=d({},au,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),nX=ei(tX),rX=d({},au,{data:0}),uT=ei(rX),iX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aX={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"},oX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sX(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=oX[s])?!!u[s]:!1}function Wb(){return sX}var lX=d({},Jd,{key:function(s){if(s.key){var u=iX[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=pg(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?aX[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wb,charCode:function(s){return s.type==="keypress"?pg(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?pg(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),uX=ei(lX),cX=d({},yg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cT=ei(cX),fX=d({},Jd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wb}),dX=ei(fX),hX=d({},au,{propertyName:0,elapsedTime:0,pseudoElement:0}),mX=ei(hX),pX=d({},yg,{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}),gX=ei(pX),vX=d({},au,{newState:0,oldState:0}),yX=ei(vX),xX=[9,13,27,32],Qb=_o&&"CompositionEvent"in window,th=null;_o&&"documentMode"in document&&(th=document.documentMode);var bX=_o&&"TextEvent"in window&&!th,fT=_o&&(!Qb||th&&8<th&&11>=th),dT=" ",hT=!1;function mT(s,u){switch(s){case"keyup":return xX.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pT(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Ic=!1;function wX(s,u){switch(s){case"compositionend":return pT(u);case"keypress":return u.which!==32?null:(hT=!0,dT);case"textInput":return s=u.data,s===dT&&hT?null:s;default:return null}}function SX(s,u){if(Ic)return s==="compositionend"||!Qb&&mT(s,u)?(s=oT(),mg=Kb=Ds=null,Ic=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return fT&&u.locale!=="ko"?null:u.data;default:return null}}var EX={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 gT(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!EX[s.type]:u==="textarea"}function vT(s,u,m,y){Dc?Rc?Rc.push(y):Rc=[y]:Dc=y,u=sv(u,"onChange"),0<u.length&&(m=new vg("onChange","change",null,m,y),s.push({event:m,listeners:u}))}var nh=null,rh=null;function _X(s){J2(s,0)}function xg(s){var u=Ns(s);if(fg(u))return s}function yT(s,u){if(s==="change")return u}var xT=!1;if(_o){var Zb;if(_o){var Jb="oninput"in document;if(!Jb){var bT=document.createElement("div");bT.setAttribute("oninput","return;"),Jb=typeof bT.oninput=="function"}Zb=Jb}else Zb=!1;xT=Zb&&(!document.documentMode||9<document.documentMode)}function wT(){nh&&(nh.detachEvent("onpropertychange",ST),rh=nh=null)}function ST(s){if(s.propertyName==="value"&&xg(rh)){var u=[];vT(u,rh,s,Hb(s)),aT(_X,u)}}function CX(s,u,m){s==="focusin"?(wT(),nh=u,rh=m,nh.attachEvent("onpropertychange",ST)):s==="focusout"&&wT()}function jX(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return xg(rh)}function AX(s,u){if(s==="click")return xg(u)}function OX(s,u){if(s==="input"||s==="change")return xg(u)}function kX(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var gi=typeof Object.is=="function"?Object.is:kX;function ih(s,u){if(gi(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var m=Object.keys(s),y=Object.keys(u);if(m.length!==y.length)return!1;for(y=0;y<m.length;y++){var _=m[y];if(!nt.call(u,_)||!gi(s[_],u[_]))return!1}return!0}function ET(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function _T(s,u){var m=ET(s);s=0;for(var y;m;){if(m.nodeType===3){if(y=s+m.textContent.length,s<=u&&y>=u)return{node:m,offset:u-s};s=y}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=ET(m)}}function CT(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?CT(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function jT(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=ru(s.document);u instanceof s.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)s=u.contentWindow;else break;u=ru(s.document)}return u}function ew(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var NX=_o&&"documentMode"in document&&11>=document.documentMode,Lc=null,tw=null,ah=null,nw=!1;function AT(s,u,m){var y=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;nw||Lc==null||Lc!==ru(y)||(y=Lc,"selectionStart"in y&&ew(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ah&&ih(ah,y)||(ah=y,y=sv(tw,"onSelect"),0<y.length&&(u=new vg("onSelect","select",null,u,m),s.push({event:u,listeners:y}),u.target=Lc)))}function ou(s,u){var m={};return m[s.toLowerCase()]=u.toLowerCase(),m["Webkit"+s]="webkit"+u,m["Moz"+s]="moz"+u,m}var zc={animationend:ou("Animation","AnimationEnd"),animationiteration:ou("Animation","AnimationIteration"),animationstart:ou("Animation","AnimationStart"),transitionrun:ou("Transition","TransitionRun"),transitionstart:ou("Transition","TransitionStart"),transitioncancel:ou("Transition","TransitionCancel"),transitionend:ou("Transition","TransitionEnd")},rw={},OT={};_o&&(OT=document.createElement("div").style,"AnimationEvent"in window||(delete zc.animationend.animation,delete zc.animationiteration.animation,delete zc.animationstart.animation),"TransitionEvent"in window||delete zc.transitionend.transition);function su(s){if(rw[s])return rw[s];if(!zc[s])return s;var u=zc[s],m;for(m in u)if(u.hasOwnProperty(m)&&m in OT)return rw[s]=u[m];return s}var kT=su("animationend"),NT=su("animationiteration"),TT=su("animationstart"),TX=su("transitionrun"),PX=su("transitionstart"),MX=su("transitioncancel"),PT=su("transitionend"),MT=new Map,iw="abort auxClick beforeToggle 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(" ");iw.push("scrollEnd");function ha(s,u){MT.set(s,u),wo(u,[s])}var bg=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Fi=[],$c=0,aw=0;function wg(){for(var s=$c,u=aw=$c=0;u<s;){var m=Fi[u];Fi[u++]=null;var y=Fi[u];Fi[u++]=null;var _=Fi[u];Fi[u++]=null;var A=Fi[u];if(Fi[u++]=null,y!==null&&_!==null){var P=y.pending;P===null?_.next=_:(_.next=P.next,P.next=_),y.pending=_}A!==0&&DT(m,_,A)}}function Sg(s,u,m,y){Fi[$c++]=s,Fi[$c++]=u,Fi[$c++]=m,Fi[$c++]=y,aw|=y,s.lanes|=y,s=s.alternate,s!==null&&(s.lanes|=y)}function ow(s,u,m,y){return Sg(s,u,m,y),Eg(s)}function lu(s,u){return Sg(s,null,null,u),Eg(s)}function DT(s,u,m){s.lanes|=m;var y=s.alternate;y!==null&&(y.lanes|=m);for(var _=!1,A=s.return;A!==null;)A.childLanes|=m,y=A.alternate,y!==null&&(y.childLanes|=m),A.tag===22&&(s=A.stateNode,s===null||s._visibility&1||(_=!0)),s=A,A=A.return;return s.tag===3?(A=s.stateNode,_&&u!==null&&(_=31-Xe(m),s=A.hiddenUpdates,y=s[_],y===null?s[_]=[u]:y.push(u),u.lane=m|536870912),A):null}function Eg(s){if(50<Ah)throw Ah=0,p1=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var Bc={};function DX(s,u,m,y){this.tag=s,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vi(s,u,m,y){return new DX(s,u,m,y)}function sw(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Co(s,u){var m=s.alternate;return m===null?(m=vi(s.tag,u,s.key,s.mode),m.elementType=s.elementType,m.type=s.type,m.stateNode=s.stateNode,m.alternate=s,s.alternate=m):(m.pendingProps=u,m.type=s.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=s.flags&65011712,m.childLanes=s.childLanes,m.lanes=s.lanes,m.child=s.child,m.memoizedProps=s.memoizedProps,m.memoizedState=s.memoizedState,m.updateQueue=s.updateQueue,u=s.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=s.sibling,m.index=s.index,m.ref=s.ref,m.refCleanup=s.refCleanup,m}function RT(s,u){s.flags&=65011714;var m=s.alternate;return m===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=m.childLanes,s.lanes=m.lanes,s.child=m.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=m.memoizedProps,s.memoizedState=m.memoizedState,s.updateQueue=m.updateQueue,s.type=m.type,u=m.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function _g(s,u,m,y,_,A){var P=0;if(y=s,typeof s=="function")sw(s)&&(P=1);else if(typeof s=="string")P=$G(s,m,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case I:return s=vi(31,m,u,_),s.elementType=I,s.lanes=A,s;case w:return uu(m.children,_,A,u);case S:P=8,_|=24;break;case E:return s=vi(12,m,u,_|2),s.elementType=E,s.lanes=A,s;case N:return s=vi(13,m,u,_),s.elementType=N,s.lanes=A,s;case k:return s=vi(19,m,u,_),s.elementType=k,s.lanes=A,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:P=10;break e;case j:P=9;break e;case O:P=11;break e;case T:P=14;break e;case M:P=16,y=null;break e}P=29,m=Error(r(130,s===null?"null":typeof s,"")),y=null}return u=vi(P,m,u,_),u.elementType=s,u.type=y,u.lanes=A,u}function uu(s,u,m,y){return s=vi(7,s,y,u),s.lanes=m,s}function lw(s,u,m){return s=vi(6,s,null,u),s.lanes=m,s}function IT(s){var u=vi(18,null,null,0);return u.stateNode=s,u}function uw(s,u,m){return u=vi(4,s.children!==null?s.children:[],s.key,u),u.lanes=m,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var LT=new WeakMap;function Ui(s,u){if(typeof s=="object"&&s!==null){var m=LT.get(s);return m!==void 0?m:(u={value:s,source:u,stack:Qe(u)},LT.set(s,u),u)}return{value:s,source:u,stack:Qe(u)}}var Fc=[],Uc=0,Cg=null,oh=0,Hi=[],qi=0,Rs=null,Ba=1,Fa="";function jo(s,u){Fc[Uc++]=oh,Fc[Uc++]=Cg,Cg=s,oh=u}function zT(s,u,m){Hi[qi++]=Ba,Hi[qi++]=Fa,Hi[qi++]=Rs,Rs=s;var y=Ba;s=Fa;var _=32-Xe(y)-1;y&=~(1<<_),m+=1;var A=32-Xe(u)+_;if(30<A){var P=_-_%5;A=(y&(1<<P)-1).toString(32),y>>=P,_-=P,Ba=1<<32-Xe(u)+_|m<<_|y,Fa=A+s}else Ba=1<<A|m<<_|y,Fa=s}function cw(s){s.return!==null&&(jo(s,1),zT(s,1,0))}function fw(s){for(;s===Cg;)Cg=Fc[--Uc],Fc[Uc]=null,oh=Fc[--Uc],Fc[Uc]=null;for(;s===Rs;)Rs=Hi[--qi],Hi[qi]=null,Fa=Hi[--qi],Hi[qi]=null,Ba=Hi[--qi],Hi[qi]=null}function $T(s,u){Hi[qi++]=Ba,Hi[qi++]=Fa,Hi[qi++]=Rs,Ba=u.id,Fa=u.overflow,Rs=s}var br=null,en=null,vt=!1,Is=null,Vi=!1,dw=Error(r(519));function Ls(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sh(Ui(u,s)),dw}function BT(s){var u=s.stateNode,m=s.type,y=s.memoizedProps;switch(u[Yt]=s,u[fr]=y,m){case"dialog":dt("cancel",u),dt("close",u);break;case"iframe":case"object":case"embed":dt("load",u);break;case"video":case"audio":for(m=0;m<kh.length;m++)dt(kh[m],u);break;case"source":dt("error",u);break;case"img":case"image":case"link":dt("error",u),dt("load",u);break;case"details":dt("toggle",u);break;case"input":dt("invalid",u),dg(u,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":dt("invalid",u);break;case"textarea":dt("invalid",u),tT(u,y.value,y.defaultValue,y.children)}m=y.children,typeof m!="string"&&typeof m!="number"&&typeof m!="bigint"||u.textContent===""+m||y.suppressHydrationWarning===!0||rM(u.textContent,m)?(y.popover!=null&&(dt("beforetoggle",u),dt("toggle",u)),y.onScroll!=null&&dt("scroll",u),y.onScrollEnd!=null&&dt("scrollend",u),y.onClick!=null&&(u.onclick=Eo),u=!0):u=!1,u||Ls(s,!0)}function FT(s){for(br=s.return;br;)switch(br.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:br=br.return}}function Hc(s){if(s!==br)return!1;if(!vt)return FT(s),vt=!0,!1;var u=s.tag,m;if((m=u!==3&&u!==27)&&((m=u===5)&&(m=s.type,m=!(m!=="form"&&m!=="button")||N1(s.type,s.memoizedProps)),m=!m),m&&en&&Ls(s),FT(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));en=dM(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));en=dM(s)}else u===27?(u=en,Qs(s.type)?(s=R1,R1=null,en=s):en=u):en=br?Yi(s.stateNode.nextSibling):null;return!0}function cu(){en=br=null,vt=!1}function hw(){var s=Is;return s!==null&&(ii===null?ii=s:ii.push.apply(ii,s),Is=null),s}function sh(s){Is===null?Is=[s]:Is.push(s)}var mw=H(null),fu=null,Ao=null;function zs(s,u,m){$(mw,u._currentValue),u._currentValue=m}function Oo(s){s._currentValue=mw.current,U(mw)}function pw(s,u,m){for(;s!==null;){var y=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,y!==null&&(y.childLanes|=u)):y!==null&&(y.childLanes&u)!==u&&(y.childLanes|=u),s===m)break;s=s.return}}function gw(s,u,m,y){var _=s.child;for(_!==null&&(_.return=s);_!==null;){var A=_.dependencies;if(A!==null){var P=_.child;A=A.firstContext;e:for(;A!==null;){var K=A;A=_;for(var Z=0;Z<u.length;Z++)if(K.context===u[Z]){A.lanes|=m,K=A.alternate,K!==null&&(K.lanes|=m),pw(A.return,m,s),y||(P=null);break e}A=K.next}}else if(_.tag===18){if(P=_.return,P===null)throw Error(r(341));P.lanes|=m,A=P.alternate,A!==null&&(A.lanes|=m),pw(P,m,s),P=null}else P=_.child;if(P!==null)P.return=_;else for(P=_;P!==null;){if(P===s){P=null;break}if(_=P.sibling,_!==null){_.return=P.return,P=_;break}P=P.return}_=P}}function qc(s,u,m,y){s=null;for(var _=u,A=!1;_!==null;){if(!A){if((_.flags&524288)!==0)A=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var P=_.alternate;if(P===null)throw Error(r(387));if(P=P.memoizedProps,P!==null){var K=_.type;gi(_.pendingProps.value,P.value)||(s!==null?s.push(K):s=[K])}}else if(_===ae.current){if(P=_.alternate,P===null)throw Error(r(387));P.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(s!==null?s.push(Dh):s=[Dh])}_=_.return}s!==null&&gw(u,s,m,y),u.flags|=262144}function jg(s){for(s=s.firstContext;s!==null;){if(!gi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function du(s){fu=s,Ao=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function wr(s){return UT(fu,s)}function Ag(s,u){return fu===null&&du(s),UT(s,u)}function UT(s,u){var m=u._currentValue;if(u={context:u,memoizedValue:m,next:null},Ao===null){if(s===null)throw Error(r(308));Ao=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else Ao=Ao.next=u;return m}var RX=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(m,y){s.push(y)}};this.abort=function(){u.aborted=!0,s.forEach(function(m){return m()})}},IX=e.unstable_scheduleCallback,LX=e.unstable_NormalPriority,$n={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vw(){return{controller:new RX,data:new Map,refCount:0}}function lh(s){s.refCount--,s.refCount===0&&IX(LX,function(){s.controller.abort()})}var uh=null,yw=0,Vc=0,Kc=null;function zX(s,u){if(uh===null){var m=uh=[];yw=0,Vc=w1(),Kc={status:"pending",value:void 0,then:function(y){m.push(y)}}}return yw++,u.then(HT,HT),u}function HT(){if(--yw===0&&uh!==null){Kc!==null&&(Kc.status="fulfilled");var s=uh;uh=null,Vc=0,Kc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function $X(s,u){var m=[],y={status:"pending",value:null,reason:null,then:function(_){m.push(_)}};return s.then(function(){y.status="fulfilled",y.value=u;for(var _=0;_<m.length;_++)(0,m[_])(u)},function(_){for(y.status="rejected",y.reason=_,_=0;_<m.length;_++)(0,m[_])(void 0)}),y}var qT=D.S;D.S=function(s,u){A2=Rt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&zX(s,u),qT!==null&&qT(s,u)};var hu=H(null);function xw(){var s=hu.current;return s!==null?s:Xt.pooledCache}function Og(s,u){u===null?$(hu,hu.current):$(hu,u.pool)}function VT(){var s=xw();return s===null?null:{parent:$n._currentValue,pool:s}}var Yc=Error(r(460)),bw=Error(r(474)),kg=Error(r(542)),Ng={then:function(){}};function KT(s){return s=s.status,s==="fulfilled"||s==="rejected"}function YT(s,u,m){switch(m=s[m],m===void 0?s.push(u):m!==u&&(u.then(Eo,Eo),u=m),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,GT(s),s;default:if(typeof u.status=="string")u.then(Eo,Eo);else{if(s=Xt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(y){if(u.status==="pending"){var _=u;_.status="fulfilled",_.value=y}},function(y){if(u.status==="pending"){var _=u;_.status="rejected",_.reason=y}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,GT(s),s}throw pu=u,Yc}}function mu(s){try{var u=s._init;return u(s._payload)}catch(m){throw m!==null&&typeof m=="object"&&typeof m.then=="function"?(pu=m,Yc):m}}var pu=null;function XT(){if(pu===null)throw Error(r(459));var s=pu;return pu=null,s}function GT(s){if(s===Yc||s===kg)throw Error(r(483))}var Xc=null,ch=0;function Tg(s){var u=ch;return ch+=1,Xc===null&&(Xc=[]),YT(Xc,s,u)}function fh(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Pg(s,u){throw u.$$typeof===p?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function WT(s){function u(oe,te){if(s){var ue=oe.deletions;ue===null?(oe.deletions=[te],oe.flags|=16):ue.push(te)}}function m(oe,te){if(!s)return null;for(;te!==null;)u(oe,te),te=te.sibling;return null}function y(oe){for(var te=new Map;oe!==null;)oe.key!==null?te.set(oe.key,oe):te.set(oe.index,oe),oe=oe.sibling;return te}function _(oe,te){return oe=Co(oe,te),oe.index=0,oe.sibling=null,oe}function A(oe,te,ue){return oe.index=ue,s?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<te?(oe.flags|=67108866,te):ue):(oe.flags|=67108866,te)):(oe.flags|=1048576,te)}function P(oe){return s&&oe.alternate===null&&(oe.flags|=67108866),oe}function K(oe,te,ue,ge){return te===null||te.tag!==6?(te=lw(ue,oe.mode,ge),te.return=oe,te):(te=_(te,ue),te.return=oe,te)}function Z(oe,te,ue,ge){var Ue=ue.type;return Ue===w?pe(oe,te,ue.props.children,ge,ue.key):te!==null&&(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===M&&mu(Ue)===te.type)?(te=_(te,ue.props),fh(te,ue),te.return=oe,te):(te=_g(ue.type,ue.key,ue.props,null,oe.mode,ge),fh(te,ue),te.return=oe,te)}function ce(oe,te,ue,ge){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=uw(ue,oe.mode,ge),te.return=oe,te):(te=_(te,ue.children||[]),te.return=oe,te)}function pe(oe,te,ue,ge,Ue){return te===null||te.tag!==7?(te=uu(ue,oe.mode,ge,Ue),te.return=oe,te):(te=_(te,ue),te.return=oe,te)}function ye(oe,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=lw(""+te,oe.mode,ue),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return ue=_g(te.type,te.key,te.props,null,oe.mode,ue),fh(ue,te),ue.return=oe,ue;case b:return te=uw(te,oe.mode,ue),te.return=oe,te;case M:return te=mu(te),ye(oe,te,ue)}if(V(te)||z(te))return te=uu(te,oe.mode,ue,null),te.return=oe,te;if(typeof te.then=="function")return ye(oe,Tg(te),ue);if(te.$$typeof===C)return ye(oe,Ag(oe,te),ue);Pg(oe,te)}return null}function fe(oe,te,ue,ge){var Ue=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ue!==null?null:K(oe,te,""+ue,ge);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===Ue?Z(oe,te,ue,ge):null;case b:return ue.key===Ue?ce(oe,te,ue,ge):null;case M:return ue=mu(ue),fe(oe,te,ue,ge)}if(V(ue)||z(ue))return Ue!==null?null:pe(oe,te,ue,ge,null);if(typeof ue.then=="function")return fe(oe,te,Tg(ue),ge);if(ue.$$typeof===C)return fe(oe,te,Ag(oe,ue),ge);Pg(oe,ue)}return null}function he(oe,te,ue,ge,Ue){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return oe=oe.get(ue)||null,K(te,oe,""+ge,Ue);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case v:return oe=oe.get(ge.key===null?ue:ge.key)||null,Z(te,oe,ge,Ue);case b:return oe=oe.get(ge.key===null?ue:ge.key)||null,ce(te,oe,ge,Ue);case M:return ge=mu(ge),he(oe,te,ue,ge,Ue)}if(V(ge)||z(ge))return oe=oe.get(ue)||null,pe(te,oe,ge,Ue,null);if(typeof ge.then=="function")return he(oe,te,ue,Tg(ge),Ue);if(ge.$$typeof===C)return he(oe,te,ue,Ag(te,ge),Ue);Pg(te,ge)}return null}function Me(oe,te,ue,ge){for(var Ue=null,At=null,Le=te,ot=te=0,pt=null;Le!==null&&ot<ue.length;ot++){Le.index>ot?(pt=Le,Le=null):pt=Le.sibling;var Ot=fe(oe,Le,ue[ot],ge);if(Ot===null){Le===null&&(Le=pt);break}s&&Le&&Ot.alternate===null&&u(oe,Le),te=A(Ot,te,ot),At===null?Ue=Ot:At.sibling=Ot,At=Ot,Le=pt}if(ot===ue.length)return m(oe,Le),vt&&jo(oe,ot),Ue;if(Le===null){for(;ot<ue.length;ot++)Le=ye(oe,ue[ot],ge),Le!==null&&(te=A(Le,te,ot),At===null?Ue=Le:At.sibling=Le,At=Le);return vt&&jo(oe,ot),Ue}for(Le=y(Le);ot<ue.length;ot++)pt=he(Le,oe,ot,ue[ot],ge),pt!==null&&(s&&pt.alternate!==null&&Le.delete(pt.key===null?ot:pt.key),te=A(pt,te,ot),At===null?Ue=pt:At.sibling=pt,At=pt);return s&&Le.forEach(function(nl){return u(oe,nl)}),vt&&jo(oe,ot),Ue}function Ye(oe,te,ue,ge){if(ue==null)throw Error(r(151));for(var Ue=null,At=null,Le=te,ot=te=0,pt=null,Ot=ue.next();Le!==null&&!Ot.done;ot++,Ot=ue.next()){Le.index>ot?(pt=Le,Le=null):pt=Le.sibling;var nl=fe(oe,Le,Ot.value,ge);if(nl===null){Le===null&&(Le=pt);break}s&&Le&&nl.alternate===null&&u(oe,Le),te=A(nl,te,ot),At===null?Ue=nl:At.sibling=nl,At=nl,Le=pt}if(Ot.done)return m(oe,Le),vt&&jo(oe,ot),Ue;if(Le===null){for(;!Ot.done;ot++,Ot=ue.next())Ot=ye(oe,Ot.value,ge),Ot!==null&&(te=A(Ot,te,ot),At===null?Ue=Ot:At.sibling=Ot,At=Ot);return vt&&jo(oe,ot),Ue}for(Le=y(Le);!Ot.done;ot++,Ot=ue.next())Ot=he(Le,oe,ot,Ot.value,ge),Ot!==null&&(s&&Ot.alternate!==null&&Le.delete(Ot.key===null?ot:Ot.key),te=A(Ot,te,ot),At===null?Ue=Ot:At.sibling=Ot,At=Ot);return s&&Le.forEach(function(WG){return u(oe,WG)}),vt&&jo(oe,ot),Ue}function Ut(oe,te,ue,ge){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var Ue=ue.key;te!==null;){if(te.key===Ue){if(Ue=ue.type,Ue===w){if(te.tag===7){m(oe,te.sibling),ge=_(te,ue.props.children),ge.return=oe,oe=ge;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===M&&mu(Ue)===te.type){m(oe,te.sibling),ge=_(te,ue.props),fh(ge,ue),ge.return=oe,oe=ge;break e}m(oe,te);break}else u(oe,te);te=te.sibling}ue.type===w?(ge=uu(ue.props.children,oe.mode,ge,ue.key),ge.return=oe,oe=ge):(ge=_g(ue.type,ue.key,ue.props,null,oe.mode,ge),fh(ge,ue),ge.return=oe,oe=ge)}return P(oe);case b:e:{for(Ue=ue.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){m(oe,te.sibling),ge=_(te,ue.children||[]),ge.return=oe,oe=ge;break e}else{m(oe,te);break}else u(oe,te);te=te.sibling}ge=uw(ue,oe.mode,ge),ge.return=oe,oe=ge}return P(oe);case M:return ue=mu(ue),Ut(oe,te,ue,ge)}if(V(ue))return Me(oe,te,ue,ge);if(z(ue)){if(Ue=z(ue),typeof Ue!="function")throw Error(r(150));return ue=Ue.call(ue),Ye(oe,te,ue,ge)}if(typeof ue.then=="function")return Ut(oe,te,Tg(ue),ge);if(ue.$$typeof===C)return Ut(oe,te,Ag(oe,ue),ge);Pg(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(m(oe,te.sibling),ge=_(te,ue),ge.return=oe,oe=ge):(m(oe,te),ge=lw(ue,oe.mode,ge),ge.return=oe,oe=ge),P(oe)):m(oe,te)}return function(oe,te,ue,ge){try{ch=0;var Ue=Ut(oe,te,ue,ge);return Xc=null,Ue}catch(Le){if(Le===Yc||Le===kg)throw Le;var At=vi(29,Le,null,oe.mode);return At.lanes=ge,At.return=oe,At}finally{}}}var gu=WT(!0),QT=WT(!1),$s=!1;function ww(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sw(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Bs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Fs(s,u,m){var y=s.updateQueue;if(y===null)return null;if(y=y.shared,(Tt&2)!==0){var _=y.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),y.pending=u,u=Eg(s),DT(s,null,m),u}return Sg(s,y,u,m),Eg(s)}function dh(s,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194048)!==0)){var y=u.lanes;y&=s.pendingLanes,m|=y,u.lanes=m,Qn(s,m)}}function Ew(s,u){var m=s.updateQueue,y=s.alternate;if(y!==null&&(y=y.updateQueue,m===y)){var _=null,A=null;if(m=m.firstBaseUpdate,m!==null){do{var P={lane:m.lane,tag:m.tag,payload:m.payload,callback:null,next:null};A===null?_=A=P:A=A.next=P,m=m.next}while(m!==null);A===null?_=A=u:A=A.next=u}else _=A=u;m={baseState:y.baseState,firstBaseUpdate:_,lastBaseUpdate:A,shared:y.shared,callbacks:y.callbacks},s.updateQueue=m;return}s=m.lastBaseUpdate,s===null?m.firstBaseUpdate=u:s.next=u,m.lastBaseUpdate=u}var _w=!1;function hh(){if(_w){var s=Kc;if(s!==null)throw s}}function mh(s,u,m,y){_w=!1;var _=s.updateQueue;$s=!1;var A=_.firstBaseUpdate,P=_.lastBaseUpdate,K=_.shared.pending;if(K!==null){_.shared.pending=null;var Z=K,ce=Z.next;Z.next=null,P===null?A=ce:P.next=ce,P=Z;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,K=pe.lastBaseUpdate,K!==P&&(K===null?pe.firstBaseUpdate=ce:K.next=ce,pe.lastBaseUpdate=Z))}if(A!==null){var ye=_.baseState;P=0,pe=ce=Z=null,K=A;do{var fe=K.lane&-536870913,he=fe!==K.lane;if(he?(mt&fe)===fe:(y&fe)===fe){fe!==0&&fe===Vc&&(_w=!0),pe!==null&&(pe=pe.next={lane:0,tag:K.tag,payload:K.payload,callback:null,next:null});e:{var Me=s,Ye=K;fe=u;var Ut=m;switch(Ye.tag){case 1:if(Me=Ye.payload,typeof Me=="function"){ye=Me.call(Ut,ye,fe);break e}ye=Me;break e;case 3:Me.flags=Me.flags&-65537|128;case 0:if(Me=Ye.payload,fe=typeof Me=="function"?Me.call(Ut,ye,fe):Me,fe==null)break e;ye=d({},ye,fe);break e;case 2:$s=!0}}fe=K.callback,fe!==null&&(s.flags|=64,he&&(s.flags|=8192),he=_.callbacks,he===null?_.callbacks=[fe]:he.push(fe))}else he={lane:fe,tag:K.tag,payload:K.payload,callback:K.callback,next:null},pe===null?(ce=pe=he,Z=ye):pe=pe.next=he,P|=fe;if(K=K.next,K===null){if(K=_.shared.pending,K===null)break;he=K,K=he.next,he.next=null,_.lastBaseUpdate=he,_.shared.pending=null}}while(!0);pe===null&&(Z=ye),_.baseState=Z,_.firstBaseUpdate=ce,_.lastBaseUpdate=pe,A===null&&(_.shared.lanes=0),Ks|=P,s.lanes=P,s.memoizedState=ye}}function ZT(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function JT(s,u){var m=s.callbacks;if(m!==null)for(s.callbacks=null,s=0;s<m.length;s++)ZT(m[s],u)}var Gc=H(null),Mg=H(0);function eP(s,u){s=Lo,$(Mg,s),$(Gc,u),Lo=s|u.baseLanes}function Cw(){$(Mg,Lo),$(Gc,Gc.current)}function jw(){Lo=Mg.current,U(Gc),U(Mg)}var yi=H(null),Ki=null;function Us(s){var u=s.alternate;$(Dn,Dn.current&1),$(yi,s),Ki===null&&(u===null||Gc.current!==null||u.memoizedState!==null)&&(Ki=s)}function Aw(s){$(Dn,Dn.current),$(yi,s),Ki===null&&(Ki=s)}function tP(s){s.tag===22?($(Dn,Dn.current),$(yi,s),Ki===null&&(Ki=s)):Hs()}function Hs(){$(Dn,Dn.current),$(yi,yi.current)}function xi(s){U(yi),Ki===s&&(Ki=null),U(Dn)}var Dn=H(0);function Dg(s){for(var u=s;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||M1(m)||D1(m)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ko=0,at=null,Bt=null,Bn=null,Rg=!1,Wc=!1,vu=!1,Ig=0,ph=0,Qc=null,BX=0;function Sn(){throw Error(r(321))}function Ow(s,u){if(u===null)return!1;for(var m=0;m<u.length&&m<s.length;m++)if(!gi(s[m],u[m]))return!1;return!0}function kw(s,u,m,y,_,A){return ko=A,at=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,D.H=s===null||s.memoizedState===null?zP:qw,vu=!1,A=m(y,_),vu=!1,Wc&&(A=rP(u,m,y,_)),nP(s),A}function nP(s){D.H=yh;var u=Bt!==null&&Bt.next!==null;if(ko=0,Bn=Bt=at=null,Rg=!1,ph=0,Qc=null,u)throw Error(r(300));s===null||Fn||(s=s.dependencies,s!==null&&jg(s)&&(Fn=!0))}function rP(s,u,m,y){at=s;var _=0;do{if(Wc&&(Qc=null),ph=0,Wc=!1,25<=_)throw Error(r(301));if(_+=1,Bn=Bt=null,s.updateQueue!=null){var A=s.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}D.H=$P,A=u(m,y)}while(Wc);return A}function FX(){var s=D.H,u=s.useState()[0];return u=typeof u.then=="function"?gh(u):u,s=s.useState()[0],(Bt!==null?Bt.memoizedState:null)!==s&&(at.flags|=1024),u}function Nw(){var s=Ig!==0;return Ig=0,s}function Tw(s,u,m){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~m}function Pw(s){if(Rg){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Rg=!1}ko=0,Bn=Bt=at=null,Wc=!1,ph=Ig=0,Qc=null}function Hr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?at.memoizedState=Bn=s:Bn=Bn.next=s,Bn}function Rn(){if(Bt===null){var s=at.alternate;s=s!==null?s.memoizedState:null}else s=Bt.next;var u=Bn===null?at.memoizedState:Bn.next;if(u!==null)Bn=u,Bt=s;else{if(s===null)throw at.alternate===null?Error(r(467)):Error(r(310));Bt=s,s={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Bn===null?at.memoizedState=Bn=s:Bn=Bn.next=s}return Bn}function Lg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gh(s){var u=ph;return ph+=1,Qc===null&&(Qc=[]),s=YT(Qc,s,u),u=at,(Bn===null?u.memoizedState:Bn.next)===null&&(u=u.alternate,D.H=u===null||u.memoizedState===null?zP:qw),s}function zg(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return gh(s);if(s.$$typeof===C)return wr(s)}throw Error(r(438,String(s)))}function Mw(s){var u=null,m=at.updateQueue;if(m!==null&&(u=m.memoCache),u==null){var y=at.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(u={data:y.data.map(function(_){return _.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),m===null&&(m=Lg(),at.updateQueue=m),m.memoCache=u,m=u.data[u.index],m===void 0)for(m=u.data[u.index]=Array(s),y=0;y<s;y++)m[y]=L;return u.index++,m}function No(s,u){return typeof u=="function"?u(s):u}function $g(s){var u=Rn();return Dw(u,Bt,s)}function Dw(s,u,m){var y=s.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=m;var _=s.baseQueue,A=y.pending;if(A!==null){if(_!==null){var P=_.next;_.next=A.next,A.next=P}u.baseQueue=_=A,y.pending=null}if(A=s.baseState,_===null)s.memoizedState=A;else{u=_.next;var K=P=null,Z=null,ce=u,pe=!1;do{var ye=ce.lane&-536870913;if(ye!==ce.lane?(mt&ye)===ye:(ko&ye)===ye){var fe=ce.revertLane;if(fe===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ye===Vc&&(pe=!0);else if((ko&fe)===fe){ce=ce.next,fe===Vc&&(pe=!0);continue}else ye={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Z===null?(K=Z=ye,P=A):Z=Z.next=ye,at.lanes|=fe,Ks|=fe;ye=ce.action,vu&&m(A,ye),A=ce.hasEagerState?ce.eagerState:m(A,ye)}else fe={lane:ye,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},Z===null?(K=Z=fe,P=A):Z=Z.next=fe,at.lanes|=ye,Ks|=ye;ce=ce.next}while(ce!==null&&ce!==u);if(Z===null?P=A:Z.next=K,!gi(A,s.memoizedState)&&(Fn=!0,pe&&(m=Kc,m!==null)))throw m;s.memoizedState=A,s.baseState=P,s.baseQueue=Z,y.lastRenderedState=A}return _===null&&(y.lanes=0),[s.memoizedState,y.dispatch]}function Rw(s){var u=Rn(),m=u.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=s;var y=m.dispatch,_=m.pending,A=u.memoizedState;if(_!==null){m.pending=null;var P=_=_.next;do A=s(A,P.action),P=P.next;while(P!==_);gi(A,u.memoizedState)||(Fn=!0),u.memoizedState=A,u.baseQueue===null&&(u.baseState=A),m.lastRenderedState=A}return[A,y]}function iP(s,u,m){var y=at,_=Rn(),A=vt;if(A){if(m===void 0)throw Error(r(407));m=m()}else m=u();var P=!gi((Bt||_).memoizedState,m);if(P&&(_.memoizedState=m,Fn=!0),_=_.queue,zw(sP.bind(null,y,_,s),[s]),_.getSnapshot!==u||P||Bn!==null&&Bn.memoizedState.tag&1){if(y.flags|=2048,Zc(9,{destroy:void 0},oP.bind(null,y,_,m,u),null),Xt===null)throw Error(r(349));A||(ko&127)!==0||aP(y,u,m)}return m}function aP(s,u,m){s.flags|=16384,s={getSnapshot:u,value:m},u=at.updateQueue,u===null?(u=Lg(),at.updateQueue=u,u.stores=[s]):(m=u.stores,m===null?u.stores=[s]:m.push(s))}function oP(s,u,m,y){u.value=m,u.getSnapshot=y,lP(u)&&uP(s)}function sP(s,u,m){return m(function(){lP(u)&&uP(s)})}function lP(s){var u=s.getSnapshot;s=s.value;try{var m=u();return!gi(s,m)}catch{return!0}}function uP(s){var u=lu(s,2);u!==null&&ai(u,s,2)}function Iw(s){var u=Hr();if(typeof s=="function"){var m=s;if(s=m(),vu){lt(!0);try{m()}finally{lt(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:s},u}function cP(s,u,m,y){return s.baseState=m,Dw(s,Bt,typeof y=="function"?y:No)}function UX(s,u,m,y,_){if(Ug(s))throw Error(r(485));if(s=u.action,s!==null){var A={payload:_,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(P){A.listeners.push(P)}};D.T!==null?m(!0):A.isTransition=!1,y(A),m=u.pending,m===null?(A.next=u.pending=A,fP(u,A)):(A.next=m.next,u.pending=m.next=A)}}function fP(s,u){var m=u.action,y=u.payload,_=s.state;if(u.isTransition){var A=D.T,P={};D.T=P;try{var K=m(_,y),Z=D.S;Z!==null&&Z(P,K),dP(s,u,K)}catch(ce){Lw(s,u,ce)}finally{A!==null&&P.types!==null&&(A.types=P.types),D.T=A}}else try{A=m(_,y),dP(s,u,A)}catch(ce){Lw(s,u,ce)}}function dP(s,u,m){m!==null&&typeof m=="object"&&typeof m.then=="function"?m.then(function(y){hP(s,u,y)},function(y){return Lw(s,u,y)}):hP(s,u,m)}function hP(s,u,m){u.status="fulfilled",u.value=m,mP(u),s.state=m,u=s.pending,u!==null&&(m=u.next,m===u?s.pending=null:(m=m.next,u.next=m,fP(s,m)))}function Lw(s,u,m){var y=s.pending;if(s.pending=null,y!==null){y=y.next;do u.status="rejected",u.reason=m,mP(u),u=u.next;while(u!==y)}s.action=null}function mP(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function pP(s,u){return u}function gP(s,u){if(vt){var m=Xt.formState;if(m!==null){e:{var y=at;if(vt){if(en){t:{for(var _=en,A=Vi;_.nodeType!==8;){if(!A){_=null;break t}if(_=Yi(_.nextSibling),_===null){_=null;break t}}A=_.data,_=A==="F!"||A==="F"?_:null}if(_){en=Yi(_.nextSibling),y=_.data==="F!";break e}}Ls(y)}y=!1}y&&(u=m[0])}}return m=Hr(),m.memoizedState=m.baseState=u,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pP,lastRenderedState:u},m.queue=y,m=RP.bind(null,at,y),y.dispatch=m,y=Iw(!1),A=Hw.bind(null,at,!1,y.queue),y=Hr(),_={state:u,dispatch:null,action:s,pending:null},y.queue=_,m=UX.bind(null,at,_,A,m),_.dispatch=m,y.memoizedState=s,[u,m,!1]}function vP(s){var u=Rn();return yP(u,Bt,s)}function yP(s,u,m){if(u=Dw(s,u,pP)[0],s=$g(No)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var y=gh(u)}catch(P){throw P===Yc?kg:P}else y=u;u=Rn();var _=u.queue,A=_.dispatch;return m!==u.memoizedState&&(at.flags|=2048,Zc(9,{destroy:void 0},HX.bind(null,_,m),null)),[y,A,s]}function HX(s,u){s.action=u}function xP(s){var u=Rn(),m=Bt;if(m!==null)return yP(u,m,s);Rn(),u=u.memoizedState,m=Rn();var y=m.queue.dispatch;return m.memoizedState=s,[u,y,!1]}function Zc(s,u,m,y){return s={tag:s,create:m,deps:y,inst:u,next:null},u=at.updateQueue,u===null&&(u=Lg(),at.updateQueue=u),m=u.lastEffect,m===null?u.lastEffect=s.next=s:(y=m.next,m.next=s,s.next=y,u.lastEffect=s),s}function bP(){return Rn().memoizedState}function Bg(s,u,m,y){var _=Hr();at.flags|=s,_.memoizedState=Zc(1|u,{destroy:void 0},m,y===void 0?null:y)}function Fg(s,u,m,y){var _=Rn();y=y===void 0?null:y;var A=_.memoizedState.inst;Bt!==null&&y!==null&&Ow(y,Bt.memoizedState.deps)?_.memoizedState=Zc(u,A,m,y):(at.flags|=s,_.memoizedState=Zc(1|u,A,m,y))}function wP(s,u){Bg(8390656,8,s,u)}function zw(s,u){Fg(2048,8,s,u)}function qX(s){at.flags|=4;var u=at.updateQueue;if(u===null)u=Lg(),at.updateQueue=u,u.events=[s];else{var m=u.events;m===null?u.events=[s]:m.push(s)}}function SP(s){var u=Rn().memoizedState;return qX({ref:u,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function EP(s,u){return Fg(4,2,s,u)}function _P(s,u){return Fg(4,4,s,u)}function CP(s,u){if(typeof u=="function"){s=s();var m=u(s);return function(){typeof m=="function"?m():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function jP(s,u,m){m=m!=null?m.concat([s]):null,Fg(4,4,CP.bind(null,u,s),m)}function $w(){}function AP(s,u){var m=Rn();u=u===void 0?null:u;var y=m.memoizedState;return u!==null&&Ow(u,y[1])?y[0]:(m.memoizedState=[s,u],s)}function OP(s,u){var m=Rn();u=u===void 0?null:u;var y=m.memoizedState;if(u!==null&&Ow(u,y[1]))return y[0];if(y=s(),vu){lt(!0);try{s()}finally{lt(!1)}}return m.memoizedState=[y,u],y}function Bw(s,u,m){return m===void 0||(ko&1073741824)!==0&&(mt&261930)===0?s.memoizedState=u:(s.memoizedState=m,s=k2(),at.lanes|=s,Ks|=s,m)}function kP(s,u,m,y){return gi(m,u)?m:Gc.current!==null?(s=Bw(s,m,y),gi(s,u)||(Fn=!0),s):(ko&42)===0||(ko&1073741824)!==0&&(mt&261930)===0?(Fn=!0,s.memoizedState=m):(s=k2(),at.lanes|=s,Ks|=s,u)}function NP(s,u,m,y,_){var A=q.p;q.p=A!==0&&8>A?A:8;var P=D.T,K={};D.T=K,Hw(s,!1,u,m);try{var Z=_(),ce=D.S;if(ce!==null&&ce(K,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var pe=$X(Z,y);vh(s,u,pe,Si(s))}else vh(s,u,y,Si(s))}catch(ye){vh(s,u,{then:function(){},status:"rejected",reason:ye},Si())}finally{q.p=A,P!==null&&K.types!==null&&(P.types=K.types),D.T=P}}function VX(){}function Fw(s,u,m,y){if(s.tag!==5)throw Error(r(476));var _=TP(s).queue;NP(s,_,u,X,m===null?VX:function(){return PP(s),m(y)})}function TP(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:X},next:null};var m={};return u.next={memoizedState:m,baseState:m,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:m},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function PP(s){var u=TP(s);u.next===null&&(u=s.alternate.memoizedState),vh(s,u.next.queue,{},Si())}function Uw(){return wr(Dh)}function MP(){return Rn().memoizedState}function DP(){return Rn().memoizedState}function KX(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var m=Si();s=Bs(m);var y=Fs(u,s,m);y!==null&&(ai(y,u,m),dh(y,u,m)),u={cache:vw()},s.payload=u;return}u=u.return}}function YX(s,u,m){var y=Si();m={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Ug(s)?IP(u,m):(m=ow(s,u,m,y),m!==null&&(ai(m,s,y),LP(m,u,y)))}function RP(s,u,m){var y=Si();vh(s,u,m,y)}function vh(s,u,m,y){var _={lane:y,revertLane:0,gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null};if(Ug(s))IP(u,_);else{var A=s.alternate;if(s.lanes===0&&(A===null||A.lanes===0)&&(A=u.lastRenderedReducer,A!==null))try{var P=u.lastRenderedState,K=A(P,m);if(_.hasEagerState=!0,_.eagerState=K,gi(K,P))return Sg(s,u,_,0),Xt===null&&wg(),!1}catch{}finally{}if(m=ow(s,u,_,y),m!==null)return ai(m,s,y),LP(m,u,y),!0}return!1}function Hw(s,u,m,y){if(y={lane:2,revertLane:w1(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Ug(s)){if(u)throw Error(r(479))}else u=ow(s,m,y,2),u!==null&&ai(u,s,2)}function Ug(s){var u=s.alternate;return s===at||u!==null&&u===at}function IP(s,u){Wc=Rg=!0;var m=s.pending;m===null?u.next=u:(u.next=m.next,m.next=u),s.pending=u}function LP(s,u,m){if((m&4194048)!==0){var y=u.lanes;y&=s.pendingLanes,m|=y,u.lanes=m,Qn(s,m)}}var yh={readContext:wr,use:zg,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};yh.useEffectEvent=Sn;var zP={readContext:wr,use:zg,useCallback:function(s,u){return Hr().memoizedState=[s,u===void 0?null:u],s},useContext:wr,useEffect:wP,useImperativeHandle:function(s,u,m){m=m!=null?m.concat([s]):null,Bg(4194308,4,CP.bind(null,u,s),m)},useLayoutEffect:function(s,u){return Bg(4194308,4,s,u)},useInsertionEffect:function(s,u){Bg(4,2,s,u)},useMemo:function(s,u){var m=Hr();u=u===void 0?null:u;var y=s();if(vu){lt(!0);try{s()}finally{lt(!1)}}return m.memoizedState=[y,u],y},useReducer:function(s,u,m){var y=Hr();if(m!==void 0){var _=m(u);if(vu){lt(!0);try{m(u)}finally{lt(!1)}}}else _=u;return y.memoizedState=y.baseState=_,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:_},y.queue=s,s=s.dispatch=YX.bind(null,at,s),[y.memoizedState,s]},useRef:function(s){var u=Hr();return s={current:s},u.memoizedState=s},useState:function(s){s=Iw(s);var u=s.queue,m=RP.bind(null,at,u);return u.dispatch=m,[s.memoizedState,m]},useDebugValue:$w,useDeferredValue:function(s,u){var m=Hr();return Bw(m,s,u)},useTransition:function(){var s=Iw(!1);return s=NP.bind(null,at,s.queue,!0,!1),Hr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,m){var y=at,_=Hr();if(vt){if(m===void 0)throw Error(r(407));m=m()}else{if(m=u(),Xt===null)throw Error(r(349));(mt&127)!==0||aP(y,u,m)}_.memoizedState=m;var A={value:m,getSnapshot:u};return _.queue=A,wP(sP.bind(null,y,A,s),[s]),y.flags|=2048,Zc(9,{destroy:void 0},oP.bind(null,y,A,m,u),null),m},useId:function(){var s=Hr(),u=Xt.identifierPrefix;if(vt){var m=Fa,y=Ba;m=(y&~(1<<32-Xe(y)-1)).toString(32)+m,u="_"+u+"R_"+m,m=Ig++,0<m&&(u+="H"+m.toString(32)),u+="_"}else m=BX++,u="_"+u+"r_"+m.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:Uw,useFormState:gP,useActionState:gP,useOptimistic:function(s){var u=Hr();u.memoizedState=u.baseState=s;var m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=m,u=Hw.bind(null,at,!0,m),m.dispatch=u,[s,u]},useMemoCache:Mw,useCacheRefresh:function(){return Hr().memoizedState=KX.bind(null,at)},useEffectEvent:function(s){var u=Hr(),m={impl:s};return u.memoizedState=m,function(){if((Tt&2)!==0)throw Error(r(440));return m.impl.apply(void 0,arguments)}}},qw={readContext:wr,use:zg,useCallback:AP,useContext:wr,useEffect:zw,useImperativeHandle:jP,useInsertionEffect:EP,useLayoutEffect:_P,useMemo:OP,useReducer:$g,useRef:bP,useState:function(){return $g(No)},useDebugValue:$w,useDeferredValue:function(s,u){var m=Rn();return kP(m,Bt.memoizedState,s,u)},useTransition:function(){var s=$g(No)[0],u=Rn().memoizedState;return[typeof s=="boolean"?s:gh(s),u]},useSyncExternalStore:iP,useId:MP,useHostTransitionStatus:Uw,useFormState:vP,useActionState:vP,useOptimistic:function(s,u){var m=Rn();return cP(m,Bt,s,u)},useMemoCache:Mw,useCacheRefresh:DP};qw.useEffectEvent=SP;var $P={readContext:wr,use:zg,useCallback:AP,useContext:wr,useEffect:zw,useImperativeHandle:jP,useInsertionEffect:EP,useLayoutEffect:_P,useMemo:OP,useReducer:Rw,useRef:bP,useState:function(){return Rw(No)},useDebugValue:$w,useDeferredValue:function(s,u){var m=Rn();return Bt===null?Bw(m,s,u):kP(m,Bt.memoizedState,s,u)},useTransition:function(){var s=Rw(No)[0],u=Rn().memoizedState;return[typeof s=="boolean"?s:gh(s),u]},useSyncExternalStore:iP,useId:MP,useHostTransitionStatus:Uw,useFormState:xP,useActionState:xP,useOptimistic:function(s,u){var m=Rn();return Bt!==null?cP(m,Bt,s,u):(m.baseState=s,[s,m.queue.dispatch])},useMemoCache:Mw,useCacheRefresh:DP};$P.useEffectEvent=SP;function Vw(s,u,m,y){u=s.memoizedState,m=m(y,u),m=m==null?u:d({},u,m),s.memoizedState=m,s.lanes===0&&(s.updateQueue.baseState=m)}var Kw={enqueueSetState:function(s,u,m){s=s._reactInternals;var y=Si(),_=Bs(y);_.payload=u,m!=null&&(_.callback=m),u=Fs(s,_,y),u!==null&&(ai(u,s,y),dh(u,s,y))},enqueueReplaceState:function(s,u,m){s=s._reactInternals;var y=Si(),_=Bs(y);_.tag=1,_.payload=u,m!=null&&(_.callback=m),u=Fs(s,_,y),u!==null&&(ai(u,s,y),dh(u,s,y))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var m=Si(),y=Bs(m);y.tag=2,u!=null&&(y.callback=u),u=Fs(s,y,m),u!==null&&(ai(u,s,m),dh(u,s,m))}};function BP(s,u,m,y,_,A,P){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(y,A,P):u.prototype&&u.prototype.isPureReactComponent?!ih(m,y)||!ih(_,A):!0}function FP(s,u,m,y){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,y),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,y),u.state!==s&&Kw.enqueueReplaceState(u,u.state,null)}function yu(s,u){var m=u;if("ref"in u){m={};for(var y in u)y!=="ref"&&(m[y]=u[y])}if(s=s.defaultProps){m===u&&(m=d({},m));for(var _ in s)m[_]===void 0&&(m[_]=s[_])}return m}function UP(s){bg(s)}function HP(s){console.error(s)}function qP(s){bg(s)}function Hg(s,u){try{var m=s.onUncaughtError;m(u.value,{componentStack:u.stack})}catch(y){setTimeout(function(){throw y})}}function VP(s,u,m){try{var y=s.onCaughtError;y(m.value,{componentStack:m.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Yw(s,u,m){return m=Bs(m),m.tag=3,m.payload={element:null},m.callback=function(){Hg(s,u)},m}function KP(s){return s=Bs(s),s.tag=3,s}function YP(s,u,m,y){var _=m.type.getDerivedStateFromError;if(typeof _=="function"){var A=y.value;s.payload=function(){return _(A)},s.callback=function(){VP(u,m,y)}}var P=m.stateNode;P!==null&&typeof P.componentDidCatch=="function"&&(s.callback=function(){VP(u,m,y),typeof _!="function"&&(Ys===null?Ys=new Set([this]):Ys.add(this));var K=y.stack;this.componentDidCatch(y.value,{componentStack:K!==null?K:""})})}function XX(s,u,m,y,_){if(m.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(u=m.alternate,u!==null&&qc(u,m,_,!0),m=yi.current,m!==null){switch(m.tag){case 31:case 13:return Ki===null?tv():m.alternate===null&&En===0&&(En=3),m.flags&=-257,m.flags|=65536,m.lanes=_,y===Ng?m.flags|=16384:(u=m.updateQueue,u===null?m.updateQueue=new Set([y]):u.add(y),y1(s,y,_)),!1;case 22:return m.flags|=65536,y===Ng?m.flags|=16384:(u=m.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([y])},m.updateQueue=u):(m=u.retryQueue,m===null?u.retryQueue=new Set([y]):m.add(y)),y1(s,y,_)),!1}throw Error(r(435,m.tag))}return y1(s,y,_),tv(),!1}if(vt)return u=yi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=_,y!==dw&&(s=Error(r(422),{cause:y}),sh(Ui(s,m)))):(y!==dw&&(u=Error(r(423),{cause:y}),sh(Ui(u,m))),s=s.current.alternate,s.flags|=65536,_&=-_,s.lanes|=_,y=Ui(y,m),_=Yw(s.stateNode,y,_),Ew(s,_),En!==4&&(En=2)),!1;var A=Error(r(520),{cause:y});if(A=Ui(A,m),jh===null?jh=[A]:jh.push(A),En!==4&&(En=2),u===null)return!0;y=Ui(y,m),m=u;do{switch(m.tag){case 3:return m.flags|=65536,s=_&-_,m.lanes|=s,s=Yw(m.stateNode,y,s),Ew(m,s),!1;case 1:if(u=m.type,A=m.stateNode,(m.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Ys===null||!Ys.has(A))))return m.flags|=65536,_&=-_,m.lanes|=_,_=KP(_),YP(_,s,m,y),Ew(m,_),!1}m=m.return}while(m!==null);return!1}var Xw=Error(r(461)),Fn=!1;function Sr(s,u,m,y){u.child=s===null?QT(u,null,m,y):gu(u,s.child,m,y)}function XP(s,u,m,y,_){m=m.render;var A=u.ref;if("ref"in y){var P={};for(var K in y)K!=="ref"&&(P[K]=y[K])}else P=y;return du(u),y=kw(s,u,m,P,A,_),K=Nw(),s!==null&&!Fn?(Tw(s,u,_),To(s,u,_)):(vt&&K&&cw(u),u.flags|=1,Sr(s,u,y,_),u.child)}function GP(s,u,m,y,_){if(s===null){var A=m.type;return typeof A=="function"&&!sw(A)&&A.defaultProps===void 0&&m.compare===null?(u.tag=15,u.type=A,WP(s,u,A,y,_)):(s=_g(m.type,null,y,u,u.mode,_),s.ref=u.ref,s.return=u,u.child=s)}if(A=s.child,!n1(s,_)){var P=A.memoizedProps;if(m=m.compare,m=m!==null?m:ih,m(P,y)&&s.ref===u.ref)return To(s,u,_)}return u.flags|=1,s=Co(A,y),s.ref=u.ref,s.return=u,u.child=s}function WP(s,u,m,y,_){if(s!==null){var A=s.memoizedProps;if(ih(A,y)&&s.ref===u.ref)if(Fn=!1,u.pendingProps=y=A,n1(s,_))(s.flags&131072)!==0&&(Fn=!0);else return u.lanes=s.lanes,To(s,u,_)}return Gw(s,u,m,y,_)}function QP(s,u,m,y){var _=y.children,A=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((u.flags&128)!==0){if(A=A!==null?A.baseLanes|m:m,s!==null){for(y=u.child=s.child,_=0;y!==null;)_=_|y.lanes|y.childLanes,y=y.sibling;y=_&~A}else y=0,u.child=null;return ZP(s,u,A,m,y)}if((m&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Og(u,A!==null?A.cachePool:null),A!==null?eP(u,A):Cw(),tP(u);else return y=u.lanes=536870912,ZP(s,u,A!==null?A.baseLanes|m:m,m,y)}else A!==null?(Og(u,A.cachePool),eP(u,A),Hs(),u.memoizedState=null):(s!==null&&Og(u,null),Cw(),Hs());return Sr(s,u,_,m),u.child}function xh(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function ZP(s,u,m,y,_){var A=xw();return A=A===null?null:{parent:$n._currentValue,pool:A},u.memoizedState={baseLanes:m,cachePool:A},s!==null&&Og(u,null),Cw(),tP(u),s!==null&&qc(s,u,y,!0),u.childLanes=_,null}function qg(s,u){return u=Kg({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function JP(s,u,m){return gu(u,s.child,null,m),s=qg(u,u.pendingProps),s.flags|=2,xi(u),u.memoizedState=null,s}function GX(s,u,m){var y=u.pendingProps,_=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(vt){if(y.mode==="hidden")return s=qg(u,y),u.lanes=536870912,xh(null,s);if(Aw(u),(s=en)?(s=fM(s,Vi),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Rs!==null?{id:Ba,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},m=IT(s),m.return=u,u.child=m,br=u,en=null)):s=null,s===null)throw Ls(u);return u.lanes=536870912,null}return qg(u,y)}var A=s.memoizedState;if(A!==null){var P=A.dehydrated;if(Aw(u),_)if(u.flags&256)u.flags&=-257,u=JP(s,u,m);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Fn||qc(s,u,m,!1),_=(m&s.childLanes)!==0,Fn||_){if(y=Xt,y!==null&&(P=cr(y,m),P!==0&&P!==A.retryLane))throw A.retryLane=P,lu(s,P),ai(y,s,P),Xw;tv(),u=JP(s,u,m)}else s=A.treeContext,en=Yi(P.nextSibling),br=u,vt=!0,Is=null,Vi=!1,s!==null&&$T(u,s),u=qg(u,y),u.flags|=4096;return u}return s=Co(s.child,{mode:y.mode,children:y.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Vg(s,u){var m=u.ref;if(m===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof m!="function"&&typeof m!="object")throw Error(r(284));(s===null||s.ref!==m)&&(u.flags|=4194816)}}function Gw(s,u,m,y,_){return du(u),m=kw(s,u,m,y,void 0,_),y=Nw(),s!==null&&!Fn?(Tw(s,u,_),To(s,u,_)):(vt&&y&&cw(u),u.flags|=1,Sr(s,u,m,_),u.child)}function e2(s,u,m,y,_,A){return du(u),u.updateQueue=null,m=rP(u,y,m,_),nP(s),y=Nw(),s!==null&&!Fn?(Tw(s,u,A),To(s,u,A)):(vt&&y&&cw(u),u.flags|=1,Sr(s,u,m,A),u.child)}function t2(s,u,m,y,_){if(du(u),u.stateNode===null){var A=Bc,P=m.contextType;typeof P=="object"&&P!==null&&(A=wr(P)),A=new m(y,A),u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=Kw,u.stateNode=A,A._reactInternals=u,A=u.stateNode,A.props=y,A.state=u.memoizedState,A.refs={},ww(u),P=m.contextType,A.context=typeof P=="object"&&P!==null?wr(P):Bc,A.state=u.memoizedState,P=m.getDerivedStateFromProps,typeof P=="function"&&(Vw(u,m,P,y),A.state=u.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(P=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),P!==A.state&&Kw.enqueueReplaceState(A,A.state,null),mh(u,y,A,_),hh(),A.state=u.memoizedState),typeof A.componentDidMount=="function"&&(u.flags|=4194308),y=!0}else if(s===null){A=u.stateNode;var K=u.memoizedProps,Z=yu(m,K);A.props=Z;var ce=A.context,pe=m.contextType;P=Bc,typeof pe=="object"&&pe!==null&&(P=wr(pe));var ye=m.getDerivedStateFromProps;pe=typeof ye=="function"||typeof A.getSnapshotBeforeUpdate=="function",K=u.pendingProps!==K,pe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(K||ce!==P)&&FP(u,A,y,P),$s=!1;var fe=u.memoizedState;A.state=fe,mh(u,y,A,_),hh(),ce=u.memoizedState,K||fe!==ce||$s?(typeof ye=="function"&&(Vw(u,m,ye,y),ce=u.memoizedState),(Z=$s||BP(u,m,Z,y,fe,ce,P))?(pe||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(u.flags|=4194308)):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=y,u.memoizedState=ce),A.props=y,A.state=ce,A.context=P,y=Z):(typeof A.componentDidMount=="function"&&(u.flags|=4194308),y=!1)}else{A=u.stateNode,Sw(s,u),P=u.memoizedProps,pe=yu(m,P),A.props=pe,ye=u.pendingProps,fe=A.context,ce=m.contextType,Z=Bc,typeof ce=="object"&&ce!==null&&(Z=wr(ce)),K=m.getDerivedStateFromProps,(ce=typeof K=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(P!==ye||fe!==Z)&&FP(u,A,y,Z),$s=!1,fe=u.memoizedState,A.state=fe,mh(u,y,A,_),hh();var he=u.memoizedState;P!==ye||fe!==he||$s||s!==null&&s.dependencies!==null&&jg(s.dependencies)?(typeof K=="function"&&(Vw(u,m,K,y),he=u.memoizedState),(pe=$s||BP(u,m,pe,y,fe,he,Z)||s!==null&&s.dependencies!==null&&jg(s.dependencies))?(ce||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(y,he,Z),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(y,he,Z)),typeof A.componentDidUpdate=="function"&&(u.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof A.componentDidUpdate!="function"||P===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),u.memoizedProps=y,u.memoizedState=he),A.props=y,A.state=he,A.context=Z,y=pe):(typeof A.componentDidUpdate!="function"||P===s.memoizedProps&&fe===s.memoizedState||(u.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||P===s.memoizedProps&&fe===s.memoizedState||(u.flags|=1024),y=!1)}return A=y,Vg(s,u),y=(u.flags&128)!==0,A||y?(A=u.stateNode,m=y&&typeof m.getDerivedStateFromError!="function"?null:A.render(),u.flags|=1,s!==null&&y?(u.child=gu(u,s.child,null,_),u.child=gu(u,null,m,_)):Sr(s,u,m,_),u.memoizedState=A.state,s=u.child):s=To(s,u,_),s}function n2(s,u,m,y){return cu(),u.flags|=256,Sr(s,u,m,y),u.child}var Ww={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qw(s){return{baseLanes:s,cachePool:VT()}}function Zw(s,u,m){return s=s!==null?s.childLanes&~m:0,u&&(s|=wi),s}function r2(s,u,m){var y=u.pendingProps,_=!1,A=(u.flags&128)!==0,P;if((P=A)||(P=s!==null&&s.memoizedState===null?!1:(Dn.current&2)!==0),P&&(_=!0,u.flags&=-129),P=(u.flags&32)!==0,u.flags&=-33,s===null){if(vt){if(_?Us(u):Hs(),(s=en)?(s=fM(s,Vi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Rs!==null?{id:Ba,overflow:Fa}:null,retryLane:536870912,hydrationErrors:null},m=IT(s),m.return=u,u.child=m,br=u,en=null)):s=null,s===null)throw Ls(u);return D1(s)?u.lanes=32:u.lanes=536870912,null}var K=y.children;return y=y.fallback,_?(Hs(),_=u.mode,K=Kg({mode:"hidden",children:K},_),y=uu(y,_,m,null),K.return=u,y.return=u,K.sibling=y,u.child=K,y=u.child,y.memoizedState=Qw(m),y.childLanes=Zw(s,P,m),u.memoizedState=Ww,xh(null,y)):(Us(u),Jw(u,K))}var Z=s.memoizedState;if(Z!==null&&(K=Z.dehydrated,K!==null)){if(A)u.flags&256?(Us(u),u.flags&=-257,u=e1(s,u,m)):u.memoizedState!==null?(Hs(),u.child=s.child,u.flags|=128,u=null):(Hs(),K=y.fallback,_=u.mode,y=Kg({mode:"visible",children:y.children},_),K=uu(K,_,m,null),K.flags|=2,y.return=u,K.return=u,y.sibling=K,u.child=y,gu(u,s.child,null,m),y=u.child,y.memoizedState=Qw(m),y.childLanes=Zw(s,P,m),u.memoizedState=Ww,u=xh(null,y));else if(Us(u),D1(K)){if(P=K.nextSibling&&K.nextSibling.dataset,P)var ce=P.dgst;P=ce,y=Error(r(419)),y.stack="",y.digest=P,sh({value:y,source:null,stack:null}),u=e1(s,u,m)}else if(Fn||qc(s,u,m,!1),P=(m&s.childLanes)!==0,Fn||P){if(P=Xt,P!==null&&(y=cr(P,m),y!==0&&y!==Z.retryLane))throw Z.retryLane=y,lu(s,y),ai(P,s,y),Xw;M1(K)||tv(),u=e1(s,u,m)}else M1(K)?(u.flags|=192,u.child=s.child,u=null):(s=Z.treeContext,en=Yi(K.nextSibling),br=u,vt=!0,Is=null,Vi=!1,s!==null&&$T(u,s),u=Jw(u,y.children),u.flags|=4096);return u}return _?(Hs(),K=y.fallback,_=u.mode,Z=s.child,ce=Z.sibling,y=Co(Z,{mode:"hidden",children:y.children}),y.subtreeFlags=Z.subtreeFlags&65011712,ce!==null?K=Co(ce,K):(K=uu(K,_,m,null),K.flags|=2),K.return=u,y.return=u,y.sibling=K,u.child=y,xh(null,y),y=u.child,K=s.child.memoizedState,K===null?K=Qw(m):(_=K.cachePool,_!==null?(Z=$n._currentValue,_=_.parent!==Z?{parent:Z,pool:Z}:_):_=VT(),K={baseLanes:K.baseLanes|m,cachePool:_}),y.memoizedState=K,y.childLanes=Zw(s,P,m),u.memoizedState=Ww,xh(s.child,y)):(Us(u),m=s.child,s=m.sibling,m=Co(m,{mode:"visible",children:y.children}),m.return=u,m.sibling=null,s!==null&&(P=u.deletions,P===null?(u.deletions=[s],u.flags|=16):P.push(s)),u.child=m,u.memoizedState=null,m)}function Jw(s,u){return u=Kg({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Kg(s,u){return s=vi(22,s,null,u),s.lanes=0,s}function e1(s,u,m){return gu(u,s.child,null,m),s=Jw(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function i2(s,u,m){s.lanes|=u;var y=s.alternate;y!==null&&(y.lanes|=u),pw(s.return,u,m)}function t1(s,u,m,y,_,A){var P=s.memoizedState;P===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:y,tail:m,tailMode:_,treeForkCount:A}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=m,P.tailMode=_,P.treeForkCount=A)}function a2(s,u,m){var y=u.pendingProps,_=y.revealOrder,A=y.tail;y=y.children;var P=Dn.current,K=(P&2)!==0;if(K?(P=P&1|2,u.flags|=128):P&=1,$(Dn,P),Sr(s,u,y,m),y=vt?oh:0,!K&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&i2(s,m,u);else if(s.tag===19)i2(s,m,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(_){case"forwards":for(m=u.child,_=null;m!==null;)s=m.alternate,s!==null&&Dg(s)===null&&(_=m),m=m.sibling;m=_,m===null?(_=u.child,u.child=null):(_=m.sibling,m.sibling=null),t1(u,!1,_,m,A,y);break;case"backwards":case"unstable_legacy-backwards":for(m=null,_=u.child,u.child=null;_!==null;){if(s=_.alternate,s!==null&&Dg(s)===null){u.child=_;break}s=_.sibling,_.sibling=m,m=_,_=s}t1(u,!0,m,null,A,y);break;case"together":t1(u,!1,null,null,void 0,y);break;default:u.memoizedState=null}return u.child}function To(s,u,m){if(s!==null&&(u.dependencies=s.dependencies),Ks|=u.lanes,(m&u.childLanes)===0)if(s!==null){if(qc(s,u,m,!1),(m&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,m=Co(s,s.pendingProps),u.child=m,m.return=u;s.sibling!==null;)s=s.sibling,m=m.sibling=Co(s,s.pendingProps),m.return=u;m.sibling=null}return u.child}function n1(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&jg(s)))}function WX(s,u,m){switch(u.tag){case 3:re(u,u.stateNode.containerInfo),zs(u,$n,s.memoizedState.cache),cu();break;case 27:case 5:se(u);break;case 4:re(u,u.stateNode.containerInfo);break;case 10:zs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Aw(u),null;break;case 13:var y=u.memoizedState;if(y!==null)return y.dehydrated!==null?(Us(u),u.flags|=128,null):(m&u.child.childLanes)!==0?r2(s,u,m):(Us(u),s=To(s,u,m),s!==null?s.sibling:null);Us(u);break;case 19:var _=(s.flags&128)!==0;if(y=(m&u.childLanes)!==0,y||(qc(s,u,m,!1),y=(m&u.childLanes)!==0),_){if(y)return a2(s,u,m);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),$(Dn,Dn.current),y)break;return null;case 22:return u.lanes=0,QP(s,u,m,u.pendingProps);case 24:zs(u,$n,s.memoizedState.cache)}return To(s,u,m)}function o2(s,u,m){if(s!==null)if(s.memoizedProps!==u.pendingProps)Fn=!0;else{if(!n1(s,m)&&(u.flags&128)===0)return Fn=!1,WX(s,u,m);Fn=(s.flags&131072)!==0}else Fn=!1,vt&&(u.flags&1048576)!==0&&zT(u,oh,u.index);switch(u.lanes=0,u.tag){case 16:e:{var y=u.pendingProps;if(s=mu(u.elementType),u.type=s,typeof s=="function")sw(s)?(y=yu(s,y),u.tag=1,u=t2(null,u,s,y,m)):(u.tag=0,u=Gw(null,u,s,y,m));else{if(s!=null){var _=s.$$typeof;if(_===O){u.tag=11,u=XP(null,u,s,y,m);break e}else if(_===T){u.tag=14,u=GP(null,u,s,y,m);break e}}throw u=F(s)||s,Error(r(306,u,""))}}return u;case 0:return Gw(s,u,u.type,u.pendingProps,m);case 1:return y=u.type,_=yu(y,u.pendingProps),t2(s,u,y,_,m);case 3:e:{if(re(u,u.stateNode.containerInfo),s===null)throw Error(r(387));y=u.pendingProps;var A=u.memoizedState;_=A.element,Sw(s,u),mh(u,y,null,m);var P=u.memoizedState;if(y=P.cache,zs(u,$n,y),y!==A.cache&&gw(u,[$n],m,!0),hh(),y=P.element,A.isDehydrated)if(A={element:y,isDehydrated:!1,cache:P.cache},u.updateQueue.baseState=A,u.memoizedState=A,u.flags&256){u=n2(s,u,y,m);break e}else if(y!==_){_=Ui(Error(r(424)),u),sh(_),u=n2(s,u,y,m);break e}else{switch(s=u.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(en=Yi(s.firstChild),br=u,vt=!0,Is=null,Vi=!0,m=QT(u,null,y,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling}else{if(cu(),y===_){u=To(s,u,m);break e}Sr(s,u,y,m)}u=u.child}return u;case 26:return Vg(s,u),s===null?(m=vM(u.type,null,u.pendingProps,null))?u.memoizedState=m:vt||(m=u.type,s=u.pendingProps,y=lv(ne.current).createElement(m),y[Yt]=u,y[fr]=s,Er(y,m,s),zn(y),u.stateNode=y):u.memoizedState=vM(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return se(u),s===null&&vt&&(y=u.stateNode=mM(u.type,u.pendingProps,ne.current),br=u,Vi=!0,_=en,Qs(u.type)?(R1=_,en=Yi(y.firstChild)):en=_),Sr(s,u,u.pendingProps.children,m),Vg(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&vt&&((_=y=en)&&(y=jG(y,u.type,u.pendingProps,Vi),y!==null?(u.stateNode=y,br=u,en=Yi(y.firstChild),Vi=!1,_=!0):_=!1),_||Ls(u)),se(u),_=u.type,A=u.pendingProps,P=s!==null?s.memoizedProps:null,y=A.children,N1(_,A)?y=null:P!==null&&N1(_,P)&&(u.flags|=32),u.memoizedState!==null&&(_=kw(s,u,FX,null,null,m),Dh._currentValue=_),Vg(s,u),Sr(s,u,y,m),u.child;case 6:return s===null&&vt&&((s=m=en)&&(m=AG(m,u.pendingProps,Vi),m!==null?(u.stateNode=m,br=u,en=null,s=!0):s=!1),s||Ls(u)),null;case 13:return r2(s,u,m);case 4:return re(u,u.stateNode.containerInfo),y=u.pendingProps,s===null?u.child=gu(u,null,y,m):Sr(s,u,y,m),u.child;case 11:return XP(s,u,u.type,u.pendingProps,m);case 7:return Sr(s,u,u.pendingProps,m),u.child;case 8:return Sr(s,u,u.pendingProps.children,m),u.child;case 12:return Sr(s,u,u.pendingProps.children,m),u.child;case 10:return y=u.pendingProps,zs(u,u.type,y.value),Sr(s,u,y.children,m),u.child;case 9:return _=u.type._context,y=u.pendingProps.children,du(u),_=wr(_),y=y(_),u.flags|=1,Sr(s,u,y,m),u.child;case 14:return GP(s,u,u.type,u.pendingProps,m);case 15:return WP(s,u,u.type,u.pendingProps,m);case 19:return a2(s,u,m);case 31:return GX(s,u,m);case 22:return QP(s,u,m,u.pendingProps);case 24:return du(u),y=wr($n),s===null?(_=xw(),_===null&&(_=Xt,A=vw(),_.pooledCache=A,A.refCount++,A!==null&&(_.pooledCacheLanes|=m),_=A),u.memoizedState={parent:y,cache:_},ww(u),zs(u,$n,_)):((s.lanes&m)!==0&&(Sw(s,u),mh(u,null,null,m),hh()),_=s.memoizedState,A=u.memoizedState,_.parent!==y?(_={parent:y,cache:y},u.memoizedState=_,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=_),zs(u,$n,y)):(y=A.cache,zs(u,$n,y),y!==_.cache&&gw(u,[$n],m,!0))),Sr(s,u,u.pendingProps.children,m),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Po(s){s.flags|=4}function r1(s,u,m,y,_){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(_&335544128)===_)if(s.stateNode.complete)s.flags|=8192;else if(M2())s.flags|=8192;else throw pu=Ng,bw}else s.flags&=-16777217}function s2(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!SM(u))if(M2())s.flags|=8192;else throw pu=Ng,bw}function Yg(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Ln():536870912,s.lanes|=u,nf|=u)}function bh(s,u){if(!vt)switch(s.tailMode){case"hidden":u=s.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?s.tail=null:m.sibling=null;break;case"collapsed":m=s.tail;for(var y=null;m!==null;)m.alternate!==null&&(y=m),m=m.sibling;y===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:y.sibling=null}}function tn(s){var u=s.alternate!==null&&s.alternate.child===s.child,m=0,y=0;if(u)for(var _=s.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags&65011712,y|=_.flags&65011712,_.return=s,_=_.sibling;else for(_=s.child;_!==null;)m|=_.lanes|_.childLanes,y|=_.subtreeFlags,y|=_.flags,_.return=s,_=_.sibling;return s.subtreeFlags|=y,s.childLanes=m,u}function QX(s,u,m){var y=u.pendingProps;switch(fw(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(u),null;case 1:return tn(u),null;case 3:return m=u.stateNode,y=null,s!==null&&(y=s.memoizedState.cache),u.memoizedState.cache!==y&&(u.flags|=2048),Oo($n),ee(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(Hc(u)?Po(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,hw())),tn(u),null;case 26:var _=u.type,A=u.memoizedState;return s===null?(Po(u),A!==null?(tn(u),s2(u,A)):(tn(u),r1(u,_,null,y,m))):A?A!==s.memoizedState?(Po(u),tn(u),s2(u,A)):(tn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==y&&Po(u),tn(u),r1(u,_,s,y,m)),null;case 27:if(me(u),m=ne.current,_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&Po(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return tn(u),null}s=Q.current,Hc(u)?BT(u):(s=mM(_,y,m),u.stateNode=s,Po(u))}return tn(u),null;case 5:if(me(u),_=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==y&&Po(u);else{if(!y){if(u.stateNode===null)throw Error(r(166));return tn(u),null}if(A=Q.current,Hc(u))BT(u);else{var P=lv(ne.current);switch(A){case 1:A=P.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:A=P.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":A=P.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":A=P.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":A=P.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof y.is=="string"?P.createElement("select",{is:y.is}):P.createElement("select"),y.multiple?A.multiple=!0:y.size&&(A.size=y.size);break;default:A=typeof y.is=="string"?P.createElement(_,{is:y.is}):P.createElement(_)}}A[Yt]=u,A[fr]=y;e:for(P=u.child;P!==null;){if(P.tag===5||P.tag===6)A.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===u)break e;for(;P.sibling===null;){if(P.return===null||P.return===u)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}u.stateNode=A;e:switch(Er(A,_,y),_){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Po(u)}}return tn(u),r1(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,m),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==y&&Po(u);else{if(typeof y!="string"&&u.stateNode===null)throw Error(r(166));if(s=ne.current,Hc(u)){if(s=u.stateNode,m=u.memoizedProps,y=null,_=br,_!==null)switch(_.tag){case 27:case 5:y=_.memoizedProps}s[Yt]=u,s=!!(s.nodeValue===m||y!==null&&y.suppressHydrationWarning===!0||rM(s.nodeValue,m)),s||Ls(u,!0)}else s=lv(s).createTextNode(y),s[Yt]=u,u.stateNode=s}return tn(u),null;case 31:if(m=u.memoizedState,s===null||s.memoizedState!==null){if(y=Hc(u),m!==null){if(s===null){if(!y)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Yt]=u}else cu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;tn(u),s=!1}else m=hw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),s=!0;if(!s)return u.flags&256?(xi(u),u):(xi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return tn(u),null;case 13:if(y=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(_=Hc(u),y!==null&&y.dehydrated!==null){if(s===null){if(!_)throw Error(r(318));if(_=u.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[Yt]=u}else cu(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;tn(u),_=!1}else _=hw(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=_),_=!0;if(!_)return u.flags&256?(xi(u),u):(xi(u),null)}return xi(u),(u.flags&128)!==0?(u.lanes=m,u):(m=y!==null,s=s!==null&&s.memoizedState!==null,m&&(y=u.child,_=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(_=y.alternate.memoizedState.cachePool.pool),A=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(A=y.memoizedState.cachePool.pool),A!==_&&(y.flags|=2048)),m!==s&&m&&(u.child.flags|=8192),Yg(u,u.updateQueue),tn(u),null);case 4:return ee(),s===null&&C1(u.stateNode.containerInfo),tn(u),null;case 10:return Oo(u.type),tn(u),null;case 19:if(U(Dn),y=u.memoizedState,y===null)return tn(u),null;if(_=(u.flags&128)!==0,A=y.rendering,A===null)if(_)bh(y,!1);else{if(En!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(A=Dg(s),A!==null){for(u.flags|=128,bh(y,!1),s=A.updateQueue,u.updateQueue=s,Yg(u,s),u.subtreeFlags=0,s=m,m=u.child;m!==null;)RT(m,s),m=m.sibling;return $(Dn,Dn.current&1|2),vt&&jo(u,y.treeForkCount),u.child}s=s.sibling}y.tail!==null&&Rt()>Zg&&(u.flags|=128,_=!0,bh(y,!1),u.lanes=4194304)}else{if(!_)if(s=Dg(A),s!==null){if(u.flags|=128,_=!0,s=s.updateQueue,u.updateQueue=s,Yg(u,s),bh(y,!0),y.tail===null&&y.tailMode==="hidden"&&!A.alternate&&!vt)return tn(u),null}else 2*Rt()-y.renderingStartTime>Zg&&m!==536870912&&(u.flags|=128,_=!0,bh(y,!1),u.lanes=4194304);y.isBackwards?(A.sibling=u.child,u.child=A):(s=y.last,s!==null?s.sibling=A:u.child=A,y.last=A)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=Rt(),s.sibling=null,m=Dn.current,$(Dn,_?m&1|2:m&1),vt&&jo(u,y.treeForkCount),s):(tn(u),null);case 22:case 23:return xi(u),jw(),y=u.memoizedState!==null,s!==null?s.memoizedState!==null!==y&&(u.flags|=8192):y&&(u.flags|=8192),y?(m&536870912)!==0&&(u.flags&128)===0&&(tn(u),u.subtreeFlags&6&&(u.flags|=8192)):tn(u),m=u.updateQueue,m!==null&&Yg(u,m.retryQueue),m=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==m&&(u.flags|=2048),s!==null&&U(hu),null;case 24:return m=null,s!==null&&(m=s.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),Oo($n),tn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function ZX(s,u){switch(fw(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return Oo($n),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return me(u),null;case 31:if(u.memoizedState!==null){if(xi(u),u.alternate===null)throw Error(r(340));cu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(xi(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));cu()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(Dn),null;case 4:return ee(),null;case 10:return Oo(u.type),null;case 22:case 23:return xi(u),jw(),s!==null&&U(hu),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return Oo($n),null;case 25:return null;default:return null}}function l2(s,u){switch(fw(u),u.tag){case 3:Oo($n),ee();break;case 26:case 27:case 5:me(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&xi(u);break;case 13:xi(u);break;case 19:U(Dn);break;case 10:Oo(u.type);break;case 22:case 23:xi(u),jw(),s!==null&&U(hu);break;case 24:Oo($n)}}function wh(s,u){try{var m=u.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var _=y.next;m=_;do{if((m.tag&s)===s){y=void 0;var A=m.create,P=m.inst;y=A(),P.destroy=y}m=m.next}while(m!==_)}}catch(K){zt(u,u.return,K)}}function qs(s,u,m){try{var y=u.updateQueue,_=y!==null?y.lastEffect:null;if(_!==null){var A=_.next;y=A;do{if((y.tag&s)===s){var P=y.inst,K=P.destroy;if(K!==void 0){P.destroy=void 0,_=u;var Z=m,ce=K;try{ce()}catch(pe){zt(_,Z,pe)}}}y=y.next}while(y!==A)}}catch(pe){zt(u,u.return,pe)}}function u2(s){var u=s.updateQueue;if(u!==null){var m=s.stateNode;try{JT(u,m)}catch(y){zt(s,s.return,y)}}}function c2(s,u,m){m.props=yu(s.type,s.memoizedProps),m.state=s.memoizedState;try{m.componentWillUnmount()}catch(y){zt(s,u,y)}}function Sh(s,u){try{var m=s.ref;if(m!==null){switch(s.tag){case 26:case 27:case 5:var y=s.stateNode;break;case 30:y=s.stateNode;break;default:y=s.stateNode}typeof m=="function"?s.refCleanup=m(y):m.current=y}}catch(_){zt(s,u,_)}}function Ua(s,u){var m=s.ref,y=s.refCleanup;if(m!==null)if(typeof y=="function")try{y()}catch(_){zt(s,u,_)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof m=="function")try{m(null)}catch(_){zt(s,u,_)}else m.current=null}function f2(s){var u=s.type,m=s.memoizedProps,y=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":m.autoFocus&&y.focus();break e;case"img":m.src?y.src=m.src:m.srcSet&&(y.srcset=m.srcSet)}}catch(_){zt(s,s.return,_)}}function i1(s,u,m){try{var y=s.stateNode;bG(y,s.type,m,u),y[fr]=u}catch(_){zt(s,s.return,_)}}function d2(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Qs(s.type)||s.tag===4}function a1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||d2(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.tag===27&&Qs(s.type)||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 o1(s,u,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?(m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m).insertBefore(s,u):(u=m.nodeType===9?m.body:m.nodeName==="HTML"?m.ownerDocument.body:m,u.appendChild(s),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=Eo));else if(y!==4&&(y===27&&Qs(s.type)&&(m=s.stateNode,u=null),s=s.child,s!==null))for(o1(s,u,m),s=s.sibling;s!==null;)o1(s,u,m),s=s.sibling}function Xg(s,u,m){var y=s.tag;if(y===5||y===6)s=s.stateNode,u?m.insertBefore(s,u):m.appendChild(s);else if(y!==4&&(y===27&&Qs(s.type)&&(m=s.stateNode),s=s.child,s!==null))for(Xg(s,u,m),s=s.sibling;s!==null;)Xg(s,u,m),s=s.sibling}function h2(s){var u=s.stateNode,m=s.memoizedProps;try{for(var y=s.type,_=u.attributes;_.length;)u.removeAttributeNode(_[0]);Er(u,y,m),u[Yt]=s,u[fr]=m}catch(A){zt(s,s.return,A)}}var Mo=!1,Un=!1,s1=!1,m2=typeof WeakSet=="function"?WeakSet:Set,dr=null;function JX(s,u){if(s=s.containerInfo,O1=pv,s=jT(s),ew(s)){if("selectionStart"in s)var m={start:s.selectionStart,end:s.selectionEnd};else e:{m=(m=s.ownerDocument)&&m.defaultView||window;var y=m.getSelection&&m.getSelection();if(y&&y.rangeCount!==0){m=y.anchorNode;var _=y.anchorOffset,A=y.focusNode;y=y.focusOffset;try{m.nodeType,A.nodeType}catch{m=null;break e}var P=0,K=-1,Z=-1,ce=0,pe=0,ye=s,fe=null;t:for(;;){for(var he;ye!==m||_!==0&&ye.nodeType!==3||(K=P+_),ye!==A||y!==0&&ye.nodeType!==3||(Z=P+y),ye.nodeType===3&&(P+=ye.nodeValue.length),(he=ye.firstChild)!==null;)fe=ye,ye=he;for(;;){if(ye===s)break t;if(fe===m&&++ce===_&&(K=P),fe===A&&++pe===y&&(Z=P),(he=ye.nextSibling)!==null)break;ye=fe,fe=ye.parentNode}ye=he}m=K===-1||Z===-1?null:{start:K,end:Z}}else m=null}m=m||{start:0,end:0}}else m=null;for(k1={focusedElem:s,selectionRange:m},pv=!1,dr=u;dr!==null;)if(u=dr,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,dr=s;else for(;dr!==null;){switch(u=dr,A=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(m=0;m<s.length;m++)_=s[m],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&A!==null){s=void 0,m=u,_=A.memoizedProps,A=A.memoizedState,y=m.stateNode;try{var Me=yu(m.type,_);s=y.getSnapshotBeforeUpdate(Me,A),y.__reactInternalSnapshotBeforeUpdate=s}catch(Ye){zt(m,m.return,Ye)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,m=s.nodeType,m===9)P1(s);else if(m===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":P1(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=u.sibling,s!==null){s.return=u.return,dr=s;break}dr=u.return}}function p2(s,u,m){var y=m.flags;switch(m.tag){case 0:case 11:case 15:Ro(s,m),y&4&&wh(5,m);break;case 1:if(Ro(s,m),y&4)if(s=m.stateNode,u===null)try{s.componentDidMount()}catch(P){zt(m,m.return,P)}else{var _=yu(m.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(_,u,s.__reactInternalSnapshotBeforeUpdate)}catch(P){zt(m,m.return,P)}}y&64&&u2(m),y&512&&Sh(m,m.return);break;case 3:if(Ro(s,m),y&64&&(s=m.updateQueue,s!==null)){if(u=null,m.child!==null)switch(m.child.tag){case 27:case 5:u=m.child.stateNode;break;case 1:u=m.child.stateNode}try{JT(s,u)}catch(P){zt(m,m.return,P)}}break;case 27:u===null&&y&4&&h2(m);case 26:case 5:Ro(s,m),u===null&&y&4&&f2(m),y&512&&Sh(m,m.return);break;case 12:Ro(s,m);break;case 31:Ro(s,m),y&4&&y2(s,m);break;case 13:Ro(s,m),y&4&&x2(s,m),y&64&&(s=m.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(m=lG.bind(null,m),OG(s,m))));break;case 22:if(y=m.memoizedState!==null||Mo,!y){u=u!==null&&u.memoizedState!==null||Un,_=Mo;var A=Un;Mo=y,(Un=u)&&!A?Io(s,m,(m.subtreeFlags&8772)!==0):Ro(s,m),Mo=_,Un=A}break;case 30:break;default:Ro(s,m)}}function g2(s){var u=s.alternate;u!==null&&(s.alternate=null,g2(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&Xd(u)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var sn=null,ti=!1;function Do(s,u,m){for(m=m.child;m!==null;)v2(s,u,m),m=m.sibling}function v2(s,u,m){if(Se&&typeof Se.onCommitFiberUnmount=="function")try{Se.onCommitFiberUnmount(Kt,m)}catch{}switch(m.tag){case 26:Un||Ua(m,u),Do(s,u,m),m.memoizedState?m.memoizedState.count--:m.stateNode&&(m=m.stateNode,m.parentNode.removeChild(m));break;case 27:Un||Ua(m,u);var y=sn,_=ti;Qs(m.type)&&(sn=m.stateNode,ti=!1),Do(s,u,m),Th(m.stateNode),sn=y,ti=_;break;case 5:Un||Ua(m,u);case 6:if(y=sn,_=ti,sn=null,Do(s,u,m),sn=y,ti=_,sn!==null)if(ti)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(m.stateNode)}catch(A){zt(m,u,A)}else try{sn.removeChild(m.stateNode)}catch(A){zt(m,u,A)}break;case 18:sn!==null&&(ti?(s=sn,uM(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,m.stateNode),ff(s)):uM(sn,m.stateNode));break;case 4:y=sn,_=ti,sn=m.stateNode.containerInfo,ti=!0,Do(s,u,m),sn=y,ti=_;break;case 0:case 11:case 14:case 15:qs(2,m,u),Un||qs(4,m,u),Do(s,u,m);break;case 1:Un||(Ua(m,u),y=m.stateNode,typeof y.componentWillUnmount=="function"&&c2(m,u,y)),Do(s,u,m);break;case 21:Do(s,u,m);break;case 22:Un=(y=Un)||m.memoizedState!==null,Do(s,u,m),Un=y;break;default:Do(s,u,m)}}function y2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{ff(s)}catch(m){zt(u,u.return,m)}}}function x2(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{ff(s)}catch(m){zt(u,u.return,m)}}function eG(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new m2),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new m2),u;default:throw Error(r(435,s.tag))}}function Gg(s,u){var m=eG(s);u.forEach(function(y){if(!m.has(y)){m.add(y);var _=uG.bind(null,s,y);y.then(_,_)}})}function ni(s,u){var m=u.deletions;if(m!==null)for(var y=0;y<m.length;y++){var _=m[y],A=s,P=u,K=P;e:for(;K!==null;){switch(K.tag){case 27:if(Qs(K.type)){sn=K.stateNode,ti=!1;break e}break;case 5:sn=K.stateNode,ti=!1;break e;case 3:case 4:sn=K.stateNode.containerInfo,ti=!0;break e}K=K.return}if(sn===null)throw Error(r(160));v2(A,P,_),sn=null,ti=!1,A=_.alternate,A!==null&&(A.return=null),_.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)b2(u,s),u=u.sibling}var ma=null;function b2(s,u){var m=s.alternate,y=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:ni(u,s),ri(s),y&4&&(qs(3,s,s.return),wh(3,s),qs(5,s,s.return));break;case 1:ni(u,s),ri(s),y&512&&(Un||m===null||Ua(m,m.return)),y&64&&Mo&&(s=s.updateQueue,s!==null&&(y=s.callbacks,y!==null&&(m=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=m===null?y:m.concat(y))));break;case 26:var _=ma;if(ni(u,s),ri(s),y&512&&(Un||m===null||Ua(m,m.return)),y&4){var A=m!==null?m.memoizedState:null;if(y=s.memoizedState,m===null)if(y===null)if(s.stateNode===null){e:{y=s.type,m=s.memoizedProps,_=_.ownerDocument||_;t:switch(y){case"title":A=_.getElementsByTagName("title")[0],(!A||A[nu]||A[Yt]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=_.createElement(y),_.head.insertBefore(A,_.querySelector("head > title"))),Er(A,y,m),A[Yt]=s,zn(A),y=A;break e;case"link":var P=bM("link","href",_).get(y+(m.href||""));if(P){for(var K=0;K<P.length;K++)if(A=P[K],A.getAttribute("href")===(m.href==null||m.href===""?null:m.href)&&A.getAttribute("rel")===(m.rel==null?null:m.rel)&&A.getAttribute("title")===(m.title==null?null:m.title)&&A.getAttribute("crossorigin")===(m.crossOrigin==null?null:m.crossOrigin)){P.splice(K,1);break t}}A=_.createElement(y),Er(A,y,m),_.head.appendChild(A);break;case"meta":if(P=bM("meta","content",_).get(y+(m.content||""))){for(K=0;K<P.length;K++)if(A=P[K],A.getAttribute("content")===(m.content==null?null:""+m.content)&&A.getAttribute("name")===(m.name==null?null:m.name)&&A.getAttribute("property")===(m.property==null?null:m.property)&&A.getAttribute("http-equiv")===(m.httpEquiv==null?null:m.httpEquiv)&&A.getAttribute("charset")===(m.charSet==null?null:m.charSet)){P.splice(K,1);break t}}A=_.createElement(y),Er(A,y,m),_.head.appendChild(A);break;default:throw Error(r(468,y))}A[Yt]=s,zn(A),y=A}s.stateNode=y}else wM(_,s.type,s.stateNode);else s.stateNode=xM(_,y,s.memoizedProps);else A!==y?(A===null?m.stateNode!==null&&(m=m.stateNode,m.parentNode.removeChild(m)):A.count--,y===null?wM(_,s.type,s.stateNode):xM(_,y,s.memoizedProps)):y===null&&s.stateNode!==null&&i1(s,s.memoizedProps,m.memoizedProps)}break;case 27:ni(u,s),ri(s),y&512&&(Un||m===null||Ua(m,m.return)),m!==null&&y&4&&i1(s,s.memoizedProps,m.memoizedProps);break;case 5:if(ni(u,s),ri(s),y&512&&(Un||m===null||Ua(m,m.return)),s.flags&32){_=s.stateNode;try{Mc(_,"")}catch(Me){zt(s,s.return,Me)}}y&4&&s.stateNode!=null&&(_=s.memoizedProps,i1(s,_,m!==null?m.memoizedProps:_)),y&1024&&(s1=!0);break;case 6:if(ni(u,s),ri(s),y&4){if(s.stateNode===null)throw Error(r(162));y=s.memoizedProps,m=s.stateNode;try{m.nodeValue=y}catch(Me){zt(s,s.return,Me)}}break;case 3:if(fv=null,_=ma,ma=uv(u.containerInfo),ni(u,s),ma=_,ri(s),y&4&&m!==null&&m.memoizedState.isDehydrated)try{ff(u.containerInfo)}catch(Me){zt(s,s.return,Me)}s1&&(s1=!1,w2(s));break;case 4:y=ma,ma=uv(s.stateNode.containerInfo),ni(u,s),ri(s),ma=y;break;case 12:ni(u,s),ri(s);break;case 31:ni(u,s),ri(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Gg(s,y)));break;case 13:ni(u,s),ri(s),s.child.flags&8192&&s.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Qg=Rt()),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Gg(s,y)));break;case 22:_=s.memoizedState!==null;var Z=m!==null&&m.memoizedState!==null,ce=Mo,pe=Un;if(Mo=ce||_,Un=pe||Z,ni(u,s),Un=pe,Mo=ce,ri(s),y&8192)e:for(u=s.stateNode,u._visibility=_?u._visibility&-2:u._visibility|1,_&&(m===null||Z||Mo||Un||xu(s)),m=null,u=s;;){if(u.tag===5||u.tag===26){if(m===null){Z=m=u;try{if(A=Z.stateNode,_)P=A.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none";else{K=Z.stateNode;var ye=Z.memoizedProps.style,fe=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;K.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Me){zt(Z,Z.return,Me)}}}else if(u.tag===6){if(m===null){Z=u;try{Z.stateNode.nodeValue=_?"":Z.memoizedProps}catch(Me){zt(Z,Z.return,Me)}}}else if(u.tag===18){if(m===null){Z=u;try{var he=Z.stateNode;_?cM(he,!0):cM(Z.stateNode,!1)}catch(Me){zt(Z,Z.return,Me)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;m===u&&(m=null),u=u.return}m===u&&(m=null),u.sibling.return=u.return,u=u.sibling}y&4&&(y=s.updateQueue,y!==null&&(m=y.retryQueue,m!==null&&(y.retryQueue=null,Gg(s,m))));break;case 19:ni(u,s),ri(s),y&4&&(y=s.updateQueue,y!==null&&(s.updateQueue=null,Gg(s,y)));break;case 30:break;case 21:break;default:ni(u,s),ri(s)}}function ri(s){var u=s.flags;if(u&2){try{for(var m,y=s.return;y!==null;){if(d2(y)){m=y;break}y=y.return}if(m==null)throw Error(r(160));switch(m.tag){case 27:var _=m.stateNode,A=a1(s);Xg(s,A,_);break;case 5:var P=m.stateNode;m.flags&32&&(Mc(P,""),m.flags&=-33);var K=a1(s);Xg(s,K,P);break;case 3:case 4:var Z=m.stateNode.containerInfo,ce=a1(s);o1(s,ce,Z);break;default:throw Error(r(161))}}catch(pe){zt(s,s.return,pe)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function w2(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;w2(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function Ro(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)p2(s,u.alternate,u),u=u.sibling}function xu(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:qs(4,u,u.return),xu(u);break;case 1:Ua(u,u.return);var m=u.stateNode;typeof m.componentWillUnmount=="function"&&c2(u,u.return,m),xu(u);break;case 27:Th(u.stateNode);case 26:case 5:Ua(u,u.return),xu(u);break;case 22:u.memoizedState===null&&xu(u);break;case 30:xu(u);break;default:xu(u)}s=s.sibling}}function Io(s,u,m){for(m=m&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var y=u.alternate,_=s,A=u,P=A.flags;switch(A.tag){case 0:case 11:case 15:Io(_,A,m),wh(4,A);break;case 1:if(Io(_,A,m),y=A,_=y.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ce){zt(y,y.return,ce)}if(y=A,_=y.updateQueue,_!==null){var K=y.stateNode;try{var Z=_.shared.hiddenCallbacks;if(Z!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Z.length;_++)ZT(Z[_],K)}catch(ce){zt(y,y.return,ce)}}m&&P&64&&u2(A),Sh(A,A.return);break;case 27:h2(A);case 26:case 5:Io(_,A,m),m&&y===null&&P&4&&f2(A),Sh(A,A.return);break;case 12:Io(_,A,m);break;case 31:Io(_,A,m),m&&P&4&&y2(_,A);break;case 13:Io(_,A,m),m&&P&4&&x2(_,A);break;case 22:A.memoizedState===null&&Io(_,A,m),Sh(A,A.return);break;case 30:break;default:Io(_,A,m)}u=u.sibling}}function l1(s,u){var m=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==m&&(s!=null&&s.refCount++,m!=null&&lh(m))}function u1(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&lh(s))}function pa(s,u,m,y){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)S2(s,u,m,y),u=u.sibling}function S2(s,u,m,y){var _=u.flags;switch(u.tag){case 0:case 11:case 15:pa(s,u,m,y),_&2048&&wh(9,u);break;case 1:pa(s,u,m,y);break;case 3:pa(s,u,m,y),_&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&lh(s)));break;case 12:if(_&2048){pa(s,u,m,y),s=u.stateNode;try{var A=u.memoizedProps,P=A.id,K=A.onPostCommit;typeof K=="function"&&K(P,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(Z){zt(u,u.return,Z)}}else pa(s,u,m,y);break;case 31:pa(s,u,m,y);break;case 13:pa(s,u,m,y);break;case 23:break;case 22:A=u.stateNode,P=u.alternate,u.memoizedState!==null?A._visibility&2?pa(s,u,m,y):Eh(s,u):A._visibility&2?pa(s,u,m,y):(A._visibility|=2,Jc(s,u,m,y,(u.subtreeFlags&10256)!==0||!1)),_&2048&&l1(P,u);break;case 24:pa(s,u,m,y),_&2048&&u1(u.alternate,u);break;default:pa(s,u,m,y)}}function Jc(s,u,m,y,_){for(_=_&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var A=s,P=u,K=m,Z=y,ce=P.flags;switch(P.tag){case 0:case 11:case 15:Jc(A,P,K,Z,_),wh(8,P);break;case 23:break;case 22:var pe=P.stateNode;P.memoizedState!==null?pe._visibility&2?Jc(A,P,K,Z,_):Eh(A,P):(pe._visibility|=2,Jc(A,P,K,Z,_)),_&&ce&2048&&l1(P.alternate,P);break;case 24:Jc(A,P,K,Z,_),_&&ce&2048&&u1(P.alternate,P);break;default:Jc(A,P,K,Z,_)}u=u.sibling}}function Eh(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var m=s,y=u,_=y.flags;switch(y.tag){case 22:Eh(m,y),_&2048&&l1(y.alternate,y);break;case 24:Eh(m,y),_&2048&&u1(y.alternate,y);break;default:Eh(m,y)}u=u.sibling}}var _h=8192;function ef(s,u,m){if(s.subtreeFlags&_h)for(s=s.child;s!==null;)E2(s,u,m),s=s.sibling}function E2(s,u,m){switch(s.tag){case 26:ef(s,u,m),s.flags&_h&&s.memoizedState!==null&&BG(m,ma,s.memoizedState,s.memoizedProps);break;case 5:ef(s,u,m);break;case 3:case 4:var y=ma;ma=uv(s.stateNode.containerInfo),ef(s,u,m),ma=y;break;case 22:s.memoizedState===null&&(y=s.alternate,y!==null&&y.memoizedState!==null?(y=_h,_h=16777216,ef(s,u,m),_h=y):ef(s,u,m));break;default:ef(s,u,m)}}function _2(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function Ch(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var m=0;m<u.length;m++){var y=u[m];dr=y,j2(y,s)}_2(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)C2(s),s=s.sibling}function C2(s){switch(s.tag){case 0:case 11:case 15:Ch(s),s.flags&2048&&qs(9,s,s.return);break;case 3:Ch(s);break;case 12:Ch(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,Wg(s)):Ch(s);break;default:Ch(s)}}function Wg(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var m=0;m<u.length;m++){var y=u[m];dr=y,j2(y,s)}_2(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:qs(8,u,u.return),Wg(u);break;case 22:m=u.stateNode,m._visibility&2&&(m._visibility&=-3,Wg(u));break;default:Wg(u)}s=s.sibling}}function j2(s,u){for(;dr!==null;){var m=dr;switch(m.tag){case 0:case 11:case 15:qs(8,m,u);break;case 23:case 22:if(m.memoizedState!==null&&m.memoizedState.cachePool!==null){var y=m.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:lh(m.memoizedState.cache)}if(y=m.child,y!==null)y.return=m,dr=y;else e:for(m=s;dr!==null;){y=dr;var _=y.sibling,A=y.return;if(g2(y),y===m){dr=null;break e}if(_!==null){_.return=A,dr=_;break e}dr=A}}}var tG={getCacheForType:function(s){var u=wr($n),m=u.data.get(s);return m===void 0&&(m=s(),u.data.set(s,m)),m},cacheSignal:function(){return wr($n).controller.signal}},nG=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Xt=null,ft=null,mt=0,Lt=0,bi=null,Vs=!1,tf=!1,c1=!1,Lo=0,En=0,Ks=0,bu=0,f1=0,wi=0,nf=0,jh=null,ii=null,d1=!1,Qg=0,A2=0,Zg=1/0,Jg=null,Ys=null,Zn=0,Xs=null,rf=null,zo=0,h1=0,m1=null,O2=null,Ah=0,p1=null;function Si(){return(Tt&2)!==0&&mt!==0?mt&-mt:D.T!==null?w1():ve()}function k2(){if(wi===0)if((mt&536870912)===0||vt){var s=ca;ca<<=1,(ca&3932160)===0&&(ca=262144),wi=s}else wi=536870912;return s=yi.current,s!==null&&(s.flags|=32),wi}function ai(s,u,m){(s===Xt&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)&&(af(s,0),Gs(s,mt,wi,!1)),It(s,m),((Tt&2)===0||s!==Xt)&&(s===Xt&&((Tt&2)===0&&(bu|=m),En===4&&Gs(s,mt,wi,!1)),Ha(s))}function N2(s,u,m){if((Tt&6)!==0)throw Error(r(327));var y=!m&&(u&127)===0&&(u&s.expiredLanes)===0||$t(s,u),_=y?aG(s,u):v1(s,u,!0),A=y;do{if(_===0){tf&&!y&&Gs(s,u,0,!1);break}else{if(m=s.current.alternate,A&&!rG(m)){_=v1(s,u,!1),A=!1;continue}if(_===2){if(A=u,s.errorRecoveryDisabledLanes&A)var P=0;else P=s.pendingLanes&-536870913,P=P!==0?P:P&536870912?536870912:0;if(P!==0){u=P;e:{var K=s;_=jh;var Z=K.current.memoizedState.isDehydrated;if(Z&&(af(K,P).flags|=256),P=v1(K,P,!1),P!==2){if(c1&&!Z){K.errorRecoveryDisabledLanes|=A,bu|=A,_=4;break e}A=ii,ii=_,A!==null&&(ii===null?ii=A:ii.push.apply(ii,A))}_=P}if(A=!1,_!==2)continue}}if(_===1){af(s,0),Gs(s,u,0,!0);break}e:{switch(y=s,A=_,A){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:Gs(y,u,wi,!Vs);break e;case 2:ii=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(_=Qg+300-Rt(),10<_)){if(Gs(y,u,wi,!Vs),Ge(y,0,!0)!==0)break e;zo=u,y.timeoutHandle=sM(T2.bind(null,y,m,ii,Jg,d1,u,wi,bu,nf,Vs,A,"Throttled",-0,0),_);break e}T2(y,m,ii,Jg,d1,u,wi,bu,nf,Vs,A,null,-0,0)}}break}while(!0);Ha(s)}function T2(s,u,m,y,_,A,P,K,Z,ce,pe,ye,fe,he){if(s.timeoutHandle=-1,ye=u.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Eo},E2(u,A,ye);var Me=(A&62914560)===A?Qg-Rt():(A&4194048)===A?A2-Rt():0;if(Me=FG(ye,Me),Me!==null){zo=A,s.cancelPendingCommit=Me($2.bind(null,s,u,A,m,y,_,P,K,Z,pe,ye,null,fe,he)),Gs(s,A,P,!ce);return}}$2(s,u,A,m,y,_,P,K,Z)}function rG(s){for(var u=s;;){var m=u.tag;if((m===0||m===11||m===15)&&u.flags&16384&&(m=u.updateQueue,m!==null&&(m=m.stores,m!==null)))for(var y=0;y<m.length;y++){var _=m[y],A=_.getSnapshot;_=_.value;try{if(!gi(A(),_))return!1}catch{return!1}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Gs(s,u,m,y){u&=~f1,u&=~bu,s.suspendedLanes|=u,s.pingedLanes&=~u,y&&(s.warmLanes|=u),y=s.expirationTimes;for(var _=u;0<_;){var A=31-Xe(_),P=1<<A;y[A]=-1,_&=~P}m!==0&&fa(s,m,u)}function ev(){return(Tt&6)===0?(Oh(0),!1):!0}function g1(){if(ft!==null){if(Lt===0)var s=ft.return;else s=ft,Ao=fu=null,Pw(s),Xc=null,ch=0,s=ft;for(;s!==null;)l2(s.alternate,s),s=s.return;ft=null}}function af(s,u){var m=s.timeoutHandle;m!==-1&&(s.timeoutHandle=-1,EG(m)),m=s.cancelPendingCommit,m!==null&&(s.cancelPendingCommit=null,m()),zo=0,g1(),Xt=s,ft=m=Co(s.current,null),mt=u,Lt=0,bi=null,Vs=!1,tf=$t(s,u),c1=!1,nf=wi=f1=bu=Ks=En=0,ii=jh=null,d1=!1,(u&8)!==0&&(u|=u&32);var y=s.entangledLanes;if(y!==0)for(s=s.entanglements,y&=u;0<y;){var _=31-Xe(y),A=1<<_;u|=s[_],y&=~A}return Lo=u,wg(),m}function P2(s,u){at=null,D.H=yh,u===Yc||u===kg?(u=XT(),Lt=3):u===bw?(u=XT(),Lt=4):Lt=u===Xw?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,bi=u,ft===null&&(En=1,Hg(s,Ui(u,s.current)))}function M2(){var s=yi.current;return s===null?!0:(mt&4194048)===mt?Ki===null:(mt&62914560)===mt||(mt&536870912)!==0?s===Ki:!1}function D2(){var s=D.H;return D.H=yh,s===null?yh:s}function R2(){var s=D.A;return D.A=tG,s}function tv(){En=4,Vs||(mt&4194048)!==mt&&yi.current!==null||(tf=!0),(Ks&134217727)===0&&(bu&134217727)===0||Xt===null||Gs(Xt,mt,wi,!1)}function v1(s,u,m){var y=Tt;Tt|=2;var _=D2(),A=R2();(Xt!==s||mt!==u)&&(Jg=null,af(s,u)),u=!1;var P=En;e:do try{if(Lt!==0&&ft!==null){var K=ft,Z=bi;switch(Lt){case 8:g1(),P=6;break e;case 3:case 2:case 9:case 6:yi.current===null&&(u=!0);var ce=Lt;if(Lt=0,bi=null,of(s,K,Z,ce),m&&tf){P=0;break e}break;default:ce=Lt,Lt=0,bi=null,of(s,K,Z,ce)}}iG(),P=En;break}catch(pe){P2(s,pe)}while(!0);return u&&s.shellSuspendCounter++,Ao=fu=null,Tt=y,D.H=_,D.A=A,ft===null&&(Xt=null,mt=0,wg()),P}function iG(){for(;ft!==null;)I2(ft)}function aG(s,u){var m=Tt;Tt|=2;var y=D2(),_=R2();Xt!==s||mt!==u?(Jg=null,Zg=Rt()+500,af(s,u)):tf=$t(s,u);e:do try{if(Lt!==0&&ft!==null){u=ft;var A=bi;t:switch(Lt){case 1:Lt=0,bi=null,of(s,u,A,1);break;case 2:case 9:if(KT(A)){Lt=0,bi=null,L2(u);break}u=function(){Lt!==2&&Lt!==9||Xt!==s||(Lt=7),Ha(s)},A.then(u,u);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:KT(A)?(Lt=0,bi=null,L2(u)):(Lt=0,bi=null,of(s,u,A,7));break;case 5:var P=null;switch(ft.tag){case 26:P=ft.memoizedState;case 5:case 27:var K=ft;if(P?SM(P):K.stateNode.complete){Lt=0,bi=null;var Z=K.sibling;if(Z!==null)ft=Z;else{var ce=K.return;ce!==null?(ft=ce,nv(ce)):ft=null}break t}}Lt=0,bi=null,of(s,u,A,5);break;case 6:Lt=0,bi=null,of(s,u,A,6);break;case 8:g1(),En=6;break e;default:throw Error(r(462))}}oG();break}catch(pe){P2(s,pe)}while(!0);return Ao=fu=null,D.H=y,D.A=_,Tt=m,ft!==null?0:(Xt=null,mt=0,wg(),En)}function oG(){for(;ft!==null&&!Mt();)I2(ft)}function I2(s){var u=o2(s.alternate,s,Lo);s.memoizedProps=s.pendingProps,u===null?nv(s):ft=u}function L2(s){var u=s,m=u.alternate;switch(u.tag){case 15:case 0:u=e2(m,u,u.pendingProps,u.type,void 0,mt);break;case 11:u=e2(m,u,u.pendingProps,u.type.render,u.ref,mt);break;case 5:Pw(u);default:l2(m,u),u=ft=RT(u,Lo),u=o2(m,u,Lo)}s.memoizedProps=s.pendingProps,u===null?nv(s):ft=u}function of(s,u,m,y){Ao=fu=null,Pw(u),Xc=null,ch=0;var _=u.return;try{if(XX(s,_,u,m,mt)){En=1,Hg(s,Ui(m,s.current)),ft=null;return}}catch(A){if(_!==null)throw ft=_,A;En=1,Hg(s,Ui(m,s.current)),ft=null;return}u.flags&32768?(vt||y===1?s=!0:tf||(mt&536870912)!==0?s=!1:(Vs=s=!0,(y===2||y===9||y===3||y===6)&&(y=yi.current,y!==null&&y.tag===13&&(y.flags|=16384))),z2(u,s)):nv(u)}function nv(s){var u=s;do{if((u.flags&32768)!==0){z2(u,Vs);return}s=u.return;var m=QX(u.alternate,u,Lo);if(m!==null){ft=m;return}if(u=u.sibling,u!==null){ft=u;return}ft=u=s}while(u!==null);En===0&&(En=5)}function z2(s,u){do{var m=ZX(s.alternate,s);if(m!==null){m.flags&=32767,ft=m;return}if(m=s.return,m!==null&&(m.flags|=32768,m.subtreeFlags=0,m.deletions=null),!u&&(s=s.sibling,s!==null)){ft=s;return}ft=s=m}while(s!==null);En=6,ft=null}function $2(s,u,m,y,_,A,P,K,Z){s.cancelPendingCommit=null;do rv();while(Zn!==0);if((Tt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(A=u.lanes|u.childLanes,A|=aw,ur(s,m,A,P,K,Z),s===Xt&&(ft=Xt=null,mt=0),rf=u,Xs=s,zo=m,h1=A,m1=_,O2=y,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,cG(ze,function(){return q2(),null})):(s.callbackNode=null,s.callbackPriority=0),y=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||y){y=D.T,D.T=null,_=q.p,q.p=2,P=Tt,Tt|=4;try{JX(s,u,m)}finally{Tt=P,q.p=_,D.T=y}}Zn=1,B2(),F2(),U2()}}function B2(){if(Zn===1){Zn=0;var s=Xs,u=rf,m=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||m){m=D.T,D.T=null;var y=q.p;q.p=2;var _=Tt;Tt|=4;try{b2(u,s);var A=k1,P=jT(s.containerInfo),K=A.focusedElem,Z=A.selectionRange;if(P!==K&&K&&K.ownerDocument&&CT(K.ownerDocument.documentElement,K)){if(Z!==null&&ew(K)){var ce=Z.start,pe=Z.end;if(pe===void 0&&(pe=ce),"selectionStart"in K)K.selectionStart=ce,K.selectionEnd=Math.min(pe,K.value.length);else{var ye=K.ownerDocument||document,fe=ye&&ye.defaultView||window;if(fe.getSelection){var he=fe.getSelection(),Me=K.textContent.length,Ye=Math.min(Z.start,Me),Ut=Z.end===void 0?Ye:Math.min(Z.end,Me);!he.extend&&Ye>Ut&&(P=Ut,Ut=Ye,Ye=P);var oe=_T(K,Ye),te=_T(K,Ut);if(oe&&te&&(he.rangeCount!==1||he.anchorNode!==oe.node||he.anchorOffset!==oe.offset||he.focusNode!==te.node||he.focusOffset!==te.offset)){var ue=ye.createRange();ue.setStart(oe.node,oe.offset),he.removeAllRanges(),Ye>Ut?(he.addRange(ue),he.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),he.addRange(ue))}}}}for(ye=[],he=K;he=he.parentNode;)he.nodeType===1&&ye.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof K.focus=="function"&&K.focus(),K=0;K<ye.length;K++){var ge=ye[K];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}pv=!!O1,k1=O1=null}finally{Tt=_,q.p=y,D.T=m}}s.current=u,Zn=2}}function F2(){if(Zn===2){Zn=0;var s=Xs,u=rf,m=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||m){m=D.T,D.T=null;var y=q.p;q.p=2;var _=Tt;Tt|=4;try{p2(s,u.alternate,u)}finally{Tt=_,q.p=y,D.T=m}}Zn=3}}function U2(){if(Zn===4||Zn===3){Zn=0,Tn();var s=Xs,u=rf,m=zo,y=O2;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Zn=5:(Zn=0,rf=Xs=null,H2(s,s.pendingLanes));var _=s.pendingLanes;if(_===0&&(Ys=null),Or(m),u=u.stateNode,Se&&typeof Se.onCommitFiberRoot=="function")try{Se.onCommitFiberRoot(Kt,u,void 0,(u.current.flags&128)===128)}catch{}if(y!==null){u=D.T,_=q.p,q.p=2,D.T=null;try{for(var A=s.onRecoverableError,P=0;P<y.length;P++){var K=y[P];A(K.value,{componentStack:K.stack})}}finally{D.T=u,q.p=_}}(zo&3)!==0&&rv(),Ha(s),_=s.pendingLanes,(m&261930)!==0&&(_&42)!==0?s===p1?Ah++:(Ah=0,p1=s):Ah=0,Oh(0)}}function H2(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,lh(u)))}function rv(){return B2(),F2(),U2(),q2()}function q2(){if(Zn!==5)return!1;var s=Xs,u=h1;h1=0;var m=Or(zo),y=D.T,_=q.p;try{q.p=32>m?32:m,D.T=null,m=m1,m1=null;var A=Xs,P=zo;if(Zn=0,rf=Xs=null,zo=0,(Tt&6)!==0)throw Error(r(331));var K=Tt;if(Tt|=4,C2(A.current),S2(A,A.current,P,m),Tt=K,Oh(0,!1),Se&&typeof Se.onPostCommitFiberRoot=="function")try{Se.onPostCommitFiberRoot(Kt,A)}catch{}return!0}finally{q.p=_,D.T=y,H2(s,u)}}function V2(s,u,m){u=Ui(m,u),u=Yw(s.stateNode,u,2),s=Fs(s,u,2),s!==null&&(It(s,2),Ha(s))}function zt(s,u,m){if(s.tag===3)V2(s,s,m);else for(;u!==null;){if(u.tag===3){V2(u,s,m);break}else if(u.tag===1){var y=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ys===null||!Ys.has(y))){s=Ui(m,s),m=KP(2),y=Fs(u,m,2),y!==null&&(YP(m,y,u,s),It(y,2),Ha(y));break}}u=u.return}}function y1(s,u,m){var y=s.pingCache;if(y===null){y=s.pingCache=new nG;var _=new Set;y.set(u,_)}else _=y.get(u),_===void 0&&(_=new Set,y.set(u,_));_.has(m)||(c1=!0,_.add(m),s=sG.bind(null,s,u,m),u.then(s,s))}function sG(s,u,m){var y=s.pingCache;y!==null&&y.delete(u),s.pingedLanes|=s.suspendedLanes&m,s.warmLanes&=~m,Xt===s&&(mt&m)===m&&(En===4||En===3&&(mt&62914560)===mt&&300>Rt()-Qg?(Tt&2)===0&&af(s,0):f1|=m,nf===mt&&(nf=0)),Ha(s)}function K2(s,u){u===0&&(u=Ln()),s=lu(s,u),s!==null&&(It(s,u),Ha(s))}function lG(s){var u=s.memoizedState,m=0;u!==null&&(m=u.retryLane),K2(s,m)}function uG(s,u){var m=0;switch(s.tag){case 31:case 13:var y=s.stateNode,_=s.memoizedState;_!==null&&(m=_.retryLane);break;case 19:y=s.stateNode;break;case 22:y=s.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(u),K2(s,m)}function cG(s,u){return Nn(s,u)}var iv=null,sf=null,x1=!1,av=!1,b1=!1,Ws=0;function Ha(s){s!==sf&&s.next===null&&(sf===null?iv=sf=s:sf=sf.next=s),av=!0,x1||(x1=!0,dG())}function Oh(s,u){if(!b1&&av){b1=!0;do for(var m=!1,y=iv;y!==null;){if(s!==0){var _=y.pendingLanes;if(_===0)var A=0;else{var P=y.suspendedLanes,K=y.pingedLanes;A=(1<<31-Xe(42|s)+1)-1,A&=_&~(P&~K),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(m=!0,W2(y,A))}else A=mt,A=Ge(y,y===Xt?A:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(A&3)===0||$t(y,A)||(m=!0,W2(y,A));y=y.next}while(m);b1=!1}}function fG(){Y2()}function Y2(){av=x1=!1;var s=0;Ws!==0&&SG()&&(s=Ws);for(var u=Rt(),m=null,y=iv;y!==null;){var _=y.next,A=X2(y,u);A===0?(y.next=null,m===null?iv=_:m.next=_,_===null&&(sf=m)):(m=y,(s!==0||(A&3)!==0)&&(av=!0)),y=_}Zn!==0&&Zn!==5||Oh(s),Ws!==0&&(Ws=0)}function X2(s,u){for(var m=s.suspendedLanes,y=s.pingedLanes,_=s.expirationTimes,A=s.pendingLanes&-62914561;0<A;){var P=31-Xe(A),K=1<<P,Z=_[P];Z===-1?((K&m)===0||(K&y)!==0)&&(_[P]=wn(K,u)):Z<=u&&(s.expiredLanes|=K),A&=~K}if(u=Xt,m=mt,m=Ge(s,s===u?m:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y=s.callbackNode,m===0||s===u&&(Lt===2||Lt===9)||s.cancelPendingCommit!==null)return y!==null&&y!==null&&Wn(y),s.callbackNode=null,s.callbackPriority=0;if((m&3)===0||$t(s,m)){if(u=m&-m,u===s.callbackPriority)return u;switch(y!==null&&Wn(y),Or(m)){case 2:case 8:m=xe;break;case 32:m=ze;break;case 268435456:m=et;break;default:m=ze}return y=G2.bind(null,s),m=Nn(m,y),s.callbackPriority=u,s.callbackNode=m,u}return y!==null&&y!==null&&Wn(y),s.callbackPriority=2,s.callbackNode=null,2}function G2(s,u){if(Zn!==0&&Zn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var m=s.callbackNode;if(rv()&&s.callbackNode!==m)return null;var y=mt;return y=Ge(s,s===Xt?y:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),y===0?null:(N2(s,y,u),X2(s,Rt()),s.callbackNode!=null&&s.callbackNode===m?G2.bind(null,s):null)}function W2(s,u){if(rv())return null;N2(s,u,!0)}function dG(){_G(function(){(Tt&6)!==0?Nn(de,fG):Y2()})}function w1(){if(Ws===0){var s=Vc;s===0&&(s=$i,$i<<=1,($i&261888)===0&&($i=256)),Ws=s}return Ws}function Q2(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:hg(""+s)}function Z2(s,u){var m=u.ownerDocument.createElement("input");return m.name=u.name,m.value=u.value,s.id&&m.setAttribute("form",s.id),u.parentNode.insertBefore(m,u),s=new FormData(s),m.parentNode.removeChild(m),s}function hG(s,u,m,y,_){if(u==="submit"&&m&&m.stateNode===_){var A=Q2((_[fr]||null).action),P=y.submitter;P&&(u=(u=P[fr]||null)?Q2(u.formAction):P.getAttribute("formAction"),u!==null&&(A=u,P=null));var K=new vg("action","action",null,y,_);s.push({event:K,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(Ws!==0){var Z=P?Z2(_,P):new FormData(_);Fw(m,{pending:!0,data:Z,method:_.method,action:A},null,Z)}}else typeof A=="function"&&(K.preventDefault(),Z=P?Z2(_,P):new FormData(_),Fw(m,{pending:!0,data:Z,method:_.method,action:A},A,Z))},currentTarget:_}]})}}for(var S1=0;S1<iw.length;S1++){var E1=iw[S1],mG=E1.toLowerCase(),pG=E1[0].toUpperCase()+E1.slice(1);ha(mG,"on"+pG)}ha(kT,"onAnimationEnd"),ha(NT,"onAnimationIteration"),ha(TT,"onAnimationStart"),ha("dblclick","onDoubleClick"),ha("focusin","onFocus"),ha("focusout","onBlur"),ha(TX,"onTransitionRun"),ha(PX,"onTransitionStart"),ha(MX,"onTransitionCancel"),ha(PT,"onTransitionEnd"),Ps("onMouseEnter",["mouseout","mouseover"]),Ps("onMouseLeave",["mouseout","mouseover"]),Ps("onPointerEnter",["pointerout","pointerover"]),Ps("onPointerLeave",["pointerout","pointerover"]),wo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wo("onBeforeInput",["compositionend","keypress","textInput","paste"]),wo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kh="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(" "),gG=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kh));function J2(s,u){u=(u&4)!==0;for(var m=0;m<s.length;m++){var y=s[m],_=y.event;y=y.listeners;e:{var A=void 0;if(u)for(var P=y.length-1;0<=P;P--){var K=y[P],Z=K.instance,ce=K.currentTarget;if(K=K.listener,Z!==A&&_.isPropagationStopped())break e;A=K,_.currentTarget=ce;try{A(_)}catch(pe){bg(pe)}_.currentTarget=null,A=Z}else for(P=0;P<y.length;P++){if(K=y[P],Z=K.instance,ce=K.currentTarget,K=K.listener,Z!==A&&_.isPropagationStopped())break e;A=K,_.currentTarget=ce;try{A(_)}catch(pe){bg(pe)}_.currentTarget=null,A=Z}}}}function dt(s,u){var m=u[Nc];m===void 0&&(m=u[Nc]=new Set);var y=s+"__bubble";m.has(y)||(eM(u,s,2,!1),m.add(y))}function _1(s,u,m){var y=0;u&&(y|=4),eM(m,s,y,u)}var ov="_reactListening"+Math.random().toString(36).slice(2);function C1(s){if(!s[ov]){s[ov]=!0,sg.forEach(function(m){m!=="selectionchange"&&(gG.has(m)||_1(m,!1,s),_1(m,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[ov]||(u[ov]=!0,_1("selectionchange",!1,u))}}function eM(s,u,m,y){switch(kM(u)){case 2:var _=qG;break;case 8:_=VG;break;default:_=B1}m=_.bind(null,u,m,s),_=void 0,!Vb||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),y?_!==void 0?s.addEventListener(u,m,{capture:!0,passive:_}):s.addEventListener(u,m,!0):_!==void 0?s.addEventListener(u,m,{passive:_}):s.addEventListener(u,m,!1)}function j1(s,u,m,y,_){var A=y;if((u&1)===0&&(u&2)===0&&y!==null)e:for(;;){if(y===null)return;var P=y.tag;if(P===3||P===4){var K=y.stateNode.containerInfo;if(K===_)break;if(P===4)for(P=y.return;P!==null;){var Z=P.tag;if((Z===3||Z===4)&&P.stateNode.containerInfo===_)return;P=P.return}for(;K!==null;){if(P=Os(K),P===null)return;if(Z=P.tag,Z===5||Z===6||Z===26||Z===27){y=A=P;continue e}K=K.parentNode}}y=y.return}aT(function(){var ce=A,pe=Hb(m),ye=[];e:{var fe=MT.get(s);if(fe!==void 0){var he=vg,Me=s;switch(s){case"keypress":if(pg(m)===0)break e;case"keydown":case"keyup":he=uX;break;case"focusin":Me="focus",he=Gb;break;case"focusout":Me="blur",he=Gb;break;case"beforeblur":case"afterblur":he=Gb;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=lT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=QY;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=dX;break;case kT:case NT:case TT:he=eX;break;case PT:he=mX;break;case"scroll":case"scrollend":he=GY;break;case"wheel":he=gX;break;case"copy":case"cut":case"paste":he=nX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=cT;break;case"toggle":case"beforetoggle":he=yX}var Ye=(u&4)!==0,Ut=!Ye&&(s==="scroll"||s==="scrollend"),oe=Ye?fe!==null?fe+"Capture":null:fe;Ye=[];for(var te=ce,ue;te!==null;){var ge=te;if(ue=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ue===null||oe===null||(ge=Qd(te,oe),ge!=null&&Ye.push(Nh(te,ge,ue))),Ut)break;te=te.return}0<Ye.length&&(fe=new he(fe,Me,null,m,pe),ye.push({event:fe,listeners:Ye}))}}if((u&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",he=s==="mouseout"||s==="pointerout",fe&&m!==Ub&&(Me=m.relatedTarget||m.fromElement)&&(Os(Me)||Me[pi]))break e;if((he||fe)&&(fe=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,he?(Me=m.relatedTarget||m.toElement,he=ce,Me=Me?Os(Me):null,Me!==null&&(Ut=a(Me),Ye=Me.tag,Me!==Ut||Ye!==5&&Ye!==27&&Ye!==6)&&(Me=null)):(he=null,Me=ce),he!==Me)){if(Ye=lT,ge="onMouseLeave",oe="onMouseEnter",te="mouse",(s==="pointerout"||s==="pointerover")&&(Ye=cT,ge="onPointerLeave",oe="onPointerEnter",te="pointer"),Ut=he==null?fe:Ns(he),ue=Me==null?fe:Ns(Me),fe=new Ye(ge,te+"leave",he,m,pe),fe.target=Ut,fe.relatedTarget=ue,ge=null,Os(pe)===ce&&(Ye=new Ye(oe,te+"enter",Me,m,pe),Ye.target=ue,Ye.relatedTarget=Ut,ge=Ye),Ut=ge,he&&Me)t:{for(Ye=vG,oe=he,te=Me,ue=0,ge=oe;ge;ge=Ye(ge))ue++;ge=0;for(var Ue=te;Ue;Ue=Ye(Ue))ge++;for(;0<ue-ge;)oe=Ye(oe),ue--;for(;0<ge-ue;)te=Ye(te),ge--;for(;ue--;){if(oe===te||te!==null&&oe===te.alternate){Ye=oe;break t}oe=Ye(oe),te=Ye(te)}Ye=null}else Ye=null;he!==null&&tM(ye,fe,he,Ye,!1),Me!==null&&Ut!==null&&tM(ye,Ut,Me,Ye,!0)}}e:{if(fe=ce?Ns(ce):window,he=fe.nodeName&&fe.nodeName.toLowerCase(),he==="select"||he==="input"&&fe.type==="file")var At=yT;else if(gT(fe))if(xT)At=OX;else{At=jX;var Le=CX}else he=fe.nodeName,!he||he.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ce&&Fb(ce.elementType)&&(At=yT):At=AX;if(At&&(At=At(s,ce))){vT(ye,At,m,pe);break e}Le&&Le(s,fe,ce),s==="focusout"&&ce&&fe.type==="number"&&ce.memoizedProps.value!=null&&Wd(fe,"number",fe.value)}switch(Le=ce?Ns(ce):window,s){case"focusin":(gT(Le)||Le.contentEditable==="true")&&(Lc=Le,tw=ce,ah=null);break;case"focusout":ah=tw=Lc=null;break;case"mousedown":nw=!0;break;case"contextmenu":case"mouseup":case"dragend":nw=!1,AT(ye,m,pe);break;case"selectionchange":if(NX)break;case"keydown":case"keyup":AT(ye,m,pe)}var ot;if(Qb)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Ic?mT(s,m)&&(pt="onCompositionEnd"):s==="keydown"&&m.keyCode===229&&(pt="onCompositionStart");pt&&(fT&&m.locale!=="ko"&&(Ic||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Ic&&(ot=oT()):(Ds=pe,Kb="value"in Ds?Ds.value:Ds.textContent,Ic=!0)),Le=sv(ce,pt),0<Le.length&&(pt=new uT(pt,s,null,m,pe),ye.push({event:pt,listeners:Le}),ot?pt.data=ot:(ot=pT(m),ot!==null&&(pt.data=ot)))),(ot=bX?wX(s,m):SX(s,m))&&(pt=sv(ce,"onBeforeInput"),0<pt.length&&(Le=new uT("onBeforeInput","beforeinput",null,m,pe),ye.push({event:Le,listeners:pt}),Le.data=ot)),hG(ye,s,ce,m,pe)}J2(ye,u)})}function Nh(s,u,m){return{instance:s,listener:u,currentTarget:m}}function sv(s,u){for(var m=u+"Capture",y=[];s!==null;){var _=s,A=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||A===null||(_=Qd(s,m),_!=null&&y.unshift(Nh(s,_,A)),_=Qd(s,u),_!=null&&y.push(Nh(s,_,A))),s.tag===3)return y;s=s.return}return[]}function vG(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function tM(s,u,m,y,_){for(var A=u._reactName,P=[];m!==null&&m!==y;){var K=m,Z=K.alternate,ce=K.stateNode;if(K=K.tag,Z!==null&&Z===y)break;K!==5&&K!==26&&K!==27||ce===null||(Z=ce,_?(ce=Qd(m,A),ce!=null&&P.unshift(Nh(m,ce,Z))):_||(ce=Qd(m,A),ce!=null&&P.push(Nh(m,ce,Z)))),m=m.return}P.length!==0&&s.push({event:u,listeners:P})}var yG=/\r\n?/g,xG=/\u0000|\uFFFD/g;function nM(s){return(typeof s=="string"?s:""+s).replace(yG,`
`).replace(xG,"")}function rM(s,u){return u=nM(u),nM(s)===u}function Ft(s,u,m,y,_,A){switch(m){case"children":typeof y=="string"?u==="body"||u==="textarea"&&y===""||Mc(s,y):(typeof y=="number"||typeof y=="bigint")&&u!=="body"&&Mc(s,""+y);break;case"className":Pc(s,"class",y);break;case"tabIndex":Pc(s,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Pc(s,m,y);break;case"style":rT(s,y,A);break;case"data":if(u!=="object"){Pc(s,"data",y);break}case"src":case"href":if(y===""&&(u!=="a"||m!=="href")){s.removeAttribute(m);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(m);break}y=hg(""+y),s.setAttribute(m,y);break;case"action":case"formAction":if(typeof y=="function"){s.setAttribute(m,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof A=="function"&&(m==="formAction"?(u!=="input"&&Ft(s,u,"name",_.name,_,null),Ft(s,u,"formEncType",_.formEncType,_,null),Ft(s,u,"formMethod",_.formMethod,_,null),Ft(s,u,"formTarget",_.formTarget,_,null)):(Ft(s,u,"encType",_.encType,_,null),Ft(s,u,"method",_.method,_,null),Ft(s,u,"target",_.target,_,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){s.removeAttribute(m);break}y=hg(""+y),s.setAttribute(m,y);break;case"onClick":y!=null&&(s.onclick=Eo);break;case"onScroll":y!=null&&dt("scroll",s);break;case"onScrollEnd":y!=null&&dt("scrollend",s);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=m}}break;case"multiple":s.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":s.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){s.removeAttribute("xlink:href");break}m=hg(""+y),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",m);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(m,""+y):s.removeAttribute(m);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":y&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(m,""):s.removeAttribute(m);break;case"capture":case"download":y===!0?s.setAttribute(m,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?s.setAttribute(m,y):s.removeAttribute(m);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?s.setAttribute(m,y):s.removeAttribute(m);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?s.removeAttribute(m):s.setAttribute(m,y);break;case"popover":dt("beforetoggle",s),dt("toggle",s),Tc(s,"popover",y);break;case"xlinkActuate":da(s,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":da(s,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":da(s,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":da(s,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":da(s,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":da(s,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":da(s,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":da(s,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":da(s,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":Tc(s,"is",y);break;case"innerText":case"textContent":break;default:(!(2<m.length)||m[0]!=="o"&&m[0]!=="O"||m[1]!=="n"&&m[1]!=="N")&&(m=YY.get(m)||m,Tc(s,m,y))}}function A1(s,u,m,y,_,A){switch(m){case"style":rT(s,y,A);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(m=y.__html,m!=null){if(_.children!=null)throw Error(r(60));s.innerHTML=m}}break;case"children":typeof y=="string"?Mc(s,y):(typeof y=="number"||typeof y=="bigint")&&Mc(s,""+y);break;case"onScroll":y!=null&&dt("scroll",s);break;case"onScrollEnd":y!=null&&dt("scrollend",s);break;case"onClick":y!=null&&(s.onclick=Eo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lg.hasOwnProperty(m))e:{if(m[0]==="o"&&m[1]==="n"&&(_=m.endsWith("Capture"),u=m.slice(2,_?m.length-7:void 0),A=s[fr]||null,A=A!=null?A[m]:null,typeof A=="function"&&s.removeEventListener(u,A,_),typeof y=="function")){typeof A!="function"&&A!==null&&(m in s?s[m]=null:s.hasAttribute(m)&&s.removeAttribute(m)),s.addEventListener(u,y,_);break e}m in s?s[m]=y:y===!0?s.setAttribute(m,""):Tc(s,m,y)}}}function Er(s,u,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",s),dt("load",s);var y=!1,_=!1,A;for(A in m)if(m.hasOwnProperty(A)){var P=m[A];if(P!=null)switch(A){case"src":y=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ft(s,u,A,P,m,null)}}_&&Ft(s,u,"srcSet",m.srcSet,m,null),y&&Ft(s,u,"src",m.src,m,null);return;case"input":dt("invalid",s);var K=A=P=_=null,Z=null,ce=null;for(y in m)if(m.hasOwnProperty(y)){var pe=m[y];if(pe!=null)switch(y){case"name":_=pe;break;case"type":P=pe;break;case"checked":Z=pe;break;case"defaultChecked":ce=pe;break;case"value":A=pe;break;case"defaultValue":K=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,u));break;default:Ft(s,u,y,pe,m,null)}}dg(s,A,K,Z,ce,P,_,!1);return;case"select":dt("invalid",s),y=P=A=null;for(_ in m)if(m.hasOwnProperty(_)&&(K=m[_],K!=null))switch(_){case"value":A=K;break;case"defaultValue":P=K;break;case"multiple":y=K;default:Ft(s,u,_,K,m,null)}u=A,m=P,s.multiple=!!y,u!=null?So(s,!!y,u,!1):m!=null&&So(s,!!y,m,!0);return;case"textarea":dt("invalid",s),A=_=y=null;for(P in m)if(m.hasOwnProperty(P)&&(K=m[P],K!=null))switch(P){case"value":y=K;break;case"defaultValue":_=K;break;case"children":A=K;break;case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(91));break;default:Ft(s,u,P,K,m,null)}tT(s,y,_,A);return;case"option":for(Z in m)if(m.hasOwnProperty(Z)&&(y=m[Z],y!=null))switch(Z){case"selected":s.selected=y&&typeof y!="function"&&typeof y!="symbol";break;default:Ft(s,u,Z,y,m,null)}return;case"dialog":dt("beforetoggle",s),dt("toggle",s),dt("cancel",s),dt("close",s);break;case"iframe":case"object":dt("load",s);break;case"video":case"audio":for(y=0;y<kh.length;y++)dt(kh[y],s);break;case"image":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"embed":case"source":case"link":dt("error",s),dt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in m)if(m.hasOwnProperty(ce)&&(y=m[ce],y!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ft(s,u,ce,y,m,null)}return;default:if(Fb(u)){for(pe in m)m.hasOwnProperty(pe)&&(y=m[pe],y!==void 0&&A1(s,u,pe,y,m,void 0));return}}for(K in m)m.hasOwnProperty(K)&&(y=m[K],y!=null&&Ft(s,u,K,y,m,null))}function bG(s,u,m,y){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,A=null,P=null,K=null,Z=null,ce=null,pe=null;for(he in m){var ye=m[he];if(m.hasOwnProperty(he)&&ye!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=ye;default:y.hasOwnProperty(he)||Ft(s,u,he,null,y,ye)}}for(var fe in y){var he=y[fe];if(ye=m[fe],y.hasOwnProperty(fe)&&(he!=null||ye!=null))switch(fe){case"type":A=he;break;case"name":_=he;break;case"checked":ce=he;break;case"defaultChecked":pe=he;break;case"value":P=he;break;case"defaultValue":K=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,u));break;default:he!==ye&&Ft(s,u,fe,he,y,ye)}}iu(s,P,K,Z,ce,pe,A,_);return;case"select":he=P=K=fe=null;for(A in m)if(Z=m[A],m.hasOwnProperty(A)&&Z!=null)switch(A){case"value":break;case"multiple":he=Z;default:y.hasOwnProperty(A)||Ft(s,u,A,null,y,Z)}for(_ in y)if(A=y[_],Z=m[_],y.hasOwnProperty(_)&&(A!=null||Z!=null))switch(_){case"value":fe=A;break;case"defaultValue":K=A;break;case"multiple":P=A;default:A!==Z&&Ft(s,u,_,A,y,Z)}u=K,m=P,y=he,fe!=null?So(s,!!m,fe,!1):!!y!=!!m&&(u!=null?So(s,!!m,u,!0):So(s,!!m,m?[]:"",!1));return;case"textarea":he=fe=null;for(K in m)if(_=m[K],m.hasOwnProperty(K)&&_!=null&&!y.hasOwnProperty(K))switch(K){case"value":break;case"children":break;default:Ft(s,u,K,null,y,_)}for(P in y)if(_=y[P],A=m[P],y.hasOwnProperty(P)&&(_!=null||A!=null))switch(P){case"value":fe=_;break;case"defaultValue":he=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:_!==A&&Ft(s,u,P,_,y,A)}eT(s,fe,he);return;case"option":for(var Me in m)if(fe=m[Me],m.hasOwnProperty(Me)&&fe!=null&&!y.hasOwnProperty(Me))switch(Me){case"selected":s.selected=!1;break;default:Ft(s,u,Me,null,y,fe)}for(Z in y)if(fe=y[Z],he=m[Z],y.hasOwnProperty(Z)&&fe!==he&&(fe!=null||he!=null))switch(Z){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Ft(s,u,Z,fe,y,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in m)fe=m[Ye],m.hasOwnProperty(Ye)&&fe!=null&&!y.hasOwnProperty(Ye)&&Ft(s,u,Ye,null,y,fe);for(ce in y)if(fe=y[ce],he=m[ce],y.hasOwnProperty(ce)&&fe!==he&&(fe!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:Ft(s,u,ce,fe,y,he)}return;default:if(Fb(u)){for(var Ut in m)fe=m[Ut],m.hasOwnProperty(Ut)&&fe!==void 0&&!y.hasOwnProperty(Ut)&&A1(s,u,Ut,void 0,y,fe);for(pe in y)fe=y[pe],he=m[pe],!y.hasOwnProperty(pe)||fe===he||fe===void 0&&he===void 0||A1(s,u,pe,fe,y,he);return}}for(var oe in m)fe=m[oe],m.hasOwnProperty(oe)&&fe!=null&&!y.hasOwnProperty(oe)&&Ft(s,u,oe,null,y,fe);for(ye in y)fe=y[ye],he=m[ye],!y.hasOwnProperty(ye)||fe===he||fe==null&&he==null||Ft(s,u,ye,fe,y,he)}function iM(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wG(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,m=performance.getEntriesByType("resource"),y=0;y<m.length;y++){var _=m[y],A=_.transferSize,P=_.initiatorType,K=_.duration;if(A&&K&&iM(P)){for(P=0,K=_.responseEnd,y+=1;y<m.length;y++){var Z=m[y],ce=Z.startTime;if(ce>K)break;var pe=Z.transferSize,ye=Z.initiatorType;pe&&iM(ye)&&(Z=Z.responseEnd,P+=pe*(Z<K?1:(K-ce)/(Z-ce)))}if(--y,u+=8*(A+P)/(_.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var O1=null,k1=null;function lv(s){return s.nodeType===9?s:s.ownerDocument}function aM(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function oM(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function N1(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var T1=null;function SG(){var s=window.event;return s&&s.type==="popstate"?s===T1?!1:(T1=s,!0):(T1=null,!1)}var sM=typeof setTimeout=="function"?setTimeout:void 0,EG=typeof clearTimeout=="function"?clearTimeout:void 0,lM=typeof Promise=="function"?Promise:void 0,_G=typeof queueMicrotask=="function"?queueMicrotask:typeof lM<"u"?function(s){return lM.resolve(null).then(s).catch(CG)}:sM;function CG(s){setTimeout(function(){throw s})}function Qs(s){return s==="head"}function uM(s,u){var m=u,y=0;do{var _=m.nextSibling;if(s.removeChild(m),_&&_.nodeType===8)if(m=_.data,m==="/$"||m==="/&"){if(y===0){s.removeChild(_),ff(u);return}y--}else if(m==="$"||m==="$?"||m==="$~"||m==="$!"||m==="&")y++;else if(m==="html")Th(s.ownerDocument.documentElement);else if(m==="head"){m=s.ownerDocument.head,Th(m);for(var A=m.firstChild;A;){var P=A.nextSibling,K=A.nodeName;A[nu]||K==="SCRIPT"||K==="STYLE"||K==="LINK"&&A.rel.toLowerCase()==="stylesheet"||m.removeChild(A),A=P}}else m==="body"&&Th(s.ownerDocument.body);m=_}while(m);ff(u)}function cM(s,u){var m=s;s=0;do{var y=m.nextSibling;if(m.nodeType===1?u?(m._stashedDisplay=m.style.display,m.style.display="none"):(m.style.display=m._stashedDisplay||"",m.getAttribute("style")===""&&m.removeAttribute("style")):m.nodeType===3&&(u?(m._stashedText=m.nodeValue,m.nodeValue=""):m.nodeValue=m._stashedText||""),y&&y.nodeType===8)if(m=y.data,m==="/$"){if(s===0)break;s--}else m!=="$"&&m!=="$?"&&m!=="$~"&&m!=="$!"||s++;m=y}while(m)}function P1(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var m=u;switch(u=u.nextSibling,m.nodeName){case"HTML":case"HEAD":case"BODY":P1(m),Xd(m);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(m.rel.toLowerCase()==="stylesheet")continue}s.removeChild(m)}}function jG(s,u,m,y){for(;s.nodeType===1;){var _=m;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!y&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(y){if(!s[nu])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(A=s.getAttribute("rel"),A==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(A!==_.rel||s.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||s.getAttribute("title")!==(_.title==null?null:_.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(A=s.getAttribute("src"),(A!==(_.src==null?null:_.src)||s.getAttribute("type")!==(_.type==null?null:_.type)||s.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&A&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var A=_.name==null?null:""+_.name;if(_.type==="hidden"&&s.getAttribute("name")===A)return s}else return s;if(s=Yi(s.nextSibling),s===null)break}return null}function AG(s,u,m){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!m||(s=Yi(s.nextSibling),s===null))return null;return s}function fM(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Yi(s.nextSibling),s===null))return null;return s}function M1(s){return s.data==="$?"||s.data==="$~"}function D1(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function OG(s,u){var m=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||m.readyState!=="loading")u();else{var y=function(){u(),m.removeEventListener("DOMContentLoaded",y)};m.addEventListener("DOMContentLoaded",y),s._reactRetry=y}}function Yi(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var R1=null;function dM(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var m=s.data;if(m==="/$"||m==="/&"){if(u===0)return Yi(s.nextSibling);u--}else m!=="$"&&m!=="$!"&&m!=="$?"&&m!=="$~"&&m!=="&"||u++}s=s.nextSibling}return null}function hM(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var m=s.data;if(m==="$"||m==="$!"||m==="$?"||m==="$~"||m==="&"){if(u===0)return s;u--}else m!=="/$"&&m!=="/&"||u++}s=s.previousSibling}return null}function mM(s,u,m){switch(u=lv(m),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Th(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);Xd(s)}var Xi=new Map,pM=new Set;function uv(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var $o=q.d;q.d={f:kG,r:NG,D:TG,C:PG,L:MG,m:DG,X:IG,S:RG,M:LG};function kG(){var s=$o.f(),u=ev();return s||u}function NG(s){var u=ks(s);u!==null&&u.tag===5&&u.type==="form"?PP(u):$o.r(s)}var lf=typeof document>"u"?null:document;function gM(s,u,m){var y=lf;if(y&&typeof u=="string"&&u){var _=Jr(u);_='link[rel="'+s+'"][href="'+_+'"]',typeof m=="string"&&(_+='[crossorigin="'+m+'"]'),pM.has(_)||(pM.add(_),s={rel:s,crossOrigin:m,href:u},y.querySelector(_)===null&&(u=y.createElement("link"),Er(u,"link",s),zn(u),y.head.appendChild(u)))}}function TG(s){$o.D(s),gM("dns-prefetch",s,null)}function PG(s,u){$o.C(s,u),gM("preconnect",s,u)}function MG(s,u,m){$o.L(s,u,m);var y=lf;if(y&&s&&u){var _='link[rel="preload"][as="'+Jr(u)+'"]';u==="image"&&m&&m.imageSrcSet?(_+='[imagesrcset="'+Jr(m.imageSrcSet)+'"]',typeof m.imageSizes=="string"&&(_+='[imagesizes="'+Jr(m.imageSizes)+'"]')):_+='[href="'+Jr(s)+'"]';var A=_;switch(u){case"style":A=uf(s);break;case"script":A=cf(s)}Xi.has(A)||(s=d({rel:"preload",href:u==="image"&&m&&m.imageSrcSet?void 0:s,as:u},m),Xi.set(A,s),y.querySelector(_)!==null||u==="style"&&y.querySelector(Ph(A))||u==="script"&&y.querySelector(Mh(A))||(u=y.createElement("link"),Er(u,"link",s),zn(u),y.head.appendChild(u)))}}function DG(s,u){$o.m(s,u);var m=lf;if(m&&s){var y=u&&typeof u.as=="string"?u.as:"script",_='link[rel="modulepreload"][as="'+Jr(y)+'"][href="'+Jr(s)+'"]',A=_;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=cf(s)}if(!Xi.has(A)&&(s=d({rel:"modulepreload",href:s},u),Xi.set(A,s),m.querySelector(_)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(m.querySelector(Mh(A)))return}y=m.createElement("link"),Er(y,"link",s),zn(y),m.head.appendChild(y)}}}function RG(s,u,m){$o.S(s,u,m);var y=lf;if(y&&s){var _=Ts(y).hoistableStyles,A=uf(s);u=u||"default";var P=_.get(A);if(!P){var K={loading:0,preload:null};if(P=y.querySelector(Ph(A)))K.loading=5;else{s=d({rel:"stylesheet",href:s,"data-precedence":u},m),(m=Xi.get(A))&&I1(s,m);var Z=P=y.createElement("link");zn(Z),Er(Z,"link",s),Z._p=new Promise(function(ce,pe){Z.onload=ce,Z.onerror=pe}),Z.addEventListener("load",function(){K.loading|=1}),Z.addEventListener("error",function(){K.loading|=2}),K.loading|=4,cv(P,u,y)}P={type:"stylesheet",instance:P,count:1,state:K},_.set(A,P)}}}function IG(s,u){$o.X(s,u);var m=lf;if(m&&s){var y=Ts(m).hoistableScripts,_=cf(s),A=y.get(_);A||(A=m.querySelector(Mh(_)),A||(s=d({src:s,async:!0},u),(u=Xi.get(_))&&L1(s,u),A=m.createElement("script"),zn(A),Er(A,"link",s),m.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},y.set(_,A))}}function LG(s,u){$o.M(s,u);var m=lf;if(m&&s){var y=Ts(m).hoistableScripts,_=cf(s),A=y.get(_);A||(A=m.querySelector(Mh(_)),A||(s=d({src:s,async:!0,type:"module"},u),(u=Xi.get(_))&&L1(s,u),A=m.createElement("script"),zn(A),Er(A,"link",s),m.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},y.set(_,A))}}function vM(s,u,m,y){var _=(_=ne.current)?uv(_):null;if(!_)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof m.precedence=="string"&&typeof m.href=="string"?(u=uf(m.href),m=Ts(_).hoistableStyles,y=m.get(u),y||(y={type:"style",instance:null,count:0,state:null},m.set(u,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(m.rel==="stylesheet"&&typeof m.href=="string"&&typeof m.precedence=="string"){s=uf(m.href);var A=Ts(_).hoistableStyles,P=A.get(s);if(P||(_=_.ownerDocument||_,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(s,P),(A=_.querySelector(Ph(s)))&&!A._p&&(P.instance=A,P.state.loading=5),Xi.has(s)||(m={rel:"preload",as:"style",href:m.href,crossOrigin:m.crossOrigin,integrity:m.integrity,media:m.media,hrefLang:m.hrefLang,referrerPolicy:m.referrerPolicy},Xi.set(s,m),A||zG(_,s,m,P.state))),u&&y===null)throw Error(r(528,""));return P}if(u&&y!==null)throw Error(r(529,""));return null;case"script":return u=m.async,m=m.src,typeof m=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=cf(m),m=Ts(_).hoistableScripts,y=m.get(u),y||(y={type:"script",instance:null,count:0,state:null},m.set(u,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function uf(s){return'href="'+Jr(s)+'"'}function Ph(s){return'link[rel="stylesheet"]['+s+"]"}function yM(s){return d({},s,{"data-precedence":s.precedence,precedence:null})}function zG(s,u,m,y){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?y.loading=1:(u=s.createElement("link"),y.preload=u,u.addEventListener("load",function(){return y.loading|=1}),u.addEventListener("error",function(){return y.loading|=2}),Er(u,"link",m),zn(u),s.head.appendChild(u))}function cf(s){return'[src="'+Jr(s)+'"]'}function Mh(s){return"script[async]"+s}function xM(s,u,m){if(u.count++,u.instance===null)switch(u.type){case"style":var y=s.querySelector('style[data-href~="'+Jr(m.href)+'"]');if(y)return u.instance=y,zn(y),y;var _=d({},m,{"data-href":m.href,"data-precedence":m.precedence,href:null,precedence:null});return y=(s.ownerDocument||s).createElement("style"),zn(y),Er(y,"style",_),cv(y,m.precedence,s),u.instance=y;case"stylesheet":_=uf(m.href);var A=s.querySelector(Ph(_));if(A)return u.state.loading|=4,u.instance=A,zn(A),A;y=yM(m),(_=Xi.get(_))&&I1(y,_),A=(s.ownerDocument||s).createElement("link"),zn(A);var P=A;return P._p=new Promise(function(K,Z){P.onload=K,P.onerror=Z}),Er(A,"link",y),u.state.loading|=4,cv(A,m.precedence,s),u.instance=A;case"script":return A=cf(m.src),(_=s.querySelector(Mh(A)))?(u.instance=_,zn(_),_):(y=m,(_=Xi.get(A))&&(y=d({},m),L1(y,_)),s=s.ownerDocument||s,_=s.createElement("script"),zn(_),Er(_,"link",y),s.head.appendChild(_),u.instance=_);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(y=u.instance,u.state.loading|=4,cv(y,m.precedence,s));return u.instance}function cv(s,u,m){for(var y=m.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=y.length?y[y.length-1]:null,A=_,P=0;P<y.length;P++){var K=y[P];if(K.dataset.precedence===u)A=K;else if(A!==_)break}A?A.parentNode.insertBefore(s,A.nextSibling):(u=m.nodeType===9?m.head:m,u.insertBefore(s,u.firstChild))}function I1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function L1(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var fv=null;function bM(s,u,m){if(fv===null){var y=new Map,_=fv=new Map;_.set(m,y)}else _=fv,y=_.get(m),y||(y=new Map,_.set(m,y));if(y.has(s))return y;for(y.set(s,null),m=m.getElementsByTagName(s),_=0;_<m.length;_++){var A=m[_];if(!(A[nu]||A[Yt]||s==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var P=A.getAttribute(u)||"";P=s+P;var K=y.get(P);K?K.push(A):y.set(P,[A])}}return y}function wM(s,u,m){s=s.ownerDocument||s,s.head.insertBefore(m,u==="title"?s.querySelector("head > title"):null)}function $G(s,u,m){if(m===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return s=u.disabled,typeof u.precedence=="string"&&s==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function SM(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function BG(s,u,m,y){if(m.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(m.state.loading&4)===0){if(m.instance===null){var _=uf(y.href),A=u.querySelector(Ph(_));if(A){u=A._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=dv.bind(s),u.then(s,s)),m.state.loading|=4,m.instance=A,zn(A);return}A=u.ownerDocument||u,y=yM(y),(_=Xi.get(_))&&I1(y,_),A=A.createElement("link"),zn(A);var P=A;P._p=new Promise(function(K,Z){P.onload=K,P.onerror=Z}),Er(A,"link",y),m.instance=A}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(m,u),(u=m.state.preload)&&(m.state.loading&3)===0&&(s.count++,m=dv.bind(s),u.addEventListener("load",m),u.addEventListener("error",m))}}var z1=0;function FG(s,u){return s.stylesheets&&s.count===0&&mv(s,s.stylesheets),0<s.count||0<s.imgCount?function(m){var y=setTimeout(function(){if(s.stylesheets&&mv(s,s.stylesheets),s.unsuspend){var A=s.unsuspend;s.unsuspend=null,A()}},6e4+u);0<s.imgBytes&&z1===0&&(z1=62500*wG());var _=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&mv(s,s.stylesheets),s.unsuspend)){var A=s.unsuspend;s.unsuspend=null,A()}},(s.imgBytes>z1?50:800)+u);return s.unsuspend=m,function(){s.unsuspend=null,clearTimeout(y),clearTimeout(_)}}:null}function dv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mv(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var hv=null;function mv(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,hv=new Map,u.forEach(UG,s),hv=null,dv.call(s))}function UG(s,u){if(!(u.state.loading&4)){var m=hv.get(s);if(m)var y=m.get(null);else{m=new Map,hv.set(s,m);for(var _=s.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<_.length;A++){var P=_[A];(P.nodeName==="LINK"||P.getAttribute("media")!=="not all")&&(m.set(P.dataset.precedence,P),y=P)}y&&m.set(null,y)}_=u.instance,P=_.getAttribute("data-precedence"),A=m.get(P)||y,A===y&&m.set(null,_),m.set(P,_),this.count++,y=dv.bind(this),_.addEventListener("load",y),_.addEventListener("error",y),A?A.parentNode.insertBefore(_,A.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(_,s.firstChild)),u.state.loading|=4}}var Dh={$$typeof:C,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function HG(s,u,m,y,_,A,P,K,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mi(0),this.hiddenUpdates=mi(null),this.identifierPrefix=y,this.onUncaughtError=_,this.onCaughtError=A,this.onRecoverableError=P,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function EM(s,u,m,y,_,A,P,K,Z,ce,pe,ye){return s=new HG(s,u,m,P,Z,ce,pe,ye,K),u=1,A===!0&&(u|=24),A=vi(3,null,null,u),s.current=A,A.stateNode=s,u=vw(),u.refCount++,s.pooledCache=u,u.refCount++,A.memoizedState={element:y,isDehydrated:m,cache:u},ww(A),s}function _M(s){return s?(s=Bc,s):Bc}function CM(s,u,m,y,_,A){_=_M(_),y.context===null?y.context=_:y.pendingContext=_,y=Bs(u),y.payload={element:m},A=A===void 0?null:A,A!==null&&(y.callback=A),m=Fs(s,y,u),m!==null&&(ai(m,s,u),dh(m,s,u))}function jM(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var m=s.retryLane;s.retryLane=m!==0&&m<u?m:u}}function $1(s,u){jM(s,u),(s=s.alternate)&&jM(s,u)}function AM(s){if(s.tag===13||s.tag===31){var u=lu(s,67108864);u!==null&&ai(u,s,67108864),$1(s,67108864)}}function OM(s){if(s.tag===13||s.tag===31){var u=Si();u=$a(u);var m=lu(s,u);m!==null&&ai(m,s,u),$1(s,u)}}var pv=!0;function qG(s,u,m,y){var _=D.T;D.T=null;var A=q.p;try{q.p=2,B1(s,u,m,y)}finally{q.p=A,D.T=_}}function VG(s,u,m,y){var _=D.T;D.T=null;var A=q.p;try{q.p=8,B1(s,u,m,y)}finally{q.p=A,D.T=_}}function B1(s,u,m,y){if(pv){var _=F1(y);if(_===null)j1(s,u,y,gv,m),NM(s,y);else if(YG(_,s,u,m,y))y.stopPropagation();else if(NM(s,y),u&4&&-1<KG.indexOf(s)){for(;_!==null;){var A=ks(_);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var P=Ur(A.pendingLanes);if(P!==0){var K=A;for(K.pendingLanes|=2,K.entangledLanes|=2;P;){var Z=1<<31-Xe(P);K.entanglements[1]|=Z,P&=~Z}Ha(A),(Tt&6)===0&&(Zg=Rt()+500,Oh(0))}}break;case 31:case 13:K=lu(A,2),K!==null&&ai(K,A,2),ev(),$1(A,2)}if(A=F1(y),A===null&&j1(s,u,y,gv,m),A===_)break;_=A}_!==null&&y.stopPropagation()}else j1(s,u,y,null,m)}}function F1(s){return s=Hb(s),U1(s)}var gv=null;function U1(s){if(gv=null,s=Os(s),s!==null){var u=a(s);if(u===null)s=null;else{var m=u.tag;if(m===13){if(s=o(u),s!==null)return s;s=null}else if(m===31){if(s=l(u),s!==null)return s;s=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return gv=s,null}function kM(s){switch(s){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pn()){case de:return 2;case xe:return 8;case ze:case Ke:return 32;case et:return 268435456;default:return 32}default:return 32}}var H1=!1,Zs=null,Js=null,el=null,Rh=new Map,Ih=new Map,tl=[],KG="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".split(" ");function NM(s,u){switch(s){case"focusin":case"focusout":Zs=null;break;case"dragenter":case"dragleave":Js=null;break;case"mouseover":case"mouseout":el=null;break;case"pointerover":case"pointerout":Rh.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ih.delete(u.pointerId)}}function Lh(s,u,m,y,_,A){return s===null||s.nativeEvent!==A?(s={blockedOn:u,domEventName:m,eventSystemFlags:y,nativeEvent:A,targetContainers:[_]},u!==null&&(u=ks(u),u!==null&&AM(u)),s):(s.eventSystemFlags|=y,u=s.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),s)}function YG(s,u,m,y,_){switch(u){case"focusin":return Zs=Lh(Zs,s,u,m,y,_),!0;case"dragenter":return Js=Lh(Js,s,u,m,y,_),!0;case"mouseover":return el=Lh(el,s,u,m,y,_),!0;case"pointerover":var A=_.pointerId;return Rh.set(A,Lh(Rh.get(A)||null,s,u,m,y,_)),!0;case"gotpointercapture":return A=_.pointerId,Ih.set(A,Lh(Ih.get(A)||null,s,u,m,y,_)),!0}return!1}function TM(s){var u=Os(s.target);if(u!==null){var m=a(u);if(m!==null){if(u=m.tag,u===13){if(u=o(m),u!==null){s.blockedOn=u,Ct(s.priority,function(){OM(m)});return}}else if(u===31){if(u=l(m),u!==null){s.blockedOn=u,Ct(s.priority,function(){OM(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){s.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}s.blockedOn=null}function vv(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var m=F1(s.nativeEvent);if(m===null){m=s.nativeEvent;var y=new m.constructor(m.type,m);Ub=y,m.target.dispatchEvent(y),Ub=null}else return u=ks(m),u!==null&&AM(u),s.blockedOn=m,!1;u.shift()}return!0}function PM(s,u,m){vv(s)&&m.delete(u)}function XG(){H1=!1,Zs!==null&&vv(Zs)&&(Zs=null),Js!==null&&vv(Js)&&(Js=null),el!==null&&vv(el)&&(el=null),Rh.forEach(PM),Ih.forEach(PM)}function yv(s,u){s.blockedOn===u&&(s.blockedOn=null,H1||(H1=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,XG)))}var xv=null;function MM(s){xv!==s&&(xv=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){xv===s&&(xv=null);for(var u=0;u<s.length;u+=3){var m=s[u],y=s[u+1],_=s[u+2];if(typeof y!="function"){if(U1(y||m)===null)continue;break}var A=ks(m);A!==null&&(s.splice(u,3),u-=3,Fw(A,{pending:!0,data:_,method:m.method,action:y},y,_))}}))}function ff(s){function u(Z){return yv(Z,s)}Zs!==null&&yv(Zs,s),Js!==null&&yv(Js,s),el!==null&&yv(el,s),Rh.forEach(u),Ih.forEach(u);for(var m=0;m<tl.length;m++){var y=tl[m];y.blockedOn===s&&(y.blockedOn=null)}for(;0<tl.length&&(m=tl[0],m.blockedOn===null);)TM(m),m.blockedOn===null&&tl.shift();if(m=(s.ownerDocument||s).$$reactFormReplay,m!=null)for(y=0;y<m.length;y+=3){var _=m[y],A=m[y+1],P=_[fr]||null;if(typeof A=="function")P||MM(m);else if(P){var K=null;if(A&&A.hasAttribute("formAction")){if(_=A,P=A[fr]||null)K=P.formAction;else if(U1(_)!==null)continue}else K=P.action;typeof K=="function"?m[y+1]=K:(m.splice(y,3),y-=3),MM(m)}}}function DM(){function s(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(P){return _=P})},focusReset:"manual",scroll:"manual"})}function u(){_!==null&&(_(),_=null),y||setTimeout(m,20)}function m(){if(!y&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var y=!1,_=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(m,100),function(){y=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),_!==null&&(_(),_=null)}}}function q1(s){this._internalRoot=s}bv.prototype.render=q1.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var m=u.current,y=Si();CM(m,y,s,u,null,null)},bv.prototype.unmount=q1.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;CM(s.current,2,null,s,null,null),ev(),u[pi]=null}};function bv(s){this._internalRoot=s}bv.prototype.unstable_scheduleHydration=function(s){if(s){var u=ve();s={blockedOn:null,target:s,priority:u};for(var m=0;m<tl.length&&u!==0&&u<tl[m].priority;m++);tl.splice(m,0,s),m===0&&TM(s)}};var RM=t.version;if(RM!=="19.2.4")throw Error(r(527,RM,"19.2.4"));q.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(u),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var GG={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wv.isDisabled&&wv.supportsFiber)try{Kt=wv.inject(GG),Se=wv}catch{}}return $h.createRoot=function(s,u){if(!i(s))throw Error(r(299));var m=!1,y="",_=UP,A=HP,P=qP;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(_=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError)),u=EM(s,1,!1,null,null,m,y,null,_,A,P,DM),s[pi]=u.current,C1(s),new q1(u)},$h.hydrateRoot=function(s,u,m){if(!i(s))throw Error(r(299));var y=!1,_="",A=UP,P=HP,K=qP,Z=null;return m!=null&&(m.unstable_strictMode===!0&&(y=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onUncaughtError!==void 0&&(A=m.onUncaughtError),m.onCaughtError!==void 0&&(P=m.onCaughtError),m.onRecoverableError!==void 0&&(K=m.onRecoverableError),m.formState!==void 0&&(Z=m.formState)),u=EM(s,1,!0,u,m??null,y,_,Z,A,P,K,DM),u.context=_M(null),m=u.current,y=Si(),y=$a(y),_=Bs(y),_.callback=null,Fs(m,_,y),m=y,u.current.lanes=m,It(u,m),Ha(u),s[pi]=u.current,C1(s),new bv(u)},$h.version="19.2.4",$h}var KM;function sW(){if(KM)return G1.exports;KM=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),G1.exports=oW(),G1.exports}var lW=sW();/**
 * react-router v7.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var YM="popstate";function XM(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uW(e={}){function t(r,i){var f;let a=(f=i.state)==null?void 0:f.masked,{pathname:o,search:l,hash:c}=a||r.location;return j_("",{pathname:o,search:l,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:_m(i)}return fW(t,n,null,e)}function fn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ka(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function cW(){return Math.random().toString(36).substring(2,10)}function GM(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function j_(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ad(t):t,state:n,key:t&&t.key||r||cW(),unstable_mask:i}}function _m({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ad(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function fW(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l="POP",c=null,f=h();f==null&&(f=0,o.replaceState({...o.state,idx:f},""));function h(){return(o.state||{idx:null}).idx}function d(){l="POP";let S=h(),E=S==null?null:S-f;f=S,c&&c({action:l,location:w.location,delta:E})}function p(S,E){l="PUSH";let j=XM(S)?S:j_(w.location,S,E);f=h()+1;let C=GM(j,f),O=w.createHref(j.unstable_mask||j);try{o.pushState(C,"",O)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;i.location.assign(O)}a&&c&&c({action:l,location:w.location,delta:1})}function v(S,E){l="REPLACE";let j=XM(S)?S:j_(w.location,S,E);f=h();let C=GM(j,f),O=w.createHref(j.unstable_mask||j);o.replaceState(C,"",O),a&&c&&c({action:l,location:w.location,delta:0})}function b(S){return dW(S)}let w={get action(){return l},get location(){return e(i,o)},listen(S){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(YM,d),c=S,()=>{i.removeEventListener(YM,d),c=null}},createHref(S){return t(i,S)},createURL:b,encodeLocation(S){let E=b(S);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:p,replace:v,go(S){return o.go(S)}};return w}function dW(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),fn(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:_m(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function o$(e,t,n="/"){return hW(e,t,n,!1)}function hW(e,t,n,r){let i=typeof t=="string"?Ad(t):t,a=rs(i.pathname||"/",n);if(a==null)return null;let o=s$(e);mW(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let f=u$(a);l=EW(o[c],f,r)}return l}function s$(e,t=[],n=[],r="",i=!1){let a=(o,l,c=i,f)=>{let h={relativePath:f===void 0?o.path||"":f,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&c)return;fn(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let d=ro([r,h.relativePath]),p=n.concat(h);o.children&&o.children.length>0&&(fn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),s$(o.children,t,p,d,c)),!(o.path==null&&!o.index)&&t.push({path:d,score:wW(d,o.index),routesMeta:p})};return e.forEach((o,l)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,l);else for(let f of l$(o.path))a(o,l,!0,f)}),t}function l$(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=l$(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function mW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:SW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var pW=/^:[\w-]+$/,gW=3,vW=2,yW=1,xW=10,bW=-2,WM=e=>e==="*";function wW(e,t){let n=e.split("/"),r=n.length;return n.some(WM)&&(r+=bW),t&&(r+=vW),n.filter(i=>!WM(i)).reduce((i,a)=>i+(pW.test(a)?gW:a===""?yW:xW),r)}function SW(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function EW(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],f=l===r.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=Cm({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},h),p=c.route;if(!d&&f&&n&&!r[r.length-1].route.index&&(d=Cm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:ro([a,d.pathname]),pathnameBase:OW(ro([a,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(a=ro([a,d.pathnameBase]))}return o}function Cm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_W(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((f,{paramName:h,isOptional:d},p)=>{if(h==="*"){let b=l[p]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[p];return d&&!v?f[h]=void 0:f[h]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:o,pattern:e}}function _W(e,t=!1,n=!0){ka(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c,f,h)=>{if(r.push({paramName:l,isOptional:c!=null}),c){let d=h.charAt(f+o.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function u$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ka(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function rs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var CW=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function jW(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ad(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=QM(n.substring(1),"/"):a=QM(n,t)):a=t,{pathname:a,search:kW(r),hash:NW(i)}}function QM(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function J1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function AW(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function c$(e){let t=AW(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function qj(e,t,n,r=!1){let i;typeof e=="string"?i=Ad(e):(i={...e},fn(!i.pathname||!i.pathname.includes("?"),J1("?","pathname","search",i)),fn(!i.pathname||!i.pathname.includes("#"),J1("#","pathname","hash",i)),fn(!i.search||!i.search.includes("#"),J1("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}l=d>=0?t[d]:"/"}let c=jW(i,l),f=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||h)&&(c.pathname+="/"),c}var ro=e=>e.join("/").replace(/\/\/+/g,"/"),OW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),kW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,NW=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,TW=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function PW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function MW(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var f$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function d$(e,t){let n=e;if(typeof n!="string"||!CW.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(f$)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),l=rs(o.pathname,t);o.origin===a.origin&&l!=null?n=l+o.search+o.hash:i=!0}catch{ka(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var h$=["POST","PUT","PATCH","DELETE"];new Set(h$);var DW=["GET",...h$];new Set(DW);var Od=x.createContext(null);Od.displayName="DataRouter";var Zx=x.createContext(null);Zx.displayName="DataRouterState";var RW=x.createContext(!1),m$=x.createContext({isTransitioning:!1});m$.displayName="ViewTransition";var IW=x.createContext(new Map);IW.displayName="Fetchers";var LW=x.createContext(null);LW.displayName="Await";var sa=x.createContext(null);sa.displayName="Navigation";var pp=x.createContext(null);pp.displayName="Location";var Ma=x.createContext({outlet:null,matches:[],isDataRoute:!1});Ma.displayName="Route";var Vj=x.createContext(null);Vj.displayName="RouteError";var p$="REACT_ROUTER_ERROR",zW="REDIRECT",$W="ROUTE_ERROR_RESPONSE";function BW(e){if(e.startsWith(`${p$}:${zW}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function FW(e){if(e.startsWith(`${p$}:${$W}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new TW(t.status,t.statusText,t.data)}catch{}}function UW(e,{relative:t}={}){fn(kd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(sa),{hash:i,pathname:a,search:o}=gp(e,{relative:t}),l=a;return n!=="/"&&(l=a==="/"?n:ro([n,a])),r.createHref({pathname:l,search:o,hash:i})}function kd(){return x.useContext(pp)!=null}function Da(){return fn(kd(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(pp).location}function HW(e){fn(kd(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Da();return x.useMemo(()=>Cm(e,u$(t)),[t,e])}var g$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function v$(e){x.useContext(sa).static||x.useLayoutEffect(e)}function Fl(){let{isDataRoute:e}=x.useContext(Ma);return e?iQ():qW()}function qW(){fn(kd(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Od),{basename:t,navigator:n}=x.useContext(sa),{matches:r}=x.useContext(Ma),{pathname:i}=Da(),a=JSON.stringify(c$(r)),o=x.useRef(!1);return v$(()=>{o.current=!0}),x.useCallback((c,f={})=>{if(ka(o.current,g$),!o.current)return;if(typeof c=="number"){n.go(c);return}let h=qj(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ro([t,h.pathname])),(f.replace?n.replace:n.push)(h,f.state,f)},[t,n,a,i,e])}var VW=x.createContext(null);function KW(e){let t=x.useContext(Ma).outlet;return x.useMemo(()=>t&&x.createElement(VW.Provider,{value:e},t),[t,e])}function Jx(){let{matches:e}=x.useContext(Ma),t=e[e.length-1];return t?t.params:{}}function gp(e,{relative:t}={}){let{matches:n}=x.useContext(Ma),{pathname:r}=Da(),i=JSON.stringify(c$(n));return x.useMemo(()=>qj(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function YW(e,t){return y$(e,t)}function y$(e,t,n){var S;fn(kd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(sa),{matches:i}=x.useContext(Ma),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let E=f&&f.path||"";b$(l,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${E}">) 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.

Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let h=Da(),d;if(t){let E=typeof t=="string"?Ad(t):t;fn(c==="/"||((S=E.pathname)==null?void 0:S.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${E.pathname}" was given in the \`location\` prop.`),d=E}else d=h;let p=d.pathname||"/",v=p;if(c!=="/"){let E=c.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=o$(e,{pathname:v});ka(f||b!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),ka(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 w=ZW(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},o,E.params),pathname:ro([c,r.encodeLocation?r.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?c:ro([c,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),i,n);return t&&w?x.createElement(pp.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},w):w}function XW(){let e=rQ(),t=PW(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:a},"ErrorBoundary")," or"," ",x.createElement("code",{style:a},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,o)}var GW=x.createElement(XW,null),x$=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=FW(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Ma.Provider,{value:this.props.routeContext},x.createElement(Vj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(WW,{error:e},t):t}};x$.contextType=RW;var eS=new WeakMap;function WW({children:e,error:t}){let{basename:n}=x.useContext(sa);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=BW(t.digest);if(r){let i=eS.get(t);if(i)throw i;let a=d$(r.location,n);if(f$&&!eS.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw eS.set(t,o),o}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function QW({routeContext:e,match:t,children:n}){let r=x.useContext(Od);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Ma.Provider,{value:e},n)}function ZW(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r==null?void 0:r.errors;if(a!=null){let h=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);fn(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,h+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let h=0;h<i.length;h++){let d=i[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=h),d.route.id){let{loaderData:p,errors:v}=r,b=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!v||v[d.route.id]===void 0);if(d.route.lazy||b){n.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let c=n==null?void 0:n.onError,f=r&&c?(h,d)=>{var p,v;c(h,{location:r.location,params:((v=(p=r.matches)==null?void 0:p[0])==null?void 0:v.params)??{},unstable_pattern:MW(r.matches),errorInfo:d})}:void 0;return i.reduceRight((h,d,p)=>{let v,b=!1,w=null,S=null;r&&(v=a&&d.route.id?a[d.route.id]:void 0,w=d.route.errorElement||GW,o&&(l<0&&p===0?(b$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):l===p&&(b=!0,S=d.route.hydrateFallbackElement||null)));let E=t.concat(i.slice(0,p+1)),j=()=>{let C;return v?C=w:b?C=S:d.route.Component?C=x.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=h,x.createElement(QW,{match:d,routeContext:{outlet:h,matches:E,isDataRoute:r!=null},children:C})};return r&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?x.createElement(x$,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:j(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):j()},null)}function Kj(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function JW(e){let t=x.useContext(Od);return fn(t,Kj(e)),t}function eQ(e){let t=x.useContext(Zx);return fn(t,Kj(e)),t}function tQ(e){let t=x.useContext(Ma);return fn(t,Kj(e)),t}function Yj(e){let t=tQ(e),n=t.matches[t.matches.length-1];return fn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nQ(){return Yj("useRouteId")}function rQ(){var r;let e=x.useContext(Vj),t=eQ("useRouteError"),n=Yj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function iQ(){let{router:e}=JW("useNavigate"),t=Yj("useNavigate"),n=x.useRef(!1);return v$(()=>{n.current=!0}),x.useCallback(async(i,a={})=>{ka(n.current,g$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var ZM={};function b$(e,t,n){!t&&!ZM[e]&&(ZM[e]=!0,ka(!1,n))}x.memo(aQ);function aQ({routes:e,future:t,state:n,isStatic:r,onError:i}){return y$(e,void 0,{state:n,isStatic:r,onError:i})}function oQ(e){return KW(e.context)}function va(e){fn(!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 sQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){fn(!kd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=x.useMemo(()=>({basename:l,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[l,i,a,o]);typeof n=="string"&&(n=Ad(n));let{pathname:f="/",search:h="",hash:d="",state:p=null,key:v="default",unstable_mask:b}=n,w=x.useMemo(()=>{let S=rs(f,l);return S==null?null:{location:{pathname:S,search:h,hash:d,state:p,key:v,unstable_mask:b},navigationType:r}},[l,f,h,d,p,v,r,b]);return ka(w!=null,`<Router basename="${l}"> is not able to match the URL "${f}${h}${d}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(sa.Provider,{value:c},x.createElement(pp.Provider,{children:t,value:w}))}function lQ({children:e,location:t}){return YW(A_(e),t)}function A_(e,t=[]){let n=[];return x.Children.forEach(e,(r,i)=>{if(!x.isValidElement(r))return;let a=[...t,i];if(r.type===x.Fragment){n.push.apply(n,A_(r.props.children,a));return}fn(r.type===va,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),fn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=A_(r.props.children,a)),n.push(o)}),n}var ly="get",uy="application/x-www-form-urlencoded";function e0(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uQ(e){return e0(e)&&e.tagName.toLowerCase()==="button"}function cQ(e){return e0(e)&&e.tagName.toLowerCase()==="form"}function fQ(e){return e0(e)&&e.tagName.toLowerCase()==="input"}function dQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hQ(e,t){return e.button===0&&(!t||t==="_self")&&!dQ(e)}function O_(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function mQ(e,t){let n=O_(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Ev=null;function pQ(){if(Ev===null)try{new FormData(document.createElement("form"),0),Ev=!1}catch{Ev=!0}return Ev}var gQ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tS(e){return e!=null&&!gQ.has(e)?(ka(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${uy}"`),null):e}function vQ(e,t){let n,r,i,a,o;if(cQ(e)){let l=e.getAttribute("action");r=l?rs(l,t):null,n=e.getAttribute("method")||ly,i=tS(e.getAttribute("enctype"))||uy,a=new FormData(e)}else if(uQ(e)||fQ(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?rs(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||ly,i=tS(e.getAttribute("formenctype"))||tS(l.getAttribute("enctype"))||uy,a=new FormData(l,e),!pQ()){let{name:f,type:h,value:d}=e;if(h==="image"){let p=f?`${f}.`:"";a.append(`${p}x`,"0"),a.append(`${p}y`,"0")}else f&&a.append(f,d)}}else{if(e0(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ly,r=null,i=uy,o=e}return a&&i==="text/plain"&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Xj(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function yQ(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&rs(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function xQ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bQ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function wQ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await xQ(a,n);return o.links?o.links():[]}return[]}));return CQ(r.flat(1).filter(bQ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function JM(e,t,n,r,i,a){let o=(c,f)=>n[f]?c.route.id!==n[f].route.id:!0,l=(c,f)=>{var h;return n[f].pathname!==c.pathname||((h=n[f].route.path)==null?void 0:h.endsWith("*"))&&n[f].params["*"]!==c.params["*"]};return a==="assets"?t.filter((c,f)=>o(c,f)||l(c,f)):a==="data"?t.filter((c,f)=>{var d;let h=r.routes[c.route.id];if(!h||!h.hasLoader)return!1;if(o(c,f)||l(c,f))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function SQ(e,t,{includeHydrateFallback:n}={}){return EQ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function EQ(e){return[...new Set(e)]}function _Q(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function CQ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(_Q(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function w$(){let e=x.useContext(Od);return Xj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function jQ(){let e=x.useContext(Zx);return Xj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Gj=x.createContext(void 0);Gj.displayName="FrameworkContext";function S$(){let e=x.useContext(Gj);return Xj(e,"You must render this element inside a <HydratedRouter> element"),e}function AQ(e,t){let n=x.useContext(Gj),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:f,onMouseLeave:h,onTouchStart:d}=t,p=x.useRef(null);x.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=E=>{E.forEach(j=>{o(j.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return p.current&&S.observe(p.current),()=>{S.disconnect()}}},[e]),x.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let v=()=>{i(!0)},b=()=>{i(!1),o(!1)};return n?e!=="intent"?[a,p,{}]:[a,p,{onFocus:Bh(l,v),onBlur:Bh(c,b),onMouseEnter:Bh(f,v),onMouseLeave:Bh(h,b),onTouchStart:Bh(d,v)}]:[!1,p,{}]}function Bh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function OQ({page:e,...t}){let{router:n}=w$(),r=x.useMemo(()=>o$(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(NQ,{page:e,matches:r,...t}):null}function kQ(e){let{manifest:t,routeModules:n}=S$(),[r,i]=x.useState([]);return x.useEffect(()=>{let a=!1;return wQ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function NQ({page:e,matches:t,...n}){let r=Da(),{future:i,manifest:a,routeModules:o}=S$(),{basename:l}=w$(),{loaderData:c,matches:f}=jQ(),h=x.useMemo(()=>JM(e,t,f,a,r,"data"),[e,t,f,a,r]),d=x.useMemo(()=>JM(e,t,f,a,r,"assets"),[e,t,f,a,r]),p=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,S=!1;if(t.forEach(j=>{var O;let C=a.routes[j.route.id];!C||!C.hasLoader||(!h.some(N=>N.route.id===j.route.id)&&j.route.id in c&&((O=o[j.route.id])!=null&&O.shouldRevalidate)||C.hasClientLoader?S=!0:w.add(j.route.id))}),w.size===0)return[];let E=yQ(e,l,i.unstable_trailingSlashAwareDataRequests,"data");return S&&w.size>0&&E.searchParams.set("_routes",t.filter(j=>w.has(j.route.id)).map(j=>j.route.id).join(",")),[E.pathname+E.search]},[l,i.unstable_trailingSlashAwareDataRequests,c,r,a,h,t,e,o]),v=x.useMemo(()=>SQ(d,a),[d,a]),b=kQ(d);return x.createElement(x.Fragment,null,p.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:S})=>x.createElement("link",{key:w,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function TQ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var PQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{PQ&&(window.__reactRouterVersion="7.13.1")}catch{}function MQ({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=x.useRef();i.current==null&&(i.current=uW({window:r,v5Compat:!0}));let a=i.current,[o,l]=x.useState({action:a.action,location:a.location}),c=x.useCallback(f=>{n===!1?l(f):x.startTransition(()=>l(f))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(sQ,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}var E$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yr=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,unstable_mask:l,state:c,target:f,to:h,preventScrollReset:d,viewTransition:p,unstable_defaultShouldRevalidate:v,...b},w){let{basename:S,navigator:E,unstable_useTransitions:j}=x.useContext(sa),C=typeof h=="string"&&E$.test(h),O=d$(h,S);h=O.to;let N=UW(h,{relative:i}),k=Da(),T=null;if(l){let V=qj(l,[],k.unstable_mask?k.unstable_mask.pathname:"/",!0);S!=="/"&&(V.pathname=V.pathname==="/"?S:ro([S,V.pathname])),T=E.createHref(V)}let[M,I,L]=AQ(r,b),B=IQ(h,{replace:o,unstable_mask:l,state:c,target:f,preventScrollReset:d,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:v,unstable_useTransitions:j});function z(V){t&&t(V),V.defaultPrevented||B(V)}let G=!(O.isExternal||a),F=x.createElement("a",{...b,...L,href:(G?T:void 0)||O.absoluteURL||N,onClick:G?z:t,ref:TQ(w,I),target:f,"data-discover":!C&&n==="render"?"true":void 0});return M&&!C?x.createElement(x.Fragment,null,F,x.createElement(OQ,{page:N})):F});Yr.displayName="Link";var k_=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:l,children:c,...f},h){let d=gp(o,{relative:f.relative}),p=Da(),v=x.useContext(Zx),{navigator:b,basename:w}=x.useContext(sa),S=v!=null&&UQ(d)&&l===!0,E=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,j=p.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),C=C?C.toLowerCase():null,E=E.toLowerCase()),C&&w&&(C=rs(C,w)||C);const O=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let N=j===E||!i&&j.startsWith(E)&&j.charAt(O)==="/",k=C!=null&&(C===E||!i&&C.startsWith(E)&&C.charAt(E.length)==="/"),T={isActive:N,isPending:k,isTransitioning:S},M=N?t:void 0,I;typeof r=="function"?I=r(T):I=[r,N?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let L=typeof a=="function"?a(T):a;return x.createElement(Yr,{...f,"aria-current":M,className:I,ref:h,style:L,to:o,viewTransition:l},typeof c=="function"?c(T):c)});k_.displayName="NavLink";var DQ=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ly,action:l,onSubmit:c,relative:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:p,...v},b)=>{let{unstable_useTransitions:w}=x.useContext(sa),S=BQ(),E=FQ(l,{relative:f}),j=o.toLowerCase()==="get"?"get":"post",C=typeof l=="string"&&E$.test(l),O=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let k=N.nativeEvent.submitter,T=(k==null?void 0:k.getAttribute("formmethod"))||o,M=()=>S(k||N.currentTarget,{fetcherKey:t,method:T,navigate:n,replace:i,state:a,relative:f,preventScrollReset:h,viewTransition:d,unstable_defaultShouldRevalidate:p});w&&n!==!1?x.startTransition(()=>M()):M()};return x.createElement("form",{ref:b,method:j,action:E,onSubmit:r?c:O,...v,"data-discover":!C&&e==="render"?"true":void 0})});DQ.displayName="Form";function RQ(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function _$(e){let t=x.useContext(Od);return fn(t,RQ(e)),t}function IQ(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let h=Fl(),d=Da(),p=gp(e,{relative:o});return x.useCallback(v=>{if(hQ(v,t)){v.preventDefault();let b=n!==void 0?n:_m(d)===_m(p),w=()=>h(e,{replace:b,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?x.startTransition(()=>w()):w()}},[d,h,p,n,r,i,t,e,a,o,l,c,f])}function LQ(e){ka(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(O_(e)),n=x.useRef(!1),r=Da(),i=x.useMemo(()=>mQ(r.search,n.current?null:t.current),[r.search]),a=Fl(),o=x.useCallback((l,c)=>{const f=O_(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,a("?"+f,c)},[a,i]);return[i,o]}var zQ=0,$Q=()=>`__${String(++zQ)}__`;function BQ(){let{router:e}=_$("useSubmit"),{basename:t}=x.useContext(sa),n=nQ(),r=e.fetch,i=e.navigate;return x.useCallback(async(a,o={})=>{let{action:l,method:c,encType:f,formData:h,body:d}=vQ(a,t);if(o.navigate===!1){let p=o.fetcherKey||$Q();await r(p,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,flushSync:o.flushSync})}else await i(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:h,body:d,formMethod:o.method||c,formEncType:o.encType||f,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function FQ(e,{relative:t}={}){let{basename:n}=x.useContext(sa),r=x.useContext(Ma);fn(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...gp(e||".",{relative:t})},o=Da();if(e==null){a.search=o.search;let l=new URLSearchParams(a.search),c=l.getAll("index");if(c.some(h=>h==="")){l.delete("index"),c.filter(d=>d).forEach(d=>l.append("index",d));let h=l.toString();a.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:ro([n,a.pathname])),_m(a)}function UQ(e,{relative:t}={}){let n=x.useContext(m$);fn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=_$("useViewTransitionState"),i=gp(e,{relative:t});if(!n.isTransitioning)return!1;let a=rs(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=rs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Cm(i.pathname,o)!=null||Cm(i.pathname,a)!=null}var Ul=a$();const C$=zi(Ul);var bc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},HQ={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gl,Uj,Y5,qQ=(Y5=class{constructor(){Oe(this,gl,HQ);Oe(this,Uj,!1)}setTimeoutProvider(e){Ce(this,gl,e)}setTimeout(e,t){return W(this,gl).setTimeout(e,t)}clearTimeout(e){W(this,gl).clearTimeout(e)}setInterval(e,t){return W(this,gl).setInterval(e,t)}clearInterval(e){W(this,gl).clearInterval(e)}},gl=new WeakMap,Uj=new WeakMap,Y5),Mu=new qQ;function VQ(e){setTimeout(e,0)}var Zu=typeof window>"u"||"Deno"in globalThis;function Dr(){}function KQ(e,t){return typeof e=="function"?e(t):e}function N_(e){return typeof e=="number"&&e>=0&&e!==1/0}function j$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ol(e,t){return typeof e=="function"?e(t):e}function ta(e,t){return typeof e=="function"?e(t):e}function eD(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==Wj(o,t.options))return!1}else if(!jm(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||a&&!a(t))}function tD(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Ju(t.options.mutationKey)!==Ju(a))return!1}else if(!jm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Wj(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ju)(e)}function Ju(e){return JSON.stringify(e,(t,n)=>T_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function jm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>jm(e[n],t[n])):!1}var YQ=Object.prototype.hasOwnProperty;function Qj(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=nD(e)&&nD(t);if(!r&&!(T_(e)&&T_(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let f=0;for(let h=0;h<l;h++){const d=r?h:o[h],p=e[d],v=t[d];if(p===v){c[d]=p,(r?h<a:YQ.call(e,d))&&f++;continue}if(p===null||v===null||typeof p!="object"||typeof v!="object"){c[d]=v;continue}const b=Qj(p,v,n+1);c[d]=b,b===p&&f++}return a===l&&f===a?e:c}function Am(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T_(e){if(!rD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!rD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rD(e){return Object.prototype.toString.call(e)==="[object Object]"}function XQ(e){return new Promise(t=>{Mu.setTimeout(t,e)})}function P_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Qj(e,t):t}function GQ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function WQ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Zj=Symbol();function A$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Zj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Jj(e,t){return typeof e=="function"?e(...t):!!e}function QQ(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var zu,vl,qf,X5,ZQ=(X5=class extends bc{constructor(){super();Oe(this,zu);Oe(this,vl);Oe(this,qf);Ce(this,qf,t=>{if(!Zu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,vl)||this.setEventListener(W(this,qf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,vl))==null||t.call(this),Ce(this,vl,void 0))}setEventListener(t){var n;Ce(this,qf,t),(n=W(this,vl))==null||n.call(this),Ce(this,vl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,zu)!==t&&(Ce(this,zu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,zu)=="boolean"?W(this,zu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},zu=new WeakMap,vl=new WeakMap,qf=new WeakMap,X5),eA=new ZQ;function M_(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var JQ=VQ;function eZ(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=JQ;const a=l=>{t?e.push(l):i(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var An=eZ(),Vf,yl,Kf,G5,tZ=(G5=class extends bc{constructor(){super();Oe(this,Vf,!0);Oe(this,yl);Oe(this,Kf);Ce(this,Kf,t=>{if(!Zu&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,yl)||this.setEventListener(W(this,Kf))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,yl))==null||t.call(this),Ce(this,yl,void 0))}setEventListener(t){var n;Ce(this,Kf,t),(n=W(this,yl))==null||n.call(this),Ce(this,yl,t(this.setOnline.bind(this)))}setOnline(t){W(this,Vf)!==t&&(Ce(this,Vf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Vf)}},Vf=new WeakMap,yl=new WeakMap,Kf=new WeakMap,G5),Oy=new tZ;function nZ(e){return Math.min(1e3*2**e,3e4)}function O$(e){return(e??"online")==="online"?Oy.isOnline():!0}var D_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function k$(e){let t=!1,n=0,r;const i=M_(),a=()=>i.status!=="pending",o=w=>{var S;if(!a()){const E=new D_(w);p(E),(S=e.onCancel)==null||S.call(e,E)}},l=()=>{t=!0},c=()=>{t=!1},f=()=>eA.isFocused()&&(e.networkMode==="always"||Oy.isOnline())&&e.canRun(),h=()=>O$(e.networkMode)&&e.canRun(),d=w=>{a()||(r==null||r(),i.resolve(w))},p=w=>{a()||(r==null||r(),i.reject(w))},v=()=>new Promise(w=>{var S;r=E=>{(a()||f())&&w(E)},(S=e.onPause)==null||S.call(e)}).then(()=>{var w;r=void 0,a()||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(a())return;let w;const S=n===0?e.initialPromise:void 0;try{w=S??e.fn()}catch(E){w=Promise.reject(E)}Promise.resolve(w).then(d).catch(E=>{var k;if(a())return;const j=e.retry??(Zu?0:3),C=e.retryDelay??nZ,O=typeof C=="function"?C(n,E):C,N=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,E);if(t||!N){p(E);return}n++,(k=e.onFail)==null||k.call(e,n,E),XQ(O).then(()=>f()?void 0:v()).then(()=>{t?p(E):b()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:l,continueRetry:c,canStart:h,start:()=>(h()?b():v().then(b),i)}}var $u,W5,N$=(W5=class{constructor(){Oe(this,$u)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N_(this.gcTime)&&Ce(this,$u,Mu.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Zu?1/0:300*1e3))}clearGcTimeout(){W(this,$u)&&(Mu.clearTimeout(W(this,$u)),Ce(this,$u,void 0))}},$u=new WeakMap,W5),Bu,Yf,Ji,Fu,hr,op,Uu,xa,Uo,Q5,rZ=(Q5=class extends N${constructor(t){super();Oe(this,xa);Oe(this,Bu);Oe(this,Yf);Oe(this,Ji);Oe(this,Fu);Oe(this,hr);Oe(this,op);Oe(this,Uu);Ce(this,Uu,!1),Ce(this,op,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,Fu,t.client),Ce(this,Ji,W(this,Fu).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,Bu,aD(this.options)),this.state=t.state??W(this,Bu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,hr))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,op),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=aD(this.options);n.data!==void 0&&(this.setState(iD(n.data,n.dataUpdatedAt)),Ce(this,Bu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,Ji).remove(this)}setData(t,n){const r=P_(this.state.data,t,this.options);return We(this,xa,Uo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){We(this,xa,Uo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=W(this,hr))==null?void 0:r.promise;return(i=W(this,hr))==null||i.cancel(t),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Bu))}isActive(){return this.observers.some(t=>ta(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ol(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!j$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,hr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,hr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,Ji).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,hr)&&(W(this,Uu)?W(this,hr).cancel({revert:!0}):W(this,hr).cancelRetry()),this.scheduleGc()),W(this,Ji).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,xa,Uo).call(this,{type:"invalidate"})}async fetch(t,n){var c,f,h,d,p,v,b,w,S,E,j,C;if(this.state.fetchStatus!=="idle"&&((c=W(this,hr))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,hr))return W(this,hr).continueRetry(),W(this,hr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const O=this.observers.find(N=>N.options.queryFn);O&&this.setOptions(O.options)}const r=new AbortController,i=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(Ce(this,Uu,!0),r.signal)})},a=()=>{const O=A$(this.options,n),k=(()=>{const T={client:W(this,Fu),queryKey:this.queryKey,meta:this.meta};return i(T),T})();return Ce(this,Uu,!1),this.options.persister?this.options.persister(O,k,this):O(k)},l=(()=>{const O={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,Fu),state:this.state,fetchFn:a};return i(O),O})();(f=this.options.behavior)==null||f.onFetch(l,this),Ce(this,Yf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&We(this,xa,Uo).call(this,{type:"fetch",meta:(d=l.fetchOptions)==null?void 0:d.meta}),Ce(this,hr,k$({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:O=>{O instanceof D_&&O.revert&&this.setState({...W(this,Yf),fetchStatus:"idle"}),r.abort()},onFail:(O,N)=>{We(this,xa,Uo).call(this,{type:"failed",failureCount:O,error:N})},onPause:()=>{We(this,xa,Uo).call(this,{type:"pause"})},onContinue:()=>{We(this,xa,Uo).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const O=await W(this,hr).start();if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(v=(p=W(this,Ji).config).onSuccess)==null||v.call(p,O,this),(w=(b=W(this,Ji).config).onSettled)==null||w.call(b,O,this.state.error,this),O}catch(O){if(O instanceof D_){if(O.silent)return W(this,hr).promise;if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw We(this,xa,Uo).call(this,{type:"error",error:O}),(E=(S=W(this,Ji).config).onError)==null||E.call(S,O,this),(C=(j=W(this,Ji).config).onSettled)==null||C.call(j,this.state.data,O,this),O}finally{this.scheduleGc()}}},Bu=new WeakMap,Yf=new WeakMap,Ji=new WeakMap,Fu=new WeakMap,hr=new WeakMap,op=new WeakMap,Uu=new WeakMap,xa=new WeakSet,Uo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...T$(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...iD(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Yf,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,Ji).notify({query:this,type:"updated",action:t})})},Q5);function T$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function iD(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function aD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var si,yt,sp,qr,Hu,Xf,qo,xl,lp,Gf,Wf,qu,Vu,bl,Qf,Dt,cm,R_,I_,L_,z_,$_,B_,F_,P$,Z5,t0=(Z5=class extends bc{constructor(t,n){super();Oe(this,Dt);Oe(this,si);Oe(this,yt);Oe(this,sp);Oe(this,qr);Oe(this,Hu);Oe(this,Xf);Oe(this,qo);Oe(this,xl);Oe(this,lp);Oe(this,Gf);Oe(this,Wf);Oe(this,qu);Oe(this,Vu);Oe(this,bl);Oe(this,Qf,new Set);this.options=n,Ce(this,si,t),Ce(this,xl,null),Ce(this,qo,M_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,yt).addObserver(this),oD(W(this,yt),this.options)?We(this,Dt,cm).call(this):this.updateResult(),We(this,Dt,z_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return U_(W(this,yt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return U_(W(this,yt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,Dt,$_).call(this),We(this,Dt,B_).call(this),W(this,yt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,yt);if(this.options=W(this,si).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ta(this.options.enabled,W(this,yt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,Dt,F_).call(this),W(this,yt).setOptions(this.options),n._defaulted&&!Am(this.options,n)&&W(this,si).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,yt),observer:this});const i=this.hasListeners();i&&sD(W(this,yt),r,this.options,n)&&We(this,Dt,cm).call(this),this.updateResult(),i&&(W(this,yt)!==r||ta(this.options.enabled,W(this,yt))!==ta(n.enabled,W(this,yt))||Ol(this.options.staleTime,W(this,yt))!==Ol(n.staleTime,W(this,yt)))&&We(this,Dt,R_).call(this);const a=We(this,Dt,I_).call(this);i&&(W(this,yt)!==r||ta(this.options.enabled,W(this,yt))!==ta(n.enabled,W(this,yt))||a!==W(this,bl))&&We(this,Dt,L_).call(this,a)}getOptimisticResult(t){const n=W(this,si).getQueryCache().build(W(this,si),t),r=this.createResult(n,t);return aZ(this,r)&&(Ce(this,qr,r),Ce(this,Xf,this.options),Ce(this,Hu,W(this,yt).state)),r}getCurrentResult(){return W(this,qr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,qo).status==="pending"&&W(this,qo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Qf).add(t)}getCurrentQuery(){return W(this,yt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,si).defaultQueryOptions(t),r=W(this,si).getQueryCache().build(W(this,si),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return We(this,Dt,cm).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,qr)))}createResult(t,n){var I;const r=W(this,yt),i=this.options,a=W(this,qr),o=W(this,Hu),l=W(this,Xf),f=t!==r?t.state:W(this,sp),{state:h}=t;let d={...h},p=!1,v;if(n._optimisticResults){const L=this.hasListeners(),B=!L&&oD(t,n),z=L&&sD(t,r,n,i);(B||z)&&(d={...d,...T$(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=d;v=d.data;let E=!1;if(n.placeholderData!==void 0&&v===void 0&&S==="pending"){let L;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(L=a.data,E=!0):L=typeof n.placeholderData=="function"?n.placeholderData((I=W(this,Wf))==null?void 0:I.state.data,W(this,Wf)):n.placeholderData,L!==void 0&&(S="success",v=P_(a==null?void 0:a.data,L,n),p=!0)}if(n.select&&v!==void 0&&!E)if(a&&v===(o==null?void 0:o.data)&&n.select===W(this,lp))v=W(this,Gf);else try{Ce(this,lp,n.select),v=n.select(v),v=P_(a==null?void 0:a.data,v,n),Ce(this,Gf,v),Ce(this,xl,null)}catch(L){Ce(this,xl,L)}W(this,xl)&&(b=W(this,xl),v=W(this,Gf),w=Date.now(),S="error");const j=d.fetchStatus==="fetching",C=S==="pending",O=S==="error",N=C&&j,k=v!==void 0,M={status:S,fetchStatus:d.fetchStatus,isPending:C,isSuccess:S==="success",isError:O,isInitialLoading:N,isLoading:N,data:v,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!C,isLoadingError:O&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:O&&k,isStale:tA(t,n),refetch:this.refetch,promise:W(this,qo),isEnabled:ta(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const L=M.data!==void 0,B=M.status==="error"&&!L,z=V=>{B?V.reject(M.error):L&&V.resolve(M.data)},G=()=>{const V=Ce(this,qo,M.promise=M_());z(V)},F=W(this,qo);switch(F.status){case"pending":t.queryHash===r.queryHash&&z(F);break;case"fulfilled":(B||M.data!==F.value)&&G();break;case"rejected":(!B||M.error!==F.reason)&&G();break}}return M}updateResult(){const t=W(this,qr),n=this.createResult(W(this,yt),this.options);if(Ce(this,Hu,W(this,yt).state),Ce(this,Xf,this.options),W(this,Hu).data!==void 0&&Ce(this,Wf,W(this,yt)),Am(n,t))return;Ce(this,qr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!W(this,Qf).size)return!0;const o=new Set(a??W(this,Qf));return this.options.throwOnError&&o.add("error"),Object.keys(W(this,qr)).some(l=>{const c=l;return W(this,qr)[c]!==t[c]&&o.has(c)})};We(this,Dt,P$).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,Dt,z_).call(this)}},si=new WeakMap,yt=new WeakMap,sp=new WeakMap,qr=new WeakMap,Hu=new WeakMap,Xf=new WeakMap,qo=new WeakMap,xl=new WeakMap,lp=new WeakMap,Gf=new WeakMap,Wf=new WeakMap,qu=new WeakMap,Vu=new WeakMap,bl=new WeakMap,Qf=new WeakMap,Dt=new WeakSet,cm=function(t){We(this,Dt,F_).call(this);let n=W(this,yt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Dr)),n},R_=function(){We(this,Dt,$_).call(this);const t=Ol(this.options.staleTime,W(this,yt));if(Zu||W(this,qr).isStale||!N_(t))return;const r=j$(W(this,qr).dataUpdatedAt,t)+1;Ce(this,qu,Mu.setTimeout(()=>{W(this,qr).isStale||this.updateResult()},r))},I_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,yt)):this.options.refetchInterval)??!1},L_=function(t){We(this,Dt,B_).call(this),Ce(this,bl,t),!(Zu||ta(this.options.enabled,W(this,yt))===!1||!N_(W(this,bl))||W(this,bl)===0)&&Ce(this,Vu,Mu.setInterval(()=>{(this.options.refetchIntervalInBackground||eA.isFocused())&&We(this,Dt,cm).call(this)},W(this,bl)))},z_=function(){We(this,Dt,R_).call(this),We(this,Dt,L_).call(this,We(this,Dt,I_).call(this))},$_=function(){W(this,qu)&&(Mu.clearTimeout(W(this,qu)),Ce(this,qu,void 0))},B_=function(){W(this,Vu)&&(Mu.clearInterval(W(this,Vu)),Ce(this,Vu,void 0))},F_=function(){const t=W(this,si).getQueryCache().build(W(this,si),this.options);if(t===W(this,yt))return;const n=W(this,yt);Ce(this,yt,t),Ce(this,sp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},P$=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,qr))}),W(this,si).getQueryCache().notify({query:W(this,yt),type:"observerResultsUpdated"})})},Z5);function iZ(e,t){return ta(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function oD(e,t){return iZ(e,t)||e.state.data!==void 0&&U_(e,t,t.refetchOnMount)}function U_(e,t,n){if(ta(t.enabled,e)!==!1&&Ol(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&tA(e,t)}return!1}function sD(e,t,n,r){return(e!==t||ta(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&tA(e,n)}function tA(e,t){return ta(t.enabled,e)!==!1&&e.isStaleByTime(Ol(t.staleTime,e))}function aZ(e,t){return!Am(e.getCurrentResult(),t)}function ky(e){return{onFetch:(t,n)=>{var h,d,p,v,b;const r=t.options,i=(p=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,a=((v=t.state.data)==null?void 0:v.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const f=async()=>{let w=!1;const S=C=>{QQ(C,()=>t.signal,()=>w=!0)},E=A$(t.options,t.fetchOptions),j=async(C,O,N)=>{if(w)return Promise.reject();if(O==null&&C.pages.length)return Promise.resolve(C);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:O,direction:N?"backward":"forward",meta:t.options.meta};return S(B),B})(),M=await E(T),{maxPages:I}=t.options,L=N?WQ:GQ;return{pages:L(C.pages,M,I),pageParams:L(C.pageParams,O,I)}};if(i&&a.length){const C=i==="backward",O=C?M$:H_,N={pages:a,pageParams:o},k=O(r,N);l=await j(N,k,C)}else{const C=e??a.length;do{const O=c===0?o[0]??r.initialPageParam:H_(r,l);if(c>0&&O==null)break;l=await j(l,O),c++}while(c<C)}return l};t.options.persister?t.fetchFn=()=>{var w,S;return(S=(w=t.options).persister)==null?void 0:S.call(w,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function H_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function M$(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function oZ(e,t){return t?H_(e,t)!=null:!1}function sZ(e,t){return!t||!e.getPreviousPageParam?!1:M$(e,t)!=null}var lZ=class extends t0{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:ky()})}getOptimisticResult(e){return e.behavior=ky(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var b,w;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:l}=r,c=(w=(b=n.fetchMeta)==null?void 0:b.fetchMore)==null?void 0:w.direction,f=o&&c==="forward",h=i&&c==="forward",d=o&&c==="backward",p=i&&c==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:oZ(t,n.data),hasPreviousPage:sZ(t,n.data),isFetchNextPageError:f,isFetchingNextPage:h,isFetchPreviousPageError:d,isFetchingPreviousPage:p,isRefetchError:l&&!f&&!d,isRefetching:a&&!h&&!p}}},up,Ga,Pr,Ku,Wa,ul,J5,uZ=(J5=class extends N${constructor(t){super();Oe(this,Wa);Oe(this,up);Oe(this,Ga);Oe(this,Pr);Oe(this,Ku);Ce(this,up,t.client),this.mutationId=t.mutationId,Ce(this,Pr,t.mutationCache),Ce(this,Ga,[]),this.state=t.state||D$(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Ga).includes(t)||(W(this,Ga).push(t),this.clearGcTimeout(),W(this,Pr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Ga,W(this,Ga).filter(n=>n!==t)),this.scheduleGc(),W(this,Pr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Ga).length||(this.state.status==="pending"?this.scheduleGc():W(this,Pr).remove(this))}continue(){var t;return((t=W(this,Ku))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,l,c,f,h,d,p,v,b,w,S,E,j,C,O,N,k,T;const n=()=>{We(this,Wa,ul).call(this,{type:"continue"})},r={client:W(this,up),meta:this.options.meta,mutationKey:this.options.mutationKey};Ce(this,Ku,k$({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{We(this,Wa,ul).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{We(this,Wa,ul).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Pr).canRun(this)}));const i=this.state.status==="pending",a=!W(this,Ku).canStart();try{if(i)n();else{We(this,Wa,ul).call(this,{type:"pending",variables:t,isPaused:a}),W(this,Pr).config.onMutate&&await W(this,Pr).config.onMutate(t,this,r);const I=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t,r));I!==this.state.context&&We(this,Wa,ul).call(this,{type:"pending",context:I,variables:t,isPaused:a})}const M=await W(this,Ku).start();return await((f=(c=W(this,Pr).config).onSuccess)==null?void 0:f.call(c,M,t,this.state.context,this,r)),await((d=(h=this.options).onSuccess)==null?void 0:d.call(h,M,t,this.state.context,r)),await((v=(p=W(this,Pr).config).onSettled)==null?void 0:v.call(p,M,null,this.state.variables,this.state.context,this,r)),await((w=(b=this.options).onSettled)==null?void 0:w.call(b,M,null,t,this.state.context,r)),We(this,Wa,ul).call(this,{type:"success",data:M}),M}catch(M){try{await((E=(S=W(this,Pr).config).onError)==null?void 0:E.call(S,M,t,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((C=(j=this.options).onError)==null?void 0:C.call(j,M,t,this.state.context,r))}catch(I){Promise.reject(I)}try{await((N=(O=W(this,Pr).config).onSettled)==null?void 0:N.call(O,void 0,M,this.state.variables,this.state.context,this,r))}catch(I){Promise.reject(I)}try{await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,M,t,this.state.context,r))}catch(I){Promise.reject(I)}throw We(this,Wa,ul).call(this,{type:"error",error:M}),M}finally{W(this,Pr).runNext(this)}}},up=new WeakMap,Ga=new WeakMap,Pr=new WeakMap,Ku=new WeakMap,Wa=new WeakSet,ul=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{W(this,Ga).forEach(r=>{r.onMutationUpdate(t)}),W(this,Pr).notify({mutation:this,type:"updated",action:t})})},J5);function D$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vo,ba,cp,e$,cZ=(e$=class extends bc{constructor(t={}){super();Oe(this,Vo);Oe(this,ba);Oe(this,cp);this.config=t,Ce(this,Vo,new Set),Ce(this,ba,new Map),Ce(this,cp,0)}build(t,n,r){const i=new uZ({client:t,mutationCache:this,mutationId:++Sv(this,cp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,Vo).add(t);const n=_v(t);if(typeof n=="string"){const r=W(this,ba).get(n);r?r.push(t):W(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Vo).delete(t)){const n=_v(t);if(typeof n=="string"){const r=W(this,ba).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=_v(t);if(typeof n=="string"){const r=W(this,ba).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=_v(t);if(typeof n=="string"){const i=(r=W(this,ba).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{W(this,Vo).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Vo).clear(),W(this,ba).clear()})}getAll(){return Array.from(W(this,Vo))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>tD(n,r))}findAll(t={}){return this.getAll().filter(n=>tD(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dr))))}},Vo=new WeakMap,ba=new WeakMap,cp=new WeakMap,e$);function _v(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ko,wl,li,Yo,ns,cy,q_,t$,fZ=(t$=class extends bc{constructor(n,r){super();Oe(this,ns);Oe(this,Ko);Oe(this,wl);Oe(this,li);Oe(this,Yo);Ce(this,Ko,n),this.setOptions(r),this.bindMethods(),We(this,ns,cy).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,Ko).defaultMutationOptions(n),Am(this.options,r)||W(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,li),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ju(r.mutationKey)!==Ju(this.options.mutationKey)?this.reset():((i=W(this,li))==null?void 0:i.state.status)==="pending"&&W(this,li).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,li))==null||n.removeObserver(this)}onMutationUpdate(n){We(this,ns,cy).call(this),We(this,ns,q_).call(this,n)}getCurrentResult(){return W(this,wl)}reset(){var n;(n=W(this,li))==null||n.removeObserver(this),Ce(this,li,void 0),We(this,ns,cy).call(this),We(this,ns,q_).call(this)}mutate(n,r){var i;return Ce(this,Yo,r),(i=W(this,li))==null||i.removeObserver(this),Ce(this,li,W(this,Ko).getMutationCache().build(W(this,Ko),this.options)),W(this,li).addObserver(this),W(this,li).execute(n)}},Ko=new WeakMap,wl=new WeakMap,li=new WeakMap,Yo=new WeakMap,ns=new WeakSet,cy=function(){var r;const n=((r=W(this,li))==null?void 0:r.state)??D$();Ce(this,wl,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},q_=function(n){An.batch(()=>{var r,i,a,o,l,c,f,h;if(W(this,Yo)&&this.hasListeners()){const d=W(this,wl).variables,p=W(this,wl).context,v={client:W(this,Ko),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,Yo)).onSuccess)==null||i.call(r,n.data,d,p,v)}catch(b){Promise.reject(b)}try{(o=(a=W(this,Yo)).onSettled)==null||o.call(a,n.data,null,d,p,v)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=W(this,Yo)).onError)==null||c.call(l,n.error,d,p,v)}catch(b){Promise.reject(b)}try{(h=(f=W(this,Yo)).onSettled)==null||h.call(f,void 0,n.error,d,p,v)}catch(b){Promise.reject(b)}}}this.listeners.forEach(d=>{d(W(this,wl))})})},t$);function lD(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function dZ(e,t,n){const r=e.slice(0);return r[t]=n,r}var Zf,_i,Jf,ed,ea,Sl,fp,dp,hp,mp,Ar,V_,K_,Y_,X_,G_,n$,hZ=(n$=class extends bc{constructor(t,n,r){super();Oe(this,Ar);Oe(this,Zf);Oe(this,_i);Oe(this,Jf);Oe(this,ed);Oe(this,ea);Oe(this,Sl);Oe(this,fp);Oe(this,dp);Oe(this,hp);Oe(this,mp,[]);Ce(this,Zf,t),Ce(this,ed,r),Ce(this,Jf,[]),Ce(this,ea,[]),Ce(this,_i,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&W(this,ea).forEach(t=>{t.subscribe(n=>{We(this,Ar,X_).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,W(this,ea).forEach(t=>{t.destroy()})}setQueries(t,n){Ce(this,Jf,t),Ce(this,ed,n),An.batch(()=>{const r=W(this,ea),i=We(this,Ar,Y_).call(this,W(this,Jf));i.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const a=i.map(d=>d.observer),o=a.map(d=>d.getCurrentResult()),l=r.length!==a.length,c=a.some((d,p)=>d!==r[p]),f=l||c,h=f?!0:o.some((d,p)=>{const v=W(this,_i)[p];return!v||!Am(d,v)});!f&&!h||(f&&(Ce(this,mp,i),Ce(this,ea,a)),Ce(this,_i,o),this.hasListeners()&&(f&&(lD(r,a).forEach(d=>{d.destroy()}),lD(a,r).forEach(d=>{d.subscribe(p=>{We(this,Ar,X_).call(this,d,p)})})),We(this,Ar,G_).call(this)))})}getCurrentResult(){return W(this,_i)}getQueries(){return W(this,ea).map(t=>t.getCurrentQuery())}getObservers(){return W(this,ea)}getOptimisticResult(t,n){const r=We(this,Ar,Y_).call(this,t),i=r.map(o=>o.observer.getOptimisticResult(o.defaultedQueryOptions)),a=r.map(o=>o.defaultedQueryOptions.queryHash);return[i,o=>We(this,Ar,K_).call(this,o??i,n,a),()=>We(this,Ar,V_).call(this,i,r)]}},Zf=new WeakMap,_i=new WeakMap,Jf=new WeakMap,ed=new WeakMap,ea=new WeakMap,Sl=new WeakMap,fp=new WeakMap,dp=new WeakMap,hp=new WeakMap,mp=new WeakMap,Ar=new WeakSet,V_=function(t,n){return n.map((r,i)=>{const a=t[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,o=>{n.forEach(l=>{l.observer.trackProp(o)})})})},K_=function(t,n,r){if(n){const i=W(this,hp),a=r!==void 0&&i!==void 0&&(i.length!==r.length||r.some((o,l)=>o!==i[l]));return(!W(this,Sl)||W(this,_i)!==W(this,dp)||a||n!==W(this,fp))&&(Ce(this,fp,n),Ce(this,dp,W(this,_i)),r!==void 0&&Ce(this,hp,r),Ce(this,Sl,Qj(W(this,Sl),n(t)))),W(this,Sl)}return t},Y_=function(t){const n=new Map;W(this,ea).forEach(i=>{const a=i.options.queryHash;if(!a)return;const o=n.get(a);o?o.push(i):n.set(a,[i])});const r=[];return t.forEach(i=>{var c;const a=W(this,Zf).defaultQueryOptions(i),l=((c=n.get(a.queryHash))==null?void 0:c.shift())??new t0(W(this,Zf),a);r.push({defaultedQueryOptions:a,observer:l})}),r},X_=function(t,n){const r=W(this,ea).indexOf(t);r!==-1&&(Ce(this,_i,dZ(W(this,_i),r,n)),We(this,Ar,G_).call(this))},G_=function(){var t;if(this.hasListeners()){const n=W(this,Sl),r=We(this,Ar,V_).call(this,W(this,_i),W(this,mp)),i=We(this,Ar,K_).call(this,r,(t=W(this,ed))==null?void 0:t.combine);n!==i&&An.batch(()=>{this.listeners.forEach(a=>{a(W(this,_i))})})}},n$),Qa,r$,mZ=(r$=class extends bc{constructor(t={}){super();Oe(this,Qa);this.config=t,Ce(this,Qa,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??Wj(i,n);let o=this.get(a);return o||(o=new rZ({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){W(this,Qa).has(t.queryHash)||(W(this,Qa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Qa).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Qa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Qa).get(t)}getAll(){return[...W(this,Qa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>eD(t,r)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qa=new WeakMap,r$),_n,El,_l,td,nd,Cl,rd,id,i$,pZ=(i$=class{constructor(e={}){Oe(this,_n);Oe(this,El);Oe(this,_l);Oe(this,td);Oe(this,nd);Oe(this,Cl);Oe(this,rd);Oe(this,id);Ce(this,_n,e.queryCache||new mZ),Ce(this,El,e.mutationCache||new cZ),Ce(this,_l,e.defaultOptions||{}),Ce(this,td,new Map),Ce(this,nd,new Map),Ce(this,Cl,0)}mount(){Sv(this,Cl)._++,W(this,Cl)===1&&(Ce(this,rd,eA.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,_n).onFocus())})),Ce(this,id,Oy.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,_n).onOnline())})))}unmount(){var e,t;Sv(this,Cl)._--,W(this,Cl)===0&&((e=W(this,rd))==null||e.call(this),Ce(this,rd,void 0),(t=W(this,id))==null||t.call(this),Ce(this,id,void 0))}isFetching(e){return W(this,_n).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,El).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,_n).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,_n).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ol(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,_n).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=W(this,_n).get(r.queryHash),a=i==null?void 0:i.state.data,o=KQ(t,a);if(o!==void 0)return W(this,_n).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>W(this,_n).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,_n).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,_n);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,_n);return An.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=An.batch(()=>W(this,_n).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Dr).catch(Dr)}invalidateQueries(e,t={}){return An.batch(()=>(W(this,_n).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=An.batch(()=>W(this,_n).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Dr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Dr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,_n).build(this,t);return n.isStaleByTime(Ol(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dr).catch(Dr)}fetchInfiniteQuery(e){return e.behavior=ky(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dr).catch(Dr)}ensureInfiniteQueryData(e){return e.behavior=ky(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Oy.isOnline()?W(this,El).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,_n)}getMutationCache(){return W(this,El)}getDefaultOptions(){return W(this,_l)}setDefaultOptions(e){Ce(this,_l,e)}setQueryDefaults(e,t){W(this,td).set(Ju(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,td).values()],n={};return t.forEach(r=>{jm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,nd).set(Ju(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,nd).values()],n={};return t.forEach(r=>{jm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,_l).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wj(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Zj&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,_l).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,_n).clear(),W(this,El).clear()}},_n=new WeakMap,El=new WeakMap,_l=new WeakMap,td=new WeakMap,nd=new WeakMap,Cl=new WeakMap,rd=new WeakMap,id=new WeakMap,i$),R$=x.createContext(void 0),_t=e=>{const t=x.useContext(R$);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gZ=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(R$.Provider,{value:e,children:t})),I$=x.createContext(!1),L$=()=>x.useContext(I$);I$.Provider;function vZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var yZ=x.createContext(vZ()),z$=()=>x.useContext(yZ),$$=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Jj(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},B$=e=>{x.useEffect(()=>{e.clearReset()},[e])},F$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Jj(n,[e.error,r])),U$=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},xZ=(e,t)=>e.isLoading&&e.isFetching&&!t,W_=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Q_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function bZ({queries:e,...t},n){const r=_t(),i=L$(),a=z$(),o=x.useMemo(()=>e.map(w=>{const S=r.defaultQueryOptions(w);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);o.forEach(w=>{U$(w);const S=r.getQueryCache().get(w.queryHash);$$(w,a,S)}),B$(a);const[l]=x.useState(()=>new hZ(r,o,t)),[c,f,h]=l.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(w=>d?l.subscribe(An.batchCalls(w)):Dr,[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setQueries(o,t)},[o,t,l]);const v=c.some((w,S)=>W_(o[S],w))?c.flatMap((w,S)=>{const E=o[S];if(E&&W_(E,w)){const j=new t0(r,E);return Q_(E,j,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const b=c.find((w,S)=>{const E=o[S];return E&&F$({result:w,errorResetBoundary:a,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(b!=null&&b.error)throw b.error;return f(h())}function H$(e,t,n){var p,v,b,w;const r=L$(),i=z$(),a=_t(),o=a.defaultQueryOptions(e);(v=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||v.call(p,o);const l=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",U$(o),$$(o,i,l),B$(i);const c=!a.getQueryCache().get(o.queryHash),[f]=x.useState(()=>new t(a,o)),h=f.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(S=>{const E=d?f.subscribe(An.batchCalls(S)):Dr;return f.updateResult(),E},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),W_(o,h))throw Q_(o,f,i);if(F$({result:h,errorResetBoundary:i,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw h.error;if((w=(b=a.getDefaultOptions().queries)==null?void 0:b._experimental_afterQuery)==null||w.call(b,o,h),o.experimental_prefetchInRender&&!Zu&&xZ(h,r)){const S=c?Q_(o,f,i):l==null?void 0:l.promise;S==null||S.catch(Dr).finally(()=>{f.updateResult()})}return o.notifyOnChangeProps?h:f.trackResult(h)}function Yn(e,t){return H$(e,t0)}function Qt(e,t){const n=_t(),[r]=x.useState(()=>new fZ(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(An.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,l)=>{r.mutate(o,l).catch(Dr)},[r]);if(i.error&&Jj(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function wZ(e,t){return H$(e,lZ)}var SZ=(e,t,n,r,i,a,o,l)=>{let c=document.documentElement,f=["light","dark"];function h(v){(Array.isArray(e)?e:[e]).forEach(b=>{let w=b==="class",S=w&&a?i.map(E=>a[E]||E):i;w?(c.classList.remove(...S),c.classList.add(a&&a[v]?a[v]:v)):c.setAttribute(b,v)}),d(v)}function d(v){l&&f.includes(v)&&(c.style.colorScheme=v)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)h(r);else try{let v=localStorage.getItem(t)||n,b=o&&v==="system"?p():v;h(b)}catch{}},uD=["light","dark"],q$="(prefers-color-scheme: dark)",EZ=typeof window>"u",nA=x.createContext(void 0),_Z={setTheme:e=>{},themes:[]},rA=()=>{var e;return(e=x.useContext(nA))!=null?e:_Z},CZ=e=>x.useContext(nA)?x.createElement(x.Fragment,null,e.children):x.createElement(AZ,{...e}),jZ=["light","dark"],AZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i="theme",themes:a=jZ,defaultTheme:o=n?"system":"light",attribute:l="data-theme",value:c,children:f,nonce:h,scriptProps:d})=>{let[p,v]=x.useState(()=>kZ(i,o)),[b,w]=x.useState(()=>p==="system"?nS():p),S=c?Object.values(c):a,E=x.useCallback(N=>{let k=N;if(!k)return;N==="system"&&n&&(k=nS());let T=c?c[k]:k,M=t?NZ(h):null,I=document.documentElement,L=B=>{B==="class"?(I.classList.remove(...S),T&&I.classList.add(T)):B.startsWith("data-")&&(T?I.setAttribute(B,T):I.removeAttribute(B))};if(Array.isArray(l)?l.forEach(L):L(l),r){let B=uD.includes(o)?o:null,z=uD.includes(k)?k:B;I.style.colorScheme=z}M==null||M()},[h]),j=x.useCallback(N=>{let k=typeof N=="function"?N(p):N;v(k);try{localStorage.setItem(i,k)}catch{}},[p]),C=x.useCallback(N=>{let k=nS(N);w(k),p==="system"&&n&&!e&&E("system")},[p,e]);x.useEffect(()=>{let N=window.matchMedia(q$);return N.addListener(C),C(N),()=>N.removeListener(C)},[C]),x.useEffect(()=>{let N=k=>{k.key===i&&(k.newValue?v(k.newValue):j(o))};return window.addEventListener("storage",N),()=>window.removeEventListener("storage",N)},[j]),x.useEffect(()=>{E(e??p)},[e,p]);let O=x.useMemo(()=>({theme:p,setTheme:j,forcedTheme:e,resolvedTheme:p==="system"?b:p,themes:n?[...a,"system"]:a,systemTheme:n?b:void 0}),[p,j,e,b,n,a]);return x.createElement(nA.Provider,{value:O},x.createElement(OZ,{forcedTheme:e,storageKey:i,attribute:l,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:h,scriptProps:d}),f)},OZ=x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:l,nonce:c,scriptProps:f})=>{let h=JSON.stringify([n,t,a,e,l,o,r,i]).slice(1,-1);return x.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${SZ.toString()})(${h})`}})}),kZ=(e,t)=>{if(EZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},NZ=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},nS=e=>(e||(e=window.matchMedia(q$)),e.matches?"dark":"light");function cD(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function is(...e){return t=>{let n=!1;const r=e.map(i=>{const a=cD(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():cD(e[i],null)}}}}function gt(...e){return x.useCallback(is(...e),e)}function ec(e){const t=TZ(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,l=x.Children.toArray(a),c=l.find(MZ);if(c){const f=c.props.children,h=l.map(d=>d===c?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:d);return g.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,h):null})}return g.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var iA=ec("Slot");function TZ(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=RZ(i),l=DZ(a,i.props);return i.type!==x.Fragment&&(l.ref=r?is(r,o):o),x.cloneElement(i,l)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V$=Symbol("radix.slottable");function PZ(e){const t=({children:n})=>g.jsx(g.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=V$,t}function MZ(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V$}function DZ(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function RZ(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var IZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=IZ.reduce((e,t)=>{const n=ec(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function K$(e,t){e&&Ul.flushSync(()=>e.dispatchEvent(t))}var Y$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),LZ="VisuallyHidden",X$=x.forwardRef((e,t)=>g.jsx(Be.span,{...e,ref:t,style:{...Y$,...e.style}}));X$.displayName=LZ;var zZ=X$;function $Z(e,t){const n=x.createContext(t),r=a=>{const{children:o,...l}=a,c=x.useMemo(()=>l,Object.values(l));return g.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Ra(e,t=[]){let n=[];function r(a,o){const l=x.createContext(o),c=n.length;n=[...n,o];const f=d=>{var E;const{scope:p,children:v,...b}=d,w=((E=p==null?void 0:p[e])==null?void 0:E[c])||l,S=x.useMemo(()=>b,Object.values(b));return g.jsx(w.Provider,{value:S,children:v})};f.displayName=a+"Provider";function h(d,p){var w;const v=((w=p==null?void 0:p[e])==null?void 0:w[c])||l,b=x.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${a}\``)}return[f,h]}const i=()=>{const a=n.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,BZ(i,...t)]}function BZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:f})=>{const d=c(a)[`__scope${f}`];return{...l,...d}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function aA(e){const t=e+"CollectionProvider",[n,r]=Ra(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:S,children:E}=w,j=_e.useRef(null),C=_e.useRef(new Map).current;return g.jsx(i,{scope:S,itemMap:C,collectionRef:j,children:E})};o.displayName=t;const l=e+"CollectionSlot",c=ec(l),f=_e.forwardRef((w,S)=>{const{scope:E,children:j}=w,C=a(l,E),O=gt(S,C.collectionRef);return g.jsx(c,{ref:O,children:j})});f.displayName=l;const h=e+"CollectionItemSlot",d="data-radix-collection-item",p=ec(h),v=_e.forwardRef((w,S)=>{const{scope:E,children:j,...C}=w,O=_e.useRef(null),N=gt(S,O),k=a(h,E);return _e.useEffect(()=>(k.itemMap.set(O,{ref:O,...C}),()=>void k.itemMap.delete(O))),g.jsx(p,{[d]:"",ref:N,children:j})});v.displayName=h;function b(w){const S=a(e+"CollectionConsumer",w);return _e.useCallback(()=>{const j=S.collectionRef.current;if(!j)return[];const C=Array.from(j.querySelectorAll(`[${d}]`));return Array.from(S.itemMap.values()).sort((k,T)=>C.indexOf(k.ref.current)-C.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:f,ItemSlot:v},b,r]}function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var vr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},FZ=Hj[" useInsertionEffect ".trim().toString()]||vr;function Pl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=UZ({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const h=x.useRef(e!==void 0);x.useEffect(()=>{const d=h.current;d!==l&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const f=x.useCallback(h=>{var d;if(l){const p=HZ(h)?h(e):h;p!==e&&((d=o.current)==null||d.call(o,p))}else a(h)},[l,e,a,o]);return[c,f]}function UZ({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return FZ(()=>{a.current=t},[t]),x.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function HZ(e){return typeof e=="function"}function qZ(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var zr=e=>{const{present:t,children:n}=e,r=VZ(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=gt(r.ref,KZ(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};zr.displayName="Presence";function VZ(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[l,c]=qZ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Cv(r.current);a.current=l==="mounted"?f:"none"},[l]),vr(()=>{const f=r.current,h=i.current;if(h!==e){const p=a.current,v=Cv(f);e?c("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?c("UNMOUNT"):c(h&&p!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),vr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,d=v=>{const w=Cv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(c("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},p=v=>{v.target===t&&(a.current=Cv(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Cv(e){return(e==null?void 0:e.animationName)||"none"}function KZ(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YZ=Hj[" useId ".trim().toString()]||(()=>{}),XZ=0;function gr(e){const[t,n]=x.useState(YZ());return vr(()=>{n(r=>r??String(XZ++))},[e]),e||(t?`radix-${t}`:"")}var n0="Collapsible",[GZ]=Ra(n0),[WZ,oA]=GZ(n0),G$=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...l}=e,[c,f]=Pl({prop:r,defaultProp:i??!1,onChange:o,caller:n0});return g.jsx(WZ,{scope:n,disabled:a,contentId:gr(),open:c,onOpenToggle:x.useCallback(()=>f(h=>!h),[f]),children:g.jsx(Be.div,{"data-state":lA(c),"data-disabled":a?"":void 0,...l,ref:t})})});G$.displayName=n0;var W$="CollapsibleTrigger",Q$=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=oA(W$,n);return g.jsx(Be.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":lA(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Ae(e.onClick,i.onOpenToggle)})});Q$.displayName=W$;var sA="CollapsibleContent",Z$=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=oA(sA,e.__scopeCollapsible);return g.jsx(zr,{present:n||i.open,children:({present:a})=>g.jsx(QZ,{...r,ref:t,present:a})})});Z$.displayName=sA;var QZ=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,o=oA(sA,n),[l,c]=x.useState(r),f=x.useRef(null),h=gt(t,f),d=x.useRef(0),p=d.current,v=x.useRef(0),b=v.current,w=o.open||l,S=x.useRef(w),E=x.useRef(void 0);return x.useEffect(()=>{const j=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(j)},[]),vr(()=>{const j=f.current;if(j){E.current=E.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const C=j.getBoundingClientRect();d.current=C.height,v.current=C.width,S.current||(j.style.transitionDuration=E.current.transitionDuration,j.style.animationName=E.current.animationName),c(r)}},[o.open,r]),g.jsx(Be.div,{"data-state":lA(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...a,ref:h,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&i})});function lA(e){return e?"open":"closed"}var ZZ=G$,JZ=x.createContext(void 0);function vp(e){const t=x.useContext(JZ);return e||t||"ltr"}function jr(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function eJ(e,t=globalThis==null?void 0:globalThis.document){const n=jr(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var tJ="DismissableLayer",Z_="dismissableLayer.update",nJ="dismissableLayer.pointerDownOutside",rJ="dismissableLayer.focusOutside",fD,J$=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yp=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,f=x.useContext(J$),[h,d]=x.useState(null),p=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=x.useState({}),b=gt(t,T=>d(T)),w=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=w.indexOf(S),j=h?w.indexOf(h):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,O=j>=E,N=oJ(T=>{const M=T.target,I=[...f.branches].some(L=>L.contains(M));!O||I||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},p),k=sJ(T=>{const M=T.target;[...f.branches].some(L=>L.contains(M))||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},p);return eJ(T=>{j===f.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},p),x.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(fD=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),dD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=fD)}},[h,p,n,f]),x.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),dD())},[h,f]),x.useEffect(()=>{const T=()=>v({});return document.addEventListener(Z_,T),()=>document.removeEventListener(Z_,T)},[]),g.jsx(Be.div,{...c,ref:b,style:{pointerEvents:C?O?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,N.onPointerDownCapture)})});yp.displayName=tJ;var iJ="DismissableLayerBranch",aJ=x.forwardRef((e,t)=>{const n=x.useContext(J$),r=x.useRef(null),i=gt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),g.jsx(Be.div,{...e,ref:i})});aJ.displayName=iJ;function oJ(e,t=globalThis==null?void 0:globalThis.document){const n=jr(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){eB(nJ,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sJ(e,t=globalThis==null?void 0:globalThis.document){const n=jr(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&eB(rJ,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function dD(){const e=new CustomEvent(Z_);document.dispatchEvent(e)}function eB(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?K$(i,a):i.dispatchEvent(a)}var rS="focusScope.autoFocusOnMount",iS="focusScope.autoFocusOnUnmount",hD={bubbles:!1,cancelable:!0},lJ="FocusScope",r0=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,c]=x.useState(null),f=jr(i),h=jr(a),d=x.useRef(null),p=gt(t,w=>c(w)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(C){if(v.paused||!l)return;const O=C.target;l.contains(O)?d.current=O:cl(d.current,{select:!0})},S=function(C){if(v.paused||!l)return;const O=C.relatedTarget;O!==null&&(l.contains(O)||cl(d.current,{select:!0}))},E=function(C){if(document.activeElement===document.body)for(const N of C)N.removedNodes.length>0&&cl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const j=new MutationObserver(E);return l&&j.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),j.disconnect()}}},[r,l,v.paused]),x.useEffect(()=>{if(l){pD.add(v);const w=document.activeElement;if(!l.contains(w)){const E=new CustomEvent(rS,hD);l.addEventListener(rS,f),l.dispatchEvent(E),E.defaultPrevented||(uJ(mJ(tB(l)),{select:!0}),document.activeElement===w&&cl(l))}return()=>{l.removeEventListener(rS,f),setTimeout(()=>{const E=new CustomEvent(iS,hD);l.addEventListener(iS,h),l.dispatchEvent(E),E.defaultPrevented||cl(w??document.body,{select:!0}),l.removeEventListener(iS,h),pD.remove(v)},0)}}},[l,f,h,v]);const b=x.useCallback(w=>{if(!n&&!r||v.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(S&&E){const j=w.currentTarget,[C,O]=cJ(j);C&&O?!w.shiftKey&&E===O?(w.preventDefault(),n&&cl(C,{select:!0})):w.shiftKey&&E===C&&(w.preventDefault(),n&&cl(O,{select:!0})):E===j&&w.preventDefault()}},[n,r,v.paused]);return g.jsx(Be.div,{tabIndex:-1,...o,ref:p,onKeyDown:b})});r0.displayName=lJ;function uJ(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(cl(r,{select:t}),document.activeElement!==n)return}function cJ(e){const t=tB(e),n=mD(t,e),r=mD(t.reverse(),e);return[n,r]}function tB(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mD(e,t){for(const n of e)if(!fJ(n,{upTo:t}))return n}function fJ(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dJ(e){return e instanceof HTMLInputElement&&"select"in e}function cl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dJ(e)&&t&&e.select()}}var pD=hJ();function hJ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gD(e,t),e.unshift(t)},remove(t){var n;e=gD(e,t),(n=e[0])==null||n.resume()}}}function gD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mJ(e){return e.filter(t=>t.tagName!=="A")}var pJ="Portal",xp=x.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=x.useState(!1);vr(()=>a(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?C$.createPortal(g.jsx(Be.div,{...r,ref:t}),o):null});xp.displayName=pJ;var aS=0;function uA(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vD()),document.body.insertAdjacentElement("beforeend",e[1]??vD()),aS++,()=>{aS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),aS--}},[])}function vD(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ja.apply(this,arguments)};function nB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gJ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var fy="right-scroll-bar-position",dy="width-before-scroll-bar",vJ="with-scroll-bars-hidden",yJ="--removed-body-scroll-bar-size";function oS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xJ(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var bJ=typeof window<"u"?x.useLayoutEffect:x.useEffect,yD=new WeakMap;function wJ(e,t){var n=xJ(null,function(r){return e.forEach(function(i){return oS(i,r)})});return bJ(function(){var r=yD.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(l){a.has(l)||oS(l,null)}),a.forEach(function(l){i.has(l)||oS(l,o)})}yD.set(n,e)},[e]),n}function SJ(e){return e}function EJ(e,t){t===void 0&&(t=SJ);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var h=o;o=[],h.forEach(a)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return i}function _J(e){e===void 0&&(e={});var t=EJ(null);return t.options=Ja({async:!0,ssr:!1},e),t}var rB=function(e){var t=e.sideCar,n=nB(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ja({},n))};rB.isSideCarExport=!0;function CJ(e,t){return e.useMedium(t),rB}var iB=_J(),sS=function(){},i0=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:sS,onWheelCapture:sS,onTouchMoveCapture:sS}),i=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,f=e.removeScrollBar,h=e.enabled,d=e.shards,p=e.sideCar,v=e.noRelative,b=e.noIsolation,w=e.inert,S=e.allowPinchZoom,E=e.as,j=E===void 0?"div":E,C=e.gapMode,O=nB(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,k=wJ([n,t]),T=Ja(Ja({},O),i);return x.createElement(x.Fragment,null,h&&x.createElement(N,{sideCar:iB,removeScrollBar:f,shards:d,noRelative:v,noIsolation:b,inert:w,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:C}),o?x.cloneElement(x.Children.only(l),Ja(Ja({},T),{ref:k})):x.createElement(j,Ja({},T,{className:c,ref:k}),l))});i0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};i0.classNames={fullWidth:dy,zeroRight:fy};var jJ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function AJ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jJ();return t&&e.setAttribute("nonce",t),e}function OJ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kJ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NJ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=AJ())&&(OJ(t,n),kJ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TJ=function(){var e=NJ();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aB=function(){var e=TJ(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},PJ={left:0,top:0,right:0,gap:0},lS=function(e){return parseInt(e||"",10)||0},MJ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[lS(n),lS(r),lS(i)]},DJ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PJ;var t=MJ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},RJ=aB(),Df="data-scroll-locked",IJ=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(vJ,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(l,"px ").concat(r,`;
  }
  body[`).concat(Df,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(a,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(fy,` {
    right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(dy,` {
    margin-right: `).concat(l,"px ").concat(r,`;
  }
  
  .`).concat(fy," .").concat(fy,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(dy," .").concat(dy,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Df,`] {
    `).concat(yJ,": ").concat(l,`px;
  }
`)},xD=function(){var e=parseInt(document.body.getAttribute(Df)||"0",10);return isFinite(e)?e:0},LJ=function(){x.useEffect(function(){return document.body.setAttribute(Df,(xD()+1).toString()),function(){var e=xD()-1;e<=0?document.body.removeAttribute(Df):document.body.setAttribute(Df,e.toString())}},[])},zJ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;LJ();var a=x.useMemo(function(){return DJ(i)},[i]);return x.createElement(RJ,{styles:IJ(a,!t,i,n?"":"!important")})},J_=!1;if(typeof window<"u")try{var jv=Object.defineProperty({},"passive",{get:function(){return J_=!0,!0}});window.addEventListener("test",jv,jv),window.removeEventListener("test",jv,jv)}catch{J_=!1}var df=J_?{passive:!1}:!1,$J=function(e){return e.tagName==="TEXTAREA"},oB=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$J(e)&&n[t]==="visible")},BJ=function(e){return oB(e,"overflowY")},FJ=function(e){return oB(e,"overflowX")},bD=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=sB(e,r);if(i){var a=lB(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},UJ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},HJ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sB=function(e,t){return e==="v"?BJ(t):FJ(t)},lB=function(e,t){return e==="v"?UJ(t):HJ(t)},qJ=function(e,t){return e==="h"&&t==="rtl"?-1:1},VJ=function(e,t,n,r,i){var a=qJ(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),f=!1,h=o>0,d=0,p=0;do{if(!l)break;var v=lB(e,l),b=v[0],w=v[1],S=v[2],E=w-S-a*b;(b||E)&&sB(e,l)&&(d+=E,p+=b);var j=l.parentNode;l=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(p)<1)&&(f=!0),f},Av=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wD=function(e){return[e.deltaX,e.deltaY]},SD=function(e){return e&&"current"in e?e.current:e},KJ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YJ=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},XJ=0,hf=[];function GJ(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(XJ++)[0],a=x.useState(aB)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=gJ([e.lockRef.current],(e.shards||[]).map(SD),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(w,S){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var E=Av(w),j=n.current,C="deltaX"in w?w.deltaX:j[0]-E[0],O="deltaY"in w?w.deltaY:j[1]-E[1],N,k=w.target,T=Math.abs(C)>Math.abs(O)?"h":"v";if("touches"in w&&T==="h"&&k.type==="range")return!1;var M=window.getSelection(),I=M&&M.anchorNode,L=I?I===k||I.contains(k):!1;if(L)return!1;var B=bD(T,k);if(!B)return!0;if(B?N=T:(N=T==="v"?"h":"v",B=bD(T,k)),!B)return!1;if(!r.current&&"changedTouches"in w&&(C||O)&&(r.current=N),!N)return!0;var z=r.current||N;return VJ(z,S,w,z==="h"?C:O)},[]),c=x.useCallback(function(w){var S=w;if(!(!hf.length||hf[hf.length-1]!==a)){var E="deltaY"in S?wD(S):Av(S),j=t.current.filter(function(N){return N.name===S.type&&(N.target===S.target||S.target===N.shadowParent)&&KJ(N.delta,E)})[0];if(j&&j.should){S.cancelable&&S.preventDefault();return}if(!j){var C=(o.current.shards||[]).map(SD).filter(Boolean).filter(function(N){return N.contains(S.target)}),O=C.length>0?l(S,C[0]):!o.current.noIsolation;O&&S.cancelable&&S.preventDefault()}}},[]),f=x.useCallback(function(w,S,E,j){var C={name:w,delta:S,target:E,should:j,shadowParent:WJ(E)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(O){return O!==C})},1)},[]),h=x.useCallback(function(w){n.current=Av(w),r.current=void 0},[]),d=x.useCallback(function(w){f(w.type,wD(w),w.target,l(w,e.lockRef.current))},[]),p=x.useCallback(function(w){f(w.type,Av(w),w.target,l(w,e.lockRef.current))},[]);x.useEffect(function(){return hf.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,df),document.addEventListener("touchmove",c,df),document.addEventListener("touchstart",h,df),function(){hf=hf.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,df),document.removeEventListener("touchmove",c,df),document.removeEventListener("touchstart",h,df)}},[]);var v=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(a,{styles:YJ(i)}):null,v?x.createElement(zJ,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WJ(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QJ=CJ(iB,GJ);var a0=x.forwardRef(function(e,t){return x.createElement(i0,Ja({},e,{ref:t,sideCar:QJ}))});a0.classNames=i0.classNames;var ZJ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mf=new WeakMap,Ov=new WeakMap,kv={},uS=0,uB=function(e){return e&&(e.host||uB(e.parentNode))},JJ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uB(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},eee=function(e,t,n,r){var i=JJ(t,Array.isArray(e)?e:[e]);kv[n]||(kv[n]=new WeakMap);var a=kv[n],o=[],l=new Set,c=new Set(i),f=function(d){!d||l.has(d)||(l.add(d),f(d.parentNode))};i.forEach(f);var h=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(l.has(p))h(p);else try{var v=p.getAttribute(r),b=v!==null&&v!=="false",w=(mf.get(p)||0)+1,S=(a.get(p)||0)+1;mf.set(p,w),a.set(p,S),o.push(p),w===1&&b&&Ov.set(p,!0),S===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",p,E)}})};return h(t),l.clear(),uS++,function(){o.forEach(function(d){var p=mf.get(d)-1,v=a.get(d)-1;mf.set(d,p),a.set(d,v),p||(Ov.has(d)||d.removeAttribute(r),Ov.delete(d)),v||d.removeAttribute(n)}),uS--,uS||(mf=new WeakMap,mf=new WeakMap,Ov=new WeakMap,kv={})}},cA=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=ZJ(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),eee(r,i,n,"aria-hidden")):function(){return null}},o0="Dialog",[cB]=Ra(o0),[tee,Ia]=cB(o0),fB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=x.useRef(null),c=x.useRef(null),[f,h]=Pl({prop:r,defaultProp:i??!1,onChange:a,caller:o0});return g.jsx(tee,{scope:t,triggerRef:l,contentRef:c,contentId:gr(),titleId:gr(),descriptionId:gr(),open:f,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(d=>!d),[h]),modal:o,children:n})};fB.displayName=o0;var dB="DialogTrigger",nee=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ia(dB,n),a=gt(t,i.triggerRef);return g.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":hA(i.open),...r,ref:a,onClick:Ae(e.onClick,i.onOpenToggle)})});nee.displayName=dB;var fA="DialogPortal",[ree,hB]=cB(fA,{forceMount:void 0}),mB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ia(fA,t);return g.jsx(ree,{scope:t,forceMount:n,children:x.Children.map(r,o=>g.jsx(zr,{present:n||a.open,children:g.jsx(xp,{asChild:!0,container:i,children:o})}))})};mB.displayName=fA;var Ny="DialogOverlay",pB=x.forwardRef((e,t)=>{const n=hB(Ny,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ia(Ny,e.__scopeDialog);return a.modal?g.jsx(zr,{present:r||a.open,children:g.jsx(aee,{...i,ref:t})}):null});pB.displayName=Ny;var iee=ec("DialogOverlay.RemoveScroll"),aee=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ia(Ny,n);return g.jsx(a0,{as:iee,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(Be.div,{"data-state":hA(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),tc="DialogContent",gB=x.forwardRef((e,t)=>{const n=hB(tc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ia(tc,e.__scopeDialog);return g.jsx(zr,{present:r||a.open,children:a.modal?g.jsx(oee,{...i,ref:t}):g.jsx(see,{...i,ref:t})})});gB.displayName=tc;var oee=x.forwardRef((e,t)=>{const n=Ia(tc,e.__scopeDialog),r=x.useRef(null),i=gt(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return cA(a)},[]),g.jsx(vB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault())})}),see=x.forwardRef((e,t)=>{const n=Ia(tc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return g.jsx(vB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,f;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((f=n.triggerRef.current)==null?void 0:f.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),vB=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=Ia(tc,n),c=x.useRef(null),f=gt(t,c);return uA(),g.jsxs(g.Fragment,{children:[g.jsx(r0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:g.jsx(yp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":hA(l.open),...o,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(lee,{titleId:l.titleId}),g.jsx(cee,{contentRef:c,descriptionId:l.descriptionId})]})]})}),dA="DialogTitle",yB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ia(dA,n);return g.jsx(Be.h2,{id:i.titleId,...r,ref:t})});yB.displayName=dA;var xB="DialogDescription",bB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ia(xB,n);return g.jsx(Be.p,{id:i.descriptionId,...r,ref:t})});bB.displayName=xB;var wB="DialogClose",SB=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ia(wB,n);return g.jsx(Be.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>i.onOpenChange(!1))})});SB.displayName=wB;function hA(e){return e?"open":"closed"}var EB="DialogTitleWarning",[I4e,_B]=$Z(EB,{contentName:tc,titleName:dA,docsSlug:"dialog"}),lee=({titleId:e})=>{const t=_B(EB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},uee="DialogDescriptionWarning",cee=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_B(uee).contentName}}.`;return x.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mA=fB,pA=mB,gA=pB,vA=gB,CB=yB,jB=bB,yA=SB,cS={exports:{}},fS={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ED;function fee(){if(ED)return fS;ED=1;var e=jd();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(d,p){var v=p(),b=r({inst:{value:v,getSnapshot:p}}),w=b[0].inst,S=b[1];return a(function(){w.value=v,w.getSnapshot=p,c(w)&&S({inst:w})},[d,v,p]),i(function(){return c(w)&&S({inst:w}),d(function(){c(w)&&S({inst:w})})},[d]),o(v),v}function c(d){var p=d.getSnapshot;d=d.value;try{var v=p();return!n(d,v)}catch{return!0}}function f(d,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return fS.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,fS}var _D;function dee(){return _D||(_D=1,cS.exports=fee()),cS.exports}function hee(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function mee(e){const[t,n]=x.useState(void 0);return vr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,f=Array.isArray(c)?c[0]:c;o=f.inlineSize,l=f.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const pee=["top","right","bottom","left"],Ml=Math.min,Ci=Math.max,Ty=Math.round,Nv=Math.floor,io=e=>({x:e,y:e}),gee={left:"right",right:"left",bottom:"top",top:"bottom"};function eC(e,t,n){return Ci(e,Ml(t,n))}function as(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function Nd(e){return e.split("-")[1]}function xA(e){return e==="x"?"y":"x"}function bA(e){return e==="y"?"height":"width"}function eo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function wA(e){return xA(eo(e))}function vee(e,t,n){n===void 0&&(n=!1);const r=Nd(e),i=wA(e),a=bA(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Py(o)),[o,Py(o)]}function yee(e){const t=Py(e);return[tC(e),t,tC(t)]}function tC(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const CD=["left","right"],jD=["right","left"],xee=["top","bottom"],bee=["bottom","top"];function wee(e,t,n){switch(e){case"top":case"bottom":return n?t?jD:CD:t?CD:jD;case"left":case"right":return t?xee:bee;default:return[]}}function See(e,t,n,r){const i=Nd(e);let a=wee(os(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(tC)))),a}function Py(e){const t=os(e);return gee[t]+e.slice(t.length)}function Eee(e){return{top:0,right:0,bottom:0,left:0,...e}}function AB(e){return typeof e!="number"?Eee(e):{top:e,right:e,bottom:e,left:e}}function My(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function AD(e,t,n){let{reference:r,floating:i}=e;const a=eo(t),o=wA(t),l=bA(o),c=os(t),f=a==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[l]/2-i[l]/2;let v;switch(c){case"top":v={x:h,y:r.y-i.height};break;case"bottom":v={x:h,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:d};break;case"left":v={x:r.x-i.width,y:d};break;default:v={x:r.x,y:r.y}}switch(Nd(t)){case"start":v[o]-=p*(n&&f?-1:1);break;case"end":v[o]+=p*(n&&f?-1:1);break}return v}async function _ee(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:v=0}=as(t,e),b=AB(v),S=l[p?d==="floating"?"reference":"floating":d],E=My(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(S)))==null||n?S:S.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:f,rootBoundary:h,strategy:c})),j=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),O=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},N=My(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:j,offsetParent:C,strategy:c}):j);return{top:(E.top-N.top+b.top)/O.y,bottom:(N.bottom-E.bottom+b.bottom)/O.y,left:(E.left-N.left+b.left)/O.x,right:(N.right-E.right+b.right)/O.x}}const Cee=50,jee=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:_ee},c=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=AD(f,r,c),p=r,v=0;const b={};for(let w=0;w<a.length;w++){const S=a[w];if(!S)continue;const{name:E,fn:j}=S,{x:C,y:O,data:N,reset:k}=await j({x:h,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:b,rects:f,platform:l,elements:{reference:e,floating:t}});h=C??h,d=O??d,b[E]={...b[E],...N},k&&v<Cee&&(v++,typeof k=="object"&&(k.placement&&(p=k.placement),k.rects&&(f=k.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:h,y:d}=AD(f,p,c)),w=-1)}return{x:h,y:d,placement:p,strategy:i,middlewareData:b}},Aee=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:f,padding:h=0}=as(e,t)||{};if(f==null)return{};const d=AB(h),p={x:n,y:r},v=wA(i),b=bA(v),w=await o.getDimensions(f),S=v==="y",E=S?"top":"left",j=S?"bottom":"right",C=S?"clientHeight":"clientWidth",O=a.reference[b]+a.reference[v]-p[v]-a.floating[b],N=p[v]-a.reference[v],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let T=k?k[C]:0;(!T||!await(o.isElement==null?void 0:o.isElement(k)))&&(T=l.floating[C]||a.floating[b]);const M=O/2-N/2,I=T/2-w[b]/2-1,L=Ml(d[E],I),B=Ml(d[j],I),z=L,G=T-w[b]-B,F=T/2-w[b]/2+M,V=eC(z,F,G),D=!c.arrow&&Nd(i)!=null&&F!==V&&a.reference[b]/2-(F<z?L:B)-w[b]/2<0,q=D?F<z?F-z:F-G:0;return{[v]:p[v]+q,data:{[v]:V,centerOffset:F-V-q,...D&&{alignmentOffset:q}},reset:D}}}),Oee=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:f}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...S}=as(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const E=os(i),j=eo(l),C=os(l)===l,O=await(c.isRTL==null?void 0:c.isRTL(f.floating)),N=p||(C||!w?[Py(l)]:yee(l)),k=b!=="none";!p&&k&&N.push(...See(l,w,b,O));const T=[l,...N],M=await c.detectOverflow(t,S),I=[];let L=((r=a.flip)==null?void 0:r.overflows)||[];if(h&&I.push(M[E]),d){const F=vee(i,o,O);I.push(M[F[0]],M[F[1]])}if(L=[...L,{placement:i,overflows:I}],!I.every(F=>F<=0)){var B,z;const F=(((B=a.flip)==null?void 0:B.index)||0)+1,V=T[F];if(V&&(!(d==="alignment"?j!==eo(V):!1)||L.every(X=>eo(X.placement)===j?X.overflows[0]>0:!0)))return{data:{index:F,overflows:L},reset:{placement:V}};let D=(z=L.filter(q=>q.overflows[0]<=0).sort((q,X)=>q.overflows[1]-X.overflows[1])[0])==null?void 0:z.placement;if(!D)switch(v){case"bestFit":{var G;const q=(G=L.filter(X=>{if(k){const Y=eo(X.placement);return Y===j||Y==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(Y=>Y>0).reduce((Y,R)=>Y+R,0)]).sort((X,Y)=>X[1]-Y[1])[0])==null?void 0:G[0];q&&(D=q);break}case"initialPlacement":D=l;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function OD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kD(e){return pee.some(t=>e[t]>=0)}const kee=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=as(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),l=OD(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:kD(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),l=OD(o,n.floating);return{data:{escapedOffsets:l,escaped:kD(l)}}}default:return{}}}}},OB=new Set(["left","top"]);async function Nee(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=os(n),l=Nd(n),c=eo(n)==="y",f=OB.has(o)?-1:1,h=a&&c?-1:1,d=as(t,e);let{mainAxis:p,crossAxis:v,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),c?{x:v*h,y:p*f}:{x:p*f,y:v*h}}const Tee=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:l}=t,c=await Nee(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Pee=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:E=>{let{x:j,y:C}=E;return{x:j,y:C}}},...f}=as(e,t),h={x:n,y:r},d=await a.detectOverflow(t,f),p=eo(os(i)),v=xA(p);let b=h[v],w=h[p];if(o){const E=v==="y"?"top":"left",j=v==="y"?"bottom":"right",C=b+d[E],O=b-d[j];b=eC(C,b,O)}if(l){const E=p==="y"?"top":"left",j=p==="y"?"bottom":"right",C=w+d[E],O=w-d[j];w=eC(C,w,O)}const S=c.fn({...t,[v]:b,[p]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[p]:l}}}}}},Mee=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=as(e,t),h={x:n,y:r},d=eo(i),p=xA(d);let v=h[p],b=h[d];const w=as(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const C=p==="y"?"height":"width",O=a.reference[p]-a.floating[C]+S.mainAxis,N=a.reference[p]+a.reference[C]-S.mainAxis;v<O?v=O:v>N&&(v=N)}if(f){var E,j;const C=p==="y"?"width":"height",O=OB.has(os(i)),N=a.reference[d]-a.floating[C]+(O&&((E=o.offset)==null?void 0:E[d])||0)+(O?0:S.crossAxis),k=a.reference[d]+a.reference[C]+(O?0:((j=o.offset)==null?void 0:j[d])||0)-(O?S.crossAxis:0);b<N?b=N:b>k&&(b=k)}return{[p]:v,[d]:b}}}},Dee=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...f}=as(e,t),h=await o.detectOverflow(t,f),d=os(i),p=Nd(i),v=eo(i)==="y",{width:b,height:w}=a.floating;let S,E;d==="top"||d==="bottom"?(S=d,E=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(E=d,S=p==="end"?"top":"bottom");const j=w-h.top-h.bottom,C=b-h.left-h.right,O=Ml(w-h[S],j),N=Ml(b-h[E],C),k=!t.middlewareData.shift;let T=O,M=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),k&&!p){const L=Ci(h.left,0),B=Ci(h.right,0),z=Ci(h.top,0),G=Ci(h.bottom,0);v?M=b-2*(L!==0||B!==0?L+B:Ci(h.left,h.right)):T=w-2*(z!==0||G!==0?z+G:Ci(h.top,h.bottom))}await c({...t,availableWidth:M,availableHeight:T});const I=await o.getDimensions(l.floating);return b!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};function s0(){return typeof window<"u"}function Td(e){return kB(e)?(e.nodeName||"").toLowerCase():"#document"}function Ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vo(e){var t;return(t=(kB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kB(e){return s0()?e instanceof Node||e instanceof Ti(e).Node:!1}function Na(e){return s0()?e instanceof Element||e instanceof Ti(e).Element:!1}function vs(e){return s0()?e instanceof HTMLElement||e instanceof Ti(e).HTMLElement:!1}function ND(e){return!s0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ti(e).ShadowRoot}function bp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ta(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Ree(e){return/^(table|td|th)$/.test(Td(e))}function l0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Iee=/transform|translate|scale|rotate|perspective|filter/,Lee=/paint|layout|strict|content/,wu=e=>!!e&&e!=="none";let dS;function SA(e){const t=Na(e)?Ta(e):e;return wu(t.transform)||wu(t.translate)||wu(t.scale)||wu(t.rotate)||wu(t.perspective)||!EA()&&(wu(t.backdropFilter)||wu(t.filter))||Iee.test(t.willChange||"")||Lee.test(t.contain||"")}function zee(e){let t=Dl(e);for(;vs(t)&&!ad(t);){if(SA(t))return t;if(l0(t))return null;t=Dl(t)}return null}function EA(){return dS==null&&(dS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dS}function ad(e){return/^(html|body|#document)$/.test(Td(e))}function Ta(e){return Ti(e).getComputedStyle(e)}function u0(e){return Na(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dl(e){if(Td(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ND(e)&&e.host||vo(e);return ND(t)?t.host:t}function NB(e){const t=Dl(e);return ad(t)?e.ownerDocument?e.ownerDocument.body:e.body:vs(t)&&bp(t)?t:NB(t)}function Om(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=NB(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Ti(i);if(a){const l=nC(o);return t.concat(o,o.visualViewport||[],bp(i)?i:[],l&&n?Om(l):[])}else return t.concat(i,Om(i,[],n))}function nC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function TB(e){const t=Ta(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=vs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Ty(n)!==a||Ty(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function _A(e){return Na(e)?e:e.contextElement}function Rf(e){const t=_A(e);if(!vs(t))return io(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=TB(t);let o=(a?Ty(n.width):n.width)/r,l=(a?Ty(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const $ee=io(0);function PB(e){const t=Ti(e);return!EA()||!t.visualViewport?$ee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ti(e)?!1:t}function nc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=_A(e);let o=io(1);t&&(r?Na(r)&&(o=Rf(r)):o=Rf(e));const l=Bee(a,n,r)?PB(a):io(0);let c=(i.left+l.x)/o.x,f=(i.top+l.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(a){const p=Ti(a),v=r&&Na(r)?Ti(r):r;let b=p,w=nC(b);for(;w&&r&&v!==b;){const S=Rf(w),E=w.getBoundingClientRect(),j=Ta(w),C=E.left+(w.clientLeft+parseFloat(j.paddingLeft))*S.x,O=E.top+(w.clientTop+parseFloat(j.paddingTop))*S.y;c*=S.x,f*=S.y,h*=S.x,d*=S.y,c+=C,f+=O,b=Ti(w),w=nC(b)}}return My({width:h,height:d,x:c,y:f})}function c0(e,t){const n=u0(e).scrollLeft;return t?t.left+n:nc(vo(e)).left+n}function MB(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-c0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Fee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=vo(r),l=t?l0(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},f=io(1);const h=io(0),d=vs(r);if((d||!d&&!a)&&((Td(r)!=="body"||bp(o))&&(c=u0(r)),d)){const v=nc(r);f=Rf(r),h.x=v.x+r.clientLeft,h.y=v.y+r.clientTop}const p=o&&!d&&!a?MB(o,c):io(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+h.x+p.x,y:n.y*f.y-c.scrollTop*f.y+h.y+p.y}}function Uee(e){return Array.from(e.getClientRects())}function Hee(e){const t=vo(e),n=u0(e),r=e.ownerDocument.body,i=Ci(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ci(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+c0(e);const l=-n.scrollTop;return Ta(r).direction==="rtl"&&(o+=Ci(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:l}}const TD=25;function qee(e,t){const n=Ti(e),r=vo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){a=i.width,o=i.height;const h=EA();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const f=c0(r);if(f<=0){const h=r.ownerDocument,d=h.body,p=getComputedStyle(d),v=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(r.clientWidth-d.clientWidth-v);b<=TD&&(a-=b)}else f<=TD&&(a+=f);return{width:a,height:o,x:l,y:c}}function Vee(e,t){const n=nc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=vs(e)?Rf(e):io(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,f=r*a.y;return{width:o,height:l,x:c,y:f}}function PD(e,t,n){let r;if(t==="viewport")r=qee(e,n);else if(t==="document")r=Hee(vo(e));else if(Na(t))r=Vee(t,n);else{const i=PB(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return My(r)}function DB(e,t){const n=Dl(e);return n===t||!Na(n)||ad(n)?!1:Ta(n).position==="fixed"||DB(n,t)}function Kee(e,t){const n=t.get(e);if(n)return n;let r=Om(e,[],!1).filter(l=>Na(l)&&Td(l)!=="body"),i=null;const a=Ta(e).position==="fixed";let o=a?Dl(e):e;for(;Na(o)&&!ad(o);){const l=Ta(o),c=SA(o);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||bp(o)&&!c&&DB(e,o))?r=r.filter(h=>h!==o):i=l,o=Dl(o)}return t.set(e,r),r}function Yee(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?l0(t)?[]:Kee(t,this._c):[].concat(n),r],l=PD(t,o[0],i);let c=l.top,f=l.right,h=l.bottom,d=l.left;for(let p=1;p<o.length;p++){const v=PD(t,o[p],i);c=Ci(v.top,c),f=Ml(v.right,f),h=Ml(v.bottom,h),d=Ci(v.left,d)}return{width:f-d,height:h-c,x:d,y:c}}function Xee(e){const{width:t,height:n}=TB(e);return{width:t,height:n}}function Gee(e,t,n){const r=vs(t),i=vo(t),a=n==="fixed",o=nc(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=io(0);function f(){c.x=c0(i)}if(r||!r&&!a)if((Td(t)!=="body"||bp(i))&&(l=u0(t)),r){const v=nc(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else i&&f();a&&!r&&i&&f();const h=i&&!r&&!a?MB(i,l):io(0),d=o.left+l.scrollLeft-c.x-h.x,p=o.top+l.scrollTop-c.y-h.y;return{x:d,y:p,width:o.width,height:o.height}}function hS(e){return Ta(e).position==="static"}function MD(e,t){if(!vs(e)||Ta(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vo(e)===n&&(n=n.ownerDocument.body),n}function RB(e,t){const n=Ti(e);if(l0(e))return n;if(!vs(e)){let i=Dl(e);for(;i&&!ad(i);){if(Na(i)&&!hS(i))return i;i=Dl(i)}return n}let r=MD(e,t);for(;r&&Ree(r)&&hS(r);)r=MD(r,t);return r&&ad(r)&&hS(r)&&!SA(r)?n:r||zee(e)||n}const Wee=async function(e){const t=this.getOffsetParent||RB,n=this.getDimensions,r=await n(e.floating);return{reference:Gee(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qee(e){return Ta(e).direction==="rtl"}const Zee={convertOffsetParentRelativeRectToViewportRelativeRect:Fee,getDocumentElement:vo,getClippingRect:Yee,getOffsetParent:RB,getElementRects:Wee,getClientRects:Uee,getDimensions:Xee,getScale:Rf,isElement:Na,isRTL:Qee};function IB(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jee(e,t){let n=null,r;const i=vo(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const f=e.getBoundingClientRect(),{left:h,top:d,width:p,height:v}=f;if(l||t(),!p||!v)return;const b=Nv(d),w=Nv(i.clientWidth-(h+p)),S=Nv(i.clientHeight-(d+v)),E=Nv(h),C={rootMargin:-b+"px "+-w+"px "+-S+"px "+-E+"px",threshold:Ci(0,Ml(1,c))||1};let O=!0;function N(k){const T=k[0].intersectionRatio;if(T!==c){if(!O)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!IB(f,e.getBoundingClientRect())&&o(),O=!1}try{n=new IntersectionObserver(N,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(N,C)}n.observe(e)}return o(!0),a}function ete(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=_A(e),h=i||a?[...f?Om(f):[],...t?Om(t):[]]:[];h.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),a&&E.addEventListener("resize",n)});const d=f&&l?Jee(f,n):null;let p=-1,v=null;o&&(v=new ResizeObserver(E=>{let[j]=E;j&&j.target===f&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),f&&!c&&v.observe(f),t&&v.observe(t));let b,w=c?nc(e):null;c&&S();function S(){const E=nc(e);w&&!IB(w,E)&&n(),w=E,b=requestAnimationFrame(S)}return n(),()=>{var E;h.forEach(j=>{i&&j.removeEventListener("scroll",n),a&&j.removeEventListener("resize",n)}),d==null||d(),(E=v)==null||E.disconnect(),v=null,c&&cancelAnimationFrame(b)}}const tte=Tee,nte=Pee,rte=Oee,ite=Dee,ate=kee,DD=Aee,ote=Mee,ste=(e,t,n)=>{const r=new Map,i={platform:Zee,...n},a={...i.platform,_c:r};return jee(e,t,{...i,platform:a})};var lte=typeof document<"u",ute=function(){},hy=lte?x.useLayoutEffect:ute;function Dy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Dy(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Dy(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function LB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RD(e,t){const n=LB(e);return Math.round(t*n)/n}function mS(e){const t=x.useRef(e);return hy(()=>{t.current=e}),t}function cte(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[h,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,v]=x.useState(r);Dy(p,r)||v(r);const[b,w]=x.useState(null),[S,E]=x.useState(null),j=x.useCallback(X=>{X!==k.current&&(k.current=X,w(X))},[]),C=x.useCallback(X=>{X!==T.current&&(T.current=X,E(X))},[]),O=a||b,N=o||S,k=x.useRef(null),T=x.useRef(null),M=x.useRef(h),I=c!=null,L=mS(c),B=mS(i),z=mS(f),G=x.useCallback(()=>{if(!k.current||!T.current)return;const X={placement:t,strategy:n,middleware:p};B.current&&(X.platform=B.current),ste(k.current,T.current,X).then(Y=>{const R={...Y,isPositioned:z.current!==!1};F.current&&!Dy(M.current,R)&&(M.current=R,Ul.flushSync(()=>{d(R)}))})},[p,t,n,B,z]);hy(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(X=>({...X,isPositioned:!1})))},[f]);const F=x.useRef(!1);hy(()=>(F.current=!0,()=>{F.current=!1}),[]),hy(()=>{if(O&&(k.current=O),N&&(T.current=N),O&&N){if(L.current)return L.current(O,N,G);G()}},[O,N,G,L,I]);const V=x.useMemo(()=>({reference:k,floating:T,setReference:j,setFloating:C}),[j,C]),D=x.useMemo(()=>({reference:O,floating:N}),[O,N]),q=x.useMemo(()=>{const X={position:n,left:0,top:0};if(!D.floating)return X;const Y=RD(D.floating,h.x),R=RD(D.floating,h.y);return l?{...X,transform:"translate("+Y+"px, "+R+"px)",...LB(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:R}},[n,l,D.floating,h.x,h.y]);return x.useMemo(()=>({...h,update:G,refs:V,elements:D,floatingStyles:q}),[h,G,V,D,q])}const fte=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?DD({element:r.current,padding:i}).fn(n):{}:r?DD({element:r,padding:i}).fn(n):{}}}},dte=(e,t)=>{const n=tte(e);return{name:n.name,fn:n.fn,options:[e,t]}},hte=(e,t)=>{const n=nte(e);return{name:n.name,fn:n.fn,options:[e,t]}},mte=(e,t)=>({fn:ote(e).fn,options:[e,t]}),pte=(e,t)=>{const n=rte(e);return{name:n.name,fn:n.fn,options:[e,t]}},gte=(e,t)=>{const n=ite(e);return{name:n.name,fn:n.fn,options:[e,t]}},vte=(e,t)=>{const n=ate(e);return{name:n.name,fn:n.fn,options:[e,t]}},yte=(e,t)=>{const n=fte(e);return{name:n.name,fn:n.fn,options:[e,t]}};var xte="Arrow",zB=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return g.jsx(Be.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});zB.displayName=xte;var bte=zB,CA="Popper",[$B,Pd]=Ra(CA),[wte,BB]=$B(CA),FB=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return g.jsx(wte,{scope:t,anchor:r,onAnchorChange:i,children:n})};FB.displayName=CA;var UB="PopperAnchor",HB=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=BB(UB,n),o=x.useRef(null),l=gt(t,o),c=x.useRef(null);return x.useEffect(()=>{const f=c.current;c.current=(r==null?void 0:r.current)||o.current,f!==c.current&&a.onAnchorChange(c.current)}),r?null:g.jsx(Be.div,{...i,ref:l})});HB.displayName=UB;var jA="PopperContent",[Ste,Ete]=$B(jA),qB=x.forwardRef((e,t)=>{var ae,re,ee,se,me,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:b,...w}=e,S=BB(jA,n),[E,j]=x.useState(null),C=gt(t,we=>j(we)),[O,N]=x.useState(null),k=mee(O),T=(k==null?void 0:k.width)??0,M=(k==null?void 0:k.height)??0,I=r+(a!=="center"?"-"+a:""),L=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(f)?f:[f],z=B.length>0,G={padding:L,boundary:B.filter(Cte),altBoundary:z},{refs:F,floatingStyles:V,placement:D,isPositioned:q,middlewareData:X}=cte({strategy:"fixed",placement:I,whileElementsMounted:(...we)=>ete(...we,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[dte({mainAxis:i+M,alignmentAxis:o}),c&&hte({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?mte():void 0,...G}),c&&pte({...G}),gte({...G,apply:({elements:we,rects:be,availableWidth:$e,availableHeight:Ne})=>{const{width:Je,height:Qe}=be.reference,nt=we.floating.style;nt.setProperty("--radix-popper-available-width",`${$e}px`),nt.setProperty("--radix-popper-available-height",`${Ne}px`),nt.setProperty("--radix-popper-anchor-width",`${Je}px`),nt.setProperty("--radix-popper-anchor-height",`${Qe}px`)}}),O&&yte({element:O,padding:l}),jte({arrowWidth:T,arrowHeight:M}),p&&vte({strategy:"referenceHidden",...G})]}),[Y,R]=YB(D),H=jr(b);vr(()=>{q&&(H==null||H())},[q,H]);const U=(ae=X.arrow)==null?void 0:ae.x,$=(re=X.arrow)==null?void 0:re.y,Q=((ee=X.arrow)==null?void 0:ee.centerOffset)!==0,[J,ne]=x.useState();return vr(()=>{E&&ne(window.getComputedStyle(E).zIndex)},[E]),g.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(se=X.transformOrigin)==null?void 0:se.x,(me=X.transformOrigin)==null?void 0:me.y].join(" "),...((ie=X.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Ste,{scope:n,placedSide:Y,onArrowChange:N,arrowX:U,arrowY:$,shouldHideArrow:Q,children:g.jsx(Be.div,{"data-side":Y,"data-align":R,...w,ref:C,style:{...w.style,animation:q?void 0:"none"}})})})});qB.displayName=jA;var VB="PopperArrow",_te={top:"bottom",right:"left",bottom:"top",left:"right"},KB=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=Ete(VB,r),o=_te[a.placedSide];return g.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:g.jsx(bte,{...i,ref:n,style:{...i.style,display:"block"}})})});KB.displayName=VB;function Cte(e){return e!==null}var jte=e=>({name:"transformOrigin",options:e,fn(t){var S,E,j;const{placement:n,rects:r,middlewareData:i}=t,o=((S=i.arrow)==null?void 0:S.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[f,h]=YB(n),d={start:"0%",center:"50%",end:"100%"}[h],p=(((E=i.arrow)==null?void 0:E.x)??0)+l/2,v=(((j=i.arrow)==null?void 0:j.y)??0)+c/2;let b="",w="";return f==="bottom"?(b=o?d:`${p}px`,w=`${-c}px`):f==="top"?(b=o?d:`${p}px`,w=`${r.floating.height+c}px`):f==="right"?(b=`${-c}px`,w=o?d:`${v}px`):f==="left"&&(b=`${r.floating.width+c}px`,w=o?d:`${v}px`),{data:{x:b,y:w}}}});function YB(e){const[t,n="center"]=e.split("-");return[t,n]}var AA=FB,OA=HB,kA=qB,NA=KB,pS="rovingFocusGroup.onEntryFocus",Ate={bubbles:!1,cancelable:!0},wp="RovingFocusGroup",[rC,XB,Ote]=aA(wp),[kte,f0]=Ra(wp,[Ote]),[Nte,Tte]=kte(wp),GB=x.forwardRef((e,t)=>g.jsx(rC.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(rC.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Pte,{...e,ref:t})})}));GB.displayName=wp;var Pte=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...d}=e,p=x.useRef(null),v=gt(t,p),b=vp(a),[w,S]=Pl({prop:o,defaultProp:l??null,onChange:c,caller:wp}),[E,j]=x.useState(!1),C=jr(f),O=XB(n),N=x.useRef(!1),[k,T]=x.useState(0);return x.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(pS,C),()=>M.removeEventListener(pS,C)},[C]),g.jsx(Nte,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:x.useCallback(M=>S(M),[S]),onItemShiftTab:x.useCallback(()=>j(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:x.useCallback(()=>T(M=>M-1),[]),children:g.jsx(Be.div,{tabIndex:E||k===0?-1:0,"data-orientation":r,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{N.current=!0}),onFocus:Ae(e.onFocus,M=>{const I=!N.current;if(M.target===M.currentTarget&&I&&!E){const L=new CustomEvent(pS,Ate);if(M.currentTarget.dispatchEvent(L),!L.defaultPrevented){const B=O().filter(D=>D.focusable),z=B.find(D=>D.active),G=B.find(D=>D.id===w),V=[z,G,...B].filter(Boolean).map(D=>D.ref.current);ZB(V,h)}}N.current=!1}),onBlur:Ae(e.onBlur,()=>j(!1))})})}),WB="RovingFocusGroupItem",QB=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...l}=e,c=gr(),f=a||c,h=Tte(WB,n),d=h.currentTabStopId===f,p=XB(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:w}=h;return x.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),g.jsx(rC.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:g.jsx(Be.span,{tabIndex:d?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:Ae(e.onMouseDown,S=>{r?h.onItemFocus(f):S.preventDefault()}),onFocus:Ae(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ae(e.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){h.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const E=Rte(S,h.orientation,h.dir);if(E!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let C=p().filter(O=>O.focusable).map(O=>O.ref.current);if(E==="last")C.reverse();else if(E==="prev"||E==="next"){E==="prev"&&C.reverse();const O=C.indexOf(S.currentTarget);C=h.loop?Ite(C,O+1):C.slice(O+1)}setTimeout(()=>ZB(C))}}),children:typeof o=="function"?o({isCurrentTabStop:d,hasTabStop:w!=null}):o})})});QB.displayName=WB;var Mte={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Dte(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Rte(e,t,n){const r=Dte(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Mte[r]}function ZB(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ite(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var JB=GB,e6=QB,iC=["Enter"," "],Lte=["ArrowDown","PageUp","Home"],t6=["ArrowUp","PageDown","End"],zte=[...Lte,...t6],$te={ltr:[...iC,"ArrowRight"],rtl:[...iC,"ArrowLeft"]},Bte={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sp="Menu",[km,Fte,Ute]=aA(Sp),[wc,n6]=Ra(Sp,[Ute,Pd,f0]),d0=Pd(),r6=f0(),[Hte,Sc]=wc(Sp),[qte,Ep]=wc(Sp),i6=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,l=d0(t),[c,f]=x.useState(null),h=x.useRef(!1),d=jr(a),p=vp(i);return x.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),g.jsx(AA,{...l,children:g.jsx(Hte,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:f,children:g.jsx(qte,{scope:t,onClose:x.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:p,modal:o,children:r})})})};i6.displayName=Sp;var Vte="MenuAnchor",TA=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=d0(n);return g.jsx(OA,{...i,...r,ref:t})});TA.displayName=Vte;var PA="MenuPortal",[Kte,a6]=wc(PA,{forceMount:void 0}),o6=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Sc(PA,t);return g.jsx(Kte,{scope:t,forceMount:n,children:g.jsx(zr,{present:n||a.open,children:g.jsx(xp,{asChild:!0,container:i,children:r})})})};o6.displayName=PA;var aa="MenuContent",[Yte,MA]=wc(aa),s6=x.forwardRef((e,t)=>{const n=a6(aa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Sc(aa,e.__scopeMenu),o=Ep(aa,e.__scopeMenu);return g.jsx(km.Provider,{scope:e.__scopeMenu,children:g.jsx(zr,{present:r||a.open,children:g.jsx(km.Slot,{scope:e.__scopeMenu,children:o.modal?g.jsx(Xte,{...i,ref:t}):g.jsx(Gte,{...i,ref:t})})})})}),Xte=x.forwardRef((e,t)=>{const n=Sc(aa,e.__scopeMenu),r=x.useRef(null),i=gt(t,r);return x.useEffect(()=>{const a=r.current;if(a)return cA(a)},[]),g.jsx(DA,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gte=x.forwardRef((e,t)=>{const n=Sc(aa,e.__scopeMenu);return g.jsx(DA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Wte=ec("MenuContent.ScrollLock"),DA=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,onDismiss:v,disableOutsideScroll:b,...w}=e,S=Sc(aa,n),E=Ep(aa,n),j=d0(n),C=r6(n),O=Fte(n),[N,k]=x.useState(null),T=x.useRef(null),M=gt(t,T,S.onContentChange),I=x.useRef(0),L=x.useRef(""),B=x.useRef(0),z=x.useRef(null),G=x.useRef("right"),F=x.useRef(0),V=b?a0:x.Fragment,D=b?{as:Wte,allowPinchZoom:!0}:void 0,q=Y=>{var ae,re;const R=L.current+Y,H=O().filter(ee=>!ee.disabled),U=document.activeElement,$=(ae=H.find(ee=>ee.ref.current===U))==null?void 0:ae.textValue,Q=H.map(ee=>ee.textValue),J=lne(Q,R,$),ne=(re=H.find(ee=>ee.textValue===J))==null?void 0:re.ref.current;(function ee(se){L.current=se,window.clearTimeout(I.current),se!==""&&(I.current=window.setTimeout(()=>ee(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};x.useEffect(()=>()=>window.clearTimeout(I.current),[]),uA();const X=x.useCallback(Y=>{var H,U;return G.current===((H=z.current)==null?void 0:H.side)&&cne(Y,(U=z.current)==null?void 0:U.area)},[]);return g.jsx(Yte,{scope:n,searchRef:L,onItemEnter:x.useCallback(Y=>{X(Y)&&Y.preventDefault()},[X]),onItemLeave:x.useCallback(Y=>{var R;X(Y)||((R=T.current)==null||R.focus(),k(null))},[X]),onTriggerLeave:x.useCallback(Y=>{X(Y)&&Y.preventDefault()},[X]),pointerGraceTimerRef:B,onPointerGraceIntentChange:x.useCallback(Y=>{z.current=Y},[]),children:g.jsx(V,{...D,children:g.jsx(r0,{asChild:!0,trapped:i,onMountAutoFocus:Ae(a,Y=>{var R;Y.preventDefault(),(R=T.current)==null||R.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:g.jsx(yp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:p,onDismiss:v,children:g.jsx(JB,{asChild:!0,...C,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:k,onEntryFocus:Ae(c,Y=>{E.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(kA,{role:"menu","aria-orientation":"vertical","data-state":E6(S.open),"data-radix-menu-content":"",dir:E.dir,...j,...w,ref:M,style:{outline:"none",...w.style},onKeyDown:Ae(w.onKeyDown,Y=>{const H=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,U=Y.ctrlKey||Y.altKey||Y.metaKey,$=Y.key.length===1;H&&(Y.key==="Tab"&&Y.preventDefault(),!U&&$&&q(Y.key));const Q=T.current;if(Y.target!==Q||!zte.includes(Y.key))return;Y.preventDefault();const ne=O().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);t6.includes(Y.key)&&ne.reverse(),one(ne)}),onBlur:Ae(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(I.current),L.current="")}),onPointerMove:Ae(e.onPointerMove,Nm(Y=>{const R=Y.target,H=F.current!==Y.clientX;if(Y.currentTarget.contains(R)&&H){const U=Y.clientX>F.current?"right":"left";G.current=U,F.current=Y.clientX}}))})})})})})})});s6.displayName=aa;var Qte="MenuGroup",RA=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Be.div,{role:"group",...r,ref:t})});RA.displayName=Qte;var Zte="MenuLabel",l6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Be.div,{...r,ref:t})});l6.displayName=Zte;var Ry="MenuItem",ID="menu.itemSelect",h0=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=x.useRef(null),o=Ep(Ry,e.__scopeMenu),l=MA(Ry,e.__scopeMenu),c=gt(t,a),f=x.useRef(!1),h=()=>{const d=a.current;if(!n&&d){const p=new CustomEvent(ID,{bubbles:!0,cancelable:!0});d.addEventListener(ID,v=>r==null?void 0:r(v),{once:!0}),K$(d,p),p.defaultPrevented?f.current=!1:o.onClose()}};return g.jsx(u6,{...i,ref:c,disabled:n,onClick:Ae(e.onClick,h),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),f.current=!0},onPointerUp:Ae(e.onPointerUp,d=>{var p;f.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Ae(e.onKeyDown,d=>{const p=l.searchRef.current!=="";n||p&&d.key===" "||iC.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});h0.displayName=Ry;var u6=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=MA(Ry,n),l=r6(n),c=x.useRef(null),f=gt(t,c),[h,d]=x.useState(!1),[p,v]=x.useState("");return x.useEffect(()=>{const b=c.current;b&&v((b.textContent??"").trim())},[a.children]),g.jsx(km.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:g.jsx(e6,{asChild:!0,...l,focusable:!r,children:g.jsx(Be.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:Ae(e.onPointerMove,Nm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,Nm(b=>o.onItemLeave(b))),onFocus:Ae(e.onFocus,()=>d(!0)),onBlur:Ae(e.onBlur,()=>d(!1))})})})}),Jte="MenuCheckboxItem",c6=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return g.jsx(p6,{scope:e.__scopeMenu,checked:n,children:g.jsx(h0,{role:"menuitemcheckbox","aria-checked":Iy(n)?"mixed":n,...i,ref:t,"data-state":LA(n),onSelect:Ae(i.onSelect,()=>r==null?void 0:r(Iy(n)?!0:!n),{checkForDefaultPrevented:!1})})})});c6.displayName=Jte;var f6="MenuRadioGroup",[ene,tne]=wc(f6,{value:void 0,onValueChange:()=>{}}),d6=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=jr(r);return g.jsx(ene,{scope:e.__scopeMenu,value:n,onValueChange:a,children:g.jsx(RA,{...i,ref:t})})});d6.displayName=f6;var h6="MenuRadioItem",m6=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=tne(h6,e.__scopeMenu),a=n===i.value;return g.jsx(p6,{scope:e.__scopeMenu,checked:a,children:g.jsx(h0,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":LA(a),onSelect:Ae(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});m6.displayName=h6;var IA="MenuItemIndicator",[p6,nne]=wc(IA,{checked:!1}),g6=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=nne(IA,n);return g.jsx(zr,{present:r||Iy(a.checked)||a.checked===!0,children:g.jsx(Be.span,{...i,ref:t,"data-state":LA(a.checked)})})});g6.displayName=IA;var rne="MenuSeparator",v6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(Be.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});v6.displayName=rne;var ine="MenuArrow",y6=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=d0(n);return g.jsx(NA,{...i,...r,ref:t})});y6.displayName=ine;var ane="MenuSub",[L4e,x6]=wc(ane),fm="MenuSubTrigger",b6=x.forwardRef((e,t)=>{const n=Sc(fm,e.__scopeMenu),r=Ep(fm,e.__scopeMenu),i=x6(fm,e.__scopeMenu),a=MA(fm,e.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,f={__scopeMenu:e.__scopeMenu},h=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>h,[h]),x.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),c(null)}},[l,c]),g.jsx(TA,{asChild:!0,...f,children:g.jsx(u6,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":E6(n.open),...e,ref:is(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(e.onPointerMove,Nm(d=>{a.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ae(e.onPointerLeave,Nm(d=>{var v,b;h();const p=(v=n.content)==null?void 0:v.getBoundingClientRect();if(p){const w=(b=n.content)==null?void 0:b.dataset.side,S=w==="right",E=S?-5:5,j=p[S?"left":"right"],C=p[S?"right":"left"];a.onPointerGraceIntentChange({area:[{x:d.clientX+E,y:d.clientY},{x:j,y:p.top},{x:C,y:p.top},{x:C,y:p.bottom},{x:j,y:p.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(d),d.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,d=>{var v;const p=a.searchRef.current!=="";e.disabled||p&&d.key===" "||$te[r.dir].includes(d.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),d.preventDefault())})})})});b6.displayName=fm;var w6="MenuSubContent",S6=x.forwardRef((e,t)=>{const n=a6(aa,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Sc(aa,e.__scopeMenu),o=Ep(aa,e.__scopeMenu),l=x6(w6,e.__scopeMenu),c=x.useRef(null),f=gt(t,c);return g.jsx(km.Provider,{scope:e.__scopeMenu,children:g.jsx(zr,{present:r||a.open,children:g.jsx(km.Slot,{scope:e.__scopeMenu,children:g.jsx(DA,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var d;o.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ae(e.onFocusOutside,h=>{h.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{var v;const d=h.currentTarget.contains(h.target),p=Bte[o.dir].includes(h.key);d&&p&&(a.onOpenChange(!1),(v=l.trigger)==null||v.focus(),h.preventDefault())})})})})})});S6.displayName=w6;function E6(e){return e?"open":"closed"}function Iy(e){return e==="indeterminate"}function LA(e){return Iy(e)?"indeterminate":e?"checked":"unchecked"}function one(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function sne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function lne(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=sne(e,Math.max(a,0));i.length===1&&(o=o.filter(f=>f!==n));const c=o.find(f=>f.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function une(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],f=l.x,h=l.y,d=c.x,p=c.y;h>r!=p>r&&n<(d-f)*(r-h)/(p-h)+f&&(i=!i)}return i}function cne(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return une(n,t)}function Nm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fne=i6,dne=TA,hne=o6,mne=s6,pne=RA,gne=l6,vne=h0,yne=c6,xne=d6,bne=m6,wne=g6,Sne=v6,Ene=y6,_ne=b6,Cne=S6,m0="DropdownMenu",[jne]=Ra(m0,[n6]),Qr=n6(),[Ane,_6]=jne(m0),C6=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,c=Qr(t),f=x.useRef(null),[h,d]=Pl({prop:i,defaultProp:a??!1,onChange:o,caller:m0});return g.jsx(Ane,{scope:t,triggerId:gr(),triggerRef:f,contentId:gr(),open:h,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(p=>!p),[d]),modal:l,children:g.jsx(fne,{...c,open:h,onOpenChange:d,dir:r,modal:l,children:n})})};C6.displayName=m0;var j6="DropdownMenuTrigger",A6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=_6(j6,n),o=Qr(n);return g.jsx(dne,{asChild:!0,...o,children:g.jsx(Be.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:is(t,a.triggerRef),onPointerDown:Ae(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ae(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});A6.displayName=j6;var One="DropdownMenuPortal",O6=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return g.jsx(hne,{...r,...n})};O6.displayName=One;var k6="DropdownMenuContent",N6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=_6(k6,n),a=Qr(n),o=x.useRef(!1);return g.jsx(mne,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,l=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:Ae(e.onInteractOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,h=c.button===2||f;(!i.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});N6.displayName=k6;var kne="DropdownMenuGroup",Nne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(pne,{...i,...r,ref:t})});Nne.displayName=kne;var Tne="DropdownMenuLabel",Pne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(gne,{...i,...r,ref:t})});Pne.displayName=Tne;var Mne="DropdownMenuItem",T6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(vne,{...i,...r,ref:t})});T6.displayName=Mne;var Dne="DropdownMenuCheckboxItem",P6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(yne,{...i,...r,ref:t})});P6.displayName=Dne;var Rne="DropdownMenuRadioGroup",Ine=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(xne,{...i,...r,ref:t})});Ine.displayName=Rne;var Lne="DropdownMenuRadioItem",zne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(bne,{...i,...r,ref:t})});zne.displayName=Lne;var $ne="DropdownMenuItemIndicator",M6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(wne,{...i,...r,ref:t})});M6.displayName=$ne;var Bne="DropdownMenuSeparator",Fne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(Sne,{...i,...r,ref:t})});Fne.displayName=Bne;var Une="DropdownMenuArrow",Hne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(Ene,{...i,...r,ref:t})});Hne.displayName=Une;var qne="DropdownMenuSubTrigger",Vne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(_ne,{...i,...r,ref:t})});Vne.displayName=qne;var Kne="DropdownMenuSubContent",Yne=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Qr(n);return g.jsx(Cne,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Yne.displayName=Kne;var Xne=C6,Gne=A6,Wne=O6,Qne=N6,Zne=T6,Jne=P6,ere=M6,tre="Label",D6=x.forwardRef((e,t)=>g.jsx(Be.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));D6.displayName=tre;var nre=D6;function aC(e,[t,n]){return Math.min(n,Math.max(t,e))}function rre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var zA="ScrollArea",[R6]=Ra(zA),[ire,la]=R6(zA),I6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:a=600,...o}=e,[l,c]=x.useState(null),[f,h]=x.useState(null),[d,p]=x.useState(null),[v,b]=x.useState(null),[w,S]=x.useState(null),[E,j]=x.useState(0),[C,O]=x.useState(0),[N,k]=x.useState(!1),[T,M]=x.useState(!1),I=gt(t,B=>c(B)),L=vp(i);return g.jsx(ire,{scope:n,type:r,dir:L,scrollHideDelay:a,scrollArea:l,viewport:f,onViewportChange:h,content:d,onContentChange:p,scrollbarX:v,onScrollbarXChange:b,scrollbarXEnabled:N,onScrollbarXEnabledChange:k,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:M,onCornerWidthChange:j,onCornerHeightChange:O,children:g.jsx(Be.div,{dir:L,...o,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});I6.displayName=zA;var L6="ScrollAreaViewport",z6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=la(L6,n),l=x.useRef(null),c=gt(t,l,o.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(Be.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});z6.displayName=L6;var yo="ScrollAreaScrollbar",$6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=la(yo,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,l=e.orientation==="horizontal";return x.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),i.type==="hover"?g.jsx(are,{...r,ref:t,forceMount:n}):i.type==="scroll"?g.jsx(ore,{...r,ref:t,forceMount:n}):i.type==="auto"?g.jsx(B6,{...r,ref:t,forceMount:n}):i.type==="always"?g.jsx($A,{...r,ref:t}):null});$6.displayName=yo;var are=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=la(yo,e.__scopeScrollArea),[a,o]=x.useState(!1);return x.useEffect(()=>{const l=i.scrollArea;let c=0;if(l){const f=()=>{window.clearTimeout(c),o(!0)},h=()=>{c=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),g.jsx(zr,{present:n||a,children:g.jsx(B6,{"data-state":a?"visible":"hidden",...r,ref:t})})}),ore=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=la(yo,e.__scopeScrollArea),a=e.orientation==="horizontal",o=g0(()=>c("SCROLL_END"),100),[l,c]=rre("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,i.scrollHideDelay,c]),x.useEffect(()=>{const f=i.viewport,h=a?"scrollLeft":"scrollTop";if(f){let d=f[h];const p=()=>{const v=f[h];d!==v&&(c("SCROLL"),o()),d=v};return f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,a,c,o]),g.jsx(zr,{present:n||l!=="hidden",children:g.jsx($A,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),B6=x.forwardRef((e,t)=>{const n=la(yo,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=x.useState(!1),l=e.orientation==="horizontal",c=g0(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?f:h)}},10);return od(n.viewport,c),od(n.content,c),g.jsx(zr,{present:r||a,children:g.jsx($A,{"data-state":a?"visible":"hidden",...i,ref:t})})}),$A=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=la(yo,e.__scopeScrollArea),a=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=V6(l.viewport,l.content),h={...r,sizes:l,onSizesChange:c,hasThumb:f>0&&f<1,onThumbChange:p=>a.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function d(p,v){return dre(p,o.current,l,v)}return n==="horizontal"?g.jsx(sre,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const p=i.viewport.scrollLeft,v=LD(p,l,i.dir);a.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}}):n==="vertical"?g.jsx(lre,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const p=i.viewport.scrollTop,v=LD(p,l);a.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}}):null}),sre=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=la(yo,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),f=gt(t,c,a.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),g.jsx(U6,{"data-orientation":"horizontal",...i,ref:f,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":p0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(a.viewport){const p=a.viewport.scrollLeft+h.deltaX;e.onWheelScroll(p),Y6(p,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:zy(o.paddingLeft),paddingEnd:zy(o.paddingRight)}})}})}),lre=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,a=la(yo,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),f=gt(t,c,a.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),g.jsx(U6,{"data-orientation":"vertical",...i,ref:f,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":p0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(a.viewport){const p=a.viewport.scrollTop+h.deltaY;e.onWheelScroll(p),Y6(p,d)&&h.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:zy(o.paddingTop),paddingEnd:zy(o.paddingBottom)}})}})}),[ure,F6]=R6(yo),U6=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:f,onWheelScroll:h,onResize:d,...p}=e,v=la(yo,n),[b,w]=x.useState(null),S=gt(t,I=>w(I)),E=x.useRef(null),j=x.useRef(""),C=v.viewport,O=r.content-r.viewport,N=jr(h),k=jr(c),T=g0(d,10);function M(I){if(E.current){const L=I.clientX-E.current.left,B=I.clientY-E.current.top;f({x:L,y:B})}}return x.useEffect(()=>{const I=L=>{const B=L.target;(b==null?void 0:b.contains(B))&&N(L,O)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[C,b,O,N]),x.useEffect(k,[r,k]),od(b,T),od(v.content,T),g.jsx(ure,{scope:n,scrollbar:b,hasThumb:i,onThumbChange:jr(a),onThumbPointerUp:jr(o),onThumbPositionChange:k,onThumbPointerDown:jr(l),children:g.jsx(Be.div,{...p,ref:S,style:{position:"absolute",...p.style},onPointerDown:Ae(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),E.current=b.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),M(I))}),onPointerMove:Ae(e.onPointerMove,M),onPointerUp:Ae(e.onPointerUp,I=>{const L=I.target;L.hasPointerCapture(I.pointerId)&&L.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=j.current,v.viewport&&(v.viewport.style.scrollBehavior=""),E.current=null})})})}),Ly="ScrollAreaThumb",H6=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=F6(Ly,e.__scopeScrollArea);return g.jsx(zr,{present:n||i.hasThumb,children:g.jsx(cre,{ref:t,...r})})}),cre=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,a=la(Ly,n),o=F6(Ly,n),{onThumbPositionChange:l}=o,c=gt(t,d=>o.onThumbChange(d)),f=x.useRef(void 0),h=g0(()=>{f.current&&(f.current(),f.current=void 0)},100);return x.useEffect(()=>{const d=a.viewport;if(d){const p=()=>{if(h(),!f.current){const v=hre(d,l);f.current=v,l()}};return l(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[a.viewport,h,l]),g.jsx(Be.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ae(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),b=d.clientX-v.left,w=d.clientY-v.top;o.onThumbPointerDown({x:b,y:w})}),onPointerUp:Ae(e.onPointerUp,o.onThumbPointerUp)})});H6.displayName=Ly;var BA="ScrollAreaCorner",q6=x.forwardRef((e,t)=>{const n=la(BA,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?g.jsx(fre,{...e,ref:t}):null});q6.displayName=BA;var fre=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=la(BA,n),[a,o]=x.useState(0),[l,c]=x.useState(0),f=!!(a&&l);return od(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),c(h)}),od(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),o(h)}),f?g.jsx(Be.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function zy(e){return e?parseInt(e,10):0}function V6(e,t){const n=e/t;return isNaN(n)?0:n}function p0(e){const t=V6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function dre(e,t,n,r="ltr"){const i=p0(n),a=i/2,o=t||a,l=i-o,c=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return K6([c,f],d)(e)}function LD(e,t,n="ltr"){const r=p0(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],f=aC(e,c);return K6([0,o],[0,l])(f)}function K6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Y6(e,t){return e>0&&e<t}var hre=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function g0(e,t){const n=jr(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function od(e,t){const n=jr(t);vr(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var mre=I6,pre=z6,gre=q6,vre=[" ","Enter","ArrowUp","ArrowDown"],yre=[" ","Enter"],rc="Select",[v0,y0,xre]=aA(rc),[Md]=Ra(rc,[xre,Pd]),x0=Pd(),[bre,Hl]=Md(rc),[wre,Sre]=Md(rc),X6=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:f,name:h,autoComplete:d,disabled:p,required:v,form:b}=e,w=x0(t),[S,E]=x.useState(null),[j,C]=x.useState(null),[O,N]=x.useState(!1),k=vp(f),[T,M]=Pl({prop:r,defaultProp:i??!1,onChange:a,caller:rc}),[I,L]=Pl({prop:o,defaultProp:l,onChange:c,caller:rc}),B=x.useRef(null),z=S?b||!!S.closest("form"):!0,[G,F]=x.useState(new Set),V=Array.from(G).map(D=>D.props.value).join(";");return g.jsx(AA,{...w,children:g.jsxs(bre,{required:v,scope:t,trigger:S,onTriggerChange:E,valueNode:j,onValueNodeChange:C,valueNodeHasChildren:O,onValueNodeHasChildrenChange:N,contentId:gr(),value:I,onValueChange:L,open:T,onOpenChange:M,dir:k,triggerPointerDownPosRef:B,disabled:p,children:[g.jsx(v0.Provider,{scope:t,children:g.jsx(wre,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(D=>{F(q=>new Set(q).add(D))},[]),onNativeOptionRemove:x.useCallback(D=>{F(q=>{const X=new Set(q);return X.delete(D),X})},[]),children:n})}),z?g.jsxs(g8,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:d,value:I,onChange:D=>L(D.target.value),disabled:p,form:b,children:[I===void 0?g.jsx("option",{value:""}):null,Array.from(G)]},V):null]})})};X6.displayName=rc;var G6="SelectTrigger",W6=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=x0(n),o=Hl(G6,n),l=o.disabled||r,c=gt(t,o.onTriggerChange),f=y0(n),h=x.useRef("touch"),[d,p,v]=y8(w=>{const S=f().filter(C=>!C.disabled),E=S.find(C=>C.value===o.value),j=x8(S,w,E);j!==void 0&&o.onValueChange(j.value)}),b=w=>{l||(o.onOpenChange(!0),v()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(OA,{asChild:!0,...a,children:g.jsx(Be.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":v8(o.value)?"":void 0,...i,ref:c,onClick:Ae(i.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&b(w)}),onPointerDown:Ae(i.onPointerDown,w=>{h.current=w.pointerType;const S=w.target;S.hasPointerCapture(w.pointerId)&&S.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:Ae(i.onKeyDown,w=>{const S=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&p(w.key),!(S&&w.key===" ")&&vre.includes(w.key)&&(b(),w.preventDefault())})})})});W6.displayName=G6;var Q6="SelectValue",Z6=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...l}=e,c=Hl(Q6,n),{onValueNodeHasChildrenChange:f}=c,h=a!==void 0,d=gt(t,c.onValueNodeChange);return vr(()=>{f(h)},[f,h]),g.jsx(Be.span,{...l,ref:d,style:{pointerEvents:"none"},children:v8(c.value)?g.jsx(g.Fragment,{children:o}):a})});Z6.displayName=Q6;var Ere="SelectIcon",J6=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return g.jsx(Be.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});J6.displayName=Ere;var _re="SelectPortal",e8=e=>g.jsx(xp,{asChild:!0,...e});e8.displayName=_re;var ic="SelectContent",t8=x.forwardRef((e,t)=>{const n=Hl(ic,e.__scopeSelect),[r,i]=x.useState();if(vr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Ul.createPortal(g.jsx(n8,{scope:e.__scopeSelect,children:g.jsx(v0.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),a):null}return g.jsx(r8,{...e,ref:t})});t8.displayName=ic;var ya=10,[n8,ql]=Md(ic),Cre="SelectContentImpl",jre=ec("SelectContent.RemoveScroll"),r8=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S,...E}=e,j=Hl(ic,n),[C,O]=x.useState(null),[N,k]=x.useState(null),T=gt(t,ae=>O(ae)),[M,I]=x.useState(null),[L,B]=x.useState(null),z=y0(n),[G,F]=x.useState(!1),V=x.useRef(!1);x.useEffect(()=>{if(C)return cA(C)},[C]),uA();const D=x.useCallback(ae=>{const[re,...ee]=z().map(ie=>ie.ref.current),[se]=ee.slice(-1),me=document.activeElement;for(const ie of ae)if(ie===me||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===re&&N&&(N.scrollTop=0),ie===se&&N&&(N.scrollTop=N.scrollHeight),ie==null||ie.focus(),document.activeElement!==me))return},[z,N]),q=x.useCallback(()=>D([M,C]),[D,M,C]);x.useEffect(()=>{G&&q()},[G,q]);const{onOpenChange:X,triggerPointerDownPosRef:Y}=j;x.useEffect(()=>{if(C){let ae={x:0,y:0};const re=se=>{var me,ie;ae={x:Math.abs(Math.round(se.pageX)-(((me=Y.current)==null?void 0:me.x)??0)),y:Math.abs(Math.round(se.pageY)-(((ie=Y.current)==null?void 0:ie.y)??0))}},ee=se=>{ae.x<=10&&ae.y<=10?se.preventDefault():C.contains(se.target)||X(!1),document.removeEventListener("pointermove",re),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,X,Y]),x.useEffect(()=>{const ae=()=>X(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[X]);const[R,H]=y8(ae=>{const re=z().filter(me=>!me.disabled),ee=re.find(me=>me.ref.current===document.activeElement),se=x8(re,ae,ee);se&&setTimeout(()=>se.ref.current.focus())}),U=x.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(j.value!==void 0&&j.value===re||se)&&(I(ae),se&&(V.current=!0))},[j.value]),$=x.useCallback(()=>C==null?void 0:C.focus(),[C]),Q=x.useCallback((ae,re,ee)=>{const se=!V.current&&!ee;(j.value!==void 0&&j.value===re||se)&&B(ae)},[j.value]),J=r==="popper"?oC:i8,ne=J===oC?{side:l,sideOffset:c,align:f,alignOffset:h,arrowPadding:d,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:w,avoidCollisions:S}:{};return g.jsx(n8,{scope:n,content:C,viewport:N,onViewportChange:k,itemRefCallback:U,selectedItem:M,onItemLeave:$,itemTextRefCallback:Q,focusSelectedItem:q,selectedItemText:L,position:r,isPositioned:G,searchRef:R,children:g.jsx(a0,{as:jre,allowPinchZoom:!0,children:g.jsx(r0,{asChild:!0,trapped:j.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ae(i,ae=>{var re;(re=j.trigger)==null||re.focus({preventScroll:!0}),ae.preventDefault()}),children:g.jsx(yp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:g.jsx(J,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ae=>ae.preventDefault(),...E,...ne,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:Ae(E.onKeyDown,ae=>{const re=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!re&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let se=z().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const me=ae.target,ie=se.indexOf(me);se=se.slice(ie+1)}setTimeout(()=>D(se)),ae.preventDefault()}})})})})})})});r8.displayName=Cre;var Are="SelectItemAlignedPosition",i8=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Hl(ic,n),o=ql(ic,n),[l,c]=x.useState(null),[f,h]=x.useState(null),d=gt(t,T=>h(T)),p=y0(n),v=x.useRef(!1),b=x.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:E,focusSelectedItem:j}=o,C=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&w&&S&&E){const T=a.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),I=a.valueNode.getBoundingClientRect(),L=E.getBoundingClientRect();if(a.dir!=="rtl"){const me=L.left-M.left,ie=I.left-me,we=T.left-ie,be=T.width+we,$e=Math.max(be,M.width),Ne=window.innerWidth-ya,Je=aC(ie,[ya,Math.max(ya,Ne-$e)]);l.style.minWidth=be+"px",l.style.left=Je+"px"}else{const me=M.right-L.right,ie=window.innerWidth-I.right-me,we=window.innerWidth-T.right-ie,be=T.width+we,$e=Math.max(be,M.width),Ne=window.innerWidth-ya,Je=aC(ie,[ya,Math.max(ya,Ne-$e)]);l.style.minWidth=be+"px",l.style.right=Je+"px"}const B=p(),z=window.innerHeight-ya*2,G=w.scrollHeight,F=window.getComputedStyle(f),V=parseInt(F.borderTopWidth,10),D=parseInt(F.paddingTop,10),q=parseInt(F.borderBottomWidth,10),X=parseInt(F.paddingBottom,10),Y=V+D+G+X+q,R=Math.min(S.offsetHeight*5,Y),H=window.getComputedStyle(w),U=parseInt(H.paddingTop,10),$=parseInt(H.paddingBottom,10),Q=T.top+T.height/2-ya,J=z-Q,ne=S.offsetHeight/2,ae=S.offsetTop+ne,re=V+D+ae,ee=Y-re;if(re<=Q){const me=B.length>0&&S===B[B.length-1].ref.current;l.style.bottom="0px";const ie=f.clientHeight-w.offsetTop-w.offsetHeight,we=Math.max(J,ne+(me?$:0)+ie+q),be=re+we;l.style.height=be+"px"}else{const me=B.length>0&&S===B[0].ref.current;l.style.top="0px";const we=Math.max(Q,V+w.offsetTop+(me?U:0)+ne)+ee;l.style.height=we+"px",w.scrollTop=re-Q+w.offsetTop}l.style.margin=`${ya}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[p,a.trigger,a.valueNode,l,f,w,S,E,a.dir,r]);vr(()=>C(),[C]);const[O,N]=x.useState();vr(()=>{f&&N(window.getComputedStyle(f).zIndex)},[f]);const k=x.useCallback(T=>{T&&b.current===!0&&(C(),j==null||j(),b.current=!1)},[C,j]);return g.jsx(kre,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:k,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:g.jsx(Be.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});i8.displayName=Are;var Ore="SelectPopperPosition",oC=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ya,...a}=e,o=x0(n);return g.jsx(kA,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oC.displayName=Ore;var[kre,FA]=Md(ic,{}),sC="SelectViewport",a8=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=ql(sC,n),o=FA(sC,n),l=gt(t,a.onViewportChange),c=x.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),g.jsx(v0.Slot,{scope:n,children:g.jsx(Be.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ae(i.onScroll,f=>{const h=f.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&d){const v=Math.abs(c.current-h.scrollTop);if(v>0){const b=window.innerHeight-ya*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),E=Math.max(w,S);if(E<b){const j=E+v,C=Math.min(b,j),O=j-C;d.style.height=C+"px",d.style.bottom==="0px"&&(h.scrollTop=O>0?O:0,d.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});a8.displayName=sC;var o8="SelectGroup",[Nre,Tre]=Md(o8),Pre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=gr();return g.jsx(Nre,{scope:n,id:i,children:g.jsx(Be.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Pre.displayName=o8;var s8="SelectLabel",Mre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Tre(s8,n);return g.jsx(Be.div,{id:i.id,...r,ref:t})});Mre.displayName=s8;var $y="SelectItem",[Dre,l8]=Md($y),u8=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,l=Hl($y,n),c=ql($y,n),f=l.value===r,[h,d]=x.useState(a??""),[p,v]=x.useState(!1),b=gt(t,j=>{var C;return(C=c.itemRefCallback)==null?void 0:C.call(c,j,r,i)}),w=gr(),S=x.useRef("touch"),E=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(Dre,{scope:n,value:r,disabled:i,textId:w,isSelected:f,onItemTextChange:x.useCallback(j=>{d(C=>C||((j==null?void 0:j.textContent)??"").trim())},[]),children:g.jsx(v0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:g.jsx(Be.div,{role:"option","aria-labelledby":w,"data-highlighted":p?"":void 0,"aria-selected":f&&p,"data-state":f?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:b,onFocus:Ae(o.onFocus,()=>v(!0)),onBlur:Ae(o.onBlur,()=>v(!1)),onClick:Ae(o.onClick,()=>{S.current!=="mouse"&&E()}),onPointerUp:Ae(o.onPointerUp,()=>{S.current==="mouse"&&E()}),onPointerDown:Ae(o.onPointerDown,j=>{S.current=j.pointerType}),onPointerMove:Ae(o.onPointerMove,j=>{var C;S.current=j.pointerType,i?(C=c.onItemLeave)==null||C.call(c):S.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,j=>{var C;j.currentTarget===document.activeElement&&((C=c.onItemLeave)==null||C.call(c))}),onKeyDown:Ae(o.onKeyDown,j=>{var O;((O=c.searchRef)==null?void 0:O.current)!==""&&j.key===" "||(yre.includes(j.key)&&E(),j.key===" "&&j.preventDefault())})})})})});u8.displayName=$y;var dm="SelectItemText",c8=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Hl(dm,n),l=ql(dm,n),c=l8(dm,n),f=Sre(dm,n),[h,d]=x.useState(null),p=gt(t,E=>d(E),c.onItemTextChange,E=>{var j;return(j=l.itemTextRefCallback)==null?void 0:j.call(l,E,c.value,c.disabled)}),v=h==null?void 0:h.textContent,b=x.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=f;return vr(()=>(w(b),()=>S(b)),[w,S,b]),g.jsxs(g.Fragment,{children:[g.jsx(Be.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ul.createPortal(a.children,o.valueNode):null]})});c8.displayName=dm;var f8="SelectItemIndicator",d8=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l8(f8,n).isSelected?g.jsx(Be.span,{"aria-hidden":!0,...r,ref:t}):null});d8.displayName=f8;var lC="SelectScrollUpButton",h8=x.forwardRef((e,t)=>{const n=ql(lC,e.__scopeSelect),r=FA(lC,e.__scopeSelect),[i,a]=x.useState(!1),o=gt(t,r.onScrollButtonChange);return vr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollTop>0;a(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?g.jsx(p8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});h8.displayName=lC;var uC="SelectScrollDownButton",m8=x.forwardRef((e,t)=>{const n=ql(uC,e.__scopeSelect),r=FA(uC,e.__scopeSelect),[i,a]=x.useState(!1),o=gt(t,r.onScrollButtonChange);return vr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<f;a(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?g.jsx(p8,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});m8.displayName=uC;var p8=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ql("SelectScrollButton",n),o=x.useRef(null),l=y0(n),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),vr(()=>{var h;const f=l().find(d=>d.ref.current===document.activeElement);(h=f==null?void 0:f.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),g.jsx(Be.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ae(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(i.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(i.onPointerLeave,()=>{c()})})}),Rre="SelectSeparator",Ire=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(Be.div,{"aria-hidden":!0,...r,ref:t})});Ire.displayName=Rre;var cC="SelectArrow",Lre=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=x0(n),a=Hl(cC,n),o=ql(cC,n);return a.open&&o.position==="popper"?g.jsx(NA,{...i,...r,ref:t}):null});Lre.displayName=cC;var zre="SelectBubbleInput",g8=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=x.useRef(null),a=gt(r,i),o=hee(t);return x.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const d=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(d)}},[o,t]),g.jsx(Be.select,{...n,style:{...Y$,...n.style},ref:a,defaultValue:t})});g8.displayName=zre;function v8(e){return e===""||e===void 0}function y8(e){const t=jr(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(o=>{const l=n.current+o;t(l),(function c(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function x8(e,t,n){const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=$re(e,Math.max(a,0));i.length===1&&(o=o.filter(f=>f!==n));const c=o.find(f=>f.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function $re(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Bre=X6,Fre=W6,Ure=Z6,Hre=J6,qre=e8,Vre=t8,Kre=a8,Yre=u8,Xre=c8,Gre=d8,Wre=h8,Qre=m8,Zre="Separator",zD="horizontal",Jre=["horizontal","vertical"],b8=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=zD,...i}=e,a=eie(r)?r:zD,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return g.jsx(Be.div,{"data-orientation":a,...l,...i,ref:t})});b8.displayName=Zre;function eie(e){return Jre.includes(e)}var tie=b8,b0="Tabs",[nie]=Ra(b0,[f0]),w8=f0(),[rie,UA]=nie(b0),S8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...f}=e,h=vp(l),[d,p]=Pl({prop:r,onChange:i,defaultProp:a??"",caller:b0});return g.jsx(rie,{scope:n,baseId:gr(),value:d,onValueChange:p,orientation:o,dir:h,activationMode:c,children:g.jsx(Be.div,{dir:h,"data-orientation":o,...f,ref:t})})});S8.displayName=b0;var E8="TabsList",_8=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=UA(E8,n),o=w8(n);return g.jsx(JB,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:g.jsx(Be.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});_8.displayName=E8;var C8="TabsTrigger",j8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=UA(C8,n),l=w8(n),c=k8(o.baseId,r),f=N8(o.baseId,r),h=r===o.value;return g.jsx(e6,{asChild:!0,...l,focusable:!i,active:h,children:g.jsx(Be.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Ae(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?o.onValueChange(r):d.preventDefault()}),onKeyDown:Ae(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const d=o.activationMode!=="manual";!h&&!i&&d&&o.onValueChange(r)})})})});j8.displayName=C8;var A8="TabsContent",O8=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,l=UA(A8,n),c=k8(l.baseId,r),f=N8(l.baseId,r),h=r===l.value,d=x.useRef(h);return x.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),g.jsx(zr,{present:i||h,children:({present:p})=>g.jsx(Be.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&a})})});O8.displayName=A8;function k8(e,t){return`${e}-trigger-${t}`}function N8(e,t){return`${e}-content-${t}`}var iie=S8,aie=_8,oie=j8,sie=O8,[w0]=Ra("Tooltip",[Pd]),S0=Pd(),T8="TooltipProvider",lie=700,fC="tooltip.open",[uie,HA]=w0(T8),P8=e=>{const{__scopeTooltip:t,delayDuration:n=lie,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),g.jsx(uie,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(f=>{l.current=f},[]),disableHoverableContent:i,children:a})};P8.displayName=T8;var Tm="Tooltip",[cie,_p]=w0(Tm),M8=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=HA(Tm,e.__scopeTooltip),f=S0(t),[h,d]=x.useState(null),p=gr(),v=x.useRef(0),b=o??c.disableHoverableContent,w=l??c.delayDuration,S=x.useRef(!1),[E,j]=Pl({prop:r,defaultProp:i??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(fC))):c.onClose(),a==null||a(T)},caller:Tm}),C=x.useMemo(()=>E?S.current?"delayed-open":"instant-open":"closed",[E]),O=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,j(!0)},[j]),N=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),k=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,j(!0),v.current=0},w)},[w,j]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),g.jsx(AA,{...f,children:g.jsx(cie,{scope:t,contentId:p,open:E,stateAttribute:C,trigger:h,onTriggerChange:d,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?k():O()},[c.isOpenDelayedRef,k,O]),onTriggerLeave:x.useCallback(()=>{b?N():(window.clearTimeout(v.current),v.current=0)},[N,b]),onOpen:O,onClose:N,disableHoverableContent:b,children:n})})};M8.displayName=Tm;var dC="TooltipTrigger",D8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=_p(dC,n),a=HA(dC,n),o=S0(n),l=x.useRef(null),c=gt(t,l,i.onTriggerChange),f=x.useRef(!1),h=x.useRef(!1),d=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),g.jsx(OA,{asChild:!0,...o,children:g.jsx(Be.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:Ae(e.onPointerMove,p=>{p.pointerType!=="touch"&&!h.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ae(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:Ae(e.onBlur,i.onClose),onClick:Ae(e.onClick,i.onClose)})})});D8.displayName=dC;var qA="TooltipPortal",[fie,die]=w0(qA,{forceMount:void 0}),R8=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=_p(qA,t);return g.jsx(fie,{scope:t,forceMount:n,children:g.jsx(zr,{present:n||a.open,children:g.jsx(xp,{asChild:!0,container:i,children:r})})})};R8.displayName=qA;var sd="TooltipContent",I8=x.forwardRef((e,t)=>{const n=die(sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,o=_p(sd,e.__scopeTooltip);return g.jsx(zr,{present:r||o.open,children:o.disableHoverableContent?g.jsx(L8,{side:i,...a,ref:t}):g.jsx(hie,{side:i,...a,ref:t})})}),hie=x.forwardRef((e,t)=>{const n=_p(sd,e.__scopeTooltip),r=HA(sd,e.__scopeTooltip),i=x.useRef(null),a=gt(t,i),[o,l]=x.useState(null),{trigger:c,onClose:f}=n,h=i.current,{onPointerInTransitChange:d}=r,p=x.useCallback(()=>{l(null),d(!1)},[d]),v=x.useCallback((b,w)=>{const S=b.currentTarget,E={x:b.clientX,y:b.clientY},j=vie(E,S.getBoundingClientRect()),C=yie(E,j),O=xie(w.getBoundingClientRect()),N=wie([...C,...O]);l(N),d(!0)},[d]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&h){const b=S=>v(S,h),w=S=>v(S,c);return c.addEventListener("pointerleave",b),h.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",w)}}},[c,h,v,p]),x.useEffect(()=>{if(o){const b=w=>{const S=w.target,E={x:w.clientX,y:w.clientY},j=(c==null?void 0:c.contains(S))||(h==null?void 0:h.contains(S)),C=!bie(E,o);j?p():C&&(p(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,h,o,f,p]),g.jsx(L8,{...e,ref:a})}),[mie,pie]=w0(Tm,{isInside:!1}),gie=PZ("TooltipContent"),L8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=_p(sd,n),f=S0(n),{onClose:h}=c;return x.useEffect(()=>(document.addEventListener(fC,h),()=>document.removeEventListener(fC,h)),[h]),x.useEffect(()=>{if(c.trigger){const d=p=>{const v=p.target;v!=null&&v.contains(c.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,h]),g.jsx(yp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:g.jsxs(kA,{"data-state":c.stateAttribute,...f,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(gie,{children:r}),g.jsx(mie,{scope:n,isInside:!0,children:g.jsx(zZ,{id:c.contentId,role:"tooltip",children:i||r})})]})})});I8.displayName=sd;var z8="TooltipArrow",$8=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=S0(n);return pie(z8,n).isInside?null:g.jsx(NA,{...i,...r,ref:t})});$8.displayName=z8;function vie(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function yie(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function xie(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function bie(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a],c=t[o],f=l.x,h=l.y,d=c.x,p=c.y;h>r!=p>r&&n<(d-f)*(r-h)/(p-h)+f&&(i=!i)}return i}function wie(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Sie(t)}function Sie(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Eie=P8,_ie=M8,Cie=D8,jie=R8,Aie=I8,Oie=$8;function B8(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=B8(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Et(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=B8(e))&&(r&&(r+=" "),r+=t);return r}const kie=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Nie=(e,t)=>({classGroupId:e,validator:t}),F8=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),By="-",$D=[],Tie="arbitrary..",Pie=e=>{const t=Die(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Mie(o);const l=o.split(By),c=l[0]===""&&l.length>1?1:0;return U8(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],f=n[o];return c?f?kie(f,c):c:f||$D}return n[o]||$D}}},U8=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=U8(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const l=t===0?e.join(By):e.slice(t).join(By),c=o.length;for(let f=0;f<c;f++){const h=o[f];if(h.validator(l))return h.classGroupId}},Mie=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Tie+r:void 0})(),Die=e=>{const{theme:t,classGroups:n}=e;return Rie(n,t)},Rie=(e,t)=>{const n=F8();for(const r in e){const i=e[r];VA(i,n,r,t)}return n},VA=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];Iie(o,t,n,r)}},Iie=(e,t,n,r)=>{if(typeof e=="string"){Lie(e,t,n);return}if(typeof e=="function"){zie(e,t,n,r);return}$ie(e,t,n,r)},Lie=(e,t,n)=>{const r=e===""?t:H8(t,e);r.classGroupId=n},zie=(e,t,n,r)=>{if(Bie(e)){VA(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Nie(n,e))},$ie=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[l,c]=i[o];VA(c,H8(t,l),n,r)}},H8=(e,t)=>{let n=e;const r=t.split(By),i=r.length;for(let a=0;a<i;a++){const o=r[a];let l=n.nextPart.get(o);l||(l=F8(),n.nextPart.set(o,l)),n=l}return n},Bie=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Fie=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},hC="!",BD=":",Uie=[],FD=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Hie=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,l=0,c=0,f;const h=i.length;for(let w=0;w<h;w++){const S=i[w];if(o===0&&l===0){if(S===BD){a.push(i.slice(c,w)),c=w+1;continue}if(S==="/"){f=w;continue}}S==="["?o++:S==="]"?o--:S==="("?l++:S===")"&&l--}const d=a.length===0?i:i.slice(c);let p=d,v=!1;d.endsWith(hC)?(p=d.slice(0,-1),v=!0):d.startsWith(hC)&&(p=d.slice(1),v=!0);const b=f&&f>c?f-c:void 0;return FD(a,v,p,b)};if(t){const i=t+BD,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):FD(Uie,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},qie=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],l=o[0]==="[",c=t.has(o);l||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Vie=e=>({cache:Fie(e.cacheSize),parseClassName:Hie(e),sortModifiers:qie(e),...Pie(e)}),Kie=/\s+/,Yie=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],l=e.trim().split(Kie);let c="";for(let f=l.length-1;f>=0;f-=1){const h=l[f],{isExternal:d,modifiers:p,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:w}=n(h);if(d){c=h+(c.length>0?" "+c:c);continue}let S=!!w,E=r(S?b.substring(0,w):b);if(!E){if(!S){c=h+(c.length>0?" "+c:c);continue}if(E=r(b),!E){c=h+(c.length>0?" "+c:c);continue}S=!1}const j=p.length===0?"":p.length===1?p[0]:a(p).join(":"),C=v?j+hC:j,O=C+E;if(o.indexOf(O)>-1)continue;o.push(O);const N=i(E,S);for(let k=0;k<N.length;++k){const T=N[k];o.push(C+T)}c=h+(c.length>0?" "+c:c)}return c},Xie=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=q8(n))&&(i&&(i+=" "),i+=r);return i},q8=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=q8(e[r]))&&(n&&(n+=" "),n+=t);return n},Gie=(e,...t)=>{let n,r,i,a;const o=c=>{const f=t.reduce((h,d)=>d(h),e());return n=Vie(f),r=n.cache.get,i=n.cache.set,a=l,l(c)},l=c=>{const f=r(c);if(f)return f;const h=Yie(c,n);return i(c,h),h};return a=o,(...c)=>a(Xie(...c))},Wie=[],Jn=e=>{const t=n=>n[e]||Wie;return t.isThemeGetter=!0,t},V8=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K8=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Zie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Jie=/\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$/,eae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,rl=e=>Qie.test(e),ut=e=>!!e&&!Number.isNaN(Number(e)),il=e=>!!e&&Number.isInteger(Number(e)),gS=e=>e.endsWith("%")&&ut(e.slice(0,-1)),Bo=e=>Zie.test(e),Y8=()=>!0,rae=e=>Jie.test(e)&&!eae.test(e),KA=()=>!1,iae=e=>tae.test(e),aae=e=>nae.test(e),oae=e=>!Re(e)&&!Ie(e),sae=e=>Vl(e,W8,KA),Re=e=>V8.test(e),Su=e=>Vl(e,Q8,rae),UD=e=>Vl(e,pae,ut),lae=e=>Vl(e,J8,Y8),uae=e=>Vl(e,Z8,KA),HD=e=>Vl(e,X8,KA),cae=e=>Vl(e,G8,aae),Tv=e=>Vl(e,eF,iae),Ie=e=>K8.test(e),Fh=e=>Ec(e,Q8),fae=e=>Ec(e,Z8),qD=e=>Ec(e,X8),dae=e=>Ec(e,W8),hae=e=>Ec(e,G8),Pv=e=>Ec(e,eF,!0),mae=e=>Ec(e,J8,!0),Vl=(e,t,n)=>{const r=V8.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ec=(e,t,n=!1)=>{const r=K8.exec(e);return r?r[1]?t(r[1]):n:!1},X8=e=>e==="position"||e==="percentage",G8=e=>e==="image"||e==="url",W8=e=>e==="length"||e==="size"||e==="bg-size",Q8=e=>e==="length",pae=e=>e==="number",Z8=e=>e==="family-name",J8=e=>e==="number"||e==="weight",eF=e=>e==="shadow",gae=()=>{const e=Jn("color"),t=Jn("font"),n=Jn("text"),r=Jn("font-weight"),i=Jn("tracking"),a=Jn("leading"),o=Jn("breakpoint"),l=Jn("container"),c=Jn("spacing"),f=Jn("radius"),h=Jn("shadow"),d=Jn("inset-shadow"),p=Jn("text-shadow"),v=Jn("drop-shadow"),b=Jn("blur"),w=Jn("perspective"),S=Jn("aspect"),E=Jn("ease"),j=Jn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...O(),Ie,Re],k=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[Ie,Re,c],I=()=>[rl,"full","auto",...M()],L=()=>[il,"none","subgrid",Ie,Re],B=()=>["auto",{span:["full",il,Ie,Re]},il,Ie,Re],z=()=>[il,"auto",Ie,Re],G=()=>["auto","min","max","fr",Ie,Re],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...M()],q=()=>[rl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],X=()=>[rl,"screen","full","dvw","lvw","svw","min","max","fit",...M()],Y=()=>[rl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],R=()=>[e,Ie,Re],H=()=>[...O(),qD,HD,{position:[Ie,Re]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",dae,sae,{size:[Ie,Re]}],Q=()=>[gS,Fh,Su],J=()=>["","none","full",f,Ie,Re],ne=()=>["",ut,Fh,Su],ae=()=>["solid","dashed","dotted","double"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[ut,gS,qD,HD],se=()=>["","none",b,Ie,Re],me=()=>["none",ut,Ie,Re],ie=()=>["none",ut,Ie,Re],we=()=>[ut,Ie,Re],be=()=>[rl,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bo],breakpoint:[Bo],color:[Y8],container:[Bo],"drop-shadow":[Bo],ease:["in","out","in-out"],font:[oae],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bo],shadow:[Bo],spacing:["px",ut],text:[Bo],"text-shadow":[Bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",rl,Re,Ie,S]}],container:["container"],columns:[{columns:[ut,Re,Ie,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:N()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[il,"auto",Ie,Re]}],basis:[{basis:[rl,"full","auto",l,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ut,rl,"auto","initial","none",Re]}],grow:[{grow:["",ut,Ie,Re]}],shrink:[{shrink:["",ut,Ie,Re]}],order:[{order:[il,"first","last","none",Ie,Re]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[l,"screen",...q()]}],"min-w":[{"min-w":[l,"screen","none",...q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Fh,Su]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,mae,lae]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gS,Re]}],"font-family":[{font:[fae,uae,t]}],"font-features":[{"font-features":[Re]}],"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,Ie,Re]}],"line-clamp":[{"line-clamp":[ut,"none",Ie,UD]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",Ie,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[ut,"from-font","auto",Ie,Su]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[ut,"auto",Ie,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Re]}],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",Ie,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},il,Ie,Re],radial:["",Ie,Re],conic:[il,Ie,Re]},hae,cae]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ut,Ie,Re]}],"outline-w":[{outline:["",ut,Fh,Su]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",h,Pv,Tv]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",d,Pv,Tv]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[ut,Su]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",p,Pv,Tv]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[ut,Ie,Re]}],"mix-blend":[{"mix-blend":[...re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":re()}],"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":[ut]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Ie,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[ut]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Re]}],filter:[{filter:["","none",Ie,Re]}],blur:[{blur:se()}],brightness:[{brightness:[ut,Ie,Re]}],contrast:[{contrast:[ut,Ie,Re]}],"drop-shadow":[{"drop-shadow":["","none",v,Pv,Tv]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",ut,Ie,Re]}],"hue-rotate":[{"hue-rotate":[ut,Ie,Re]}],invert:[{invert:["",ut,Ie,Re]}],saturate:[{saturate:[ut,Ie,Re]}],sepia:[{sepia:["",ut,Ie,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Re]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[ut,Ie,Re]}],"backdrop-contrast":[{"backdrop-contrast":[ut,Ie,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ut,Ie,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ut,Ie,Re]}],"backdrop-invert":[{"backdrop-invert":["",ut,Ie,Re]}],"backdrop-opacity":[{"backdrop-opacity":[ut,Ie,Re]}],"backdrop-saturate":[{"backdrop-saturate":[ut,Ie,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",ut,Ie,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ut,"initial",Ie,Re]}],ease:[{ease:["linear","initial",E,Ie,Re]}],delay:[{delay:[ut,Ie,Re]}],animate:[{animate:["none",j,Ie,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ie,Re]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":["scale-3d"],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[Ie,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",Ie,Re]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Ie,Re]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[ut,Fh,Su,UD]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vae=Gie(gae);function ke(...e){return vae(Et(e))}function tF({delayDuration:e=0,...t}){return g.jsx(Eie,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function yae({...e}){return g.jsx(_ie,{"data-slot":"tooltip",...e})}function xae({...e}){return g.jsx(Cie,{"data-slot":"tooltip-trigger",...e})}function bae({className:e,sideOffset:t=0,children:n,...r}){return g.jsx(jie,{children:g.jsxs(Aie,{"data-slot":"tooltip-content",sideOffset:t,className:ke("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[n,g.jsx(Oie,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nF=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wae=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sae=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VD=e=>{const t=Sae(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var Eae={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"};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _ae=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cae=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...Eae,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:nF("lucide",i),...!a&&!_ae(l)&&{"aria-hidden":"true"},...l},[...o.map(([f,h])=>x.createElement(f,h)),...Array.isArray(a)?a:[a]]));/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ze=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(Cae,{ref:a,iconNode:t,className:nF(`lucide-${wae(VD(e))}`,`lucide-${e}`,r),...i}));return n.displayName=VD(e),n};/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jae=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Aae=Ze("arrow-down",jae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oae=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],YA=Ze("arrow-left",Oae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kae=[["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"}]],rF=Ze("bot",kae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nae=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],iF=Ze("brain",Nae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tae=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],XA=Ze("check",Tae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pae=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Pm=Ze("chevron-down",Pae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mae=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Dae=Ze("chevron-left",Mae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rae=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yu=Ze("chevron-right",Rae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Iae=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Lae=Ze("chevron-up",Iae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zae=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],$ae=Ze("chevrons-up-down",zae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ss=Ze("circle-alert",Bae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],GA=Ze("circle-check",Fae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Uae=[["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"}]],aF=Ze("circle-x",Uae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],qae=Ze("clock",Hae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vae=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],KD=Ze("corner-down-left",Vae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Kae=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],E0=Ze("download",Kae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yae=[["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"}]],Xae=Ze("external-link",Yae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gae=[["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"}]],Wae=Ze("eye-off",Gae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qae=[["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"}]],Zae=Ze("eye",Qae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Jae=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],mC=Ze("folder-kanban",Jae);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eoe=[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]],toe=Ze("folder-up",eoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const noe=[["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"}]],roe=Ze("folder",noe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ioe=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aoe=Ze("house",ioe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ooe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],soe=Ze("info",ooe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const loe=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],uoe=Ze("key-round",loe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const coe=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],oF=Ze("layout-dashboard",coe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const foe=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],jl=Ze("loader-circle",foe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const doe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],WA=Ze("message-square",doe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hoe=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],moe=Ze("monitor",hoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const poe=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],sF=Ze("moon",poe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const goe=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],lF=Ze("octagon-x",goe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const voe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],uF=Ze("paperclip",voe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yoe=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],xoe=Ze("pause",yoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const boe=[["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"}]],QA=Ze("pencil",boe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const woe=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],ZA=Ze("play",woe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Soe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fy=Ze("plus",Soe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eoe=[["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"}]],cF=Ze("save",Eoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _oe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fF=Ze("search",_oe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Coe=[["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"}]],joe=Ze("send",Coe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Aoe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],dF=Ze("settings",Aoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ooe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],koe=Ze("square",Ooe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Noe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],hF=Ze("sun",Noe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Toe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Poe=Ze("terminal",Toe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Moe=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Kl=Ze("trash-2",Moe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Doe=[["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"}]],Roe=Ze("triangle-alert",Doe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ioe=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],JA=Ze("upload",Ioe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Loe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],mF=Ze("users",Loe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zoe=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],pF=Ze("wrench",zoe);/**
 * @license lucide-react v0.577.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $oe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_0=Ze("x",$oe);function Boe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Foe=e=>{switch(e){case"success":return qoe;case"info":return Koe;case"warning":return Voe;case"error":return Yoe;default:return null}},Uoe=Array(12).fill(0),Hoe=({visible:e,className:t})=>_e.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},_e.createElement("div",{className:"sonner-spinner"},Uoe.map((n,r)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),qoe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),Voe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.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"})),Koe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),Yoe=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.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"})),Xoe=_e.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"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Goe=()=>{const[e,t]=_e.useState(document.hidden);return _e.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let pC=1;class Woe{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:pC++,o=this.toasts.find(c=>c.id===a),l=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:l,title:r}):c):this.addToast({title:r,...i,dismissible:l,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const l=i.then(async f=>{if(o=["resolve",f],_e.isValidElement(f))a=!1,this.create({id:r,type:"default",message:f});else if(Zoe(f)&&!f.ok){a=!1;const d=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,b=typeof d=="object"&&!_e.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...b})}else if(f instanceof Error){a=!1;const d=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!_e.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:p,...b})}else if(n.success!==void 0){a=!1;const d=typeof n.success=="function"?await n.success(f):n.success,p=typeof n.description=="function"?await n.description(f):n.description,b=typeof d=="object"&&!_e.isValidElement(d)?d:{message:d};this.create({id:r,type:"success",description:p,...b})}}).catch(async f=>{if(o=["reject",f],n.error!==void 0){a=!1;const h=typeof n.error=="function"?await n.error(f):n.error,d=typeof n.description=="function"?await n.description(f):n.description,v=typeof h=="object"&&!_e.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:d,...v})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((f,h)=>l.then(()=>o[0]==="reject"?h(o[1]):f(o[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||pC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ui=new Woe,Qoe=(e,t)=>{const n=(t==null?void 0:t.id)||pC++;return ui.addToast({title:e,...t,id:n}),n},Zoe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Joe=Qoe,ese=()=>ui.toasts,tse=()=>ui.getActiveToasts(),Pt=Object.assign(Joe,{success:ui.success,info:ui.info,warning:ui.warning,error:ui.error,custom:ui.custom,message:ui.message,promise:ui.promise,dismiss:ui.dismiss,loading:ui.loading},{getHistory:ese,getToasts:tse});Boe("[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 Mv(e){return e.label!==void 0}const nse=3,rse="24px",ise="16px",YD=4e3,ase=356,ose=14,sse=45,lse=200;function qa(...e){return e.filter(Boolean).join(" ")}function use(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const cse=e=>{var t,n,r,i,a,o,l,c,f;const{invert:h,toast:d,unstyled:p,interacting:v,setHeights:b,visibleToasts:w,heights:S,index:E,toasts:j,expanded:C,removeToast:O,defaultRichColors:N,closeButton:k,style:T,cancelButtonStyle:M,actionButtonStyle:I,className:L="",descriptionClassName:B="",duration:z,position:G,gap:F,expandByDefault:V,classNames:D,icons:q,closeButtonAriaLabel:X="Close toast"}=e,[Y,R]=_e.useState(null),[H,U]=_e.useState(null),[$,Q]=_e.useState(!1),[J,ne]=_e.useState(!1),[ae,re]=_e.useState(!1),[ee,se]=_e.useState(!1),[me,ie]=_e.useState(!1),[we,be]=_e.useState(0),[$e,Ne]=_e.useState(0),Je=_e.useRef(d.duration||z||YD),Qe=_e.useRef(null),nt=_e.useRef(null),Nn=E===0,Wn=E+1<=w,Mt=d.type,Tn=d.dismissible!==!1,Rt=d.className||"",pn=d.descriptionClassName||"",de=_e.useMemo(()=>S.findIndex(Ge=>Ge.toastId===d.id)||0,[S,d.id]),xe=_e.useMemo(()=>{var Ge;return(Ge=d.closeButton)!=null?Ge:k},[d.closeButton,k]),ze=_e.useMemo(()=>d.duration||z||YD,[d.duration,z]),Ke=_e.useRef(0),et=_e.useRef(0),gn=_e.useRef(0),on=_e.useRef(null),[Kt,Se]=G.split("-"),lt=_e.useMemo(()=>S.reduce((Ge,$t,wn)=>wn>=de?Ge:Ge+$t.height,0),[S,de]),Xe=Goe(),Pn=d.invert||h,vn=Mt==="loading";et.current=_e.useMemo(()=>de*F+lt,[de,lt]),_e.useEffect(()=>{Je.current=ze},[ze]),_e.useEffect(()=>{Q(!0)},[]),_e.useEffect(()=>{const Ge=nt.current;if(Ge){const $t=Ge.getBoundingClientRect().height;return Ne($t),b(wn=>[{toastId:d.id,height:$t,position:d.position},...wn]),()=>b(wn=>wn.filter(Ln=>Ln.toastId!==d.id))}},[b,d.id]),_e.useLayoutEffect(()=>{if(!$)return;const Ge=nt.current,$t=Ge.style.height;Ge.style.height="auto";const wn=Ge.getBoundingClientRect().height;Ge.style.height=$t,Ne(wn),b(Ln=>Ln.find(It=>It.toastId===d.id)?Ln.map(It=>It.toastId===d.id?{...It,height:wn}:It):[{toastId:d.id,height:wn,position:d.position},...Ln])},[$,d.title,d.description,b,d.id,d.jsx,d.action,d.cancel]);const In=_e.useCallback(()=>{ne(!0),be(et.current),b(Ge=>Ge.filter($t=>$t.toastId!==d.id)),setTimeout(()=>{O(d)},lse)},[d,O,b,et]);_e.useEffect(()=>{if(d.promise&&Mt==="loading"||d.duration===1/0||d.type==="loading")return;let Ge;return C||v||Xe?(()=>{if(gn.current<Ke.current){const Ln=new Date().getTime()-Ke.current;Je.current=Je.current-Ln}gn.current=new Date().getTime()})():(()=>{Je.current!==1/0&&(Ke.current=new Date().getTime(),Ge=setTimeout(()=>{d.onAutoClose==null||d.onAutoClose.call(d,d),In()},Je.current))})(),()=>clearTimeout(Ge)},[C,v,d,Mt,Xe,In]),_e.useEffect(()=>{d.delete&&(In(),d.onDismiss==null||d.onDismiss.call(d,d))},[In,d.delete]);function $i(){var Ge;if(q!=null&&q.loading){var $t;return _e.createElement("div",{className:qa(D==null?void 0:D.loader,d==null||($t=d.classNames)==null?void 0:$t.loader,"sonner-loader"),"data-visible":Mt==="loading"},q.loading)}return _e.createElement(Hoe,{className:qa(D==null?void 0:D.loader,d==null||(Ge=d.classNames)==null?void 0:Ge.loader),visible:Mt==="loading"})}const ca=d.icon||(q==null?void 0:q[Mt])||Foe(Mt);var Bi,Ur;return _e.createElement("li",{tabIndex:0,ref:nt,className:qa(L,Rt,D==null?void 0:D.toast,d==null||(t=d.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Mt],d==null||(n=d.classNames)==null?void 0:n[Mt]),"data-sonner-toast":"","data-rich-colors":(Bi=d.richColors)!=null?Bi:N,"data-styled":!(d.jsx||d.unstyled||p),"data-mounted":$,"data-promise":!!d.promise,"data-swiped":me,"data-removed":J,"data-visible":Wn,"data-y-position":Kt,"data-x-position":Se,"data-index":E,"data-front":Nn,"data-swiping":ae,"data-dismissible":Tn,"data-type":Mt,"data-invert":Pn,"data-swipe-out":ee,"data-swipe-direction":H,"data-expanded":!!(C||V&&$),"data-testid":d.testId,style:{"--index":E,"--toasts-before":E,"--z-index":j.length-E,"--offset":`${J?we:et.current}px`,"--initial-height":V?"auto":`${$e}px`,...T,...d.style},onDragEnd:()=>{re(!1),R(null),on.current=null},onPointerDown:Ge=>{Ge.button!==2&&(vn||!Tn||(Qe.current=new Date,be(et.current),Ge.target.setPointerCapture(Ge.pointerId),Ge.target.tagName!=="BUTTON"&&(re(!0),on.current={x:Ge.clientX,y:Ge.clientY})))},onPointerUp:()=>{var Ge,$t,wn;if(ee||!Tn)return;on.current=null;const Ln=Number(((Ge=nt.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mi=Number((($t=nt.current)==null?void 0:$t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),It=new Date().getTime()-((wn=Qe.current)==null?void 0:wn.getTime()),ur=Y==="x"?Ln:mi,fa=Math.abs(ur)/It;if(Math.abs(ur)>=sse||fa>.11){be(et.current),d.onDismiss==null||d.onDismiss.call(d,d),U(Y==="x"?Ln>0?"right":"left":mi>0?"down":"up"),In(),se(!0);return}else{var Qn,cr;(Qn=nt.current)==null||Qn.style.setProperty("--swipe-amount-x","0px"),(cr=nt.current)==null||cr.style.setProperty("--swipe-amount-y","0px")}ie(!1),re(!1),R(null)},onPointerMove:Ge=>{var $t,wn,Ln;if(!on.current||!Tn||(($t=window.getSelection())==null?void 0:$t.toString().length)>0)return;const It=Ge.clientY-on.current.y,ur=Ge.clientX-on.current.x;var fa;const Qn=(fa=e.swipeDirections)!=null?fa:use(G);!Y&&(Math.abs(ur)>1||Math.abs(It)>1)&&R(Math.abs(ur)>Math.abs(It)?"x":"y");let cr={x:0,y:0};const $a=Or=>1/(1.5+Math.abs(Or)/20);if(Y==="y"){if(Qn.includes("top")||Qn.includes("bottom"))if(Qn.includes("top")&&It<0||Qn.includes("bottom")&&It>0)cr.y=It;else{const Or=It*$a(It);cr.y=Math.abs(Or)<Math.abs(It)?Or:It}}else if(Y==="x"&&(Qn.includes("left")||Qn.includes("right")))if(Qn.includes("left")&&ur<0||Qn.includes("right")&&ur>0)cr.x=ur;else{const Or=ur*$a(ur);cr.x=Math.abs(Or)<Math.abs(ur)?Or:ur}(Math.abs(cr.x)>0||Math.abs(cr.y)>0)&&ie(!0),(wn=nt.current)==null||wn.style.setProperty("--swipe-amount-x",`${cr.x}px`),(Ln=nt.current)==null||Ln.style.setProperty("--swipe-amount-y",`${cr.y}px`)}},xe&&!d.jsx&&Mt!=="loading"?_e.createElement("button",{"aria-label":X,"data-disabled":vn,"data-close-button":!0,onClick:vn||!Tn?()=>{}:()=>{In(),d.onDismiss==null||d.onDismiss.call(d,d)},className:qa(D==null?void 0:D.closeButton,d==null||(r=d.classNames)==null?void 0:r.closeButton)},(Ur=q==null?void 0:q.close)!=null?Ur:Xoe):null,(Mt||d.icon||d.promise)&&d.icon!==null&&((q==null?void 0:q[Mt])!==null||d.icon)?_e.createElement("div",{"data-icon":"",className:qa(D==null?void 0:D.icon,d==null||(i=d.classNames)==null?void 0:i.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||$i():null,d.type!=="loading"?ca:null):null,_e.createElement("div",{"data-content":"",className:qa(D==null?void 0:D.content,d==null||(a=d.classNames)==null?void 0:a.content)},_e.createElement("div",{"data-title":"",className:qa(D==null?void 0:D.title,d==null||(o=d.classNames)==null?void 0:o.title)},d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title),d.description?_e.createElement("div",{"data-description":"",className:qa(B,pn,D==null?void 0:D.description,d==null||(l=d.classNames)==null?void 0:l.description)},typeof d.description=="function"?d.description():d.description):null),_e.isValidElement(d.cancel)?d.cancel:d.cancel&&Mv(d.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||M,onClick:Ge=>{Mv(d.cancel)&&Tn&&(d.cancel.onClick==null||d.cancel.onClick.call(d.cancel,Ge),In())},className:qa(D==null?void 0:D.cancelButton,d==null||(c=d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,_e.isValidElement(d.action)?d.action:d.action&&Mv(d.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||I,onClick:Ge=>{Mv(d.action)&&(d.action.onClick==null||d.action.onClick.call(d.action,Ge),!Ge.defaultPrevented&&In())},className:qa(D==null?void 0:D.actionButton,d==null||(f=d.classNames)==null?void 0:f.actionButton)},d.action.label):null)};function XD(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function fse(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?ise:rse;function c(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=l:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(l)}),n}const dse=_e.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:f,offset:h,mobileOffset:d,theme:p="light",richColors:v,duration:b,style:w,visibleToasts:S=nse,toastOptions:E,dir:j=XD(),gap:C=ose,icons:O,containerAriaLabel:N="Notifications"}=t,[k,T]=_e.useState([]),M=_e.useMemo(()=>r?k.filter($=>$.toasterId===r):k.filter($=>!$.toasterId),[k,r]),I=_e.useMemo(()=>Array.from(new Set([a].concat(M.filter($=>$.position).map($=>$.position)))),[M,a]),[L,B]=_e.useState([]),[z,G]=_e.useState(!1),[F,V]=_e.useState(!1),[D,q]=_e.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=_e.useRef(null),Y=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=_e.useRef(null),H=_e.useRef(!1),U=_e.useCallback($=>{T(Q=>{var J;return(J=Q.find(ne=>ne.id===$.id))!=null&&J.delete||ui.dismiss($.id),Q.filter(({id:ne})=>ne!==$.id)})},[]);return _e.useEffect(()=>ui.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{T(Q=>Q.map(J=>J.id===$.id?{...J,delete:!0}:J))});return}setTimeout(()=>{C$.flushSync(()=>{T(Q=>{const J=Q.findIndex(ne=>ne.id===$.id);return J!==-1?[...Q.slice(0,J),{...Q[J],...$},...Q.slice(J+1)]:[$,...Q]})})})}),[k]),_e.useEffect(()=>{if(p!=="system"){q(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Q})=>{q(Q?"dark":"light")})}catch{$.addListener(({matches:J})=>{try{q(J?"dark":"light")}catch(ne){console.error(ne)}})}},[p]),_e.useEffect(()=>{k.length<=1&&G(!1)},[k]),_e.useEffect(()=>{const $=Q=>{var J;if(o.every(re=>Q[re]||Q.code===re)){var ae;G(!0),(ae=X.current)==null||ae.focus()}Q.code==="Escape"&&(document.activeElement===X.current||(J=X.current)!=null&&J.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[o]),_e.useEffect(()=>{if(X.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,H.current=!1)}},[X.current]),_e.createElement("section",{ref:n,"aria-label":`${N} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map(($,Q)=>{var J;const[ne,ae]=$.split("-");return M.length?_e.createElement("ol",{key:$,dir:j==="auto"?XD():j,tabIndex:-1,ref:X,className:f,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":ne,"data-x-position":ae,style:{"--front-toast-height":`${((J=L[0])==null?void 0:J.height)||0}px`,"--width":`${ase}px`,"--gap":`${C}px`,...w,...fse(h,d)},onBlur:re=>{H.current&&!re.currentTarget.contains(re.relatedTarget)&&(H.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||H.current||(H.current=!0,R.current=re.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{F||G(!1)},onDragEnd:()=>G(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(re=>!re.position&&Q===0||re.position===$).map((re,ee)=>{var se,me;return _e.createElement(cse,{key:re.id,icons:O,index:ee,toast:re,defaultRichColors:v,duration:(se=E==null?void 0:E.duration)!=null?se:b,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:i,visibleToasts:S,closeButton:(me=E==null?void 0:E.closeButton)!=null?me:c,interacting:F,position:$,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:U,toasts:M.filter(ie=>ie.position==re.position),heights:L.filter(ie=>ie.position==re.position),setHeights:B,expandByDefault:l,gap:C,expanded:z,swipeDirections:t.swipeDirections})})):null}))}),hse=({...e})=>{const{theme:t="system"}=rA();return g.jsx(dse,{theme:t,className:"toaster group",icons:{success:g.jsx(GA,{className:"size-4"}),info:g.jsx(soe,{className:"size-4"}),warning:g.jsx(Roe,{className:"size-4"}),error:g.jsx(lF,{className:"size-4"}),loading:g.jsx(jl,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},mse=new pZ({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,refetchOnWindowFocus:!0,retry:1}}}),gF="/api";class vF extends Error{constructor(t,n,r){super(`${t} ${n}`),this.status=t,this.statusText=n,this.body=r,this.name="ApiError"}}async function Uh(e,t){const n=`${gF}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),3e4);let a;try{a=await fetch(n,{...t,signal:(t==null?void 0:t.signal)??r.signal,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}})}finally{clearTimeout(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new vF(a.status,a.statusText,o)}if(!(a.status===204||a.headers.get("content-length")==="0"))return a.json()}async function pse(e,t){const n=`${gF}${e}`,r=new AbortController,i=setTimeout(()=>r.abort(),6e4);let a;try{a=await fetch(n,{method:"POST",body:t,signal:r.signal})}finally{clearTimeout(i)}if(!a.ok){const o=await a.json().catch(()=>null);throw new vF(a.status,a.statusText,o)}return a.json()}const He={get:e=>Uh(e),post:(e,t)=>Uh(e,{method:"POST",body:t!=null?JSON.stringify(t):void 0}),put:(e,t)=>Uh(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Uh(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Uh(e,{method:"DELETE"}),upload:(e,t)=>{const n=new FormData;return t.forEach(r=>n.append("files",r)),pse(e,n)}},qe={projects:{all:["projects"],detail:e=>["projects",e],config:e=>["projects",e,"config"],sessions:e=>["projects",e,"sessions"],files:e=>["projects",e,"files"],stats:(e,t)=>["projects",e,"stats",t],resources:e=>["projects",e,"resources"],resourceDetail:(e,t,n)=>["projects",e,"resources",t,n],resourceConfig:(e,t,n)=>["projects",e,"resources",t,n,"config"]},sessions:{all:e=>["sessions",e],detail:(e,t)=>["sessions",e,t],running:()=>["sessions",{status:"running"}]},roles:{all:["roles"]},config:{global:["config","global"]},registry:{list:e=>["registry",e],detail:(e,t)=>["registry",e,t],config:(e,t)=>["registry",e,t,"config"],validate:e=>["registry","agents",e,"validate"]},schedules:{all:["schedules"],detail:e=>["schedules",e],history:e=>["schedules",e,"history"]},conversations:{all:e=>["conversations",e],detail:e=>["conversations","detail",e]}};function Dd(){return Yn({queryKey:qe.projects.all,queryFn:()=>He.get("/projects")})}function eO(e,t){return Yn({queryKey:qe.projects.detail(e),queryFn:()=>He.get(`/projects/${e}`),enabled:t==null?void 0:t.enabled})}function tO(e){return Yn({queryKey:qe.projects.files(e),queryFn:()=>He.get(`/projects/${e}/files`)})}function nO(e,t){return Yn({queryKey:qe.projects.config(e),queryFn:()=>He.get(`/projects/${e}/config`),enabled:t==null?void 0:t.enabled})}function GD(e,t){return wZ({queryKey:qe.conversations.detail(e),queryFn:({pageParam:n})=>He.get(`/conversations/${e}?limit=20${n?`&before_id=${encodeURIComponent(n)}`:""}`),initialPageParam:null,getPreviousPageParam:n=>{var r;return n.has_more?((r=n.sessions[0])==null?void 0:r.run_id)??null:null},getNextPageParam:()=>null,...t})}function gse(e=10){return Yn({queryKey:["conversations","recent",e],queryFn:()=>He.get(`/conversations/recent?limit=${e}`)})}function rO(e,t=1,n=20){return Yn({queryKey:[...qe.conversations.all(e),t,n],queryFn:()=>He.get(`/projects/${e}/conversations?page=${t}&per_page=${n}`),enabled:e>0})}function yF(){const e=_t();return Qt({mutationFn:t=>He.post("/conversations",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:qe.conversations.all(n.project_id)})}})}function vse(e){const t=_t();return Qt({mutationFn:n=>He.post(`/conversations/${e}/tasks`,n),onSuccess:()=>{t.invalidateQueries({queryKey:qe.conversations.detail(e)}),t.invalidateQueries({queryKey:["sessions"]})}})}function iO(e){const t=_t();return Qt({mutationFn:({conversationId:n,title:r})=>He.patch(`/conversations/${n}`,{title:r}),onSuccess:(n,{conversationId:r})=>{t.invalidateQueries({queryKey:qe.conversations.all(e)}),t.invalidateQueries({queryKey:qe.conversations.detail(r)})}})}function xF(e){const t=_t();return Qt({mutationFn:n=>He.delete(`/conversations/${n}`),onMutate:async n=>{await t.cancelQueries({queryKey:qe.conversations.all(e)});const r=t.getQueryData(qe.conversations.all(e));return t.setQueryData(qe.conversations.all(e),i=>i&&{...i,items:i.items.filter(a=>a.id!==n),total:i.total-1}),{previous:r}},onError:(n,r,i)=>{i!=null&&i.previous&&t.setQueryData(qe.conversations.all(e),i.previous)},onSettled:()=>{t.invalidateQueries({queryKey:qe.conversations.all(e)})}})}function ct({className:e,type:t,...n}){return g.jsx("input",{type:t,"data-slot":"input",className:ke("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}const yse=500;function xse({onCommandPalette:e,onShortcutsHelp:t}){const n=Fl(),r=x.useRef(null),i=x.useRef(void 0);x.useEffect(()=>{function a(o){const l=o.target;if(!(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)){if((o.metaKey||o.ctrlKey)&&o.key==="k"){o.preventDefault(),e();return}if(!(o.metaKey||o.ctrlKey||o.altKey)){if(o.key==="?"){o.preventDefault(),t();return}if(r.current==="g"){if(r.current=null,clearTimeout(i.current),o.key==="d"){o.preventDefault(),n("/");return}if(o.key==="p"){o.preventDefault(),n("/projects");return}}if(o.key==="g"){r.current="g",i.current=setTimeout(()=>{r.current=null},yse);return}}}}return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),clearTimeout(i.current)}},[n,e,t])}function bF(e){const t=e?"?"+new URLSearchParams(e).toString():"";return Yn({queryKey:qe.sessions.all(e),queryFn:()=>He.get(`/sessions${t}`)})}function aO(){return bF({status:"running",per_page:"50"})}function bse(){return bF({per_page:"10"})}function wse(e,t=1,n=20){return Yn({queryKey:[...qe.projects.sessions(e),t,n],queryFn:()=>He.get(`/projects/${e}/sessions?page=${t}&per_page=${n}`)})}function Sse(e,t,n){return Yn({queryKey:qe.sessions.detail(e,t),queryFn:()=>He.get(`/projects/${e}/sessions/${t}`),...n})}var WD=1,Ese=.9,_se=.8,Cse=.17,vS=.1,yS=.999,jse=.9999,Ase=.99,Ose=/[\\\/_+.#"@\[\(\{&]/,kse=/[\\\/_+.#"@\[\(\{&]/g,Nse=/[\s-]/,wF=/[\s-]/g;function gC(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?WD:Ase;var l=`${i},${a}`;if(o[l]!==void 0)return o[l];for(var c=r.charAt(a),f=n.indexOf(c,i),h=0,d,p,v,b;f>=0;)d=gC(e,t,n,r,f+1,a+1,o),d>h&&(f===i?d*=WD:Ose.test(e.charAt(f-1))?(d*=_se,v=e.slice(i,f-1).match(kse),v&&i>0&&(d*=Math.pow(yS,v.length))):Nse.test(e.charAt(f-1))?(d*=Ese,b=e.slice(i,f-1).match(wF),b&&i>0&&(d*=Math.pow(yS,b.length))):(d*=Cse,i>0&&(d*=Math.pow(yS,f-i))),e.charAt(f)!==t.charAt(a)&&(d*=jse)),(d<vS&&n.charAt(f-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(f-1)!==r.charAt(a))&&(p=gC(e,t,n,r,f+1,a+2,o),p*vS>d&&(d=p*vS)),d>h&&(h=d),f=n.indexOf(c,f+1);return o[l]=h,h}function QD(e){return e.toLowerCase().replace(wF," ")}function Tse(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,gC(e,t,QD(e),QD(t),0,0,{})}var Hh='[cmdk-group=""]',xS='[cmdk-group-items=""]',Pse='[cmdk-group-heading=""]',SF='[cmdk-item=""]',ZD=`${SF}:not([aria-disabled="true"])`,vC="cmdk-item-select",jf="data-value",Mse=(e,t,n)=>Tse(e,t,n),EF=x.createContext(void 0),Cp=()=>x.useContext(EF),_F=x.createContext(void 0),oO=()=>x.useContext(_F),CF=x.createContext(void 0),jF=x.forwardRef((e,t)=>{let n=Af(()=>{var U,$;return{search:"",value:($=(U=e.value)!=null?U:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Af(()=>new Set),i=Af(()=>new Map),a=Af(()=>new Map),o=Af(()=>new Set),l=AF(e),{label:c,children:f,value:h,onValueChange:d,filter:p,shouldFilter:v,loop:b,disablePointerSelection:w=!1,vimBindings:S=!0,...E}=e,j=gr(),C=gr(),O=gr(),N=x.useRef(null),k=qse();ac(()=>{if(h!==void 0){let U=h.trim();n.current.value=U,T.emit()}},[h]),ac(()=>{k(6,G)},[]);let T=x.useMemo(()=>({subscribe:U=>(o.current.add(U),()=>o.current.delete(U)),snapshot:()=>n.current,setState:(U,$,Q)=>{var J,ne,ae,re;if(!Object.is(n.current[U],$)){if(n.current[U]=$,U==="search")z(),L(),k(1,B);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(O);ee?ee.focus():(J=document.getElementById(j))==null||J.focus()}if(k(7,()=>{var ee;n.current.selectedItemId=(ee=F())==null?void 0:ee.id,T.emit()}),Q||k(5,G),((ne=l.current)==null?void 0:ne.value)!==void 0){let ee=$??"";(re=(ae=l.current).onValueChange)==null||re.call(ae,ee);return}}T.emit()}},emit:()=>{o.current.forEach(U=>U())}}),[]),M=x.useMemo(()=>({value:(U,$,Q)=>{var J;$!==((J=a.current.get(U))==null?void 0:J.value)&&(a.current.set(U,{value:$,keywords:Q}),n.current.filtered.items.set(U,I($,Q)),k(2,()=>{L(),T.emit()}))},item:(U,$)=>(r.current.add(U),$&&(i.current.has($)?i.current.get($).add(U):i.current.set($,new Set([U]))),k(3,()=>{z(),L(),n.current.value||B(),T.emit()}),()=>{a.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=F();k(4,()=>{z(),(Q==null?void 0:Q.getAttribute("id"))===U&&B(),T.emit()})}),group:U=>(i.current.has(U)||i.current.set(U,new Set),()=>{a.current.delete(U),i.current.delete(U)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:j,inputId:O,labelId:C,listInnerRef:N}),[]);function I(U,$){var Q,J;let ne=(J=(Q=l.current)==null?void 0:Q.filter)!=null?J:Mse;return U?ne(U,n.current.search,$):0}function L(){if(!n.current.search||l.current.shouldFilter===!1)return;let U=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(J=>{let ne=i.current.get(J),ae=0;ne.forEach(re=>{let ee=U.get(re);ae=Math.max(ee,ae)}),$.push([J,ae])});let Q=N.current;V().sort((J,ne)=>{var ae,re;let ee=J.getAttribute("id"),se=ne.getAttribute("id");return((ae=U.get(se))!=null?ae:0)-((re=U.get(ee))!=null?re:0)}).forEach(J=>{let ne=J.closest(xS);ne?ne.appendChild(J.parentElement===ne?J:J.closest(`${xS} > *`)):Q.appendChild(J.parentElement===Q?J:J.closest(`${xS} > *`))}),$.sort((J,ne)=>ne[1]-J[1]).forEach(J=>{var ne;let ae=(ne=N.current)==null?void 0:ne.querySelector(`${Hh}[${jf}="${encodeURIComponent(J[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function B(){let U=V().find(Q=>Q.getAttribute("aria-disabled")!=="true"),$=U==null?void 0:U.getAttribute(jf);T.setState("value",$||void 0)}function z(){var U,$,Q,J;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let ae of r.current){let re=($=(U=a.current.get(ae))==null?void 0:U.value)!=null?$:"",ee=(J=(Q=a.current.get(ae))==null?void 0:Q.keywords)!=null?J:[],se=I(re,ee);n.current.filtered.items.set(ae,se),se>0&&ne++}for(let[ae,re]of i.current)for(let ee of re)if(n.current.filtered.items.get(ee)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ne}function G(){var U,$,Q;let J=F();J&&(((U=J.parentElement)==null?void 0:U.firstChild)===J&&((Q=($=J.closest(Hh))==null?void 0:$.querySelector(Pse))==null||Q.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function F(){var U;return(U=N.current)==null?void 0:U.querySelector(`${SF}[aria-selected="true"]`)}function V(){var U;return Array.from(((U=N.current)==null?void 0:U.querySelectorAll(ZD))||[])}function D(U){let $=V()[U];$&&T.setState("value",$.getAttribute(jf))}function q(U){var $;let Q=F(),J=V(),ne=J.findIndex(re=>re===Q),ae=J[ne+U];($=l.current)!=null&&$.loop&&(ae=ne+U<0?J[J.length-1]:ne+U===J.length?J[0]:J[ne+U]),ae&&T.setState("value",ae.getAttribute(jf))}function X(U){let $=F(),Q=$==null?void 0:$.closest(Hh),J;for(;Q&&!J;)Q=U>0?Use(Q,Hh):Hse(Q,Hh),J=Q==null?void 0:Q.querySelector(ZD);J?T.setState("value",J.getAttribute(jf)):q(U)}let Y=()=>D(V().length-1),R=U=>{U.preventDefault(),U.metaKey?Y():U.altKey?X(1):q(1)},H=U=>{U.preventDefault(),U.metaKey?D(0):U.altKey?X(-1):q(-1)};return x.createElement(Be.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:U=>{var $;($=E.onKeyDown)==null||$.call(E,U);let Q=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Q))switch(U.key){case"n":case"j":{S&&U.ctrlKey&&R(U);break}case"ArrowDown":{R(U);break}case"p":case"k":{S&&U.ctrlKey&&H(U);break}case"ArrowUp":{H(U);break}case"Home":{U.preventDefault(),D(0);break}case"End":{U.preventDefault(),Y();break}case"Enter":{U.preventDefault();let J=F();if(J){let ne=new Event(vC);J.dispatchEvent(ne)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:Kse},c),C0(e,U=>x.createElement(_F.Provider,{value:T},x.createElement(EF.Provider,{value:M},U))))}),Dse=x.forwardRef((e,t)=>{var n,r;let i=gr(),a=x.useRef(null),o=x.useContext(CF),l=Cp(),c=AF(e),f=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;ac(()=>{if(!f)return l.item(i,o==null?void 0:o.id)},[f]);let h=OF(i,a,[e.value,e.children,a],e.keywords),d=oO(),p=Rl(k=>k.value&&k.value===h.current),v=Rl(k=>f||l.filter()===!1?!0:k.search?k.filtered.items.get(i)>0:!0);x.useEffect(()=>{let k=a.current;if(!(!k||e.disabled))return k.addEventListener(vC,b),()=>k.removeEventListener(vC,b)},[v,e.onSelect,e.disabled]);function b(){var k,T;w(),(T=(k=c.current).onSelect)==null||T.call(k,h.current)}function w(){d.setState("value",h.current,!0)}if(!v)return null;let{disabled:S,value:E,onSelect:j,forceMount:C,keywords:O,...N}=e;return x.createElement(Be.div,{ref:is(a,t),...N,id:i,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!p,"data-disabled":!!S,"data-selected":!!p,onPointerMove:S||l.getDisablePointerSelection()?void 0:w,onClick:S?void 0:b},e.children)}),Rse=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=gr(),l=x.useRef(null),c=x.useRef(null),f=gr(),h=Cp(),d=Rl(v=>i||h.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);ac(()=>h.group(o),[]),OF(o,l,[e.value,e.heading,c]);let p=x.useMemo(()=>({id:o,forceMount:i}),[i]);return x.createElement(Be.div,{ref:is(l,t),...a,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&x.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),C0(e,v=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},x.createElement(CF.Provider,{value:p},v))))}),Ise=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=x.useRef(null),a=Rl(o=>!o.search);return!n&&!a?null:x.createElement(Be.div,{ref:is(i,t),...r,"cmdk-separator":"",role:"separator"})}),Lse=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=oO(),o=Rl(f=>f.search),l=Rl(f=>f.selectedItemId),c=Cp();return x.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),x.createElement(Be.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:i?e.value:o,onChange:f=>{i||a.setState("search",f.target.value),n==null||n(f.target.value)}})}),zse=x.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=x.useRef(null),o=x.useRef(null),l=Rl(f=>f.selectedItemId),c=Cp();return x.useEffect(()=>{if(o.current&&a.current){let f=o.current,h=a.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let v=f.offsetHeight;h.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return p.observe(f),()=>{cancelAnimationFrame(d),p.unobserve(f)}}},[]),x.createElement(Be.div,{ref:is(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},C0(e,f=>x.createElement("div",{ref:is(o,c.listInnerRef),"cmdk-list-sizer":""},f)))}),$se=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...l}=e;return x.createElement(mA,{open:n,onOpenChange:r},x.createElement(pA,{container:o},x.createElement(gA,{"cmdk-overlay":"",className:i}),x.createElement(vA,{"aria-label":e.label,"cmdk-dialog":"",className:a},x.createElement(jF,{ref:t,...l}))))}),Bse=x.forwardRef((e,t)=>Rl(n=>n.filtered.count===0)?x.createElement(Be.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Fse=x.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return x.createElement(Be.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},C0(e,o=>x.createElement("div",{"aria-hidden":!0},o)))}),Rd=Object.assign(jF,{List:zse,Item:Dse,Input:Lse,Group:Rse,Separator:Ise,Dialog:$se,Empty:Bse,Loading:Fse});function Use(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Hse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function AF(e){let t=x.useRef(e);return ac(()=>{t.current=e}),t}var ac=typeof window>"u"?x.useEffect:x.useLayoutEffect;function Af(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Rl(e){let t=oO(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function OF(e,t,n,r=[]){let i=x.useRef(),a=Cp();return ac(()=>{var o;let l=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():i.current}})(),c=r.map(f=>f.trim());a.value(e,l,c),(o=t.current)==null||o.setAttribute(jf,l),i.current=l}),i}var qse=()=>{let[e,t]=x.useState(),n=Af(()=>new Map);return ac(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function Vse(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function C0({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(Vse(t),{ref:t.ref},n(t.props.children)):n(t)}var Kse={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const JD=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eR=Et,j0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const h=n==null?void 0:n[f],d=a==null?void 0:a[f];if(h===null)return null;const p=JD(h)||JD(d);return i[f][p]}),l=n&&Object.entries(n).reduce((f,h)=>{let[d,p]=h;return p===void 0||(f[d]=p),f},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:d,className:p,...v}=h;return Object.entries(v).every(b=>{let[w,S]=b;return Array.isArray(S)?S.includes({...a,...l}[w]):{...a,...l}[w]===S})?[...f,d,p]:f},[]);return eR(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},Yse=j0("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function je({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const a=r?iA:"button";return g.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:ke(Yse({variant:t,size:n,className:e})),...i})}function Yl({...e}){return g.jsx(mA,{"data-slot":"dialog",...e})}function Xse({...e}){return g.jsx(pA,{"data-slot":"dialog-portal",...e})}function Gse({className:e,...t}){return g.jsx(gA,{"data-slot":"dialog-overlay",className:ke("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function Xl({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(Xse,{"data-slot":"dialog-portal",children:[g.jsx(Gse,{}),g.jsxs(vA,{"data-slot":"dialog-content",className:ke("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&g.jsxs(yA,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(_0,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Gl({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:ke("flex flex-col gap-2 text-center sm:text-left",e),...t})}function kF({className:e,showCloseButton:t=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:ke("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&g.jsx(yA,{asChild:!0,children:g.jsx(je,{variant:"outline",children:"Close"})})]})}function Wl({className:e,...t}){return g.jsx(CB,{"data-slot":"dialog-title",className:ke("text-lg leading-none font-semibold",e),...t})}function NF({className:e,...t}){return g.jsx(jB,{"data-slot":"dialog-description",className:ke("text-sm text-muted-foreground",e),...t})}function Wse({className:e,...t}){return g.jsx(Rd,{"data-slot":"command",className:ke("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t})}function Qse({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!0,...a}){return g.jsxs(Yl,{...a,children:[g.jsxs(Gl,{className:"sr-only",children:[g.jsx(Wl,{children:e}),g.jsx(NF,{children:t})]}),g.jsx(Xl,{className:ke("overflow-hidden p-0",r),showCloseButton:i,children:g.jsx(Wse,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function Zse({className:e,...t}){return g.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[g.jsx(fF,{className:"size-4 shrink-0 opacity-50"}),g.jsx(Rd.Input,{"data-slot":"command-input",className:ke("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Jse({className:e,...t}){return g.jsx(Rd.List,{"data-slot":"command-list",className:ke("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ele({...e}){return g.jsx(Rd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function qh({className:e,...t}){return g.jsx(Rd.Group,{"data-slot":"command-group",className:ke("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t})}function ga({className:e,...t}){return g.jsx(Rd.Item,{"data-slot":"command-item",className:ke("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...t})}function tR({className:e,...t}){return g.jsx("span",{"data-slot":"command-shortcut",className:ke("ml-auto text-xs tracking-widest text-muted-foreground",e),...t})}function tle({open:e,onOpenChange:t}){var f;const n=Fl(),{setTheme:r}=rA(),i=Dd(),a=aO(),o=i.data??[],l=((f=a.data)==null?void 0:f.items)??[],c=h=>{t(!1),n(h)};return g.jsxs(Qse,{open:e,onOpenChange:t,showCloseButton:!1,children:[g.jsx(Zse,{placeholder:"Type a command or search..."}),g.jsxs(Jse,{children:[g.jsx(ele,{children:"No results found."}),g.jsxs(qh,{heading:"Navigation",children:[g.jsxs(ga,{onSelect:()=>c("/"),children:[g.jsx(oF,{}),"Dashboard",g.jsx(tR,{children:"G D"})]}),g.jsxs(ga,{onSelect:()=>c("/projects"),children:[g.jsx(mC,{}),"Projects",g.jsx(tR,{children:"G P"})]})]}),o.length>0&&g.jsx(qh,{heading:"Projects",children:o.map(h=>g.jsxs(ga,{onSelect:()=>c(`/projects/${h.id}`),children:[g.jsx(mC,{}),h.display_name]},h.id))}),l.length>0&&g.jsx(qh,{heading:"Running Sessions",children:l.map(h=>g.jsxs(ga,{onSelect:()=>c(`/projects/${h.project_id}/sessions/${h.run_id}`),children:[g.jsx(ZA,{}),h.role," (",h.run_id.slice(0,8),")"]},h.run_id))}),g.jsxs(qh,{heading:"Resources",children:[g.jsxs(ga,{onSelect:()=>c("/resources/roles"),children:[g.jsx(mF,{}),"Roles"]}),g.jsxs(ga,{onSelect:()=>c("/resources/skills"),children:[g.jsx(pF,{}),"Skills"]}),g.jsxs(ga,{onSelect:()=>c("/resources/agents"),children:[g.jsx(rF,{}),"Agents"]}),g.jsxs(ga,{onSelect:()=>c("/resources/memories"),children:[g.jsx(iF,{}),"Memory"]})]}),g.jsxs(qh,{heading:"Theme",children:[g.jsxs(ga,{onSelect:()=>{r("light"),t(!1)},children:[g.jsx(hF,{}),"Light"]}),g.jsxs(ga,{onSelect:()=>{r("dark"),t(!1)},children:[g.jsx(sF,{}),"Dark"]}),g.jsxs(ga,{onSelect:()=>{r("system"),t(!1)},children:[g.jsx(moe,{}),"System"]})]})]})]})}const nle=[{keys:["⌘","K"],description:"Open command palette"},{keys:["G","D"],description:"Go to Dashboard"},{keys:["G","P"],description:"Go to Projects"},{keys:["?"],description:"Show keyboard shortcuts"}];function rle({open:e,onOpenChange:t}){return g.jsx(Yl,{open:e,onOpenChange:t,children:g.jsxs(Xl,{className:"max-w-sm",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:"Keyboard Shortcuts"})}),g.jsx("div",{className:"space-y-2",children:nle.map(n=>g.jsxs("div",{className:"flex items-center justify-between text-sm",children:[g.jsx("span",{className:"text-muted-foreground",children:n.description}),g.jsx("div",{className:"flex gap-1",children:n.keys.map(r=>g.jsx("kbd",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-xs",children:r},r))})]},n.description))})]})})}function ile({...e}){return g.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function ale({className:e,...t}){return g.jsx("ol",{"data-slot":"breadcrumb-list",className:ke("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2.5",e),...t})}function ole({className:e,...t}){return g.jsx("li",{"data-slot":"breadcrumb-item",className:ke("inline-flex items-center gap-1.5",e),...t})}function sle({asChild:e,className:t,...n}){const r=e?iA:"a";return g.jsx(r,{"data-slot":"breadcrumb-link",className:ke("transition-colors hover:text-foreground",t),...n})}function lle({className:e,...t}){return g.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ke("font-normal text-foreground",e),...t})}function ule({children:e,className:t,...n}){return g.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ke("[&>svg]:size-3.5",t),...n,children:e??g.jsx(Yu,{})})}function Mm({...e}){return g.jsx(Xne,{"data-slot":"dropdown-menu",...e})}function Dm({...e}){return g.jsx(Gne,{"data-slot":"dropdown-menu-trigger",...e})}function Rm({className:e,sideOffset:t=4,...n}){return g.jsx(Wne,{children:g.jsx(Qne,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ke("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",e),...n})})}function hm({className:e,inset:t,variant:n="default",...r}){return g.jsx(Zne,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ke("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",e),...r})}function TF({className:e,children:t,checked:n,...r}){return g.jsxs(Jne,{"data-slot":"dropdown-menu-checkbox-item",className:ke("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[g.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(ere,{children:g.jsx(XA,{className:"size-4"})})}),t]})}function hl({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return g.jsx(tie,{"data-slot":"separator",decorative:n,orientation:t,className:ke("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const cle=[{to:"/",label:"Dashboard",icon:oF,end:!0},{to:"/projects",label:"Projects",icon:mC},{to:"/schedules",label:"Schedules",icon:qae},{to:"/settings",label:"Settings",icon:dF}],fle=[{to:"/resources/roles",label:"Roles",icon:mF},{to:"/resources/skills",label:"Skills",icon:pF},{to:"/resources/agents",label:"Agents",icon:rF},{to:"/resources/memories",label:"Memory",icon:iF}];function dle({conv:e,projectId:t,isActive:n,navigate:r}){const[i,a]=x.useState(!1),[o,l]=x.useState(!1),[c,f]=x.useState(!1),[h,d]=x.useState(""),p=x.useRef(null),v=iO(t),b=xF(t),w=E=>{E.stopPropagation(),E.preventDefault(),d(e.title??""),a(!0),setTimeout(()=>{var j;return(j=p.current)==null?void 0:j.focus()},0)},S=()=>{const E=h.trim();v.mutate({conversationId:e.id,title:E||null}),a(!1)};return i?g.jsx("div",{className:"px-1",children:g.jsx(ct,{ref:p,value:h,onChange:E=>d(E.target.value),onBlur:S,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),S()),E.key==="Escape"&&(E.stopPropagation(),a(!1))},onClick:E=>E.stopPropagation(),className:"h-7 text-xs px-2"})}):g.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ke("flex items-center gap-1 rounded-md px-2 py-1.5 transition-colors",n?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[g.jsx("button",{onClick:()=>r(`/projects/${t}/conversations/${e.id}`),className:"flex-1 min-w-0 text-left text-sm",children:g.jsx("span",{className:"truncate block",children:e.title??`Conversation #${e.id}`})}),c?g.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[g.jsx("button",{onClick:E=>{E.stopPropagation(),b.mutate(e.id),f(!1)},className:"text-xs text-destructive hover:text-destructive/80 font-medium",disabled:b.isPending,children:"Delete"}),g.jsx("button",{onClick:E=>{E.stopPropagation(),f(!1)},className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):g.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",style:{opacity:o?1:0},children:[g.jsx("button",{onClick:w,className:"p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors",title:"Rename",children:g.jsx(QA,{className:"h-3 w-3"})}),!n&&g.jsx("button",{onClick:E=>{E.stopPropagation(),f(!0)},className:"p-0.5 rounded text-muted-foreground hover:text-destructive transition-colors",title:"Delete",children:g.jsx(Kl,{className:"h-3 w-3"})})]})]})}function hle({projectId:e,conversationId:t}){var o,l;const n=Fl(),r=rO(e,1,50),i=yF(),a=eO(e);return g.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[g.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:g.jsx(Yr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),g.jsxs("div",{className:"flex flex-col gap-1 p-3 flex-1 min-h-0",children:[g.jsxs("button",{onClick:()=>n(`/projects/${e}`),className:"flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground transition-colors",children:[g.jsx(YA,{className:"h-4 w-4 shrink-0"}),g.jsx("span",{className:"truncate",children:((o=a.data)==null?void 0:o.display_name)??"Back to Project"})]}),g.jsxs("div",{className:"flex items-center justify-between px-3 pt-2 pb-1",children:[g.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Conversations"}),g.jsx("button",{onClick:()=>i.mutate({project_id:e},{onSuccess:c=>n(`/projects/${e}/conversations/${c.id}`)}),className:"text-muted-foreground hover:text-foreground transition-colors",title:"New conversation",children:g.jsx(Fy,{className:"h-3.5 w-3.5"})})]}),g.jsx("div",{className:"flex-1 overflow-y-auto space-y-0.5",children:(((l=r.data)==null?void 0:l.items)??[]).map(c=>g.jsx(dle,{conv:c,projectId:e,isActive:c.id===t,navigate:n},c.id))})]})]})}function mle(){var c;const t=Da().pathname.split("/").filter(Boolean),n=t[0]==="projects"&&t[1]?Number(t[1]):0,r=t[2]==="conversations"&&t[3]?Number(t[3]):0,{data:i}=eO(n,{enabled:n>0}),{data:a}=rO(n,1,50),o=((c=a==null?void 0:a.items.find(f=>f.id===r))==null?void 0:c.title)??null,l=[{label:"Dashboard",href:"/"}];if(t[0]==="projects"&&(l.push({label:"Projects",href:"/projects"}),t[1])){const f=`/projects/${t[1]}`,h=(i==null?void 0:i.display_name)??`Project #${t[1]}`;l.push({label:h,href:f,projectSwitcher:!0}),t[2]==="sessions"&&t[3]?l.push({label:`Session ${t[3].slice(0,8)}…`}):t[2]==="conversations"&&t[3]&&l.push({label:o??`Conversation #${t[3]}`})}if(t[0]==="schedules"&&l.push({label:"Scheduled Tasks"}),t[0]==="settings"&&l.push({label:"Settings"}),t[0]==="resources"){const f={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory"};l.push({label:"Resources"}),t[1]&&(l[l.length-1].href=`/resources/${t[1]}`,l.push({label:f[t[1]]??t[1]}))}return l}function ple(){const e=mle(),t=Fl(),n=Dd(),{setTheme:r}=rA(),[i,a]=x.useState(!1),[o,l]=x.useState(!1),c=HW("/projects/:projectId/conversations/:conversationId"),f=c?Number(c.params.projectId):0,h=c?Number(c.params.conversationId):0;return xse({onCommandPalette:()=>a(!0),onShortcutsHelp:()=>l(!0)}),g.jsxs("div",{className:"flex h-screen",children:[c?g.jsx(hle,{projectId:f,conversationId:h}):g.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[g.jsx("div",{className:"flex h-14 items-center border-b border-border px-4",children:g.jsx(Yr,{to:"/",className:"text-lg font-bold tracking-tight hover:text-foreground/80",children:"StrawPot"})}),g.jsxs("nav",{className:"flex flex-col gap-1 p-3",children:[cle.map(({to:d,label:p,icon:v,end:b})=>g.jsxs(k_,{to:d,end:b,className:({isActive:w})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",w?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[g.jsx(v,{className:"h-4 w-4"}),p]},d)),g.jsx("div",{className:"mt-4 mb-1 px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Resources"}),fle.map(({to:d,label:p,icon:v})=>g.jsxs(k_,{to:d,className:({isActive:b})=>ke("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors",b?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground"),children:[g.jsx(v,{className:"h-4 w-4"}),p]},d))]})]}),g.jsxs("div",{className:"flex flex-1 flex-col",children:[g.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border px-6",children:[g.jsx(ile,{children:g.jsx(ale,{children:e.map((d,p)=>{const v=p===e.length-1;return g.jsxs(ole,{children:[p>0&&g.jsx(ule,{}),d.projectSwitcher?g.jsxs(Mm,{children:[g.jsxs(Dm,{className:"flex items-center gap-1 text-sm font-medium text-foreground hover:text-foreground/80 transition-colors",children:[d.label,g.jsx($ae,{className:"h-3 w-3 text-muted-foreground"})]}),g.jsx(Rm,{align:"start",children:(n.data??[]).map(b=>g.jsxs(hm,{onClick:()=>t(`/projects/${b.id}`),children:[d.href===`/projects/${b.id}`?g.jsx(XA,{className:"mr-2 h-3.5 w-3.5"}):g.jsx("span",{className:"mr-2 inline-block w-3.5"}),b.display_name]},b.id))})]}):v?g.jsx(lle,{children:d.label}):g.jsx(sle,{href:d.href,children:d.label})]},d.label)})})}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("button",{onClick:()=>a(!0),className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/50 px-2.5 py-1 text-xs text-muted-foreground transition-colors hover:bg-muted",children:g.jsx("kbd",{className:"font-mono",children:"⌘K"})}),g.jsxs(Mm,{children:[g.jsx(Dm,{asChild:!0,children:g.jsxs(je,{variant:"ghost",size:"icon",className:"h-8 w-8",children:[g.jsx(hF,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),g.jsx(sF,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),g.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),g.jsxs(Rm,{align:"end",children:[g.jsx(hm,{onClick:()=>r("light"),children:"Light"}),g.jsx(hm,{onClick:()=>r("dark"),children:"Dark"}),g.jsx(hm,{onClick:()=>r("system"),children:"System"})]})]})]})]}),g.jsx(hl,{}),g.jsx("main",{className:"flex-1 overflow-auto p-6",children:g.jsx(oQ,{})})]}),g.jsx(tle,{open:i,onOpenChange:a}),g.jsx(rle,{open:o,onOpenChange:l})]})}function gle(){const e=_t();return Qt({mutationFn:t=>He.post("/sessions",t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:qe.projects.sessions(n.project_id)}),e.invalidateQueries({queryKey:["sessions"]})}})}function PF(){const e=_t();return Qt({mutationFn:t=>He.post(`/sessions/${t}/stop`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function vle(){const e=_t();return Qt({mutationFn:t=>He.delete(`/sessions/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}const yle=j0("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function an({className:e,variant:t="default",asChild:n=!1,...r}){const i=n?iA:"span";return g.jsx(i,{"data-slot":"badge","data-variant":t,className:ke(yle({variant:t}),e),...r})}function ls({className:e,...t}){return g.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:g.jsx("table",{"data-slot":"table",className:ke("w-full caption-bottom text-sm",e),...t})})}function us({className:e,...t}){return g.jsx("thead",{"data-slot":"table-header",className:ke("[&_tr]:border-b",e),...t})}function cs({className:e,...t}){return g.jsx("tbody",{"data-slot":"table-body",className:ke("[&_tr:last-child]:border-0",e),...t})}function rr({className:e,...t}){return g.jsx("tr",{"data-slot":"table-row",className:ke("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function rt({className:e,...t}){return g.jsx("th",{"data-slot":"table-head",className:ke("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function tt({className:e,...t}){return g.jsx("td",{"data-slot":"table-cell",className:ke("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function yC({sessions:e,projectNames:t}){return g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Run ID"}),t&&g.jsx(rt,{children:"Project"}),g.jsx(rt,{children:"Role"}),g.jsx(rt,{children:"Status"}),g.jsx(rt,{children:"Started"}),g.jsx(rt,{children:"Duration"}),g.jsx(rt,{children:"Task"}),g.jsx(rt,{className:"w-[80px]"})]})}),g.jsx(cs,{children:e.map(n=>g.jsxs(rr,{children:[g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${n.project_id}/sessions/${n.run_id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:n.run_id.slice(0,16)})}),t&&g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${n.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:t.get(n.project_id)??`#${n.project_id}`})}),g.jsx(tt,{className:"text-sm",children:n.role}),g.jsx(tt,{children:g.jsx(xle,{status:n.status})}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:Uy(n.started_at)}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:A0(n.duration_ms)}),g.jsx(tt,{className:"max-w-[300px] truncate text-sm",children:n.user_task??n.task??"—"}),g.jsx(tt,{children:g.jsx(ble,{runId:n.run_id,disabled:n.status==="starting"||n.status==="running"})})]},n.run_id))})]})}function xle({status:e}){const t=MF(e);return g.jsxs(an,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&g.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}const nR=MF;function MF(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function Uy(e){try{return new Date(e).toLocaleString()}catch{return e}}function A0(e){if(e==null)return"—";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return`${n}m ${r}s`}function ble({runId:e,disabled:t}){const[n,r]=x.useState(!1),i=vle(),a=async()=>{try{await i.mutateAsync(e)}catch{}};return n?g.jsxs("div",{className:"flex gap-1",children:[g.jsx(je,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:()=>r(!1),children:"No"})]}):g.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>r(!0),disabled:t,children:g.jsx(Kl,{className:"h-4 w-4"})})}function yn({className:e,...t}){return g.jsx("div",{"data-slot":"card",className:ke("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}function Vh({className:e,...t}){return g.jsx("div",{"data-slot":"card-header",className:ke("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Kh({className:e,...t}){return g.jsx("div",{"data-slot":"card-title",className:ke("leading-none font-semibold",e),...t})}function xn({className:e,...t}){return g.jsx("div",{"data-slot":"card-content",className:ke("px-6",e),...t})}const bS=1e4;function DF(e,t,n){const[r,i]=x.useState([]),[a,o]=x.useState(!1),[l,c]=x.useState(!1),f=x.useRef(null),h=x.useRef(void 0),d=x.useRef(1e3),p=x.useRef("");return x.useEffect(()=>{if(!t)return;const v=`${e}:${t}`;p.current!==v&&(i([]),c(!1),p.current=v);function b(){const w=new EventSource(`/api/sessions/${e}/logs/${t}`);f.current=w,w.onopen=()=>{o(!0),d.current=1e3},w.addEventListener("snapshot",S=>{try{const E=JSON.parse(S.data);Array.isArray(E.lines)&&i(E.lines.slice(-bS))}catch{}}),w.addEventListener("append",S=>{try{const E=JSON.parse(S.data);Array.isArray(E.lines)&&E.lines.length>0&&i(j=>{const C=[...j,...E.lines];return C.length>bS?C.slice(-bS):C})}catch{}}),w.addEventListener("done",()=>{c(!0),w.close(),f.current=null}),w.onerror=()=>{w.close(),f.current=null,o(!1),h.current=setTimeout(()=>{d.current=Math.min(d.current*2,15e3),b()},d.current)}}return b(),()=>{var w;(w=f.current)==null||w.close(),f.current=null,h.current&&clearTimeout(h.current)}},[e,t,n]),{lines:r,connected:a,done:l}}const wle=5e3;function Sle({runId:e,projectId:t,agentId:n,role:r,runtime:i,startedAt:a}){const{lines:o,done:l}=DF(e,n,!0),c=o.slice(-4),[f,h]=x.useState("");x.useEffect(()=>{const w=new Date(a).getTime(),S=()=>{const j=Date.now()-w,C=Math.floor(j/1e3)%60,O=Math.floor(j/6e4)%60,N=Math.floor(j/36e5);h(N>0?`${N}h ${O}m`:`${O}m ${C}s`)};S();const E=setInterval(S,1e3);return()=>clearInterval(E)},[a]);const d=x.useRef(o.length),p=x.useRef(Date.now()),[v,b]=x.useState(!1);return x.useEffect(()=>{o.length!==d.current&&(d.current=o.length,p.current=Date.now(),b(!1))},[o.length]),x.useEffect(()=>{const w=setInterval(()=>{Date.now()-p.current>wle&&b(!0)},1e3);return()=>clearInterval(w)},[]),g.jsx(yn,{className:"overflow-hidden",children:g.jsxs(xn,{className:"space-y-2 pt-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${l?"bg-muted-foreground":v?"bg-green-300":"animate-pulse bg-green-500"}`}),g.jsx("span",{className:"font-medium text-sm",children:r})]}),g.jsx(an,{variant:"outline",className:"text-xs",children:i.replace("strawpot-","")})]}),g.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[g.jsxs("span",{children:["Session: ",e.slice(0,12)]}),g.jsx("span",{children:"·"}),g.jsx("span",{children:f})]}),g.jsx("div",{className:"rounded bg-[#1e1e1e] px-2 py-1.5 font-mono text-[11px] leading-[16px] text-[#d4d4d4]",children:c.length>0?c.map((w,S)=>g.jsxs("div",{className:"truncate",children:[g.jsx("span",{className:"text-[#666]",children:"> "}),w]},S)):g.jsx("div",{className:"text-[#555]",children:"Waiting for output..."})}),g.jsx("div",{className:"flex justify-end",children:g.jsxs(Yr,{to:`/projects/${t}/sessions/${e}?tab=logs`,className:"inline-flex items-center gap-0.5 text-xs text-primary hover:underline",children:["View Session",g.jsx(Yu,{className:"h-3 w-3"})]})})]})})}const wS=8;function Ele(){var o;const t=((o=aO().data)==null?void 0:o.items)??[],n=bZ({queries:t.slice(0,wS).map(l=>({queryKey:qe.sessions.detail(l.project_id,l.run_id),queryFn:()=>He.get(`/projects/${l.project_id}/sessions/${l.run_id}`),staleTime:1e4}))}),r=[];for(const l of n){if(!l.data)continue;const c=l.data;for(const[f,h]of Object.entries(c.agents))r.push({runId:c.run_id,projectId:c.project_id,agentId:f,role:h.role,runtime:h.runtime,startedAt:h.started_at})}if(r.length===0)return null;const i=r.slice(0,wS),a=r.length-wS;return g.jsxs("section",{className:"space-y-3",children:[g.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Active Agents (",r.length,")"]}),g.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-3",children:i.map(l=>g.jsx(Sle,{runId:l.runId,projectId:l.projectId,agentId:l.agentId,role:l.role,runtime:l.runtime,startedAt:l.startedAt},`${l.runId}:${l.agentId}`))}),a>0&&g.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",a," more agent",a!==1?"s":""," running"]})]})}function On({className:e,...t}){return g.jsx("div",{"data-slot":"skeleton",className:ke("animate-pulse rounded-md bg-accent",e),...t})}function _le(){return g.jsxs("div",{className:"space-y-8",children:[g.jsx(On,{className:"h-8 w-40"}),g.jsxs("div",{className:"space-y-3",children:[g.jsx(On,{className:"h-4 w-24"}),g.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-3",children:[1,2,3].map(e=>g.jsx(On,{className:"h-28 rounded-lg"},e))})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsx(On,{className:"h-4 w-32"}),g.jsx(On,{className:"h-48 rounded-lg"})]})]})}function Cle(){var d,p;const e=Dd(),t=aO(),n=bse(),r=gse(10),i=e.isLoading||t.isLoading||n.isLoading,a=e.error||t.error||n.error;if(i)return g.jsx(_le,{});if(a)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",a.message]})]});const o=e.data??[],l=((d=t.data)==null?void 0:d.items)??[],c=((p=n.data)==null?void 0:p.items)??[],f=new Map;for(const v of o)f.set(v.id,v.display_name);const h=new Map;for(const v of l)h.set(v.project_id,(h.get(v.project_id)??0)+1);return g.jsxs("div",{className:"space-y-8",children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Dashboard"}),g.jsx(Ele,{}),g.jsxs("section",{className:"space-y-3",children:[g.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Projects (",o.length,")"]}),o.length===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered."}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{children:"Directory"}),g.jsx(rt,{children:"Status"})]})}),g.jsxs(cs,{children:[o.slice(0,10).map(v=>g.jsxs(rr,{children:[g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.display_name})}),g.jsx(tt,{className:"max-w-[400px] truncate text-sm text-muted-foreground font-mono",children:v.working_dir}),g.jsx(tt,{children:g.jsxs("div",{className:"flex gap-1.5",children:[!v.dir_exists&&g.jsx(an,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Directory missing"}),(h.get(v.id)??0)>0&&g.jsxs(an,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:[g.jsx("span",{className:"mr-1 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),h.get(v.id)," running"]})]})})]},v.id)),o.length>10&&g.jsx(rr,{children:g.jsx(tt,{colSpan:3,className:"text-center",children:g.jsxs(Yr,{to:"/projects",className:"text-sm text-muted-foreground underline-offset-4 hover:underline",children:["+",o.length-10," more — view all projects"]})})})]})]})})})]}),l.length>0&&g.jsxs("section",{className:"space-y-3",children:[g.jsxs("h2",{className:"text-sm font-medium text-muted-foreground",children:["Running Sessions (",l.length,")"]}),g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsx(yC,{sessions:l,projectNames:f})})})]}),(r.data??[]).length>0&&g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Conversations"}),g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Title"}),g.jsx(rt,{children:"Project"}),g.jsx(rt,{children:"Sessions"}),g.jsx(rt,{children:"Last Activity"})]})}),g.jsx(cs,{children:(r.data??[]).map(v=>g.jsxs(rr,{children:[g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${v.project_id}/conversations/${v.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:v.title??`Conversation #${v.id}`})}),g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${v.project_id}`,className:"text-sm text-primary underline-offset-4 hover:underline",children:v.project_name})}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:v.session_count}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:v.last_activity?new Date(v.last_activity).toLocaleString():"—"})]},v.id))})]})})})]}),g.jsxs("section",{className:"space-y-3",children:[g.jsx("h2",{className:"text-sm font-medium text-muted-foreground",children:"Recent Sessions"}),c.length===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsx(yC,{sessions:c,projectNames:f})})})]})]})}function RF(){return Yn({queryKey:qe.config.global,queryFn:()=>He.get("/config/global")})}function jle(){const e=_t();return Qt({mutationFn:t=>He.post("/projects",t),onSuccess:()=>{e.invalidateQueries({queryKey:qe.projects.all})}})}function Ale(){const e=_t();return Qt({mutationFn:t=>He.delete(`/projects/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:qe.projects.all})}})}function Ole(){const e=_t();return Qt({mutationFn:({projectId:t,files:n})=>He.upload(`/projects/${t}/files`,n),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:qe.projects.files(n.projectId)})}})}function kle(){const e=_t();return Qt({mutationFn:({projectId:t,filePath:n})=>He.delete(`/projects/${t}/files/${n}`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:qe.projects.files(n.projectId)})}})}function Nle(){const e=_t();return Qt({mutationFn:t=>He.put("/config/global",t),onSuccess:(t,n)=>{e.setQueryData(qe.config.global,r=>({...r??{},values:n})),e.invalidateQueries({queryKey:qe.config.global})}})}function IF(){const e=_t();return Qt({mutationFn:({projectId:t,data:n})=>He.put(`/projects/${t}/config`,n),onSuccess:(t,n)=>{e.setQueryData(qe.projects.config(n.projectId),r=>({...r??{},project:n.data})),e.invalidateQueries({queryKey:qe.projects.config(n.projectId)})}})}function jp({className:e,children:t,...n}){return g.jsxs(mre,{"data-slot":"scroll-area",className:ke("relative",e),...n,children:[g.jsx(pre,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),g.jsx(Tle,{}),g.jsx(gre,{})]})}function Tle({className:e,orientation:t="vertical",...n}){return g.jsx($6,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ke("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:g.jsx(H6,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function Ple({initialPath:e,onSelect:t,onCancel:n}){const[r,i]=x.useState(null),[a,o]=x.useState(!0),[l,c]=x.useState(null),[f,h]=x.useState(null),d=v=>{o(!0),c(null);const b=v?`?path=${encodeURIComponent(v)}`:"";He.get(`/fs/browse${b}`).then(i).catch(w=>c(w.message??"Failed to browse")).finally(()=>o(!1))},p=async()=>{if(!(!r||!(f!=null&&f.trim())))try{const v=await He.post("/fs/mkdir",{path:r.path,name:f.trim()});h(null),d(v.path)}catch(v){c(v instanceof Error?v.message:"Failed to create folder")}};return x.useEffect(()=>{d(e||void 0)},[]),g.jsx(Yl,{open:!0,onOpenChange:v=>!v&&n(),children:g.jsxs(Xl,{className:"sm:max-w-[480px]",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:"Select Directory"})}),r&&g.jsx("div",{className:"break-all rounded-md bg-muted px-3 py-1.5 font-mono text-xs",children:r.path}),l&&g.jsx("p",{className:"text-sm text-destructive",children:l}),a&&!r?g.jsx("p",{className:"py-4 text-sm text-muted-foreground",children:"Loading..."}):g.jsx(jp,{className:"h-[300px]",children:g.jsxs("div",{className:"space-y-0.5",children:[(r==null?void 0:r.parent)&&g.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(r.parent),children:[g.jsx(toe,{className:"h-4 w-4"}),".."]}),r==null?void 0:r.entries.map(v=>g.jsxs("button",{className:"flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-sm text-primary hover:bg-accent",onClick:()=>d(v.path),children:[g.jsx(roe,{className:"h-4 w-4"}),v.name]},v.path)),(r==null?void 0:r.entries.length)===0&&g.jsx("p",{className:"px-3 py-4 text-sm italic text-muted-foreground",children:"No subdirectories"})]})}),g.jsx(kF,{children:f!==null?g.jsxs("div",{className:"flex w-full gap-2",children:[g.jsx(ct,{value:f,onChange:v=>h(v.target.value),onKeyDown:v=>{v.key==="Enter"&&p(),v.key==="Escape"&&h(null)},placeholder:"Folder name",autoFocus:!0,className:"flex-1"}),g.jsx(je,{size:"sm",onClick:p,children:"Create"}),g.jsx(je,{size:"sm",variant:"outline",onClick:()=>h(null),children:"Cancel"})]}):g.jsxs(g.Fragment,{children:[g.jsx(je,{variant:"outline",onClick:()=>h(""),disabled:!r,children:"New Folder"}),g.jsx("div",{className:"flex-1"}),g.jsx(je,{onClick:()=>r&&t(r.path),disabled:!r,children:"Select"}),g.jsx(je,{variant:"outline",onClick:n,children:"Cancel"})]})})]})})}function jt({className:e,...t}){return g.jsx(nre,{"data-slot":"label",className:ke("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function so({...e}){return g.jsx(Bre,{"data-slot":"select",...e})}function lo({...e}){return g.jsx(Ure,{"data-slot":"select-value",...e})}function uo({className:e,size:t="default",children:n,...r}){return g.jsxs(Fre,{"data-slot":"select-trigger","data-size":t,className:ke("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,g.jsx(Hre,{asChild:!0,children:g.jsx(Pm,{className:"size-4 opacity-50"})})]})}function co({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return g.jsx(qre,{children:g.jsxs(Vre,{"data-slot":"select-content",className:ke("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[g.jsx(Mle,{}),g.jsx(Kre,{className:ke("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(Dle,{})]})})}function ir({className:e,children:t,...n}){return g.jsxs(Yre,{"data-slot":"select-item",className:ke("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(Gre,{children:g.jsx(XA,{className:"size-4"})})}),g.jsx(Xre,{children:t})]})}function Mle({className:e,...t}){return g.jsx(Wre,{"data-slot":"select-scroll-up-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Lae,{className:"size-4"})})}function Dle({className:e,...t}){return g.jsx(Qre,{"data-slot":"select-scroll-down-button",className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Pm,{className:"size-4"})})}function Rle(){const{data:e,isLoading:t,error:n}=Dd(),[r,i]=x.useState(!1);if(t)return g.jsxs("div",{className:"space-y-6",children:[g.jsx(On,{className:"h-8 w-32"}),g.jsx(On,{className:"h-64 rounded-lg"})]});if(n)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",n.message]})]});const a=e??[];return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Projects"}),g.jsxs(je,{onClick:()=>i(!0),children:[g.jsx(Fy,{className:"mr-2 h-4 w-4"}),"Add Project"]})]}),r&&g.jsx(Ile,{onDone:()=>i(!1),onCancel:()=>i(!1)}),a.length===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No projects registered yet."}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{children:"Directory"}),g.jsx(rt,{children:"Created"}),g.jsx(rt,{children:"Status"}),g.jsx(rt,{className:"w-[80px]"})]})}),g.jsx(cs,{children:a.map(o=>g.jsxs(rr,{children:[g.jsx(tt,{children:g.jsx(Yr,{to:`/projects/${o.id}`,className:"text-sm font-medium text-primary underline-offset-4 hover:underline",children:o.display_name})}),g.jsx(tt,{className:"max-w-[300px] truncate text-sm text-muted-foreground",children:o.working_dir}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:zle(o.created_at)}),g.jsx(tt,{children:o.dir_exists?g.jsx(an,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):g.jsx(an,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})}),g.jsx(tt,{children:g.jsx(Lle,{projectId:o.id})})]},o.id))})]})})})]})}function Ile({onDone:e,onCancel:t}){var M,I,L;const[n,r]=x.useState(""),[i,a]=x.useState(""),[o,l]=x.useState(""),[c,f]=x.useState(""),[h,d]=x.useState(!1),[p,v]=x.useState(!1),b=jle(),w=IF(),E=(M=RF().data)==null?void 0:M.defaults,j=(E==null?void 0:E.isolation)??"none",C=((I=E==null?void 0:E.session)==null?void 0:I.merge_strategy)??"auto",O=o||j,N=async()=>{const B=await b.mutateAsync({display_name:n.trim(),working_dir:i.trim()}),z={},G=c||C;z.isolation=O,z.session={merge_strategy:G},await w.mutateAsync({projectId:B.id,data:z}),e()},k=async B=>{B.preventDefault();try{if(O==="worktree"&&i.trim()&&!(await He.get(`/fs/git-check?path=${encodeURIComponent(i.trim())}`)).is_git){v(!0);return}await N()}catch{}},T=async()=>{try{await He.post("/fs/git-init",{path:i.trim()}),v(!1),await N()}catch{}};return g.jsx(yn,{children:g.jsx(xn,{className:"pt-6",children:g.jsxs("form",{onSubmit:k,className:"space-y-4",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"display-name",children:"Display Name"}),g.jsx(ct,{id:"display-name",value:n,onChange:B=>r(B.target.value),required:!0,autoFocus:!0})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"working-dir",children:"Working Directory"}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(ct,{id:"working-dir",value:i,onChange:B=>a(B.target.value),placeholder:"/path/to/project",required:!0}),g.jsx(je,{type:"button",variant:"outline",size:"sm",onClick:()=>d(!h),children:"Browse"})]})]})]}),h&&g.jsx(Ple,{initialPath:i||void 0,onSelect:B=>{a(B),d(!1)},onCancel:()=>d(!1)}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"isolation",children:"Isolation"}),g.jsxs(so,{value:o||j,onValueChange:l,children:[g.jsx(uo,{id:"isolation",children:g.jsx(lo,{})}),g.jsxs(co,{children:[g.jsx(ir,{value:"none",children:"none"}),g.jsx(ir,{value:"worktree",children:"worktree"})]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"merge-strategy",children:"Merge Strategy"}),g.jsxs(so,{value:c||C,onValueChange:f,children:[g.jsx(uo,{id:"merge-strategy",children:g.jsx(lo,{})}),g.jsxs(co,{children:[g.jsx(ir,{value:"auto",children:"auto"}),g.jsx(ir,{value:"local",children:"local"}),g.jsx(ir,{value:"pr",children:"pr"})]})]})]})]}),p&&g.jsxs("div",{className:"rounded-md border border-orange-200 bg-orange-50 p-3 dark:border-orange-800 dark:bg-orange-950",children:[g.jsxs("p",{className:"text-sm",children:["The selected directory is not a git repository. Worktree isolation requires git. Initialize a git repository with ",g.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"git init"}),"?"]}),g.jsxs("div",{className:"mt-2 flex gap-2",children:[g.jsx(je,{type:"button",size:"sm",onClick:T,children:"Yes, initialize"}),g.jsx(je,{type:"button",size:"sm",variant:"outline",onClick:()=>v(!1),children:"Cancel"})]})]}),(b.error||w.error)&&g.jsx("p",{className:"text-sm text-destructive",children:(L=b.error||w.error)==null?void 0:L.message}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(je,{type:"submit",disabled:b.isPending||w.isPending,children:b.isPending||w.isPending?"Adding...":"Add"}),g.jsx(je,{type:"button",variant:"outline",onClick:t,children:"Cancel"})]})]})})})}function Lle({projectId:e}){const[t,n]=x.useState(!1),r=Ale(),i=async()=>{try{await r.mutateAsync(e)}catch{}};return t?g.jsxs("div",{className:"flex gap-1",children:[g.jsx(je,{size:"sm",variant:"destructive",onClick:i,disabled:r.isPending,children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:()=>n(!1),children:"No"})]}):g.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>n(!0),children:g.jsx(Kl,{className:"h-4 w-4"})})}function zle(e){try{return new Date(e).toLocaleDateString()}catch{return e}}function LF(e){return Yn({queryKey:qe.projects.resources(e),queryFn:()=>He.get(`/projects/${e}/resources`)})}function $le(e,t,n,r){return Yn({queryKey:qe.projects.resourceDetail(e,t,n),queryFn:()=>He.get(`/projects/${e}/resources/${t}/${n}`),enabled:(r==null?void 0:r.enabled)??!!n})}function Ble(e,t,n,r){return Yn({queryKey:qe.projects.resourceConfig(e,t,n),queryFn:()=>He.get(`/projects/${e}/resources/${t}/${n}/config`),enabled:(r==null?void 0:r.enabled)??!!n})}function Fle(e,t){if(t<=7)return Array.from({length:t},(a,o)=>o+1);const n=[1];e>3&&n.push("...");const r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let a=r;a<=i;a++)n.push(a);return e<t-2&&n.push("..."),n.push(t),n}function Ule({page:e,totalPages:t,onPageChange:n}){if(t<=1)return null;const r=Fle(e,t);return g.jsxs("div",{className:"flex items-center justify-center gap-1 pt-2",children:[g.jsx(je,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e<=1,onClick:()=>n(e-1),children:g.jsx(Dae,{className:"h-4 w-4"})}),r.map((i,a)=>i==="..."?g.jsx("span",{className:"px-1 text-sm text-muted-foreground",children:"..."},`ellipsis-${a}`):g.jsx(je,{variant:i===e?"default":"outline",size:"icon",className:"h-8 w-8 text-xs",onClick:()=>n(i),children:i},i)),g.jsx(je,{variant:"outline",size:"icon",className:"h-8 w-8",disabled:e>=t,onClick:()=>n(e+1),children:g.jsx(Yu,{className:"h-4 w-4"})})]})}function sO(){return Yn({queryKey:qe.roles.all,queryFn:()=>He.get("/roles")})}function Hle(e){return Yn({queryKey:qe.registry.validate(e??""),queryFn:()=>He.get(`/registry/agents/${e}/validate`),enabled:!!e})}function Zo(e,t){return Yn({queryKey:qe.registry.list(e),queryFn:()=>He.get(`/registry/${e}`),enabled:t==null?void 0:t.enabled})}function qle(e,t,n){return Yn({queryKey:qe.registry.detail(e,t),queryFn:()=>He.get(`/registry/${e}/${t}`),enabled:(n==null?void 0:n.enabled)??!!t})}function zF(e,t,n){return Yn({queryKey:qe.registry.config(e,t),queryFn:()=>He.get(`/registry/${e}/${t}/config`),enabled:(n==null?void 0:n.enabled)??!!t})}function ld({className:e,...t}){return g.jsx("textarea",{"data-slot":"textarea",className:ke("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",e),...t})}function If({...e}){return g.jsx(ZZ,{"data-slot":"collapsible",...e})}function Lf({...e}){return g.jsx(Q$,{"data-slot":"collapsible-trigger",...e})}function zf({...e}){return g.jsx(Z$,{"data-slot":"collapsible-content",...e})}function Vle({projectId:e,open:t,onOpenChange:n}){var ze,Ke,et,gn,on,Kt;const r=Fl(),i=nO(e),a=sO(),{data:o}=Zo("agents"),{data:l}=Zo("memories"),c=tO(e),f=gle(),h=(ze=i.data)==null?void 0:ze.merged,d="__empty__",[p,v]=x.useState(""),[b,w]=x.useState(""),[S,E]=x.useState(""),[j,C]=x.useState(""),[O,N]=x.useState(""),[k,T]=x.useState(""),[M,I]=x.useState(""),[L,B]=x.useState(""),[z,G]=x.useState(""),[F,V]=x.useState(!1),[D,q]=x.useState([]),[X,Y]=x.useState(!1),[R,H]=x.useState(""),[U,$]=x.useState(!1),[Q,J]=x.useState(!1),ne=_t(),ae=()=>{v(""),w(""),E(""),C(""),N(""),T(""),I(""),B(""),G(""),V(!1),q([]),Y(!1)},re=Se=>{Se.preventDefault(),$(!0)},ee=Se=>{Se.preventDefault(),$(!0)},se=Se=>{Se.preventDefault(),$(!1)},me=async Se=>{Se.preventDefault(),$(!1);const lt=Array.from(Se.dataTransfer.files);if(lt.length){J(!0);try{const Xe=await He.upload(`/projects/${e}/files`,lt);ne.invalidateQueries({queryKey:qe.projects.files(e)}),q(Pn=>{const vn=Xe.map(In=>In.path).filter(In=>!Pn.includes(In));return[...Pn,...vn]})}catch{}finally{J(!1)}}},ie=Se=>{q(lt=>lt.includes(Se)?lt.filter(Xe=>Xe!==Se):[...lt,Se])},we=async Se=>{Se.preventDefault();try{const lt={project_id:e,task:p.trim()};b.trim()&&(lt.role=b.trim());const Xe={};S.trim()&&(Xe.runtime=S.trim()),j.trim()&&(Xe.memory=j.trim()),O&&(Xe.cache_delegations=O==="true"),k.trim()&&(Xe.cache_max_entries=Number(k.trim())),M.trim()&&(Xe.cache_ttl_seconds=Number(M.trim())),L.trim()&&(Xe.max_num_delegations=Number(L.trim())),Object.keys(Xe).length>0&&(lt.overrides=Xe),D.length>0&&(lt.context_files=D),z.trim()&&(lt.system_prompt=z.trim()),F&&(lt.interactive=!0);const Pn=await f.mutateAsync(lt);ae(),n(!1),r(`/projects/${e}/sessions/${Pn.run_id}`)}catch{}},be=(h==null?void 0:h.orchestrator_role)??"orchestrator",$e=(a.data??[]).filter(Se=>Se!==be),Ne=[be,...$e],Je=(o??[]).map(Se=>Se.name),Qe=new Set((l??[]).map(Se=>Se.name));Qe.add("none");const nt=[...Qe].sort(),Nn=b.trim()||be,Wn=zF("roles",Nn,{enabled:!!Nn}),Mt=((et=(Ke=Wn.data)==null?void 0:Ke.params_values)==null?void 0:et.default_agent)??((Kt=(on=(gn=Wn.data)==null?void 0:gn.params_schema)==null?void 0:on.default_agent)==null?void 0:Kt.default)??"",Tn=Mt&&Je.includes(Mt)?Mt:(h==null?void 0:h.runtime)??"strawpot-claude-code",Rt=b.trim()&&!Ne.includes(b.trim())?"Role not found in installed roles":"",pn=S.trim()&&Je.length>0&&!Je.includes(S.trim())?"Runtime not found in installed agents":"",de=j.trim()&&!nt.includes(j.trim())?"Memory not found in installed providers":"",xe=!!Rt||!!pn||!!de;return g.jsx(Yl,{open:t,onOpenChange:n,children:g.jsxs(Xl,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:"Launch Session"})}),g.jsxs("form",{onSubmit:we,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs(jt,{htmlFor:"task",children:["Task ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsxs("div",{className:"relative",onDragOver:re,onDragEnter:ee,onDragLeave:se,onDrop:me,children:[g.jsx(ld,{id:"task",value:p,onChange:Se=>v(Se.target.value),placeholder:"Describe what the agent should do… (drag & drop files to attach)",required:!0,autoFocus:!0,rows:3}),(U||Q)&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:Q?g.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[g.jsx(jl,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):g.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[g.jsx(JA,{className:"h-4 w-4"})," Drop to upload & attach"]})})]})]}),(c.data??[]).length>0&&g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Mm,{children:[g.jsx(Dm,{asChild:!0,children:g.jsxs(je,{type:"button",variant:"outline",size:"sm",children:[g.jsx(uF,{className:"mr-1 h-3.5 w-3.5"}),"Annotate Files"]})}),g.jsxs(Rm,{align:"start",className:"w-64",onCloseAutoFocus:Se=>Se.preventDefault(),children:[g.jsx("div",{className:"px-2 py-1.5",children:g.jsx(ct,{placeholder:"Filter files...",value:R,onChange:Se=>H(Se.target.value),className:"h-7 text-xs",onKeyDown:Se=>Se.stopPropagation()})}),g.jsx("div",{className:"max-h-48 overflow-y-auto",children:(c.data??[]).filter(Se=>Se.path.toLowerCase().includes(R.toLowerCase())).map(Se=>g.jsx(TF,{checked:D.includes(Se.path),onCheckedChange:()=>ie(Se.path),onSelect:lt=>lt.preventDefault(),children:g.jsx("span",{className:"font-mono text-xs",children:Se.path})},Se.path))})]})]}),D.length>0&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.length," file(s) attached"]})]}),D.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[(X?D:D.slice(0,3)).map(Se=>g.jsxs(an,{variant:"secondary",className:"max-w-[200px] gap-1 font-mono text-xs",children:[g.jsx("button",{type:"button",onClick:()=>ie(Se),className:"mr-0.5 shrink-0 rounded-sm hover:bg-muted",children:g.jsx(_0,{className:"h-3 w-3"})}),g.jsxs("span",{className:"truncate",children:["@",Se]})]},Se)),!X&&D.length>3&&g.jsxs("button",{type:"button",onClick:()=>Y(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",D.length-3," more"]}),X&&D.length>3&&g.jsx("button",{type:"button",onClick:()=>Y(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"role",children:"Role"}),g.jsx(ct,{id:"role",list:"datalist-role",value:b,onChange:Se=>w(Se.target.value),placeholder:be}),g.jsxs("datalist",{id:"datalist-role",children:[g.jsx("option",{value:be}),$e.map(Se=>g.jsx("option",{value:Se},Se))]}),Rt&&g.jsx("p",{className:"text-xs text-destructive",children:Rt})]}),g.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[g.jsx("input",{type:"checkbox",checked:F,onChange:Se=>V(Se.target.checked),className:"rounded border-input"}),g.jsx("span",{className:"text-sm",children:"Interactive mode"}),g.jsx("span",{className:"text-xs text-muted-foreground",children:"Allow the agent to ask you questions via a chat panel"})]}),g.jsxs(If,{children:[g.jsx(Lf,{asChild:!0,children:g.jsxs(je,{type:"button",variant:"ghost",size:"sm",children:[g.jsx(Pm,{className:"mr-1 h-4 w-4"}),"Advanced Options"]})}),g.jsxs(zf,{className:"mt-3 space-y-4",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"runtime",children:"Runtime"}),g.jsx(ct,{id:"runtime",list:"datalist-runtime",value:S,onChange:Se=>E(Se.target.value),placeholder:Tn}),o&&g.jsx("datalist",{id:"datalist-runtime",children:o.map(Se=>g.jsx("option",{value:Se.name},Se.name))}),pn&&g.jsx("p",{className:"text-xs text-destructive",children:pn})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"memory",children:"Memory"}),g.jsx(ct,{id:"memory",list:"datalist-memory",value:j,onChange:Se=>C(Se.target.value),placeholder:(h==null?void 0:h.memory)||"dial"}),g.jsx("datalist",{id:"datalist-memory",children:nt.map(Se=>g.jsx("option",{value:Se},Se))}),de&&g.jsx("p",{className:"text-xs text-destructive",children:de})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"system-prompt",children:"System Prompt"}),g.jsx(ld,{id:"system-prompt",value:z,onChange:Se=>G(Se.target.value),placeholder:"Additional instructions for the agent...",rows:3})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Max Delegations"}),g.jsx(ct,{type:"number",min:"0",value:L,onChange:Se=>B(Se.target.value),placeholder:h!=null&&h.max_num_delegations?String(h.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache Delegations"}),g.jsxs(so,{value:O||d,onValueChange:Se=>N(Se===d?"":Se),children:[g.jsx(uo,{className:"h-8 text-xs",children:g.jsx(lo,{placeholder:(h==null?void 0:h.cache_delegations)!==!1?"true":"false"})}),g.jsxs(co,{children:[g.jsxs(ir,{value:d,className:"text-muted-foreground",children:["Default (",(h==null?void 0:h.cache_delegations)!==!1?"true":"false",")"]}),g.jsx(ir,{value:"true",children:"true"}),g.jsx(ir,{value:"false",children:"false"})]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache Max Entries"}),g.jsx(ct,{type:"number",min:"0",value:k,onChange:Se=>T(Se.target.value),placeholder:h!=null&&h.cache_max_entries?String(h.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache TTL (seconds)"}),g.jsx(ct,{type:"number",min:"0",value:M,onChange:Se=>I(Se.target.value),placeholder:h!=null&&h.cache_ttl_seconds?String(h.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]})]}),f.error&&g.jsx("p",{className:"text-sm text-destructive",children:f.error.message}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(je,{type:"submit",disabled:f.isPending||xe,children:f.isPending?"Launching...":"Launch"}),g.jsx(je,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"})]})]})]})})}function Kle(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Yle({projectId:e}){const t=tO(e),n=Ole(),r=kle(),i=x.useRef(null),[a,o]=x.useState(!1),[l,c]=x.useState(null),f=x.useCallback(E=>{const j=Array.from(E);j.length!==0&&n.mutate({projectId:e,files:j},{onSuccess:()=>Pt.success(`Uploaded ${j.length} file(s)`),onError:()=>Pt.error("Upload failed")})},[e,n]),h=x.useCallback(E=>{E.preventDefault(),o(!1),f(E.dataTransfer.files)},[f]),d=x.useCallback(E=>{E.preventDefault(),o(!0)},[]),p=x.useCallback(E=>{E.preventDefault(),o(!1)},[]),v=x.useCallback(()=>{var E;(E=i.current)==null||E.click()},[]),b=x.useCallback(E=>{E.target.files&&(f(E.target.files),E.target.value="")},[f]),w=x.useCallback(E=>{r.mutate({projectId:e,filePath:E},{onSuccess:()=>{Pt.success("File deleted"),c(null)},onError:()=>{Pt.error("Failed to delete file"),c(null)}})},[e,r]),S=t.data??[];return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{onDrop:h,onDragOver:d,onDragLeave:p,className:`flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors ${a?"border-primary bg-primary/5":"border-muted-foreground/25"}`,children:[g.jsx(JA,{className:"h-8 w-8 text-muted-foreground"}),g.jsxs("p",{className:"text-sm text-muted-foreground",children:["Drag & drop files here, or"," ",g.jsx("button",{type:"button",onClick:v,className:"font-medium text-primary underline-offset-4 hover:underline",children:"browse"})]}),n.isPending&&g.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploading..."}),g.jsx("input",{ref:i,type:"file",multiple:!0,className:"hidden",onChange:b})]}),S.length===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No files uploaded yet."}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{className:"w-24",children:"Size"}),g.jsx(rt,{className:"w-44",children:"Modified"}),g.jsx(rt,{className:"w-28"})]})}),g.jsx(cs,{children:S.map(E=>g.jsxs(rr,{children:[g.jsx(tt,{className:"font-mono text-xs",children:E.path}),g.jsx(tt,{className:"text-xs text-muted-foreground",children:Kle(E.size)}),g.jsx(tt,{className:"text-xs text-muted-foreground",children:new Date(E.modified_at).toLocaleString()}),g.jsx(tt,{children:l===E.path?g.jsxs("div",{className:"flex items-center justify-end gap-2",children:[g.jsx("button",{type:"button",onClick:()=>w(E.path),disabled:r.isPending,className:"text-xs text-destructive hover:text-destructive/80 font-medium",children:"Confirm"}),g.jsx("button",{type:"button",onClick:()=>c(null),className:"text-xs text-muted-foreground hover:text-foreground",children:"No"})]}):g.jsx("div",{className:"flex justify-end",children:g.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(E.path),disabled:r.isPending,children:g.jsx(Kl,{className:"h-3.5 w-3.5 text-muted-foreground"})})})})]},E.path))})]})})})]})}function Xle(){const e=_t();return Qt({mutationFn:t=>He.post("/registry/install",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function $F(){const e=_t();return Qt({mutationFn:({type:t,name:n})=>He.delete(`/registry/${t}/${n}`),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Gle(){const e=_t();return Qt({mutationFn:t=>He.post("/registry/update",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Wle(){const e=_t();return Qt({mutationFn:t=>He.post("/registry/reinstall",t),onSuccess:()=>{e.invalidateQueries({queryKey:["registry"]})}})}function Qle(){const e=_t();return Qt({mutationFn:({type:t,name:n,env_values:r,params_values:i})=>He.put(`/registry/${t}/${n}/config`,{env_values:r,params_values:i}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:qe.registry.config(n.type,n.name)})}})}function Zle(e){const t=_t();return Qt({mutationFn:n=>He.post(`/projects/${e}/resources/install`,n),onSuccess:()=>{t.invalidateQueries({queryKey:qe.projects.resources(e)})}})}function BF(e){const t=_t();return Qt({mutationFn:({type:n,name:r})=>He.delete(`/projects/${e}/resources/${n}/${r}`),onSuccess:()=>{t.invalidateQueries({queryKey:qe.projects.resources(e)})}})}function Jle(e){const t=_t();return Qt({mutationFn:n=>He.post(`/projects/${e}/resources/update`,n),onSuccess:()=>{t.invalidateQueries({queryKey:qe.projects.resources(e)})}})}function eue(e){const t=_t();return Qt({mutationFn:n=>He.post(`/projects/${e}/resources/reinstall`,n),onSuccess:()=>{t.invalidateQueries({queryKey:qe.projects.resources(e)})}})}function tue(e){const t=_t();return Qt({mutationFn:({type:n,name:r,env_values:i,params_values:a})=>He.put(`/projects/${e}/resources/${n}/${r}/config`,{env_values:i,params_values:a}),onSuccess:(n,r)=>{t.invalidateQueries({queryKey:qe.projects.resourceConfig(e,r.type,r.name)})}})}function nue({...e}){return g.jsx(mA,{"data-slot":"sheet",...e})}function rue({...e}){return g.jsx(pA,{"data-slot":"sheet-portal",...e})}function iue({className:e,...t}){return g.jsx(gA,{"data-slot":"sheet-overlay",className:ke("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function aue({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return g.jsxs(rue,{children:[g.jsx(iue,{}),g.jsxs(vA,{"data-slot":"sheet-content",className:ke("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",n==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",n==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",n==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...i,children:[t,r&&g.jsxs(yA,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(_0,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function oue({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-header",className:ke("flex flex-col gap-1.5 p-4",e),...t})}function sue({className:e,...t}){return g.jsx(CB,{"data-slot":"sheet-title",className:ke("font-semibold text-foreground",e),...t})}function lue({className:e,...t}){return g.jsx(jB,{"data-slot":"sheet-description",className:ke("text-sm text-muted-foreground",e),...t})}const uue=j0("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function my({className:e,variant:t,...n}){return g.jsx("div",{"data-slot":"alert",role:"alert",className:ke(uue({variant:t}),e),...n})}function py({className:e,...t}){return g.jsx("div",{"data-slot":"alert-title",className:ke("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function gy({className:e,...t}){return g.jsx("div",{"data-slot":"alert-description",className:ke("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",e),...t})}function cue({agentName:e}){const{data:t}=Hle(e);return!t||!(!t.tools_ok||t.setup_command||!t.env_ok)?null:g.jsxs("div",{className:"mb-4 space-y-3",children:[!t.tools_ok&&g.jsxs(my,{variant:"destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsx(py,{children:"Missing Prerequisites"}),g.jsx(gy,{children:t.missing_tools.map(r=>g.jsxs("div",{className:"mt-1",children:[g.jsx("strong",{children:r.name})," not found on PATH.",r.install_hint&&g.jsx("code",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-xs",children:r.install_hint})]},r.name))})]}),t.setup_command&&g.jsxs(my,{children:[g.jsx(Poe,{className:"h-4 w-4"}),g.jsx(py,{children:"Setup"}),g.jsxs(gy,{children:[g.jsx("p",{children:t.setup_description||"Run initial authentication in your terminal:"}),g.jsx("code",{className:"mt-1 block rounded bg-muted px-2 py-1 text-xs",children:t.setup_command}),g.jsx("p",{className:"mt-2 text-muted-foreground",children:"Or set the API key in the config below instead."})]})]}),!t.env_ok&&!t.setup_command&&t.missing_env.length>0&&g.jsxs(my,{children:[g.jsx(uoe,{className:"h-4 w-4"}),g.jsx(py,{children:"API Key Required"}),g.jsx(gy,{children:g.jsxs("p",{children:["Set"," ",t.missing_env.map((r,i)=>g.jsxs("span",{children:[i>0&&", ",g.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:r})]},r))," ","in the config below to authenticate."]})})]})]})}function fue({resourceType:e,resourceName:t,enabled:n,projectId:r}){const i=zF(e,t,{enabled:n&&!r}),a=Ble(r??0,e,t,{enabled:n&&!!r}),{data:o,isLoading:l}=r?a:i,c=Qle(),f=tue(r??0),h=r?f:c,{data:d}=Zo("agents",{enabled:n&&e==="roles"}),[p,v]=x.useState({}),[b,w]=x.useState({}),[S,E]=x.useState(new Set);if(x.useEffect(()=>{o&&(v({...o.env_values}),w({...o.params_values}))},[o]),l||!o)return null;const j=Object.keys(o.env_schema),C=Object.keys(o.params_schema);if(j.length===0&&C.length===0)return null;const O=I=>E(L=>{const B=new Set(L);return B.has(I)?B.delete(I):B.add(I),B}),N=(d??[]).map(I=>I.name),k=String(b.default_agent??"").trim(),T=e==="roles"&&k&&N.length>0&&!N.includes(k)?"Agent not found in installed agents":"",M=()=>{h.mutate({type:e,name:t,env_values:j.length>0?p:void 0,params_values:C.length>0?b:void 0},{onSuccess:()=>Pt.success("Configuration saved"),onError:()=>Pt.error("Failed to save configuration")})};return g.jsxs("div",{className:"flex flex-col gap-4",children:[j.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(hl,{}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx("h4",{className:"text-sm font-semibold",children:"Environment Variables"}),j.map(I=>{const L=o.env_schema[I],B=S.has(I);return g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(jt,{className:"text-xs font-mono",children:I}),L.required&&g.jsx(an,{variant:"outline",className:"h-4 px-1 text-[10px] text-red-500 border-red-200",children:"required"})]}),L.description&&g.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),g.jsxs("div",{className:"flex gap-1",children:[g.jsx(ct,{type:B?"text":"password",value:p[I]??"",onChange:z=>v(G=>({...G,[I]:z.target.value})),placeholder:I,className:"h-8 text-xs font-mono"}),g.jsx(je,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 shrink-0 p-0",onClick:()=>O(I),children:B?g.jsx(Wae,{className:"h-3.5 w-3.5"}):g.jsx(Zae,{className:"h-3.5 w-3.5"})})]})]},I)})]})]}),C.length>0&&g.jsxs(g.Fragment,{children:[g.jsx(hl,{}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx("h4",{className:"text-sm font-semibold",children:"Parameters"}),C.map(I=>{const L=o.params_schema[I],B=b[I],z=L.default;if(L.type==="boolean")return g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx(jt,{className:"text-xs font-mono",children:I}),L.description&&g.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),g.jsxs(so,{value:B!=null?String(B):z!=null?String(z):"",onValueChange:q=>w(X=>({...X,[I]:q==="true"})),children:[g.jsx(uo,{className:"h-8 text-xs",children:g.jsx(lo,{})}),g.jsxs(co,{children:[g.jsx(ir,{value:"true",children:"true"}),g.jsx(ir,{value:"false",children:"false"})]})]})]},I);const G=L.type==="int"||L.type==="float"?"number":"text",F=L.type==="float"?"any":void 0,V=I==="default_agent"&&d?d.map(q=>q.name):void 0,D=V?`datalist-${I}`:void 0;return g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx(jt,{className:"text-xs font-mono",children:I}),L.description&&g.jsx("p",{className:"text-xs text-muted-foreground",children:L.description}),g.jsx(ct,{type:G,step:F,list:D,value:B!=null?String(B):"",onChange:q=>w(X=>({...X,[I]:G==="number"&&q.target.value!==""?Number(q.target.value):q.target.value})),placeholder:z!=null?String(z):void 0,className:"h-8 text-xs font-mono"}),V&&g.jsx("datalist",{id:D,children:V.map(q=>g.jsx("option",{value:q},q))}),I==="default_agent"&&T&&g.jsx("p",{className:"text-xs text-destructive",children:T})]},I)})]})]}),g.jsxs(je,{size:"sm",onClick:M,disabled:h.isPending||!!T,className:"self-start",children:[g.jsx(cF,{className:"mr-2 h-3.5 w-3.5"}),h.isPending?"Saving...":"Save Configuration"]})]})}function FF({resource:e,resourceType:t,open:n,onOpenChange:r,projectId:i}){var T,M;const a=$F(),o=Gle(),l=Wle(),c=BF(i??0),f=Jle(i??0),h=eue(i??0),d=i?c:a,p=i?f:o,v=i?h:l,[b,w]=x.useState(!1),S=p.isPending||v.isPending||d.isPending;if(!e)return null;const E=()=>{if(!b){w(!0);return}d.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?(Pt.success(`Uninstalled ${e.name}`),r(!1)):Pt.error(`Uninstall failed: ${I.stderr||I.stdout}`),w(!1)},onError:()=>{Pt.error("Uninstall request failed"),w(!1)}})},j=()=>{p.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?Pt.success(`Updated ${e.name}`):Pt.error(`Update failed: ${I.stderr||I.stdout}`)},onError:()=>Pt.error("Update request failed")})},C=()=>{v.mutate({type:t,name:e.name},{onSuccess:I=>{I.exit_code===0?Pt.success(`Reinstalled ${e.name}`):Pt.error(`Reinstall failed: ${I.stderr||I.stdout}`)},onError:()=>Pt.error("Reinstall request failed")})},N=!i&&((T={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]}[t])==null?void 0:T.includes(e.name)),k=(M=e.frontmatter)==null?void 0:M.metadata;return g.jsx(nue,{open:n,onOpenChange:I=>{r(I),w(!1)},children:g.jsxs(aue,{side:"right",className:"flex h-full flex-col sm:max-w-lg",children:[g.jsxs(oue,{className:"shrink-0",children:[g.jsxs(sue,{className:"flex items-center gap-2",children:[e.name,e.version&&g.jsxs(an,{variant:"outline",className:"text-xs font-normal",children:["v",e.version]})]}),g.jsx(lue,{children:e.description||"No description"})]}),g.jsxs("div",{className:"shrink-0 flex flex-col gap-4 px-4",children:[g.jsxs("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[g.jsxs("span",{children:["Source: ",g.jsx("strong",{children:e.source})]}),g.jsxs("span",{children:["Path: ",g.jsx("code",{className:"rounded bg-muted px-1",children:e.path})]})]}),k&&Object.keys(k).length>0&&g.jsxs("details",{className:"text-sm",children:[g.jsx("summary",{className:"cursor-pointer font-medium text-muted-foreground",children:"Metadata"}),g.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:JSON.stringify(k,null,2)})]})]}),g.jsxs(jp,{className:"min-h-0 flex-1 px-4",children:[t==="agents"&&g.jsx(cue,{agentName:e.name}),g.jsx(fue,{resourceType:t,resourceName:e.name,enabled:n,projectId:i}),g.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap mt-4",children:e.body||"No content."})]}),g.jsxs("div",{className:"shrink-0 border-t border-border p-4 flex gap-2",children:[g.jsx(je,{size:"sm",onClick:j,disabled:S,children:p.isPending?"Updating...":"Update"}),g.jsx(je,{variant:"outline",size:"sm",onClick:C,disabled:S,children:v.isPending?"Reinstalling...":"Reinstall"}),g.jsx("div",{className:"flex-1"}),!N&&g.jsxs(g.Fragment,{children:[g.jsx(je,{variant:b?"destructive":"outline",size:"sm",onClick:E,disabled:S,children:d.isPending?"Uninstalling...":b?"Confirm Uninstall":"Uninstall"}),b&&!d.isPending&&g.jsx(je,{variant:"ghost",size:"sm",onClick:()=>w(!1),children:"Cancel"})]})]})]})})}const due=[{value:"roles",label:"Role"},{value:"skills",label:"Skill"},{value:"agents",label:"Agent"},{value:"memories",label:"Memory"}];function lO({open:e,onOpenChange:t,defaultType:n,projectId:r}){const[i,a]=x.useState(n??"roles"),[o,l]=x.useState(""),[c,f]=x.useState(null),[h,d]=x.useState(null);x.useEffect(()=>{e&&n&&a(n)},[e,n]);const p=Xle(),v=Zle(r??0),b=r?v:p,w=(c==null?void 0:c.status)==="success",S=()=>{o.trim()&&(f(null),d(null),b.mutate({type:i,name:o.trim()},{onSuccess:j=>{j.exit_code===0?(Pt.success(`Installed ${o.trim()}`),f({status:"success",message:`Successfully installed ${o.trim()}`}),d(j.stdout||null)):(f({status:"error",message:"Installation failed"}),d(j.stderr||j.stdout||"Unknown error."))},onError:()=>{f({status:"error",message:"Install request failed"}),Pt.error("Install request failed")}}))},E=j=>{j||(f(null),d(null),l("")),t(j)};return g.jsx(Yl,{open:e,onOpenChange:E,children:g.jsxs(Xl,{className:"sm:max-w-md",children:[g.jsxs(Gl,{children:[g.jsx(Wl,{children:r?"Install Resource to Project":"Install Resource"}),g.jsx(NF,{children:"Install a resource from StrawHub by name."})]}),g.jsxs("div",{className:"flex flex-col gap-4",children:[c&&g.jsxs(my,{variant:c.status==="error"?"destructive":"default",className:c.status==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-950 dark:text-green-300":"",children:[c.status==="success"?g.jsx(GA,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):g.jsx(aF,{className:"h-4 w-4"}),g.jsx(py,{children:c.status==="success"?"Installed":"Error"}),g.jsx(gy,{children:c.message})]}),g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx(jt,{htmlFor:"install-type",children:"Type"}),g.jsxs(so,{value:i,onValueChange:a,disabled:w,children:[g.jsx(uo,{id:"install-type",children:g.jsx(lo,{})}),g.jsx(co,{children:due.map(j=>g.jsx(ir,{value:j.value,children:j.label},j.value))})]})]}),g.jsxs("div",{className:"flex flex-col gap-2",children:[g.jsx(jt,{htmlFor:"install-name",children:"Package Name"}),g.jsx(ct,{id:"install-name",autoFocus:!0,value:o,onChange:j=>l(j.target.value),placeholder:"e.g. strawpot-claude-code",readOnly:w,onKeyDown:j=>{j.key==="Enter"&&S()}})]}),h&&g.jsxs("details",{className:"text-sm",children:[g.jsx("summary",{className:"cursor-pointer text-xs font-medium text-muted-foreground",children:"Output"}),g.jsx("pre",{className:"mt-2 max-h-40 overflow-auto rounded-md bg-muted p-3 text-xs",children:h})]})]}),g.jsx(kF,{children:(c==null?void 0:c.status)==="success"?g.jsx(je,{onClick:()=>E(!1),children:"Done"}):g.jsx(je,{onClick:S,disabled:!o.trim()||b.isPending,children:b.isPending?"Installing...":"Install"})})]})})}const hue={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function mue({projectId:e,installOpen:t,onInstallOpenChange:n}){const{data:r,isLoading:i}=LF(e),[a,o]=x.useState(null),[l,c]=x.useState(""),[f,h]=x.useState(!1),[d,p]=x.useState(!1),v=t??d,b=n??p,{data:w}=$le(e,l,a??"",{enabled:f&&!!a&&!!l});return g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:"Resources installed to this project"}),g.jsxs(je,{onClick:()=>b(!0),size:"sm",children:[g.jsx(E0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),i?g.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((S,E)=>g.jsx(On,{className:"h-12 w-full"},E))}):!r||r.length===0?g.jsx("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:"No project resources installed yet."}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{children:"Type"}),g.jsx(rt,{children:"Version"}),g.jsx(rt,{children:"Description"}),g.jsx(rt,{className:"w-24"})]})}),g.jsx(cs,{children:r.map(S=>g.jsxs(rr,{className:"cursor-pointer",onClick:()=>{o(S.name),c(S.type),h(!0)},children:[g.jsx(tt,{className:"font-medium",children:S.name}),g.jsx(tt,{children:g.jsx(an,{variant:"outline",className:"text-xs",children:hue[S.type]??S.type})}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:S.version??"—"}),g.jsx(tt,{className:"max-w-[300px] truncate text-sm",children:S.description||"—"}),g.jsx(tt,{children:g.jsx(pue,{projectId:e,resourceType:S.type,name:S.name})})]},`${S.type}-${S.name}`))})]})})}),g.jsx(FF,{resource:w??null,resourceType:l,open:f,onOpenChange:h,projectId:e}),g.jsx(lO,{open:v,onOpenChange:b,projectId:e})]})}function pue({projectId:e,resourceType:t,name:n}){const[r,i]=x.useState(!1),a=BF(e),o=l=>{l.stopPropagation(),a.mutate({type:t,name:n},{onSuccess:c=>{c.exit_code===0?Pt.success(`Uninstalled ${n}`):Pt.error(`Uninstall failed: ${c.stderr||c.stdout}`),i(!1)},onError:()=>{Pt.error("Uninstall request failed"),i(!1)}})};return r?g.jsxs("div",{className:"flex gap-1",children:[g.jsx(je,{size:"sm",variant:"destructive",onClick:o,disabled:a.isPending,children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:l=>{l.stopPropagation(),i(!1)},children:"No"})]}):g.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:l=>{l.stopPropagation(),i(!0)},children:g.jsx(Kl,{className:"h-4 w-4"})})}function gue(e,t="30d"){return Yn({queryKey:qe.projects.stats(e,t),queryFn:()=>He.get(`/projects/${e}/stats?period=${t}`)})}var vue=["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"];function uO(e){if(typeof e!="string")return!1;var t=vue;return t.includes(e)}var yue=["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"],xue=new Set(yue);function UF(e){return typeof e!="string"?!1:xue.has(e)}function HF(e){return typeof e=="string"&&e.startsWith("data-")}function Di(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(UF(n)||HF(n))&&(t[n]=e[n]);return t}function oc(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Di(t)}return typeof e=="object"&&!Array.isArray(e)?Di(e):null}function Gr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(UF(n)||HF(n)||uO(n))&&(t[n]=e[n]);return t}function bue(e){return e==null?null:x.isValidElement(e)?Gr(e.props):typeof e=="object"&&!Array.isArray(e)?Gr(e):null}var wue=["children","width","height","viewBox","className","style","title","desc"];function xC(){return xC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xC.apply(null,arguments)}function Sue(e,t){if(e==null)return{};var n,r,i=Eue(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Eue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cO=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:f}=e,h=Sue(e,wue),d=a||{width:r,height:i,x:0,y:0},p=Et("recharts-surface",o);return x.createElement("svg",xC({},Gr(h),{className:p,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),x.createElement("title",null,c),x.createElement("desc",null,f),n)}),_ue=["children","className"];function bC(){return bC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bC.apply(null,arguments)}function Cue(e,t){if(e==null)return{};var n,r,i=jue(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ar=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Cue(e,_ue),a=Et("recharts-layer",r);return x.createElement("g",bC({className:a},Gr(i),{ref:t}),n)}),qF=x.createContext(null),Aue=()=>x.useContext(qF);function Jt(e){return function(){return e}}const VF=Math.cos,Hy=Math.sin,La=Math.sqrt,qy=Math.PI,O0=2*qy,wC=Math.PI,SC=2*wC,ku=1e-6,Oue=SC-ku;function KF(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function kue(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KF;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Nue{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?KF:kue(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,f=i-n,h=o-t,d=l-n,p=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>ku)if(!(Math.abs(d*c-f*h)>ku)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,b=i-l,w=c*c+f*f,S=v*v+b*b,E=Math.sqrt(w),j=Math.sqrt(p),C=a*Math.tan((wC-Math.acos((w+p-S)/(2*E*j)))/2),O=C/j,N=C/E;Math.abs(O-1)>ku&&this._append`L${t+O*h},${n+O*d}`,this._append`A${a},${a},0,0,${+(d*v>h*b)},${this._x1=t+N*c},${this._y1=n+N*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),f=t+l,h=n+c,d=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>ku||Math.abs(this._y1-h)>ku)&&this._append`L${f},${h}`,r&&(p<0&&(p=p%SC+SC),p>Oue?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=f},${this._y1=h}`:p>ku&&this._append`A${r},${r},0,${+(p>=wC)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function fO(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Nue(t)}function dO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function YF(e){this._context=e}YF.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function k0(e){return new YF(e)}function XF(e){return e[0]}function GF(e){return e[1]}function WF(e,t){var n=Jt(!0),r=null,i=k0,a=null,o=fO(l);e=typeof e=="function"?e:e===void 0?XF:Jt(e),t=typeof t=="function"?t:t===void 0?GF:Jt(t);function l(c){var f,h=(c=dO(c)).length,d,p=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=h;++f)!(f<h&&n(d=c[f],f,c))===p&&((p=!p)?a.lineStart():a.lineEnd()),p&&a.point(+e(d,f,c),+t(d,f,c));if(v)return a=null,v+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Jt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Jt(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Jt(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function Dv(e,t,n){var r=null,i=Jt(!0),a=null,o=k0,l=null,c=fO(f);e=typeof e=="function"?e:e===void 0?XF:Jt(+e),t=typeof t=="function"?t:Jt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?GF:Jt(+n);function f(d){var p,v,b,w=(d=dO(d)).length,S,E=!1,j,C=new Array(w),O=new Array(w);for(a==null&&(l=o(j=c())),p=0;p<=w;++p){if(!(p<w&&i(S=d[p],p,d))===E)if(E=!E)v=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=p-1;b>=v;--b)l.point(C[b],O[b]);l.lineEnd(),l.areaEnd()}E&&(C[p]=+e(S,p,d),O[p]=+t(S,p,d),l.point(r?+r(S,p,d):C[p],n?+n(S,p,d):O[p]))}if(j)return l=null,j+""||null}function h(){return WF().defined(i).curve(o).context(a)}return f.x=function(d){return arguments.length?(e=typeof d=="function"?d:Jt(+d),r=null,f):e},f.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Jt(+d),f):e},f.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Jt(+d),f):r},f.y=function(d){return arguments.length?(t=typeof d=="function"?d:Jt(+d),n=null,f):t},f.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Jt(+d),f):t},f.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Jt(+d),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Jt(!!d),f):i},f.curve=function(d){return arguments.length?(o=d,a!=null&&(l=o(a)),f):o},f.context=function(d){return arguments.length?(d==null?a=l=null:l=o(a=d),f):a},f}class QF{constructor(t,n){this._context=t,this._x=n}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(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Tue(e){return new QF(e,!0)}function Pue(e){return new QF(e,!1)}const hO={draw(e,t){const n=La(t/qy);e.moveTo(n,0),e.arc(0,0,n,0,O0)}},Mue={draw(e,t){const n=La(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},ZF=La(1/3),Due=ZF*2,Rue={draw(e,t){const n=La(t/Due),r=n*ZF;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Iue={draw(e,t){const n=La(t),r=-n/2;e.rect(r,r,n,n)}},Lue=.8908130915292852,JF=Hy(qy/10)/Hy(7*qy/10),zue=Hy(O0/10)*JF,$ue=-VF(O0/10)*JF,Bue={draw(e,t){const n=La(t*Lue),r=zue*n,i=$ue*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=O0*a/5,l=VF(o),c=Hy(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},SS=La(3),Fue={draw(e,t){const n=-La(t/(SS*3));e.moveTo(0,n*2),e.lineTo(-SS*n,-n),e.lineTo(SS*n,-n),e.closePath()}},Gi=-.5,Wi=La(3)/2,EC=1/La(12),Uue=(EC/2+1)*3,Hue={draw(e,t){const n=La(t/Uue),r=n/2,i=n*EC,a=r,o=n*EC+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(Gi*r-Wi*i,Wi*r+Gi*i),e.lineTo(Gi*a-Wi*o,Wi*a+Gi*o),e.lineTo(Gi*l-Wi*c,Wi*l+Gi*c),e.lineTo(Gi*r+Wi*i,Gi*i-Wi*r),e.lineTo(Gi*a+Wi*o,Gi*o-Wi*a),e.lineTo(Gi*l+Wi*c,Gi*c-Wi*l),e.closePath()}};function que(e,t){let n=null,r=fO(i);e=typeof e=="function"?e:Jt(e||hO),t=typeof t=="function"?t:Jt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Jt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Jt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Vy(){}function Ky(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function eU(e){this._context=e}eU.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:Ky(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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:Ky(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vue(e){return new eU(e)}function tU(e){this._context=e}tU.prototype={areaStart:Vy,areaEnd:Vy,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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ky(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Kue(e){return new tU(e)}function nU(e){this._context=e}nU.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Ky(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Yue(e){return new nU(e)}function rU(e){this._context=e}rU.prototype={areaStart:Vy,areaEnd:Vy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Xue(e){return new rU(e)}function rR(e){return e<0?-1:1}function iR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(rR(a)+rR(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function aR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ES(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function Yy(e){this._context=e}Yy.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:ES(this,this._t0,aR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,ES(this,aR(this,n=iR(this,e,t)),n);break;default:ES(this,this._t0,n=iR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function iU(e){this._context=new aU(e)}(iU.prototype=Object.create(Yy.prototype)).point=function(e,t){Yy.prototype.point.call(this,t,e)};function aU(e){this._context=e}aU.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Gue(e){return new Yy(e)}function Wue(e){return new iU(e)}function oU(e){this._context=e}oU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=oR(e),i=oR(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function oR(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Que(e){return new oU(e)}function N0(e,t){this._context=e,this._t=t}N0.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Zue(e){return new N0(e,.5)}function Jue(e){return new N0(e,0)}function ece(e){return new N0(e,1)}function sc(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function _C(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function tce(e,t){return e[t]}function nce(e){const t=[];return t.key=e,t}function rce(){var e=Jt([]),t=_C,n=sc,r=tce;function i(a){var o=Array.from(e.apply(this,arguments),nce),l,c=o.length,f=-1,h;for(const d of a)for(l=0,++f;l<c;++l)(o[l][f]=[0,+r(d,o[l].key,f,a)]).data=d;for(l=0,h=dO(t(o));l<c;++l)o[h[l]].index=l;return n(o,h),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Jt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Jt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?_C:typeof a=="function"?a:Jt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??sc,i):n},i}function ice(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}sc(e,t)}}function ace(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,l=0;o<i;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}sc(e,t)}}function oce(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var l=0,c=0,f=0;l<o;++l){for(var h=e[t[l]],d=h[r][1]||0,p=h[r-1][1]||0,v=(d-p)/2,b=0;b<l;++b){var w=e[t[b]],S=w[r][1]||0,E=w[r-1][1]||0;v+=S-E}c+=d,f+=v*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=f/c)}i[r-1][1]+=i[r-1][0]=n,sc(e,t)}}var _S={},CS={},sR;function sce(){return sR||(sR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(CS)),CS}var jS={},lR;function sU(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(jS)),jS}var AS={},uR;function mO(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(AS)),AS}var OS={},kS={},cR;function lce(){return cR||(cR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(kS)),kS}var fR;function pO(){return fR||(fR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lce(),n=mO();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let l=0,c="",f="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<o;){const d=i[l];f?d==="\\"&&l+1<o?(l++,c+=i[l]):d===f?f="":c+=d:h?d==='"'||d==="'"?f=d:d==="]"?(h=!1,a.push(c),c=""):c+=d:d==="["?(h=!0,c&&(a.push(c),c="")):d==="."?c&&(a.push(c),c=""):c+=d,l++}return c&&a.push(c),a}e.toPath=r})(OS)),OS}var dR;function gO(){return dR||(dR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sce(),n=sU(),r=mO(),i=pO();function a(l,c,f){if(l==null)return f;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return f;const h=l[c];return h===void 0?n.isDeepKey(c)?a(l,i.toPath(c),f):f:h}case"number":case"symbol":{typeof c=="number"&&(c=r.toKey(c));const h=l[c];return h===void 0?f:h}default:{if(Array.isArray(c))return o(l,c,f);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return f;const h=l[c];return h===void 0?f:h}}}function o(l,c,f){if(c.length===0)return f;let h=l;for(let d=0;d<c.length;d++){if(h==null||t.isUnsafeProperty(c[d]))return f;h=h[c[d]]}return h===void 0?f:h}e.get=a})(_S)),_S}var NS,hR;function uce(){return hR||(hR=1,NS=gO().get),NS}var cce=uce();const lc=zi(cce);var fce=4;function Al(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fce,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function jn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var l=n[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Al(l)+a:i+a},"")}var pr=e=>e===0?0:e>0?1:-1,fo=e=>typeof e=="number"&&e!=+e,uc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Te=e=>(typeof e=="number"||e instanceof Number)&&!fo(e),ho=e=>Te(e)||typeof e=="string",dce=0,Im=e=>{var t=++dce;return"".concat(e||"").concat(t)},Lr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Te(t)&&typeof t!="string")return r;var a;if(uc(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return fo(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},lU=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function ln(e,t,n){return Te(e)&&Te(t)?Al(e+n*(t-e)):t}function uU(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):lc(r,t))===n)}var dn=e=>e===null||typeof e>"u",Ap=e=>dn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ci(e){return e!=null}function Ql(){}var hce=["type","size","sizeType"];function CC(){return CC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CC.apply(null,arguments)}function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mR(Object(n),!0).forEach(function(r){mce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mce(e,t,n){return(t=pce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pce(e){var t=gce(e,"string");return typeof t=="symbol"?t:t+""}function gce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vce(e,t){if(e==null)return{};var n,r,i=yce(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cU={symbolCircle:hO,symbolCross:Mue,symbolDiamond:Rue,symbolSquare:Iue,symbolStar:Bue,symbolTriangle:Fue,symbolWye:Hue},xce=Math.PI/180,bce=e=>{var t="symbol".concat(Ap(e));return cU[t]||hO},wce=(e,t,n)=>{if(t==="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 r=18*xce;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**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}},Sce=(e,t)=>{cU["symbol".concat(Ap(e))]=t},vO=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=vce(e,hce),a=pR(pR({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var p=bce(o),v=que().type(p).size(wce(n,r,o)),b=v();if(b!==null)return b},{className:c,cx:f,cy:h}=a,d=Gr(a);return Te(f)&&Te(h)&&Te(n)?x.createElement("path",CC({},d,{className:Et("recharts-symbols",c),transform:"translate(".concat(f,", ").concat(h,")"),d:l()})):null};vO.registerSymbol=Sce;var fU=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,yO=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{uO(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Ece=(e,t,n)=>r=>(e(t,n,r),null),Op=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];uO(i)&&typeof a=="function"&&(r||(r={}),r[i]=Ece(a,t,n))}),r};function gR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _ce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(r){Cce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cce(e,t,n){return(t=jce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jce(e){var t=Ace(e,"string");return typeof t=="symbol"?t:t+""}function Ace(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xn(e,t){var n=_ce({},e),r=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xy.apply(null,arguments)}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){Oce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oce(e,t,n){return(t=kce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kce(e){var t=Nce(e,"string");return typeof t=="symbol"?t:t+""}function Nce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zi=32,Tce={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Pce(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Mce(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Zi/2,a=Zi/6,o=Zi/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:Pce(t.payload),x1:0,y1:i,x2:Zi,y2:i,className:"recharts-legend-icon"});if(c==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
            H`).concat(Zi,"M").concat(2*o,",").concat(i,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return x.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Zi/8,"h").concat(Zi,"v").concat(Zi*3/4,"h").concat(-Zi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=dU({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(vO,{fill:l,cx:i,cy:i,size:Zi,sizeType:"diameter",type:c})}function Dce(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:l}=e,c={x:0,y:0,width:Zi,height:Zi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,p)=>{var v=d.formatter||i,b=Et({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:d.inactive});if(d.type==="none")return null;var w=typeof l=="object"?dU({},l):{};w.color=d.inactive?a:w.color||d.color;var S=v?v(d.value,d,p):d.value;return x.createElement("li",Xy({className:b,style:f,key:"legend-item-".concat(p)},Op(e,d,p)),x.createElement(cO,{width:n,height:n,viewBox:c,style:h,"aria-label":"".concat(S," legend icon")},x.createElement(Mce,{data:d,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:w},S))})}var Rce=e=>{var t=Xn(e,Tce),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(Dce,Xy({},t,{payload:n})))},TS={},PS={},yR;function Ice(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],l=r(o,a,n);i.has(l)||i.set(l,o)}return Array.from(i.values())}e.uniqBy=t})(PS)),PS}var MS={},xR;function Lce(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(MS)),MS}var DS={},bR;function hU(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(DS)),DS}var RS={},IS={},LS={},wR;function zce(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(LS)),LS}var SR;function mU(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zce();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(IS)),IS}var zS={},ER;function $ce(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(zS)),zS}var _R;function Bce(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mU(),n=$ce();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(RS)),RS}var $S={},BS={},CR;function Fce(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gO();function n(r){return function(i){return t.get(i,r)}}e.property=n})(BS)),BS}var FS={},US={},HS={},qS={},jR;function pU(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(qS)),qS}var VS={},AR;function gU(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(VS)),VS}var KS={},OR;function vU(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(KS)),KS}var kR;function Uce(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pU(),n=gU(),r=vU();function i(h,d,p){return typeof p!="function"?i(h,d,()=>{}):a(h,d,function v(b,w,S,E,j,C){const O=p(b,w,S,E,j,C);return O!==void 0?!!O:a(b,w,v,C)},new Map)}function a(h,d,p,v){if(d===h)return!0;switch(typeof d){case"object":return o(h,d,p,v);case"function":return Object.keys(d).length>0?a(h,{...d},p,v):r.isEqualsSameValueZero(h,d);default:return t.isObject(h)?typeof d=="string"?d==="":!0:r.isEqualsSameValueZero(h,d)}}function o(h,d,p,v){if(d==null)return!0;if(Array.isArray(d))return c(h,d,p,v);if(d instanceof Map)return l(h,d,p,v);if(d instanceof Set)return f(h,d,p,v);const b=Object.keys(d);if(h==null||n.isPrimitive(h))return b.length===0;if(b.length===0)return!0;if(v!=null&&v.has(d))return v.get(d)===h;v==null||v.set(d,h);try{for(let w=0;w<b.length;w++){const S=b[w];if(!n.isPrimitive(h)&&!(S in h)||d[S]===void 0&&h[S]!==void 0||d[S]===null&&h[S]!==null||!p(h[S],d[S],S,h,d,v))return!1}return!0}finally{v==null||v.delete(d)}}function l(h,d,p,v){if(d.size===0)return!0;if(!(h instanceof Map))return!1;for(const[b,w]of d.entries()){const S=h.get(b);if(p(S,w,b,h,d,v)===!1)return!1}return!0}function c(h,d,p,v){if(d.length===0)return!0;if(!Array.isArray(h))return!1;const b=new Set;for(let w=0;w<d.length;w++){const S=d[w];let E=!1;for(let j=0;j<h.length;j++){if(b.has(j))continue;const C=h[j];let O=!1;if(p(C,S,w,h,d,v)&&(O=!0),O){b.add(j),E=!0;break}}if(!E)return!1}return!0}function f(h,d,p,v){return d.size===0?!0:h instanceof Set?c([...h],[...d],p,v):!1}e.isMatchWith=i,e.isSetMatch=f})(HS)),HS}var NR;function yU(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Uce();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(US)),US}var YS={},XS={},GS={},TR;function Hce(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(GS)),GS}var WS={},PR;function xO(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(WS)),WS}var QS={},MR;function xU(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",f="[object Set]",h="[object Array]",d="[object Function]",p="[object ArrayBuffer]",v="[object Object]",b="[object Error]",w="[object DataView]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",j="[object Uint16Array]",C="[object Uint32Array]",O="[object BigUint64Array]",N="[object Int8Array]",k="[object Int16Array]",T="[object Int32Array]",M="[object BigInt64Array]",I="[object Float32Array]",L="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=p,e.arrayTag=h,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=w,e.dateTag=l,e.errorTag=b,e.float32ArrayTag=I,e.float64ArrayTag=L,e.functionTag=d,e.int16ArrayTag=k,e.int32ArrayTag=T,e.int8ArrayTag=N,e.mapTag=c,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=j,e.uint32ArrayTag=C,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=E})(QS)),QS}var ZS={},DR;function qce(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ZS)),ZS}var RR;function bU(){return RR||(RR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Hce(),n=xO(),r=xU(),i=gU(),a=qce();function o(h,d){return l(h,void 0,h,new Map,d)}function l(h,d,p,v=new Map,b=void 0){const w=b==null?void 0:b(h,d,p,v);if(w!==void 0)return w;if(i.isPrimitive(h))return h;if(v.has(h))return v.get(h);if(Array.isArray(h)){const S=new Array(h.length);v.set(h,S);for(let E=0;E<h.length;E++)S[E]=l(h[E],E,p,v,b);return Object.hasOwn(h,"index")&&(S.index=h.index),Object.hasOwn(h,"input")&&(S.input=h.input),S}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const S=new RegExp(h.source,h.flags);return S.lastIndex=h.lastIndex,S}if(h instanceof Map){const S=new Map;v.set(h,S);for(const[E,j]of h)S.set(E,l(j,E,p,v,b));return S}if(h instanceof Set){const S=new Set;v.set(h,S);for(const E of h)S.add(l(E,void 0,p,v,b));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(a.isTypedArray(h)){const S=new(Object.getPrototypeOf(h)).constructor(h.length);v.set(h,S);for(let E=0;E<h.length;E++)S[E]=l(h[E],E,p,v,b);return S}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const S=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return v.set(h,S),c(S,h,p,v,b),S}if(typeof File<"u"&&h instanceof File){const S=new File([h],h.name,{type:h.type});return v.set(h,S),c(S,h,p,v,b),S}if(typeof Blob<"u"&&h instanceof Blob){const S=new Blob([h],{type:h.type});return v.set(h,S),c(S,h,p,v,b),S}if(h instanceof Error){const S=structuredClone(h);return v.set(h,S),S.message=h.message,S.name=h.name,S.stack=h.stack,S.cause=h.cause,S.constructor=h.constructor,c(S,h,p,v,b),S}if(h instanceof Boolean){const S=new Boolean(h.valueOf());return v.set(h,S),c(S,h,p,v,b),S}if(h instanceof Number){const S=new Number(h.valueOf());return v.set(h,S),c(S,h,p,v,b),S}if(h instanceof String){const S=new String(h.valueOf());return v.set(h,S),c(S,h,p,v,b),S}if(typeof h=="object"&&f(h)){const S=Object.create(Object.getPrototypeOf(h));return v.set(h,S),c(S,h,p,v,b),S}return h}function c(h,d,p=h,v,b){const w=[...Object.keys(d),...t.getSymbols(d)];for(let S=0;S<w.length;S++){const E=w[S],j=Object.getOwnPropertyDescriptor(h,E);(j==null||j.writable)&&(h[E]=l(d[E],E,p,v,b))}}function f(h){switch(n.getTag(h)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(XS)),XS}var IR;function Vce(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bU();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(YS)),YS}var LR;function Kce(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yU(),n=Vce();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(FS)),FS}var JS={},eE={},tE={},zR;function Yce(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bU(),n=xO(),r=xU();function i(a,o){return t.cloneDeepWith(a,(l,c,f,h)=>{const d=o==null?void 0:o(l,c,f,h);if(d!==void 0)return d;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const p={};return h.set(a,p),t.copyProperties(p,a,f,h),p}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const p=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(p,a),p}case r.argumentsTag:{const p={};return t.copyProperties(p,a),p.length=a.length,p[Symbol.iterator]=a[Symbol.iterator],p}default:return}}})}e.cloneDeepWith=i})(tE)),tE}var $R;function Xce(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yce();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(eE)),eE}var nE={},rE={},BR;function wU(){return BR||(BR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(rE)),rE}var iE={},FR;function Gce(){return FR||(FR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xO();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(iE)),iE}var UR;function Wce(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sU(),n=wU(),r=Gce(),i=pO();function a(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=i.toPath(l):c=[l],c.length===0)return!1;let f=o;for(let h=0;h<c.length;h++){const d=c[h];if((f==null||!Object.hasOwn(f,d))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(d)&&d<f.length))return!1;f=f[d]}return!0}e.has=a})(nE)),nE}var HR;function Qce(){return HR||(HR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yU(),n=mO(),r=Xce(),i=gO(),a=Wce();function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=n.toKey(l);break}}return c=r.cloneDeep(c),function(f){const h=i.get(f,l);return h===void 0?a.has(f,l):c===void 0?h===void 0:t.isMatch(h,c)}}e.matchesProperty=o})(JS)),JS}var qR;function Zce(){return qR||(qR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hU(),n=Fce(),r=Kce(),i=Qce();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})($S)),$S}var VR;function Jce(){return VR||(VR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ice(),n=Lce(),r=hU(),i=Bce(),a=Zce();function o(l,c=r.identity){return i.isArrayLikeObject(l)?t.uniqBy(Array.from(l),n.ary(a.iteratee(c),1)):[]}e.uniqBy=o})(TS)),TS}var aE,KR;function efe(){return KR||(KR=1,aE=Jce().uniqBy),aE}var tfe=efe();const YR=zi(tfe);function SU(e,t,n){return t===!0?YR(e,n):typeof t=="function"?YR(e,t):e}var oE={exports:{}},sE={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var XR;function nfe(){if(XR)return sE;XR=1;var e=jd(),t=dee();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return sE.useSyncExternalStoreWithSelector=function(f,h,d,p,v){var b=a(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=l(function(){function E(k){if(!j){if(j=!0,C=k,k=p(k),v!==void 0&&w.hasValue){var T=w.value;if(v(T,k))return O=T}return O=k}if(T=O,r(C,k))return T;var M=p(k);return v!==void 0&&v(T,M)?(C=k,T):(C=k,O=M)}var j=!1,C,O,N=d===void 0?null:d;return[function(){return E(h())},N===null?void 0:function(){return E(N())}]},[h,d,p,v]);var S=i(f,b[0],b[1]);return o(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},sE}var GR;function rfe(){return GR||(GR=1,oE.exports=nfe()),oE.exports}var EU=rfe();const ife=zi(EU);var bO=x.createContext(null),afe=e=>e,Vt=()=>{var e=x.useContext(bO);return e?e.store.dispatch:afe},vy=()=>{},ofe=()=>vy,sfe=(e,t)=>e===t;function De(e){var t=x.useContext(bO),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:vy,[t,e]);return EU.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ofe,t?t.store.getState:vy,t?t.store.getState:vy,n,sfe)}function lfe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ufe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function cfe(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var WR=e=>Array.isArray(e)?e:[e];function ffe(e){const t=Array.isArray(e[0])?e[0]:e;return cfe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dfe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var hfe=class{constructor(e){this.value=e}deref(){return this.value}},mfe=typeof WeakRef<"u"?WeakRef:hfe,pfe=0,QR=1;function Rv(){return{s:pfe,v:void 0,o:null,p:null}}function _U(e,t={}){let n=Rv();const{resultEqualityCheck:r}=t;let i,a=0;function o(){var d;let l=n;const{length:c}=arguments;for(let p=0,v=c;p<v;p++){const b=arguments[p];if(typeof b=="function"||typeof b=="object"&&b!==null){let w=l.o;w===null&&(l.o=w=new WeakMap);const S=w.get(b);S===void 0?(l=Rv(),w.set(b,l)):l=S}else{let w=l.p;w===null&&(l.p=w=new Map);const S=w.get(b);S===void 0?(l=Rv(),w.set(b,l)):l=S}}const f=l;let h;if(l.s===QR)h=l.v;else if(h=e.apply(null,arguments),a++,r){const p=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;p!=null&&r(p,h)&&(h=p,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new mfe(h):h}return f.s=QR,f.v=h,h}return o.clearCache=()=>{n=Rv(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function gfe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},f=i.pop();typeof f=="object"&&(c=f,f=i.pop()),lfe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const h={...n,...c},{memoize:d,memoizeOptions:p=[],argsMemoize:v=_U,argsMemoizeOptions:b=[]}=h,w=WR(p),S=WR(b),E=ffe(i),j=d(function(){return a++,f.apply(null,arguments)},...w),C=v(function(){o++;const N=dfe(E,arguments);return l=j.apply(null,N),l},...S);return Object.assign(C,{resultFunc:f,memoizedResultFunc:j,dependencies:E,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=gfe(_U),vfe=Object.assign((e,t=le)=>{ufe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>vfe}),lE={},uE={},cE={},ZR;function yfe(){return ZR||(ZR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(cE)),cE}var fE={},dE={},JR;function CU(){return JR||(JR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(dE)),dE}var eI;function xfe(){return eI||(eI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CU(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(fE)),fE}var tI;function bfe(){return tI||(tI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yfe(),n=xfe(),r=pO();function i(a,o,l,c){if(a==null)return[];l=c?void 0:l,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(v=>String(v));const f=(v,b)=>{let w=v;for(let S=0;S<b.length&&w!=null;++S)w=w[b[S]];return w},h=(v,b)=>b==null||v==null?b:typeof v=="object"&&"key"in v?Object.hasOwn(b,v.key)?b[v.key]:f(b,v.path):typeof v=="function"?v(b):Array.isArray(v)?f(b,v):typeof b=="object"?b[v]:b,d=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:d.map(b=>h(b,v))})).slice().sort((v,b)=>{for(let w=0;w<d.length;w++){const S=t.compareValues(v.criteria[w],b.criteria[w],l[w]);if(S!==0)return S}return 0}).map(v=>v.original)}e.orderBy=i})(uE)),uE}var hE={},nI;function wfe(){return nI||(nI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,c)=>{for(let f=0;f<l.length;f++){const h=l[f];Array.isArray(h)&&c<a?o(h,c+1):i.push(h)}};return o(n,0),i}e.flatten=t})(hE)),hE}var mE={},rI;function jU(){return rI||(rI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wU(),n=mU(),r=pU(),i=vU();function a(o,l,c){return r.isObject(c)&&(typeof l=="number"&&n.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?i.isEqualsSameValueZero(c[l],o):!1}e.isIterateeCall=a})(mE)),mE}var iI;function Sfe(){return iI||(iI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bfe(),n=wfe(),r=jU();function i(a,...o){const l=o.length;return l>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(lE)),lE}var pE,aI;function Efe(){return aI||(aI=1,pE=Sfe().sortBy),pE}var _fe=Efe();const T0=zi(_fe);var AU=e=>e.legend.settings,Cfe=e=>e.legend.size,jfe=e=>e.legend.payload,Afe=le([jfe,AU],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?T0(r,n):r});function Ofe(){return De(Afe)}var Iv=1;function OU(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>Iv||Math.abs(o.left-t.left)>Iv||Math.abs(o.top-t.top)>Iv||Math.abs(o.width-t.width)>Iv)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function _r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var kfe=typeof Symbol=="function"&&Symbol.observable||"@@observable",oI=kfe,gE=()=>Math.random().toString(36).substring(7).split("").join("."),Nfe={INIT:`@@redux/INIT${gE()}`,REPLACE:`@@redux/REPLACE${gE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${gE()}`},Gy=Nfe;function wO(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function kU(e,t,n){if(typeof e!="function")throw new Error(_r(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(_r(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(_r(1));return n(kU)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function f(){o===a&&(o=new Map,a.forEach((S,E)=>{o.set(E,S)}))}function h(){if(c)throw new Error(_r(3));return i}function d(S){if(typeof S!="function")throw new Error(_r(4));if(c)throw new Error(_r(5));let E=!0;f();const j=l++;return o.set(j,S),function(){if(E){if(c)throw new Error(_r(6));E=!1,f(),o.delete(j),a=null}}}function p(S){if(!wO(S))throw new Error(_r(7));if(typeof S.type>"u")throw new Error(_r(8));if(typeof S.type!="string")throw new Error(_r(17));if(c)throw new Error(_r(9));try{c=!0,i=r(i,S)}finally{c=!1}return(a=o).forEach(j=>{j()}),S}function v(S){if(typeof S!="function")throw new Error(_r(10));r=S,p({type:Gy.REPLACE})}function b(){const S=d;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(_r(11));function j(){const O=E;O.next&&O.next(h())}return j(),{unsubscribe:S(j)}},[oI](){return this}}}return p({type:Gy.INIT}),{dispatch:p,subscribe:d,getState:h,replaceReducer:v,[oI]:b}}function Tfe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Gy.INIT})>"u")throw new Error(_r(12));if(typeof n(void 0,{type:Gy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(_r(13))})}function NU(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{Tfe(n)}catch(a){i=a}return function(o={},l){if(i)throw i;let c=!1;const f={};for(let h=0;h<r.length;h++){const d=r[h],p=n[d],v=o[d],b=p(v,l);if(typeof b>"u")throw l&&l.type,new Error(_r(14));f[d]=b,c=c||b!==v}return c=c||r.length!==Object.keys(o).length,c?f:o}}function Wy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Pfe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(_r(15))};const o={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},l=e.map(c=>c(o));return a=Wy(...l)(i.dispatch),{...i,dispatch:a}}}function TU(e){return wO(e)&&"type"in e&&typeof e.type=="string"}var PU=Symbol.for("immer-nothing"),sI=Symbol.for("immer-draftable"),Wr=Symbol.for("immer-state");function Ea(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ni=Object,ud=Ni.getPrototypeOf,Qy="constructor",P0="prototype",jC="configurable",Zy="enumerable",yy="writable",Lm="value",fs=e=>!!e&&!!e[Wr];function Pa(e){var t;return e?MU(e)||D0(e)||!!e[sI]||!!((t=e[Qy])!=null&&t[sI])||R0(e)||I0(e):!1}var Mfe=Ni[P0][Qy].toString(),lI=new WeakMap;function MU(e){if(!e||!SO(e))return!1;const t=ud(e);if(t===null||t===Ni[P0])return!0;const n=Ni.hasOwnProperty.call(t,Qy)&&t[Qy];if(n===Object)return!0;if(!Of(n))return!1;let r=lI.get(n);return r===void 0&&(r=Function.toString.call(n),lI.set(n,r)),r===Mfe}function M0(e,t,n=!0){kp(e)===0?(n?Reflect.ownKeys(e):Ni.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function kp(e){const t=e[Wr];return t?t.type_:D0(e)?1:R0(e)?2:I0(e)?3:0}var uI=(e,t,n=kp(e))=>n===2?e.has(t):Ni[P0].hasOwnProperty.call(e,t),AC=(e,t,n=kp(e))=>n===2?e.get(t):e[t],Jy=(e,t,n,r=kp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Dfe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var D0=Array.isArray,R0=e=>e instanceof Map,I0=e=>e instanceof Set,SO=e=>typeof e=="object",Of=e=>typeof e=="function",vE=e=>typeof e=="boolean";function Rfe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Ho=e=>e.copy_||e.base_,EO=e=>e.modified_?e.copy_:e.base_;function OC(e,t){if(R0(e))return new Map(e);if(I0(e))return new Set(e);if(D0(e))return Array[P0].slice.call(e);const n=MU(e);if(t===!0||t==="class_only"&&!n){const r=Ni.getOwnPropertyDescriptors(e);delete r[Wr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l[yy]===!1&&(l[yy]=!0,l[jC]=!0),(l.get||l.set)&&(r[o]={[jC]:!0,[yy]:!0,[Zy]:l[Zy],[Lm]:e[o]})}return Ni.create(ud(e),r)}else{const r=ud(e);if(r!==null&&n)return{...e};const i=Ni.create(r);return Ni.assign(i,e)}}function _O(e,t=!1){return L0(e)||fs(e)||!Pa(e)||(kp(e)>1&&Ni.defineProperties(e,{set:Lv,add:Lv,clear:Lv,delete:Lv}),Ni.freeze(e),t&&M0(e,(n,r)=>{_O(r,!0)},!1)),e}function Ife(){Ea(2)}var Lv={[Lm]:Ife};function L0(e){return e===null||!SO(e)?!0:Ni.isFrozen(e)}var ex="MapSet",kC="Patches",cI="ArrayMethods",DU={};function cc(e){const t=DU[e];return t||Ea(0,e),t}var fI=e=>!!DU[e],zm,RU=()=>zm,Lfe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:fI(ex)?cc(ex):void 0,arrayMethodsPlugin_:fI(cI)?cc(cI):void 0});function dI(e,t){t&&(e.patchPlugin_=cc(kC),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function NC(e){TC(e),e.drafts_.forEach(zfe),e.drafts_=null}function TC(e){e===zm&&(zm=e.parent_)}var hI=e=>zm=Lfe(zm,e);function zfe(e){const t=e[Wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function mI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Wr].modified_&&(NC(t),Ea(4)),Pa(e)&&(e=pI(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Wr].base_,e,t)}else e=pI(t,n);return $fe(t,e,!0),NC(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==PU?e:void 0}function pI(e,t){if(L0(t))return t;const n=t[Wr];if(!n)return tx(t,e.handledSet_,e);if(!z0(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);zU(n,e)}return n.copy_}function $fe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_O(t,n)}function IU(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var z0=(e,t)=>e.scope_===t,Bfe=[];function LU(e,t,n,r){const i=Ho(e),a=e.type_;if(r!==void 0&&AC(i,r,a)===t){Jy(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;M0(i,(c,f)=>{if(fs(f)){const h=l.get(f)||[];h.push(c),l.set(f,h)}})}const o=e.draftLocations_.get(t)??Bfe;for(const l of o)Jy(i,l,n,a)}function Ffe(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!z0(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=EO(a);LU(e,a.draft_??a,o,n),zU(a,i)})}function zU(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}IU(e)}}function Ufe(e,t,n){const{scope_:r}=e;if(fs(n)){const i=n[Wr];z0(i,r)&&i.callbacks_.push(function(){xy(e);const o=EO(i);LU(e,n,o,t)})}else Pa(n)&&e.callbacks_.push(function(){const a=Ho(e);e.type_===3?a.has(n)&&tx(n,r.handledSet_,r):AC(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&tx(AC(e.copy_,t,e.type_),r.handledSet_,r)})}function tx(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fs(e)||t.has(e)||!Pa(e)||L0(e)||(t.add(e),M0(e,(r,i)=>{if(fs(i)){const a=i[Wr];if(z0(a,n)){const o=EO(a);Jy(e,r,o,e.type_),IU(a)}}else Pa(i)&&tx(i,t,n)})),e}function Hfe(e,t){const n=D0(e),r={type_:n?1:0,scope_:t?t.scope_:RU(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=nx;n&&(i=[r],a=$m);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var nx={get(e,t){if(t===Wr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Ho(e);if(!uI(i,t,e.type_))return qfe(e,i,t);const a=i[t];if(e.finalized_||!Pa(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Rfe(t))return a;if(a===yE(e.base_,t)){xy(e);const o=e.type_===1?+t:t,l=MC(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in Ho(e)},ownKeys(e){return Reflect.ownKeys(Ho(e))},set(e,t,n){const r=$U(Ho(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yE(Ho(e),t),a=i==null?void 0:i[Wr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Dfe(n,i)&&(n!==void 0||uI(e.base_,t,e.type_)))return!0;xy(e),PC(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Ufe(e,t,n)),!0},deleteProperty(e,t){return xy(e),yE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),PC(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ho(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[yy]:!0,[jC]:e.type_!==1||t!=="length",[Zy]:r[Zy],[Lm]:n[t]}},defineProperty(){Ea(11)},getPrototypeOf(e){return ud(e.base_)},setPrototypeOf(){Ea(12)}},$m={};for(let e in nx){let t=nx[e];$m[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}$m.deleteProperty=function(e,t){return $m.set.call(this,e,t,void 0)};$m.set=function(e,t,n){return nx.set.call(this,e[0],t,n,e[0])};function yE(e,t){const n=e[Wr];return(n?Ho(n):e)[t]}function qfe(e,t,n){var i;const r=$U(t,n);return r?Lm in r?r[Lm]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function $U(e,t){if(!(t in e))return;let n=ud(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ud(n)}}function PC(e){e.modified_||(e.modified_=!0,e.parent_&&PC(e.parent_))}function xy(e){e.copy_||(e.assigned_=new Map,e.copy_=OC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vfe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Of(n)&&!Of(r)){const o=r;r=n;const l=this;return function(f=o,...h){return l.produce(f,d=>r.call(this,d,...h))}}Of(r)||Ea(6),i!==void 0&&!Of(i)&&Ea(7);let a;if(Pa(n)){const o=hI(this),l=MC(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?NC(o):TC(o)}return dI(o,i),mI(a,o)}else if(!n||!SO(n)){if(a=r(n),a===void 0&&(a=n),a===PU&&(a=void 0),this.autoFreeze_&&_O(a,!0),i){const o=[],l=[];cc(kC).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else Ea(1,n)},this.produceWithPatches=(n,r)=>{if(Of(n))return(l,...c)=>this.produceWithPatches(l,f=>n(f,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},vE(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),vE(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),vE(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Pa(t)||Ea(8),fs(t)&&(t=ra(t));const n=hI(this),r=MC(n,t,void 0);return r[Wr].isManual_=!0,TC(n),r}finishDraft(t,n){const r=t&&t[Wr];(!r||!r.isManual_)&&Ea(9);const{scope_:i}=r;return dI(i,n),mI(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=cc(kC).applyPatches_;return fs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function MC(e,t,n,r){const[i,a]=R0(t)?cc(ex).proxyMap_(t,n):I0(t)?cc(ex).proxySet_(t,n):Hfe(t,n);return((n==null?void 0:n.scope_)??RU()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?Ffe(n,a,r):a.callbacks_.push(function(c){var h;(h=c.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:f}=c;a.modified_&&f&&f.generatePatches_(a,[],c)}),i}function ra(e){return fs(e)||Ea(10,e),BU(e)}function BU(e){if(!Pa(e)||L0(e))return e;const t=e[Wr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=OC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=OC(e,!0);return M0(n,(i,a)=>{Jy(n,i,BU(a))},r),t&&(t.finalized_=!1),n}var Kfe=new Vfe,FU=Kfe.produce;function UU(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Yfe=UU(),Xfe=UU,Gfe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Wy:Wy.apply(null,arguments)};function Ri(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Pi(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>TU(r)&&r.type===e,n}var HU=class mm extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,mm.prototype)}static get[Symbol.species](){return mm}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new mm(...t[0].concat(this)):new mm(...t.concat(this))}};function gI(e){return Pa(e)?FU(e,()=>{}):e}function zv(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Wfe(e){return typeof e=="boolean"}var Qfe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new HU;return n&&(Wfe(n)?o.push(Yfe):o.push(Xfe(n.extraArgument))),o},qU="RTK_autoBatch",nn=()=>e=>({payload:e,meta:{[qU]:!0}}),vI=e=>t=>{setTimeout(t,e)},VU=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:vI(10):e.type==="callback"?e.queueNotification:vI(e.timeout),f=()=>{o=!1,a&&(a=!1,l.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const d=()=>i&&h(),p=r.subscribe(d);return l.add(h),()=>{p(),l.delete(h)}},dispatch(h){var d;try{return i=!((d=h==null?void 0:h.meta)!=null&&d[qU]),a=!i,a&&(o||(o=!0,c(f))),r.dispatch(h)}finally{i=!0}}})},Zfe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new HU(e);return r&&i.push(VU(typeof r=="object"?r:void 0)),i};function Jfe(e){const t=Qfe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(wO(n))l=NU(n);else throw new Error(Pi(1));let c;typeof r=="function"?c=r(t):c=t();let f=Wy;i&&(f=Gfe({trace:!1,...typeof i=="object"&&i}));const h=Pfe(...c),d=Zfe(h);let p=typeof o=="function"?o(d):d();const v=f(...p);return kU(l,a,v)}function KU(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Pi(28));if(l in t)throw new Error(Pi(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function ede(e){return typeof e=="function"}function tde(e,t){let[n,r,i]=KU(t),a;if(ede(e))a=()=>gI(e());else{const l=gI(e);a=()=>l}function o(l=a(),c){let f=[n[c.type],...r.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return f.filter(h=>!!h).length===0&&(f=[i]),f.reduce((h,d)=>{if(d)if(fs(h)){const v=d(h,c);return v===void 0?h:v}else{if(Pa(h))return FU(h,p=>d(p,c));{const p=d(h,c);if(p===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return h},l)}return o.getInitialState=a,o}var nde="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",rde=(e=21)=>{let t="",n=e;for(;n--;)t+=nde[Math.random()*64|0];return t},ide=Symbol.for("rtk-slice-createasyncthunk");function ade(e,t){return`${e}/${t}`}function ode({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[ide];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Pi(11));const l=(typeof i.reducers=="function"?i.reducers(lde()):i.reducers)||{},c=Object.keys(l),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(O,N){const k=typeof O=="string"?O:O.type;if(!k)throw new Error(Pi(12));if(k in f.sliceCaseReducersByType)throw new Error(Pi(13));return f.sliceCaseReducersByType[k]=N,h},addMatcher(O,N){return f.sliceMatchers.push({matcher:O,reducer:N}),h},exposeAction(O,N){return f.actionCreators[O]=N,h},exposeCaseReducer(O,N){return f.sliceCaseReducersByName[O]=N,h}};c.forEach(O=>{const N=l[O],k={reducerName:O,type:ade(a,O),createNotation:typeof i.reducers=="function"};cde(N)?dde(k,N,h,t):ude(k,N,h)});function d(){const[O={},N=[],k=void 0]=typeof i.extraReducers=="function"?KU(i.extraReducers):[i.extraReducers],T={...O,...f.sliceCaseReducersByType};return tde(i.initialState,M=>{for(let I in T)M.addCase(I,T[I]);for(let I of f.sliceMatchers)M.addMatcher(I.matcher,I.reducer);for(let I of N)M.addMatcher(I.matcher,I.reducer);k&&M.addDefaultCase(k)})}const p=O=>O,v=new Map,b=new WeakMap;let w;function S(O,N){return w||(w=d()),w(O,N)}function E(){return w||(w=d()),w.getInitialState()}function j(O,N=!1){function k(M){let I=M[O];return typeof I>"u"&&N&&(I=zv(b,k,E)),I}function T(M=p){const I=zv(v,N,()=>new WeakMap);return zv(I,M,()=>{const L={};for(const[B,z]of Object.entries(i.selectors??{}))L[B]=sde(z,M,()=>zv(b,M,E),N);return L})}return{reducerPath:O,getSelectors:T,get selectors(){return T(k)},selectSlice:k}}const C={name:a,reducer:S,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:E,...j(o),injectInto(O,{reducerPath:N,...k}={}){const T=N??o;return O.inject({reducerPath:T,reducer:S},k),{...C,...j(T,!0)}}};return C}}function sde(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var $r=ode();function lde(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function ude({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!fde(r))throw new Error(Pi(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ri(e,o):Ri(e))}function cde(e){return e._reducerDefinitionType==="asyncThunk"}function fde(e){return e._reducerDefinitionType==="reducerWithPrepare"}function dde({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Pi(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:f,options:h}=n,d=i(e,a,h);r.exposeAction(t,d),o&&r.addCase(d.fulfilled,o),l&&r.addCase(d.pending,l),c&&r.addCase(d.rejected,c),f&&r.addMatcher(d.settled,f),r.exposeCaseReducer(t,{fulfilled:o||$v,pending:l||$v,rejected:c||$v,settled:f||$v})}function $v(){}var hde="task",YU="listener",XU="completed",CO="cancelled",mde=`task-${CO}`,pde=`task-${XU}`,DC=`${YU}-${CO}`,gde=`${YU}-${XU}`,$0=class{constructor(e){V1(this,"name","TaskAbortError");V1(this,"message");this.code=e,this.message=`${hde} ${CO} (reason: ${e})`}},jO=(e,t)=>{if(typeof e!="function")throw new TypeError(Pi(32))},rx=()=>{},GU=(e,t=rx)=>(e.catch(t),e),WU=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Xu=e=>{if(e.aborted)throw new $0(e.reason)};function QU(e,t){let n=rx;return new Promise((r,i)=>{const a=()=>i(new $0(e.reason));if(e.aborted){a();return}n=WU(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=rx})}var vde=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof $0?"cancelled":"rejected",error:n}}finally{t==null||t()}},ix=e=>t=>GU(QU(e,t).then(n=>(Xu(e),n))),ZU=e=>{const t=ix(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:$f}=Object,yI={},B0="listenerMiddleware",yde=(e,t)=>{const n=r=>WU(e,()=>r.abort(e.reason));return(r,i)=>{jO(r);const a=new AbortController;n(a);const o=vde(async()=>{Xu(e),Xu(a.signal);const l=await r({pause:ix(a.signal),delay:ZU(a.signal),signal:a.signal});return Xu(a.signal),l},()=>a.abort(pde));return i!=null&&i.autoJoin&&t.push(o.catch(rx)),{result:ix(e)(o),cancel(){a.abort(mde)}}}},xde=(e,t)=>{const n=async(r,i)=>{Xu(t);let a=()=>{};const l=[new Promise((c,f)=>{let h=e({predicate:r,effect:(d,p)=>{p.unsubscribe(),c([d,p.getState(),p.getOriginalState()])}});a=()=>{h(),f()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await QU(t,Promise.race(l));return Xu(t),c}finally{a()}};return(r,i)=>GU(n(r,i))},JU=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ri(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Pi(21));return jO(a),{predicate:i,type:t,effect:a}},eH=$f(e=>{const{type:t,predicate:n,effect:r}=JU(e);return{id:rde(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Pi(22))}}},{withTypes:()=>eH}),xI=(e,t)=>{const{type:n,effect:r,predicate:i}=JU(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},RC=e=>{e.pending.forEach(t=>{t.abort(DC)})},bde=(e,t)=>()=>{for(const n of t.keys())RC(n);e.clear()},bI=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},tH=$f(Ri(`${B0}/add`),{withTypes:()=>tH}),wde=Ri(`${B0}/removeAll`),nH=$f(Ri(`${B0}/remove`),{withTypes:()=>nH}),Sde=(...e)=>{console.error(`${B0}/error`,...e)},Np=(e={})=>{const t=new Map,n=new Map,r=v=>{const b=n.get(v)??0;n.set(v,b+1)},i=v=>{const b=n.get(v)??1;b===1?n.delete(v):n.set(v,b-1)},{extra:a,onError:o=Sde}=e;jO(o);const l=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),b=>{v.unsubscribe(),b!=null&&b.cancelActive&&RC(v)}),c=v=>{const b=xI(t,v)??eH(v);return l(b)};$f(c,{withTypes:()=>c});const f=v=>{const b=xI(t,v);return b&&(b.unsubscribe(),v.cancelActive&&RC(b)),!!b};$f(f,{withTypes:()=>f});const h=async(v,b,w,S)=>{const E=new AbortController,j=xde(c,E.signal),C=[];try{v.pending.add(E),r(v),await Promise.resolve(v.effect(b,$f({},w,{getOriginalState:S,condition:(O,N)=>j(O,N).then(Boolean),take:j,delay:ZU(E.signal),pause:ix(E.signal),extra:a,signal:E.signal,fork:yde(E.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((O,N,k)=>{O!==E&&(O.abort(DC),k.delete(O))})},cancel:()=>{E.abort(DC),v.pending.delete(E)},throwIfCancelled:()=>{Xu(E.signal)}})))}catch(O){O instanceof $0||bI(o,O,{raisedBy:"effect"})}finally{await Promise.all(C),E.abort(gde),i(v),v.pending.delete(E)}},d=bde(t,n);return{middleware:v=>b=>w=>{if(!TU(w))return b(w);if(tH.match(w))return c(w.payload);if(wde.match(w)){d();return}if(nH.match(w))return f(w.payload);let S=v.getState();const E=()=>{if(S===yI)throw new Error(Pi(23));return S};let j;try{if(j=b(w),t.size>0){const C=v.getState(),O=Array.from(t.values());for(const N of O){let k=!1;try{k=N.predicate(w,C,S)}catch(T){k=!1,bI(o,T,{raisedBy:"predicate"})}k&&h(N,w,v,E)}}}finally{S=yI}return j},startListening:c,stopListening:f,clearListeners:d}};function Pi(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ede={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},rH=$r({name:"chartLayout",initialState:Ede,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:_de,setLayout:Cde,setChartSize:jde,setScale:Ade}=rH.actions,Ode=rH.reducer;function iH(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function bt(e){return Number.isFinite(e)}function mo(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(n),!0).forEach(function(r){kde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kde(e,t,n){return(t=Nde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nde(e){var t=Tde(e,"string");return typeof t=="symbol"?t:t+""}function Tde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qt(e,t,n){return dn(e)||dn(t)?n:ho(t)?lc(e,t,n):typeof t=="function"?t(e):n}var Pde=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&Te(e[a]))return Nf(Nf({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Te(e[o]))return Nf(Nf({},e),{},{[o]:e[o]+(i||0)})}return e},ys=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",aH=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,o=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||o.push(t),a||o.push(n),o},oH=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:f,tickCount:h,ticks:d,niceTicks:p,axisType:v}=e;if(!o)return null;var b=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,w=i==="category"&&o.bandwidth?o.bandwidth()/b:0;if(w=v==="angleAxis"&&a&&a.length>=2?pr(a[0]-a[1])*2*w:w,d||p){var S=(d||p||[]).map((E,j)=>{var C=r?r.indexOf(E):E,O=o.map(C);return bt(O)?{coordinate:O+w,value:E,offset:w,index:j}:null}).filter(ci);return S}return c&&f?f.map((E,j)=>{var C=o.map(E);return bt(C)?{coordinate:C+w,value:E,index:j,offset:w}:null}).filter(ci):o.ticks&&h!=null?o.ticks(h).map((E,j)=>{var C=o.map(E);return bt(C)?{coordinate:C+w,value:E,index:j,offset:w}:null}).filter(ci):o.domain().map((E,j)=>{var C=o.map(E);return bt(C)?{coordinate:C+w,value:r?r[E]:E,index:j,offset:w}:null}).filter(ci)},Mde=(e,t)=>{if(!t||t.length!==2||!Te(t[0])||!Te(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Te(e[0])||e[0]<n)&&(i[0]=n),(!Te(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Dde=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,l=0;l<n;++l){var c=e[l],f=c==null?void 0:c[i];if(f!=null){var h=f[1],d=f[0],p=fo(h)?d:h;p>=0?(f[0]=a,a+=p,f[1]=a):(f[0]=o,o+=p,f[1]=o)}}}},Rde=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var l=e[o],c=l==null?void 0:l[i];if(c!=null){var f=fo(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Ide={sign:Dde,expand:ice,none:sc,silhouette:ace,wiggle:oce,positive:Rde},Lde=(e,t,n)=>{var r,i=(r=Ide[n])!==null&&r!==void 0?r:sc,a=rce().keys(t).value((l,c)=>Number(qt(l,c,0))).order(_C).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((f,h)=>{var d=qt(e[h],t[c],0);Array.isArray(d)&&d.length===2&&Te(d[0])&&Te(d[1])&&(f[0]=d[0],f[1]=d[1])})}),o};function zde(e){return e==null?void 0:String(e)}function SI(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!dn(i[t.dataKey])){var l=uU(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=qt(i,dn(o)?t.dataKey:o),f=t.scale.map(c);return Te(f)?f:null}var EI=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var l=qt(a,t.dataKey,t.scale.domain()[o]);if(dn(l))return null;var c=t.scale.map(l);return Te(c)?c-i/2+r:null},$de=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Bde=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},Fde=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Ude=(e,t,n)=>{if(e!=null)return Fde(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,f)=>{var h=iH(f,t,n),d=Bde(h);return!bt(d[0])||!bt(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},_I=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,CI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cd=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=T0(t,h=>h.coordinate),a=1/0,o=1,l=i.length;o<l;o++){var c=i[o],f=i[o-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((f==null?void 0:f.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function jI(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Nf(Nf({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Id(e,t){if(e)return String(e);if(typeof t=="string")return t}var Hde=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},qde=(e,t)=>t==="centric"?e.angle:e.radius,xs=e=>e.layout.width,bs=e=>e.layout.height,Vde=e=>e.layout.scale,sH=e=>e.layout.margin,F0=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),U0=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),lH="data-recharts-item-index",uH="data-recharts-item-id",Tp=60;function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){Kde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kde(e,t,n){return(t=Yde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yde(e){var t=Xde(e,"string");return typeof t=="symbol"?t:t+""}function Xde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gde=e=>e.brush.height;function Wde(e){var t=U0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Tp;return n+i}return n},0)}function Qde(e){var t=U0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Tp;return n+i}return n},0)}function Zde(e){var t=F0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Jde(e){var t=F0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var or=le([xs,bs,sH,Gde,Wde,Qde,Zde,Jde,AU,Cfe],(e,t,n,r,i,a,o,l,c,f)=>{var h={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+o,bottom:(n.bottom||0)+l},p=Bv(Bv({},d),h),v=p.bottom;p.bottom+=r,p=Pde(p,c,f);var b=e-p.left-p.right,w=t-p.top-p.bottom;return Bv(Bv({brushBottom:v},p),{},{width:Math.max(b,0),height:Math.max(w,0)})}),ehe=le(or,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),AO=le(xs,bs,(e,t)=>({x:0,y:0,width:e,height:t})),the=x.createContext(null),Br=()=>x.useContext(the)!=null,H0=e=>e.brush,q0=le([H0,or,sH],(e,t,n)=>({height:e.height,x:Te(e.x)?e.x:t.left,y:Te(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Te(e.width)?e.width:t.width})),xE={},bE={},wE={},OI;function nhe(){return OI||(OI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const c=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),h=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},d=()=>{f&&h(),w()};let p=null;const v=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,d()},r)},b=()=>{p!==null&&(clearTimeout(p),p=null)},w=()=>{b(),o=void 0,l=null},S=()=>{h()},E=function(...j){if(i!=null&&i.aborted)return;o=this,l=j;const C=p==null;v(),c&&C&&h()};return E.schedule=v,E.cancel=w,E.flush=S,i==null||i.addEventListener("abort",w,{once:!0}),E}e.debounce=t})(wE)),wE}var kI;function rhe(){return kI||(kI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nhe();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,f=Array(2);o&&(f[0]="leading"),l&&(f[1]="trailing");let h,d=null;const p=t.debounce(function(...w){h=r.apply(this,w),d=null},i,{edges:f}),v=function(...w){return c!=null&&(d===null&&(d=Date.now()),Date.now()-d>=c)?(h=r.apply(this,w),d=Date.now(),p.cancel(),p.schedule(),h):(p.apply(this,w),h)},b=()=>(p.flush(),h);return v.cancel=p.cancel,v.flush=b,v}e.debounce=n})(bE)),bE}var NI;function ihe(){return NI||(NI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rhe();function n(r,i=0,a={}){const{leading:o=!0,trailing:l=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(xE)),xE}var SE,TI;function ahe(){return TI||(TI=1,SE=ihe().throttle),SE}var ohe=ahe();const she=zi(ohe);var ax=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},to={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},cH=(e,t,n)=>{var{width:r=to.width,height:i=to.height,aspect:a,maxHeight:o}=n,l=uc(r)?e:Number(r),c=uc(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},lhe={width:0,height:0,overflow:"visible"},uhe={width:0,overflowX:"visible"},che={height:0,overflowY:"visible"},fhe={},dhe=e=>{var{width:t,height:n}=e,r=uc(t),i=uc(n);return r&&i?lhe:r?uhe:i?che:fhe};function hhe(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=to.width,a=to.height):i===void 0?i=r&&r>0?void 0:to.width:a===void 0&&(a=r&&r>0?void 0:to.height),{width:i,height:a}}function IC(){return IC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IC.apply(null,arguments)}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){mhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mhe(e,t,n){return(t=phe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function phe(e){var t=ghe(e,"string");return typeof t=="symbol"?t:t+""}function ghe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fH=x.createContext(to.initialDimension);function vhe(e){return mo(e.width)&&mo(e.height)}function dH(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return vhe(i)?x.createElement(fH.Provider,{value:i},t):null}var OO=()=>x.useContext(fH),yhe=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=to.initialDimension,width:i,height:a,minWidth:o=to.minWidth,minHeight:l,maxHeight:c,children:f,debounce:h=to.debounce,id:d,className:p,onResize:v,style:b={}}=e,w=x.useRef(null),S=x.useRef();S.current=v,x.useImperativeHandle(t,()=>w.current);var[E,j]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((M,I)=>{j(L=>{var B=Math.round(M),z=Math.round(I);return L.containerWidth===B&&L.containerHeight===z?L:{containerWidth:B,containerHeight:z}})},[]);x.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Ql;var M=z=>{var G,F=z[0];if(F!=null){var{width:V,height:D}=F.contentRect;C(V,D),(G=S.current)===null||G===void 0||G.call(S,V,D)}};h>0&&(M=she(M,h,{trailing:!0,leading:!1}));var I=new ResizeObserver(M),{width:L,height:B}=w.current.getBoundingClientRect();return C(L,B),I.observe(w.current),()=>{I.disconnect()}},[C,h]);var{containerWidth:O,containerHeight:N}=E;ax(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:k,calculatedHeight:T}=cH(O,N,{width:i,height:a,aspect:n,maxHeight:c});return ax(k!=null&&k>0||T!=null&&T>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,k,T,i,a,o,l,n),x.createElement("div",{id:d?"".concat(d):void 0,className:Et("recharts-responsive-container",p),style:MI(MI({},b),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:w},x.createElement("div",{style:dhe({width:i,height:a})},x.createElement(dH,{width:k,height:T},f)))}),kO=x.forwardRef((e,t)=>{var n=OO();if(mo(n.width)&&mo(n.height))return e.children;var{width:r,height:i}=hhe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=cH(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(o)?x.createElement(dH,{width:a,height:o},e.children):x.createElement(yhe,IC({},e,{width:r,height:i,ref:t}))});function NO(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var V0=()=>{var e,t=Br(),n=De(ehe),r=De(q0),i=(e=De(H0))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},xhe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},hH=()=>{var e;return(e=De(or))!==null&&e!==void 0?e:xhe},TO=()=>De(xs),PO=()=>De(bs),bhe=()=>De(e=>e.layout.margin),Nt=e=>e.layout.layoutType,_c=()=>De(Nt),mH=()=>{var e=_c();if(e==="horizontal"||e==="vertical")return e},pH=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},whe=()=>{var e=_c();return e!==void 0},Pp=e=>{var t=Vt(),n=Br(),{width:r,height:i}=e,a=OO(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),x.useEffect(()=>{!n&&mo(o)&&mo(l)&&t(jde({width:o,height:l}))},[t,n,o,l]),null},gH=Symbol.for("immer-nothing"),DI=Symbol.for("immer-draftable"),Ii=Symbol.for("immer-state");function _a(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Bm=Object.getPrototypeOf;function fd(e){return!!e&&!!e[Ii]}function fc(e){var t;return e?vH(e)||Array.isArray(e)||!!e[DI]||!!((t=e.constructor)!=null&&t[DI])||Mp(e)||Y0(e):!1}var She=Object.prototype.constructor.toString(),RI=new WeakMap;function vH(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=RI.get(n);return r===void 0&&(r=Function.toString.call(n),RI.set(n,r)),r===She}function ox(e,t,n=!0){K0(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function K0(e){const t=e[Ii];return t?t.type_:Array.isArray(e)?1:Mp(e)?2:Y0(e)?3:0}function LC(e,t){return K0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yH(e,t,n){const r=K0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Ehe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Mp(e){return e instanceof Map}function Y0(e){return e instanceof Set}function Nu(e){return e.copy_||e.base_}function zC(e,t){if(Mp(e))return new Map(e);if(Y0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=vH(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ii];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],l=r[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Bm(e),r)}else{const r=Bm(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function MO(e,t=!1){return X0(e)||fd(e)||!fc(e)||(K0(e)>1&&Object.defineProperties(e,{set:Fv,add:Fv,clear:Fv,delete:Fv}),Object.freeze(e),t&&Object.values(e).forEach(n=>MO(n,!0))),e}function _he(){_a(2)}var Fv={value:_he};function X0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Che={};function dc(e){const t=Che[e];return t||_a(0,e),t}var Fm;function xH(){return Fm}function jhe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function II(e,t){t&&(dc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function $C(e){BC(e),e.drafts_.forEach(Ahe),e.drafts_=null}function BC(e){e===Fm&&(Fm=e.parent_)}function LI(e){return Fm=jhe(Fm,e)}function Ahe(e){const t=e[Ii];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ii].modified_&&($C(t),_a(4)),fc(e)&&(e=sx(t,e),t.parent_||lx(t,e)),t.patches_&&dc("Patches").generateReplacementPatches_(n[Ii].base_,e,t.patches_,t.inversePatches_)):e=sx(t,n,[]),$C(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gH?e:void 0}function sx(e,t,n){if(X0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Ii];if(!i)return ox(t,(a,o)=>$I(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return lx(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,l=!1;i.type_===3&&(o=new Set(a),a.clear(),l=!0),ox(o,(c,f)=>$I(e,i,a,c,f,n,l),r),lx(e,a,!1),n&&e.patches_&&dc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function $I(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=X0(i);if(!(l&&!o)){if(fd(i)){const c=a&&t&&t.type_!==3&&!LC(t.assigned_,r)?a.concat(r):void 0,f=sx(e,i,c);if(yH(n,r,f),fd(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(fc(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;sx(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Mp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&lx(e,i)}}}function lx(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&MO(t,n)}function Ohe(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:xH(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=DO;n&&(i=[r],a=Um);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var DO={get(e,t){if(t===Ii)return e;const n=Nu(e);if(!LC(n,t))return khe(e,n,t);const r=n[t];return e.finalized_||!fc(r)?r:r===EE(e.base_,t)?(_E(e),e.copy_[t]=UC(r,e)):r},has(e,t){return t in Nu(e)},ownKeys(e){return Reflect.ownKeys(Nu(e))},set(e,t,n){const r=bH(Nu(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=EE(Nu(e),t),a=i==null?void 0:i[Ii];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Ehe(n,i)&&(n!==void 0||LC(e.base_,t)))return!0;_E(e),FC(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return EE(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,_E(e),FC(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Nu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){_a(11)},getPrototypeOf(e){return Bm(e.base_)},setPrototypeOf(){_a(12)}},Um={};ox(DO,(e,t)=>{Um[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Um.deleteProperty=function(e,t){return Um.set.call(this,e,t,void 0)};Um.set=function(e,t,n){return DO.set.call(this,e[0],t,n,e[0])};function EE(e,t){const n=e[Ii];return(n?Nu(n):e)[t]}function khe(e,t,n){var i;const r=bH(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function bH(e,t){if(!(t in e))return;let n=Bm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Bm(n)}}function FC(e){e.modified_||(e.modified_=!0,e.parent_&&FC(e.parent_))}function _E(e){e.copy_||(e.copy_=zC(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Nhe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(c=a,...f){return o.produce(c,h=>n.call(this,h,...f))}}typeof n!="function"&&_a(6),r!==void 0&&typeof r!="function"&&_a(7);let i;if(fc(t)){const a=LI(this),o=UC(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?$C(a):BC(a)}return II(a,r),zI(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gH&&(i=void 0),this.autoFreeze_&&MO(i,!0),r){const a=[],o=[];dc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else _a(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){fc(e)||_a(8),fd(e)&&(e=The(e));const t=LI(this),n=UC(e,void 0);return n[Ii].isManual_=!0,BC(t),n}finishDraft(e,t){const n=e&&e[Ii];(!n||!n.isManual_)&&_a(9);const{scope_:r}=n;return II(r,t),zI(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=dc("Patches").applyPatches_;return fd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function UC(e,t){const n=Mp(e)?dc("MapSet").proxyMap_(e,t):Y0(e)?dc("MapSet").proxySet_(e,t):Ohe(e,t);return(t?t.scope_:xH()).drafts_.push(n),n}function The(e){return fd(e)||_a(10,e),wH(e)}function wH(e){if(!fc(e)||X0(e))return e;const t=e[Ii];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=zC(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=zC(e,!0);return ox(n,(i,a)=>{yH(n,i,wH(a))},r),t&&(t.finalized_=!1),n}var Phe=new Nhe;Phe.produce;var Mhe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},SH=$r({name:"legend",initialState:Mhe,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:nn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ra(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:nn()},removeLegendPayload:{reducer(e,t){var n=ra(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:nn()}}}),{setLegendSize:BI,setLegendSettings:Dhe,addLegendPayload:EH,replaceLegendPayload:_H,removeLegendPayload:CH}=SH.actions,Rhe=SH.reducer,CE={exports:{}},jE={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var FI;function Ihe(){if(FI)return jE;FI=1;var e=jd();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,l=e.useDebugValue;return jE.useSyncExternalStoreWithSelector=function(c,f,h,d,p){var v=i(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=o(function(){function S(N){if(!E){if(E=!0,j=N,N=d(N),p!==void 0&&b.hasValue){var k=b.value;if(p(k,N))return C=k}return C=N}if(k=C,n(j,N))return k;var T=d(N);return p!==void 0&&p(k,T)?(j=N,k):(j=N,C=T)}var E=!1,j,C,O=h===void 0?null:h;return[function(){return S(f())},O===null?void 0:function(){return S(O())}]},[f,h,d,p]);var w=r(c,v[0],v[1]);return a(function(){b.hasValue=!0,b.value=w},[w]),l(w),w},jE}var UI;function Lhe(){return UI||(UI=1,CE.exports=Ihe()),CE.exports}Lhe();function zhe(e){e()}function $he(){let e=null,t=null;return{clear(){e=null,t=null},notify(){zhe(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var HI={notify(){},get:()=>[]};function Bhe(e,t){let n,r=HI,i=0,a=!1;function o(w){h();const S=r.subscribe(w);let E=!1;return()=>{E||(E=!0,S(),d())}}function l(){r.notify()}function c(){b.onStateChange&&b.onStateChange()}function f(){return a}function h(){i++,n||(n=e.subscribe(c),r=$he())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=HI)}function p(){a||(a=!0,h())}function v(){a&&(a=!1,d())}const b={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:f,trySubscribe:p,tryUnsubscribe:v,getListeners:()=>r};return b}var Fhe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Uhe=Fhe(),Hhe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",qhe=Hhe(),Vhe=()=>Uhe||qhe?x.useLayoutEffect:x.useEffect,Khe=Vhe();function qI(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Yhe(e,t){if(qI(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!qI(e[n[i]],t[n[i]]))return!1;return!0}var AE=Symbol.for("react-redux-context"),OE=typeof globalThis<"u"?globalThis:{};function Xhe(){if(!x.createContext)return{};const e=OE[AE]??(OE[AE]=new Map);let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var Ghe=Xhe();function Whe(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const c=Bhe(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);Khe(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=n||Ghe;return x.createElement(l.Provider,{value:a},t)}var Qhe=Whe,Zhe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Jhe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ld(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Zhe.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Yhe(e[r],t[r]))return!1}else if(!Jhe(e[r],t[r]))return!1;return!0}var eme=["contextPayload"];function HC(){return HC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HC.apply(null,arguments)}function VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){tme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tme(e,t,n){return(t=nme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nme(e){var t=rme(e,"string");return typeof t=="symbol"?t:t+""}function rme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ime(e,t){if(e==null)return{};var n,r,i=ame(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ame(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ome(e){return e.value}function sme(e){var{contextPayload:t}=e,n=ime(e,eme),r=SU(t,e.payloadUniqBy,ome),i=dd(dd({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Rce,i)}function lme(e,t,n,r,i,a){var{layout:o,align:l,verticalAlign:c}=t,f,h;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?h={top:((i||0)-a.height)/2}:h=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),dd(dd({},f),h)}function ume(e){var t=Vt();return x.useEffect(()=>{t(Dhe(e))},[t,e]),null}function cme(e){var t=Vt();return x.useEffect(()=>(t(BI(e)),()=>{t(BI({width:0,height:0}))}),[t,e]),null}function fme(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var dme={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function hme(e){var t=Xn(e,dme),n=Ofe(),r=Aue(),i=bhe(),{width:a,height:o,wrapperStyle:l,portal:c}=t,[f,h]=OU([n]),d=TO(),p=PO();if(d==null||p==null)return null;var v=d-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),b=fme(t.layout,o,a,v),w=c?l:dd(dd({position:"absolute",width:(b==null?void 0:b.width)||a||"auto",height:(b==null?void 0:b.height)||o||"auto"},lme(l,t,i,d,p,f)),l),S=c??r;if(S==null||n==null)return null;var E=x.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:h},x.createElement(ume,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&x.createElement(cme,{width:f.width,height:f.height}),x.createElement(sme,HC({},t,b,{margin:i,chartWidth:d,chartHeight:p,contextPayload:n})));return Ul.createPortal(E,S)}var jH=x.memo(hme,Ld);jH.displayName="Legend";function qC(){return qC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qC.apply(null,arguments)}function KI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){mme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=gme(e,"string");return typeof t=="symbol"?t:t+""}function gme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vme(e){return Array.isArray(e)&&ho(e[0])&&ho(e[1])?e.join(" ~ "):e}var pf={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function yme(e,t){return t==null?e:T0(e,t)}var xme=e=>{var{separator:t=pf.separator,contentStyle:n,itemStyle:r,labelStyle:i=pf.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:f,label:h,labelFormatter:d,accessibilityLayer:p=pf.accessibilityLayer}=e,v=()=>{if(a&&a.length){var N={padding:0,margin:0},k=yme(a,l),T=k.map((M,I)=>{if(M.type==="none")return null;var L=M.formatter||o||vme,{value:B,name:z}=M,G=B,F=z;if(L){var V=L(B,z,M,I,a);if(Array.isArray(V))[G,F]=V;else if(V!=null)G=V;else return null}var D=Yh(Yh({},pf.itemStyle),{},{color:M.color||pf.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:D},ho(F)?x.createElement("span",{className:"recharts-tooltip-item-name"},F):null,ho(F)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},G),x.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:N},T)}return null},b=Yh(Yh({},pf.contentStyle),n),w=Yh({margin:0},i),S=!dn(h),E=S?h:"",j=Et("recharts-default-tooltip",c),C=Et("recharts-tooltip-label",f);S&&d&&a!==void 0&&a!==null&&(E=d(h,a));var O=p?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",qC({className:j,style:b},O),x.createElement("p",{className:C,style:w},x.isValidElement(E)?E:"".concat(E)),v())},Xh="recharts-tooltip-wrapper",bme={visibility:"hidden"};function wme(e){var{coordinate:t,translateX:n,translateY:r}=e;return Et(Xh,{["".concat(Xh,"-right")]:Te(n)&&t&&Te(t.x)&&n>=t.x,["".concat(Xh,"-left")]:Te(n)&&t&&Te(t.x)&&n<t.x,["".concat(Xh,"-bottom")]:Te(r)&&t&&Te(t.y)&&r>=t.y,["".concat(Xh,"-top")]:Te(r)&&t&&Te(t.y)&&r<t.y})}function YI(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:f}=e;if(a&&Te(a[r]))return a[r];var h=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return o[r]?h:d;var p=c[r];if(p==null)return 0;if(o[r]){var v=h,b=p;return v<b?Math.max(d,p):Math.max(h,p)}if(f==null)return 0;var w=d+l,S=p+f;return w>S?Math.max(h,p):Math.max(d,p)}function Sme(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Eme(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:f}=e,h,d,p;return l.height>0&&l.width>0&&n?(d=YI({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),p=YI({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),h=Sme({translateX:d,translateY:p,useTranslate3d:c})):h=bme,{cssProperties:h,cssClasses:wme({translateX:d,translateY:p,coordinate:n})}}var _me=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Dp={isSsr:_me()};function AH(){var[e,t]=x.useState(()=>Dp.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function XI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XI(Object(n),!0).forEach(function(r){Cme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cme(e,t,n){return(t=jme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jme(e){var t=Ame(e,"string");return typeof t=="symbol"?t:t+""}function Ame(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ome(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function kme(e){var t,n,r,i,a,o,l=AH(),[c,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var b=w=>{if(w.key==="Escape"){var S,E,j,C;f({dismissed:!0,dismissedAtCoordinate:{x:(S=(E=e.coordinate)===null||E===void 0?void 0:E.x)!==null&&S!==void 0?S:0,y:(j=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&j!==void 0?j:0}})}};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&f(gf(gf({},c),{},{dismissed:!1}));var{cssClasses:h,cssProperties:d}=Eme({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),p=e.hasPortalFromProps?{}:gf(gf({transition:Ome({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=gf(gf({},p),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:h,style:v,ref:e.innerRef},e.children)}var Nme=x.memo(kme),OH=()=>{var e;return(e=De(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function VC(){return VC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VC.apply(null,arguments)}function GI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GI(Object(n),!0).forEach(function(r){Tme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tme(e,t,n){return(t=Pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pme(e){var t=Mme(e,"string");return typeof t=="symbol"?t:t+""}function Mme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QI={curveBasisClosed:Kue,curveBasisOpen:Yue,curveBasis:Vue,curveBumpX:Tue,curveBumpY:Pue,curveLinearClosed:Xue,curveLinear:k0,curveMonotoneX:Gue,curveMonotoneY:Wue,curveNatural:Que,curveStep:Zue,curveStepAfter:ece,curveStepBefore:Jue},ux=e=>bt(e.x)&&bt(e.y),ZI=e=>e.base!=null&&ux(e.base)&&ux(e),Gh=e=>e.x,Wh=e=>e.y,Dme=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Ap(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=QI["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return QI[n]||k0},JI={connectNulls:!1,type:"linear"},Rme=e=>{var{type:t=JI.type,points:n=[],baseLine:r,layout:i,connectNulls:a=JI.connectNulls}=e,o=Dme(t,i),l=a?n.filter(ux):n;if(Array.isArray(r)){var c,f=n.map((b,w)=>WI(WI({},b),{},{base:r[w]}));i==="vertical"?c=Dv().y(Wh).x1(Gh).x0(b=>b.base.x):c=Dv().x(Gh).y1(Wh).y0(b=>b.base.y);var h=c.defined(ZI).curve(o),d=a?f.filter(ZI):f;return h(d)}var p;i==="vertical"&&Te(r)?p=Dv().y(Wh).x1(Gh).x0(r):Te(r)?p=Dv().x(Gh).y1(Wh).y0(r):p=WF().x(Gh).y(Wh);var v=p.defined(ux).curve(o);return v(l)},RO=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=_c();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?Rme(o):r;return x.createElement("path",VC({},Di(e),yO(e),{className:Et("recharts-curve",t),d:l===null?void 0:l,ref:i}))},Ime=["x","y","top","left","width","height","className"];function KC(){return KC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KC.apply(null,arguments)}function eL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lme(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eL(Object(n),!0).forEach(function(r){zme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zme(e,t,n){return(t=$me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $me(e){var t=Bme(e,"string");return typeof t=="symbol"?t:t+""}function Bme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fme(e,t){if(e==null)return{};var n,r,i=Ume(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ume(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Hme=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),qme=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=Fme(e,Ime),f=Lme({x:t,y:n,top:r,left:i,width:a,height:o},c);return!Te(t)||!Te(n)||!Te(a)||!Te(o)||!Te(r)||!Te(i)?null:x.createElement("path",KC({},Gr(f),{className:Et("recharts-cross",l),d:Hme(t,n,a,o,r,i)}))};function Vme(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function tL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tL(Object(n),!0).forEach(function(r){Kme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kme(e,t,n){return(t=Yme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yme(e){var t=Xme(e,"string");return typeof t=="symbol"?t:t+""}function Xme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gme=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),kH=(e,t,n)=>e.map(r=>"".concat(Gme(r)," ").concat(t,"ms ").concat(n)).join(","),Wme=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Hm=(e,t)=>Object.keys(t).reduce((n,r)=>nL(nL({},n),{},{[r]:e(r,t[r])}),{});function rL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rL(Object(n),!0).forEach(function(r){Qme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qme(e,t,n){return(t=Zme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zme(e){var t=Jme(e,"string");return typeof t=="symbol"?t:t+""}function Jme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cx=(e,t,n)=>e+(t-e)*n,YC=e=>{var{from:t,to:n}=e;return t!==n},NH=(e,t,n)=>{var r=Hm((i,a)=>{if(YC(a)){var[o,l]=e(a.from,a.to,a.velocity);return nr(nr({},a),{},{from:o,velocity:l})}return a},t);return n<1?Hm((i,a)=>YC(a)&&r[i]!=null?nr(nr({},a),{},{velocity:cx(a.velocity,r[i].velocity,n),from:cx(a.from,r[i].from,n)}):a,t):NH(e,r,n-1)};function epe(e,t,n,r,i,a){var o,l=r.reduce((p,v)=>nr(nr({},p),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),c=()=>Hm((p,v)=>v.from,l),f=()=>!Object.values(l).filter(YC).length,h=null,d=p=>{o||(o=p);var v=p-o,b=v/n.dt;l=NH(n,l,b),i(nr(nr(nr({},e),t),c())),o=p,f()||(h=a.setTimeout(d))};return()=>(h=a.setTimeout(d),()=>{var p;(p=h)===null||p===void 0||p()})}function tpe(e,t,n,r,i,a,o){var l=null,c=i.reduce((d,p)=>{var v=e[p],b=t[p];return v==null||b==null?d:nr(nr({},d),{},{[p]:[v,b]})},{}),f,h=d=>{f||(f=d);var p=(d-f)/r,v=Hm((w,S)=>cx(...S,n(p)),c);if(a(nr(nr(nr({},e),t),v)),p<1)l=o.setTimeout(h);else{var b=Hm((w,S)=>cx(...S,n(1)),c);a(nr(nr(nr({},e),t),b))}};return()=>(l=o.setTimeout(h),()=>{var d;(d=l)===null||d===void 0||d()})}const npe=(e,t,n,r,i,a)=>{var o=Wme(e,t);return n==null?()=>(i(nr(nr({},e),t)),()=>{}):n.isStepper===!0?epe(e,t,n,o,i,a):tpe(e,t,n,r,o,i,a)};var fx=1e-4,TH=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],PH=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),iL=(e,t)=>n=>{var r=TH(e,t);return PH(r,n)},rpe=(e,t)=>n=>{var r=TH(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return PH(i,n)},ipe=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},ape=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=ipe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},ope=(e,t,n,r)=>{var i=iL(e,n),a=iL(t,r),o=rpe(e,n),l=f=>f>1?1:f<0?0:f,c=f=>{for(var h=f>1?1:f,d=h,p=0;p<8;++p){var v=i(d)-h,b=o(d);if(Math.abs(v-h)<fx||b<fx)return a(d);d=l(d-v/b)}return a(d)};return c.isStepper=!1,c},aL=function(){return ope(...ape(...arguments))},spe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,l,c)=>{var f=-(o-l)*n,h=c*r,d=c+(f-h)*i/1e3,p=c*i/1e3+o;return Math.abs(p-l)<fx&&Math.abs(d)<fx?[l,0]:[p,d]};return a.isStepper=!0,a.dt=i,a},lpe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return aL(e);case"spring":return spe();default:if(e.split("(")[0]==="cubic-bezier")return aL(e)}return typeof e=="function"?e:null};function upe(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...f]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,f),c);return}a(c),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class cpe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function fpe(){return upe(new cpe)}var dpe=x.createContext(fpe);function hpe(e,t){var n=x.useContext(dpe);return x.useMemo(()=>t??n(e),[e,t,n])}var mpe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},oL={t:0},kE={t:1};function Rp(e){var t=Xn(e,mpe),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:f}=t,h=AH(),d=n==="auto"?!Dp.isSsr&&!h:n,p=hpe(t.animationId,t.animationManager),[v,b]=x.useState(d?oL:kE),w=x.useRef(null);return x.useEffect(()=>{d||b(kE)},[d]),x.useEffect(()=>{if(!d||!r)return Ql;var S=npe(oL,kE,lpe(a),i,b,p.getTimeoutController()),E=()=>{w.current=S()};return p.start([c,o,E,i,l]),()=>{p.stop(),w.current&&w.current(),l()}},[d,r,i,a,o,c,l,p]),f(v.t)}function Ip(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Im(t)),r=x.useRef(e);return r.current!==e&&(n.current=Im(t),r.current=e),n.current}var ppe=["radius"],gpe=["radius"],sL,lL,uL,cL,fL,dL,hL,mL,pL,gL;function vL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vpe(e,t,n){return(t=ype(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ype(e){var t=xpe(e,"string");return typeof t=="symbol"?t:t+""}function xpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dx(){return dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dx.apply(null,arguments)}function xL(e,t){if(e==null)return{};var n,r,i=bpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Va(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bL=(e,t,n,r,i)=>{var a=Al(n),o=Al(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,f=a>=0?1:-1,h=o>=0&&a>=0||o<0&&a<0?1:0,d;if(l>0&&Array.isArray(i)){for(var p=[0,0,0,0],v=0,b=4;v<b;v++){var w,S=(w=i[v])!==null&&w!==void 0?w:0;p[v]=S>l?l:S}d=jn(sL||(sL=Va(["M",",",""])),e,t+c*p[0]),p[0]>0&&(d+=jn(lL||(lL=Va(["A ",",",",0,0,",",",",",""])),p[0],p[0],h,e+f*p[0],t)),d+=jn(uL||(uL=Va(["L ",",",""])),e+n-f*p[1],t),p[1]>0&&(d+=jn(cL||(cL=Va(["A ",",",",0,0,",`,
        `,",",""])),p[1],p[1],h,e+n,t+c*p[1])),d+=jn(fL||(fL=Va(["L ",",",""])),e+n,t+r-c*p[2]),p[2]>0&&(d+=jn(dL||(dL=Va(["A ",",",",0,0,",`,
        `,",",""])),p[2],p[2],h,e+n-f*p[2],t+r)),d+=jn(hL||(hL=Va(["L ",",",""])),e+f*p[3],t+r),p[3]>0&&(d+=jn(mL||(mL=Va(["A ",",",",0,0,",`,
        `,",",""])),p[3],p[3],h,e,t+r-c*p[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var E=Math.min(l,i);d=jn(pL||(pL=Va(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+c*E,E,E,h,e+f*E,t,e+n-f*E,t,E,E,h,e+n,t+c*E,e+n,t+r-c*E,E,E,h,e+n-f*E,t+r,e+f*E,t+r,E,E,h,e,t+r-c*E)}else d=jn(gL||(gL=Va(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},wL={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},MH=e=>{var t=Xn(e,wL),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var q=n.current.getTotalLength();q&&i(q)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:f,className:h}=t,{animationEasing:d,animationDuration:p,animationBegin:v,isAnimationActive:b,isUpdateAnimationActive:w}=t,S=x.useRef(l),E=x.useRef(c),j=x.useRef(a),C=x.useRef(o),O=x.useMemo(()=>({x:a,y:o,width:l,height:c,radius:f}),[a,o,l,c,f]),N=Ip(O,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var k=Et("recharts-rectangle",h);if(!w){var T=Gr(t),{radius:M}=T,I=xL(T,ppe);return x.createElement("path",dx({},I,{x:Al(a),y:Al(o),width:Al(l),height:Al(c),radius:typeof f=="number"?f:void 0,className:k,d:bL(a,o,l,c,f)}))}var L=S.current,B=E.current,z=j.current,G=C.current,F="0px ".concat(r===-1?1:r,"px"),V="".concat(r,"px ").concat(r,"px"),D=kH(["strokeDasharray"],p,typeof d=="string"?d:wL.animationEasing);return x.createElement(Rp,{animationId:N,key:N,canBegin:r>0,duration:p,easing:d,isActive:w,begin:v},q=>{var X=ln(L,l,q),Y=ln(B,c,q),R=ln(z,a,q),H=ln(G,o,q);n.current&&(S.current=X,E.current=Y,j.current=R,C.current=H);var U;b?q>0?U={transition:D,strokeDasharray:V}:U={strokeDasharray:F}:U={strokeDasharray:V};var $=Gr(t),{radius:Q}=$,J=xL($,gpe);return x.createElement("path",dx({},J,{radius:typeof f=="number"?f:void 0,className:k,d:bL(R,H,X,Y,f),ref:n,style:yL(yL({},U),t.style)}))})};function SL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SL(Object(n),!0).forEach(function(r){wpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wpe(e,t,n){return(t=Spe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Spe(e){var t=Epe(e,"string");return typeof t=="symbol"?t:t+""}function Epe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hx=Math.PI/180,_pe=e=>e*180/Math.PI,qn=(e,t,n,r)=>({x:e+Math.cos(-hx*r)*n,y:t+Math.sin(-hx*r)*n}),DH=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Cpe=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},jpe=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=Cpe({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:_pe(c),angleInRadian:c}},Ape=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Ope=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},kpe=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=jpe({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:f}=Ape(t),h=a,d;if(c<=f){for(;h>f;)h-=360;for(;h<c;)h+=360;d=h>=c&&h<=f}else{for(;h>c;)h-=360;for(;h<f;)h+=360;d=h>=f&&h<=c}return d?EL(EL({},t),{},{radius:i,angle:Ope(h,t)}):null};function RH(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=qn(t,n,r,i),l=qn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var _L,CL,jL,AL,OL,kL,NL;function XC(){return XC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},XC.apply(null,arguments)}function Du(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Npe=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Uv=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,f=l*(o?1:-1)+r,h=Math.asin(l/f)/hx,d=c?i:i+a*h,p=qn(t,n,f,d),v=qn(t,n,r,d),b=c?i-a*h:i,w=qn(t,n,f*Math.cos(h*hx),b);return{center:p,circleTangency:v,lineTangency:w,theta:h}},IH=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=Npe(a,o),c=a+l,f=qn(t,n,i,a),h=qn(t,n,i,c),d=jn(_L||(_L=Du(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),f.x,f.y,i,i,+(Math.abs(l)>180),+(a>c),h.x,h.y);if(r>0){var p=qn(t,n,r,a),v=qn(t,n,r,c);d+=jn(CL||(CL=Du(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),v.x,v.y,r,r,+(Math.abs(l)>180),+(a<=c),p.x,p.y)}else d+=jn(jL||(jL=Du(["L ",","," Z"])),t,n);return d},Tpe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:f}=e,h=pr(f-c),{circleTangency:d,lineTangency:p,theta:v}=Uv({cx:t,cy:n,radius:i,angle:c,sign:h,cornerRadius:a,cornerIsExternal:l}),{circleTangency:b,lineTangency:w,theta:S}=Uv({cx:t,cy:n,radius:i,angle:f,sign:-h,cornerRadius:a,cornerIsExternal:l}),E=l?Math.abs(c-f):Math.abs(c-f)-v-S;if(E<0)return o?jn(AL||(AL=Du(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),p.x,p.y,a,a,a*2,a,a,-a*2):IH({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var j=jn(OL||(OL=Du(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),p.x,p.y,a,a,+(h<0),d.x,d.y,i,i,+(E>180),+(h<0),b.x,b.y,a,a,+(h<0),w.x,w.y);if(r>0){var{circleTangency:C,lineTangency:O,theta:N}=Uv({cx:t,cy:n,radius:r,angle:c,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:k,lineTangency:T,theta:M}=Uv({cx:t,cy:n,radius:r,angle:f,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),I=l?Math.abs(c-f):Math.abs(c-f)-N-M;if(I<0&&a===0)return"".concat(j,"L").concat(t,",").concat(n,"Z");j+=jn(kL||(kL=Du(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),T.x,T.y,a,a,+(h<0),k.x,k.y,r,r,+(I>180),+(h>0),C.x,C.y,a,a,+(h<0),O.x,O.y)}else j+=jn(NL||(NL=Du(["L",",","Z"])),t,n);return j},Ppe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},LH=e=>{var t=Xn(e,Ppe),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h,className:d}=t;if(a<i||f===h)return null;var p=Et("recharts-sector",d),v=a-i,b=Lr(o,v,0,!0),w;return b>0&&Math.abs(f-h)<360?w=Tpe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(b,v/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:f,endAngle:h}):w=IH({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:h}),x.createElement("path",XC({},Gr(t),{className:p,d:w}))};function Mpe(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(fU(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=qn(r,i,a,l),f=qn(r,i,o,l);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return RH(t)}}var NE={},TE={},PE={},TL;function Dpe(){return TL||(TL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CU();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(PE)),PE}var PL;function Rpe(){return PL||(PL=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Dpe();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(TE)),TE}var ML;function Ipe(){return ML||(ML=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jU(),n=Rpe();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const l=Math.max(Math.ceil((a-i)/(o||1)),0),c=new Array(l);for(let f=0;f<l;f++)c[f]=i,i+=o;return c}e.range=r})(NE)),NE}var ME,DL;function Lpe(){return DL||(DL=1,ME=Ipe().range),ME}var zpe=Lpe();const zH=zi(zpe);var ws=e=>e.chartData,G0=le([ws],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),IO=(e,t,n,r)=>r?G0(e):ws(e),$pe=(e,t,n)=>n?G0(e):ws(e);function ao(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(bt(t)&&bt(n))return!0}return!1}function RL(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function $H(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(bt(n))i=n;else if(typeof n=="function")return;if(bt(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(ao(o))return o}}function Bpe(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ao(r))return RL(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Te(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&_I.test(i)){var c=_I.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var f=+c[1];o=t[0]-f}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Te(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&CI.test(a)){var h=CI.exec(a);if(h==null||h[1]==null||t==null)l=void 0;else{var d=+h[1];l=t[1]+d}}else l=t==null?void 0:t[1];var p=[o,l];if(ao(p))return t==null?p:RL(p,t,n)}}}var zd=1e9,Fpe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},zO,cn=!0,oa="[DecimalError] ",Gu=oa+"Invalid argument: ",LO=oa+"Exponent out of range: ",$d=Math.floor,Tu=Math.pow,Upe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Oi,mr=1e7,rn=7,BH=9007199254740991,mx=$d(BH/rn),Pe={};Pe.absoluteValue=Pe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Pe.comparedTo=Pe.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*rn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Pe.dividedBy=Pe.div=function(e){return Jo(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return Gt(Jo(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Kn(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Oi))throw Error(oa+"NaN");if(n.s<1)throw Error(oa+(n.s?"NaN":"-Infinity"));return n.eq(Oi)?new r(0):(cn=!1,t=Jo(qm(n,a),qm(e,a),a),cn=!0,Gt(t,i))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?HH(t,e):FH(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(oa+"NaN");return n.s?(cn=!1,t=Jo(n,e,0,1).times(e),cn=!0,n.minus(t)):Gt(new r(n),i)};Pe.naturalExponential=Pe.exp=function(){return UH(this)};Pe.naturalLogarithm=Pe.ln=function(){return qm(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FH(t,e):HH(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Gu+e);if(t=Kn(i)+1,r=i.d.length-1,n=r*rn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Pe.squareRoot=Pe.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(oa+"NaN")}for(e=Kn(l),cn=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=no(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=$d((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(Jo(l,a,o+2)).times(.5),no(a.d).slice(0,o)===(t=no(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Gt(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return cn=!0,Gt(r,n)};Pe.times=Pe.mul=function(e){var t,n,r,i,a,o,l,c,f,h=this,d=h.constructor,p=h.d,v=(e=new d(e)).d;if(!h.s||!e.s)return new d(0);for(e.s*=h.s,n=h.e+e.e,c=p.length,f=v.length,c<f&&(a=p,p=v,v=a,o=c,c=f,f=o),a=[],o=c+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+v[r]*p[i-r-1]+t,a[i--]=l%mr|0,t=l/mr|0;a[i]=(a[i]+t)%mr|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,cn?Gt(e,d.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(po(e,0,zd),t===void 0?t=r.rounding:po(t,0,8),Gt(n,e+Kn(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hc(r,!0):(po(e,0,zd),t===void 0?t=i.rounding:po(t,0,8),r=Gt(new i(r),e+1,t),n=hc(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hc(i):(po(e,0,zd),t===void 0?t=a.rounding:po(t,0,8),r=Gt(new a(i),e+Kn(i)+1,t),n=hc(r.abs(),!1,e+Kn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return Gt(new t(e),Kn(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,f=12,h=+(e=new c(e));if(!e.s)return new c(Oi);if(l=new c(l),!l.s){if(e.s<1)throw Error(oa+"Infinity");return l}if(l.eq(Oi))return l;if(r=c.precision,e.eq(Oi))return Gt(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=h<0?-h:h)<=BH){for(i=new c(Oi),t=Math.ceil(r/rn+4),cn=!1;n%2&&(i=i.times(l),LL(i.d,t)),n=$d(n/2),n!==0;)l=l.times(l),LL(l.d,t);return cn=!0,e.s<0?new c(Oi).div(i):Gt(i,r)}}else if(a<0)throw Error(oa+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,cn=!1,i=e.times(qm(l,r+f)),cn=!0,i=UH(i),i.s=a,i};Pe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Kn(i),r=hc(i,n<=a.toExpNeg||n>=a.toExpPos)):(po(e,1,zd),t===void 0?t=a.rounding:po(t,0,8),i=Gt(new a(i),e,t),n=Kn(i),r=hc(i,e<=n||n<=a.toExpNeg,e)),r};Pe.toSignificantDigits=Pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(po(e,1,zd),t===void 0?t=r.rounding:po(t,0,8)),Gt(new r(n),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Kn(e),n=e.constructor;return hc(e,t<=n.toExpNeg||t>=n.toExpPos)};function FH(e,t){var n,r,i,a,o,l,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),cn?Gt(t,d):t;if(c=e.d,f=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=f.length):(r=f,i=o,l=c.length),o=Math.ceil(d/rn),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=f.length,l-a<0&&(a=l,r=f,f=c,c=r),n=0;a;)n=(c[--a]=c[a]+f[a]+n)/mr|0,c[a]%=mr;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,cn?Gt(t,d):t}function po(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Gu+e)}function no(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=rn-r.length,n&&(a+=fl(n)),a+=r;o=e[t],r=o+"",n=rn-r.length,n&&(a+=fl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Jo=(function(){function e(r,i){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+o,r[l]=a%mr|0,o=a/mr|0;return o&&r.unshift(o),r}function t(r,i,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*mr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var l,c,f,h,d,p,v,b,w,S,E,j,C,O,N,k,T,M,I=r.constructor,L=r.s==i.s?1:-1,B=r.d,z=i.d;if(!r.s)return new I(r);if(!i.s)throw Error(oa+"Division by zero");for(c=r.e-i.e,T=z.length,N=B.length,v=new I(L),b=v.d=[],f=0;z[f]==(B[f]||0);)++f;if(z[f]>(B[f]||0)&&--c,a==null?j=a=I.precision:o?j=a+(Kn(r)-Kn(i))+1:j=a,j<0)return new I(0);if(j=j/rn+2|0,f=0,T==1)for(h=0,z=z[0],j++;(f<N||h)&&j--;f++)C=h*mr+(B[f]||0),b[f]=C/z|0,h=C%z|0;else{for(h=mr/(z[0]+1)|0,h>1&&(z=e(z,h),B=e(B,h),T=z.length,N=B.length),O=T,w=B.slice(0,T),S=w.length;S<T;)w[S++]=0;M=z.slice(),M.unshift(0),k=z[0],z[1]>=mr/2&&++k;do h=0,l=t(z,w,T,S),l<0?(E=w[0],T!=S&&(E=E*mr+(w[1]||0)),h=E/k|0,h>1?(h>=mr&&(h=mr-1),d=e(z,h),p=d.length,S=w.length,l=t(d,w,p,S),l==1&&(h--,n(d,T<p?M:z,p))):(h==0&&(l=h=1),d=z.slice()),p=d.length,p<S&&d.unshift(0),n(w,d,S),l==-1&&(S=w.length,l=t(z,w,T,S),l<1&&(h++,n(w,T<S?M:z,S))),S=w.length):l===0&&(h++,w=[0]),b[f++]=h,l&&w[0]?w[S++]=B[O]||0:(w=[B[O]],S=1);while((O++<N||w[0]!==void 0)&&j--)}return b[0]||b.shift(),v.e=c,Gt(v,o?a+Kn(v)+1:a)}})();function UH(e,t){var n,r,i,a,o,l,c=0,f=0,h=e.constructor,d=h.precision;if(Kn(e)>16)throw Error(LO+Kn(e));if(!e.s)return new h(Oi);for(cn=!1,l=d,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Tu(2,f))/Math.LN10*2+5|0,l+=r,n=i=a=new h(Oi),h.precision=l;;){if(i=Gt(i.times(e),l),n=n.times(++c),o=a.plus(Jo(i,n,l)),no(o.d).slice(0,l)===no(a.d).slice(0,l)){for(;f--;)a=Gt(a.times(a),l);return h.precision=d,t==null?(cn=!0,Gt(a,d)):a}a=o}}function Kn(e){for(var t=e.e*rn,n=e.d[0];n>=10;n/=10)t++;return t}function DE(e,t,n){if(t>e.LN10.sd())throw cn=!0,n&&(e.precision=n),Error(oa+"LN10 precision limit exceeded");return Gt(new e(e.LN10),t)}function fl(e){for(var t="";e--;)t+="0";return t}function qm(e,t){var n,r,i,a,o,l,c,f,h,d=1,p=10,v=e,b=v.d,w=v.constructor,S=w.precision;if(v.s<1)throw Error(oa+(v.s?"NaN":"-Infinity"));if(v.eq(Oi))return new w(0);if(t==null?(cn=!1,f=S):f=t,v.eq(10))return t==null&&(cn=!0),DE(w,f);if(f+=p,w.precision=f,n=no(b),r=n.charAt(0),a=Kn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=no(v.d),r=n.charAt(0),d++;a=Kn(v),r>1?(v=new w("0."+n),a++):v=new w(r+"."+n.slice(1))}else return c=DE(w,f+2,S).times(a+""),v=qm(new w(r+"."+n.slice(1)),f-p).plus(c),w.precision=S,t==null?(cn=!0,Gt(v,S)):v;for(l=o=v=Jo(v.minus(Oi),v.plus(Oi),f),h=Gt(v.times(v),f),i=3;;){if(o=Gt(o.times(h),f),c=l.plus(Jo(o,new w(i),f)),no(c.d).slice(0,f)===no(l.d).slice(0,f))return l=l.times(2),a!==0&&(l=l.plus(DE(w,f+2,S).times(a+""))),l=Jo(l,new w(d),f),w.precision=S,t==null?(cn=!0,Gt(l,S)):l;l=c,i+=2}}function IL(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=$d(n/rn),e.d=[],r=(n+1)%rn,n<0&&(r+=rn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=rn;r<i;)e.d.push(+t.slice(r,r+=rn));t=t.slice(r),r=rn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),cn&&(e.e>mx||e.e<-mx))throw Error(LO+n)}else e.s=0,e.e=0,e.d=[0];return e}function Gt(e,t,n){var r,i,a,o,l,c,f,h,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=rn,i=t,f=d[h=0];else{if(h=Math.ceil((r+1)/rn),a=d.length,h>=a)return e;for(f=a=d[h],o=1;a>=10;a/=10)o++;r%=rn,i=r-rn+o}if(n!==void 0&&(a=Tu(10,o-i-1),l=f/a%10|0,c=t<0||d[h+1]!==void 0||f%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?f/Tu(10,o-i):0:d[h-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=Kn(e),d.length=1,t=t-a-1,d[0]=Tu(10,(rn-t%rn)%rn),e.e=$d(-t/rn)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=h,a=1,h--):(d.length=h+1,a=Tu(10,rn-r),d[h]=i>0?(f/Tu(10,o-i)%Tu(10,i)|0)*a:0),c)for(;;)if(h==0){(d[0]+=a)==mr&&(d[0]=1,++e.e);break}else{if(d[h]+=a,d[h]!=mr)break;d[h--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(cn&&(e.e>mx||e.e<-mx))throw Error(LO+Kn(e));return e}function HH(e,t){var n,r,i,a,o,l,c,f,h,d,p=e.constructor,v=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),cn?Gt(t,v):t;if(c=e.d,d=t.d,r=t.e,f=e.e,c=c.slice(),o=f-r,o){for(h=o<0,h?(n=c,o=-o,l=d.length):(n=d,r=f,l=c.length),i=Math.max(Math.ceil(v/rn),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=d.length,h=i<l,h&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){h=c[i]<d[i];break}o=0}for(h&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>o;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=mr-1;--c[a],c[i]+=mr}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,cn?Gt(t,v):t):new p(0)}function hc(e,t,n){var r,i=Kn(e),a=no(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+fl(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+fl(-i-1)+a,n&&(r=n-o)>0&&(a+=fl(r))):i>=o?(a+=fl(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+fl(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=fl(r))),e.s<0?"-"+a:a}function LL(e,t){if(e.length>t)return e.length=t,!0}function qH(e){var t,n,r;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(Gu+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 IL(o,a.toString())}else if(typeof a!="string")throw Error(Gu+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Upe.test(a))IL(o,a);else throw Error(Gu+a)}if(i.prototype=Pe,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=qH,i.config=i.set=Hpe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Hpe(e){if(!e||typeof e!="object")throw Error(oa+"Object expected");var t,n,r,i=["precision",1,zd,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if($d(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Gu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Gu+n+": "+r);return this}var zO=qH(Fpe);Oi=new zO(1);const xt=zO;function VH(e){var t;return e===0?t=1:t=Math.floor(new xt(e).abs().log(10).toNumber())+1,t}function KH(e,t,n){for(var r=new xt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var YH=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},$O=(e,t,n)=>{if(e.lte(0))return new xt(0);var r=VH(e.toNumber()),i=new xt(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new xt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new xt(c.toNumber()):new xt(Math.ceil(c.toNumber()))},XH=(e,t,n)=>{var r;if(e.lte(0))return new xt(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new xt(a).abs().log(10).toNumber()),l=new xt(10).pow(o),c=e.div(l).toNumber(),f=i.findIndex(v=>v>=c-1e-10);if(f===-1&&(l=l.mul(10),f=0),f+=n,f>=i.length){var h=Math.floor(f/i.length);f%=i.length,l=l.mul(new xt(10).pow(h))}var d=(r=i[f])!==null&&r!==void 0?r:1,p=new xt(d).mul(l);return t?p:new xt(Math.ceil(p.toNumber()))},qpe=(e,t,n)=>{var r=new xt(1),i=new xt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new xt(10).pow(VH(e)-1),i=new xt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new xt(Math.floor(e)))}else e===0?i=new xt(Math.floor((t-1)/2)):n||(i=new xt(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new xt(c-o).mul(r)).toNumber());return l},GH=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:$O;if(!Number.isFinite((n-t)/(r-1)))return{step:new xt(0),tickMin:new xt(0),tickMax:new xt(0)};var l=o(new xt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new xt(0):(c=new xt(t).add(n).div(2),c=c.sub(new xt(c).mod(l)));var f=Math.ceil(c.sub(t).div(l).toNumber()),h=Math.ceil(new xt(n).sub(c).div(l).toNumber()),d=f+h+1;return d>r?GH(t,n,r,i,a+1,o):(d<r&&(h=n>0?h+(r-d):h,f=n>0?f:f+(r-d)),{step:l,tickMin:c.sub(new xt(f).mul(l)),tickMax:c.add(new xt(h).mul(l))})},zL=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(i,2),[c,f]=YH([n,r]);if(c===-1/0||f===1/0){var h=f===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?h.reverse():h}if(c===f)return qpe(c,i,a);var d=o==="snap125"?XH:$O,{step:p,tickMin:v,tickMax:b}=GH(c,f,l,a,0,d),w=KH(v,b.add(new xt(.1).mul(p)),p);return n>r?w.reverse():w},$L=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=YH([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var f=o==="snap125"?XH:$O,h=Math.max(n,2),d=f(new xt(c).sub(l).div(h-1),a,0),p=[...KH(new xt(l),new xt(c),d),c];return a===!1&&(p=p.map(v=>Math.round(v))),r>i?p.reverse():p},WH=e=>e.rootProps.maxBarSize,Vpe=e=>e.rootProps.barGap,QH=e=>e.rootProps.barCategoryGap,Kpe=e=>e.rootProps.barSize,Lp=e=>e.rootProps.stackOffset,ZH=e=>e.rootProps.reverseStackOrder,BO=e=>e.options.chartName,FO=e=>e.rootProps.syncId,JH=e=>e.rootProps.syncMethod,UO=e=>e.options.eventEmitter,Vn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Eu={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ka={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},W0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Q0(e,t,n){if(n!=="auto")return n;if(e!=null)return ys(e,t)?"category":"number"}function BL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function px(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BL(Object(n),!0).forEach(function(r){Ype(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ype(e,t,n){return(t=Xpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xpe(e){var t=Gpe(e,"string");return typeof t=="symbol"?t:t+""}function Gpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FL={allowDataOverflow:Eu.allowDataOverflow,allowDecimals:Eu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Eu.angleAxisId,includeHidden:!1,name:void 0,reversed:Eu.reversed,scale:Eu.scale,tick:Eu.tick,tickCount:void 0,ticks:void 0,type:Eu.type,unit:void 0,niceTicks:"auto"},UL={allowDataOverflow:Ka.allowDataOverflow,allowDecimals:Ka.allowDecimals,allowDuplicatedCategory:Ka.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ka.radiusAxisId,includeHidden:Ka.includeHidden,name:void 0,reversed:Ka.reversed,scale:Ka.scale,tick:Ka.tick,tickCount:Ka.tickCount,ticks:void 0,type:Ka.type,unit:void 0,niceTicks:"auto"},Wpe=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},HO=le([Wpe,pH],(e,t)=>{var n;if(e!=null)return e;var r=(n=Q0(t,"angleAxis",FL.type))!==null&&n!==void 0?n:"category";return px(px({},FL),{},{type:r})}),Qpe=(e,t)=>e.polarAxis.radiusAxis[t],qO=le([Qpe,pH],(e,t)=>{var n;if(e!=null)return e;var r=(n=Q0(t,"radiusAxis",UL.type))!==null&&n!==void 0?n:"category";return px(px({},UL),{},{type:r})}),Z0=e=>e.polarOptions,VO=le([xs,bs,or],DH),eq=le([Z0,VO],(e,t)=>{if(e!=null)return Lr(e.innerRadius,t,0)}),tq=le([Z0,VO],(e,t)=>{if(e!=null)return Lr(e.outerRadius,t,t*.8)}),Zpe=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},nq=le([Z0],Zpe);le([HO,nq],W0);var rq=le([VO,eq,tq],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([qO,rq],W0);var iq=le([Nt,Z0,eq,tq,xs,bs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:f}=t;return{cx:Lr(o,i,i/2),cy:Lr(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),bn=(e,t)=>t,zp=(e,t,n)=>n;function KO(e){return e==null?void 0:e.id}function aq(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var c,f=(c=l.data)!==null&&c!==void 0?c:r;if(!(f==null||f.length===0)){var h=KO(l);f.forEach((d,p)=>{var v=a==null||i?p:String(qt(d,a,null)),b=qt(d,l.dataKey,0),w;o.has(v)?w=o.get(v):w={},Object.assign(w,{[h]:b}),o.set(v,w)})}}),Array.from(o.values())}function J0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var eb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function tb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Jpe(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var yr=e=>{var t=Nt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Bd=e=>e.tooltip.settings.axisId;function YO(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],l=i[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var l=e(a);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var oq=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ao(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];bt(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function kl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ege(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function XO(e){let t,n,r;e.length!==2?(t=kl,n=(l,c)=>kl(e(l),c),r=(l,c)=>e(l)-c):(t=e===kl||e===ege?e:tge,n=e,r=e);function i(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;n(l[d],c)<0?f=d+1:h=d}while(f<h)}return f}function a(l,c,f=0,h=l.length){if(f<h){if(t(c,c)!==0)return h;do{const d=f+h>>>1;n(l[d],c)<=0?f=d+1:h=d}while(f<h)}return f}function o(l,c,f=0,h=l.length){const d=i(l,c,f,h-1);return d>f&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:o,right:a}}function tge(){return 0}function sq(e){return e===null?NaN:+e}function*nge(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const rge=XO(kl),$p=rge.right;XO(sq).center;class HL extends Map{constructor(t,n=oge){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(qL(this,t))}has(t){return super.has(qL(this,t))}set(t,n){return super.set(ige(this,t),n)}delete(t){return super.delete(age(this,t))}}function qL({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function ige({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function age({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oge(e){return e!==null&&typeof e=="object"?e.valueOf():e}function sge(e=kl){if(e===kl)return lq;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function lq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const lge=Math.sqrt(50),uge=Math.sqrt(10),cge=Math.sqrt(2);function gx(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=lge?10:a>=uge?5:a>=cge?2:1;let l,c,f;return i<0?(f=Math.pow(10,-i)/o,l=Math.round(e*f),c=Math.round(t*f),l/f<e&&++l,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*o,l=Math.round(e/f),c=Math.round(t/f),l*f<e&&++l,c*f>t&&--c),c<l&&.5<=n&&n<2?gx(e,t,n*2):[l,c,f]}function GC(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?gx(t,e,n):gx(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let f=0;f<l;++f)c[f]=(a-f)/-o;else for(let f=0;f<l;++f)c[f]=(a-f)*o;else if(o<0)for(let f=0;f<l;++f)c[f]=(i+f)/-o;else for(let f=0;f<l;++f)c[f]=(i+f)*o;return c}function WC(e,t,n){return t=+t,e=+e,n=+n,gx(e,t,n)[2]}function QC(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?WC(t,e,n):WC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function VL(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function KL(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function uq(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?lq:sge(i);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,h=Math.log(c),d=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*d*(c-d)/c)*(f-c/2<0?-1:1),v=Math.max(n,Math.floor(t-f*d/c+p)),b=Math.min(r,Math.floor(t+(c-f)*d/c+p));uq(e,t,v,b,i)}const a=e[t];let o=n,l=r;for(Qh(e,n,t),i(e[r],a)>0&&Qh(e,n,r);o<l;){for(Qh(e,o,l),++o,--l;i(e[o],a)<0;)++o;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Qh(e,n,l):(++l,Qh(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Qh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function fge(e,t,n){if(e=Float64Array.from(nge(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return KL(e);if(t>=1)return VL(e);var r,i=(r-1)*t,a=Math.floor(i),o=VL(uq(e,a).subarray(0,a+1)),l=KL(e.subarray(a+1));return o+(l-o)*(i-a)}}function dge(e,t,n=sq){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function hge(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function ua(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ss(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const ZC=Symbol("implicit");function GO(){var e=new HL,t=[],n=[],r=ZC;function i(a){let o=e.get(a);if(o===void 0){if(r!==ZC)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new HL;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return GO(t,n).unknown(r)},ua.apply(i,arguments),i}function WO(){var e=GO().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,l=!1,c=0,f=0,h=.5;delete e.unknown;function d(){var p=t().length,v=i<r,b=v?i:r,w=v?r:i;a=(w-b)/Math.max(1,p-c+f*2),l&&(a=Math.floor(a)),b+=(w-b-a*(p-c))*h,o=a*(1-c),l&&(b=Math.round(b),o=Math.round(o));var S=hge(p).map(function(E){return b+a*E});return n(v?S.reverse():S)}return e.domain=function(p){return arguments.length?(t(p),d()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(p){return arguments.length?(l=!!p,d()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,f=+p),d()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),d()):c},e.paddingOuter=function(p){return arguments.length?(f=+p,d()):f},e.align=function(p){return arguments.length?(h=Math.max(0,Math.min(1,p)),d()):h},e.copy=function(){return WO(t(),[r,i]).round(l).paddingInner(c).paddingOuter(f).align(h)},ua.apply(d(),arguments)}function cq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return cq(t())},e}function mge(){return cq(WO.apply(null,arguments).paddingInner(1))}function QO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function fq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bp(){}var Vm=.7,vx=1/Vm,Bf="\\s*([+-]?\\d+)\\s*",Km="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",oo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pge=/^#([0-9a-f]{3,8})$/,gge=new RegExp(`^rgb\\(${Bf},${Bf},${Bf}\\)$`),vge=new RegExp(`^rgb\\(${oo},${oo},${oo}\\)$`),yge=new RegExp(`^rgba\\(${Bf},${Bf},${Bf},${Km}\\)$`),xge=new RegExp(`^rgba\\(${oo},${oo},${oo},${Km}\\)$`),bge=new RegExp(`^hsl\\(${Km},${oo},${oo}\\)$`),wge=new RegExp(`^hsla\\(${Km},${oo},${oo},${Km}\\)$`),YL={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};QO(Bp,mc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XL,formatHex:XL,formatHex8:Sge,formatHsl:Ege,formatRgb:GL,toString:GL});function XL(){return this.rgb().formatHex()}function Sge(){return this.rgb().formatHex8()}function Ege(){return dq(this).formatHsl()}function GL(){return this.rgb().formatRgb()}function mc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pge.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?WL(t):n===3?new fi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Hv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Hv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=gge.exec(e))?new fi(t[1],t[2],t[3],1):(t=vge.exec(e))?new fi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yge.exec(e))?Hv(t[1],t[2],t[3],t[4]):(t=xge.exec(e))?Hv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bge.exec(e))?JL(t[1],t[2]/100,t[3]/100,1):(t=wge.exec(e))?JL(t[1],t[2]/100,t[3]/100,t[4]):YL.hasOwnProperty(e)?WL(YL[e]):e==="transparent"?new fi(NaN,NaN,NaN,0):null}function WL(e){return new fi(e>>16&255,e>>8&255,e&255,1)}function Hv(e,t,n,r){return r<=0&&(e=t=n=NaN),new fi(e,t,n,r)}function _ge(e){return e instanceof Bp||(e=mc(e)),e?(e=e.rgb(),new fi(e.r,e.g,e.b,e.opacity)):new fi}function JC(e,t,n,r){return arguments.length===1?_ge(e):new fi(e,t,n,r??1)}function fi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}QO(fi,JC,fq(Bp,{brighter(e){return e=e==null?vx:Math.pow(vx,e),new fi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vm:Math.pow(Vm,e),new fi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fi(Wu(this.r),Wu(this.g),Wu(this.b),yx(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:QL,formatHex:QL,formatHex8:Cge,formatRgb:ZL,toString:ZL}));function QL(){return`#${Ru(this.r)}${Ru(this.g)}${Ru(this.b)}`}function Cge(){return`#${Ru(this.r)}${Ru(this.g)}${Ru(this.b)}${Ru((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZL(){const e=yx(this.opacity);return`${e===1?"rgb(":"rgba("}${Wu(this.r)}, ${Wu(this.g)}, ${Wu(this.b)}${e===1?")":`, ${e})`}`}function yx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Wu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ru(e){return e=Wu(e),(e<16?"0":"")+e.toString(16)}function JL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ca(e,t,n,r)}function dq(e){if(e instanceof Ca)return new Ca(e.h,e.s,e.l,e.opacity);if(e instanceof Bp||(e=mc(e)),!e)return new Ca;if(e instanceof Ca)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+i:2-a-i,o*=60):l=c>0&&c<1?0:o,new Ca(o,l,c,e.opacity)}function jge(e,t,n,r){return arguments.length===1?dq(e):new Ca(e,t,n,r??1)}function Ca(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}QO(Ca,jge,fq(Bp,{brighter(e){return e=e==null?vx:Math.pow(vx,e),new Ca(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vm:Math.pow(Vm,e),new Ca(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fi(RE(e>=240?e-240:e+120,i,r),RE(e,i,r),RE(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ca(ez(this.h),qv(this.s),qv(this.l),yx(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 e=yx(this.opacity);return`${e===1?"hsl(":"hsla("}${ez(this.h)}, ${qv(this.s)*100}%, ${qv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ez(e){return e=(e||0)%360,e<0?e+360:e}function qv(e){return Math.max(0,Math.min(1,e||0))}function RE(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ZO=e=>()=>e;function Age(e,t){return function(n){return e+n*t}}function Oge(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kge(e){return(e=+e)==1?hq:function(t,n){return n-t?Oge(t,n,e):ZO(isNaN(t)?n:t)}}function hq(e,t){var n=t-e;return n?Age(e,n):ZO(isNaN(e)?t:e)}const xx=(function e(t){var n=kge(t);function r(i,a){var o=n((i=JC(i)).r,(a=JC(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),f=hq(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=l(h),i.b=c(h),i.opacity=f(h),i+""}}return r.gamma=e,r})(1);function Nge(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Tge(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pge(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=es(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=i[o](l);return a}}function Mge(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Sa(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Dge(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=es(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var ej=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,IE=new RegExp(ej.source,"g");function Rge(e){return function(){return e}}function Ige(e){return function(t){return e(t)+""}}function mq(e,t){var n=ej.lastIndex=IE.lastIndex=0,r,i,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=ej.exec(e))&&(i=IE.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:Sa(r,i)})),n=IE.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?Ige(c[0].x):Rge(t):(t=c.length,function(f){for(var h=0,d;h<t;++h)l[(d=c[h]).i]=d.x(f);return l.join("")})}function es(e,t){var n=typeof t,r;return t==null||n==="boolean"?ZO(t):(n==="number"?Sa:n==="string"?(r=mc(t))?(t=r,xx):mq:t instanceof mc?xx:t instanceof Date?Mge:Tge(t)?Nge:Array.isArray(t)?Pge:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Dge:Sa)(e,t)}function JO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var tz=180/Math.PI,tj={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pq(e,t,n,r,i,a){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*tz,skewX:Math.atan(c)*tz,scaleX:o,scaleY:l}}var Vv;function Lge(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?tj:pq(t.a,t.b,t.c,t.d,t.e,t.f)}function zge(e){return e==null||(Vv||(Vv=document.createElementNS("http://www.w3.org/2000/svg","g")),Vv.setAttribute("transform",e),!(e=Vv.transform.baseVal.consolidate()))?tj:(e=e.matrix,pq(e.a,e.b,e.c,e.d,e.e,e.f))}function gq(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function a(f,h,d,p,v,b){if(f!==d||h!==p){var w=v.push("translate(",null,t,null,n);b.push({i:w-4,x:Sa(f,d)},{i:w-2,x:Sa(h,p)})}else(d||p)&&v.push("translate("+d+t+p+n)}function o(f,h,d,p){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),p.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Sa(f,h)})):h&&d.push(i(d)+"rotate("+h+r)}function l(f,h,d,p){f!==h?p.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Sa(f,h)}):h&&d.push(i(d)+"skewX("+h+r)}function c(f,h,d,p,v,b){if(f!==d||h!==p){var w=v.push(i(v)+"scale(",null,",",null,")");b.push({i:w-4,x:Sa(f,d)},{i:w-2,x:Sa(h,p)})}else(d!==1||p!==1)&&v.push(i(v)+"scale("+d+","+p+")")}return function(f,h){var d=[],p=[];return f=e(f),h=e(h),a(f.translateX,f.translateY,h.translateX,h.translateY,d,p),o(f.rotate,h.rotate,d,p),l(f.skewX,h.skewX,d,p),c(f.scaleX,f.scaleY,h.scaleX,h.scaleY,d,p),f=h=null,function(v){for(var b=-1,w=p.length,S;++b<w;)d[(S=p[b]).i]=S.x(v);return d.join("")}}}var $ge=gq(Lge,"px, ","px)","deg)"),Bge=gq(zge,", ",")",")"),Fge=1e-12;function nz(e){return((e=Math.exp(e))+1/e)/2}function Uge(e){return((e=Math.exp(e))-1/e)/2}function Hge(e){return((e=Math.exp(2*e))-1)/(e+1)}const by=(function e(t,n,r){function i(a,o){var l=a[0],c=a[1],f=a[2],h=o[0],d=o[1],p=o[2],v=h-l,b=d-c,w=v*v+b*b,S,E;if(w<Fge)E=Math.log(p/f)/t,S=function(T){return[l+T*v,c+T*b,f*Math.exp(t*T*E)]};else{var j=Math.sqrt(w),C=(p*p-f*f+r*w)/(2*f*n*j),O=(p*p-f*f-r*w)/(2*p*n*j),N=Math.log(Math.sqrt(C*C+1)-C),k=Math.log(Math.sqrt(O*O+1)-O);E=(k-N)/t,S=function(T){var M=T*E,I=nz(N),L=f/(n*j)*(I*Hge(t*M+N)-Uge(N));return[l+L*v,c+L*b,f*I/nz(t*M+N)]}}return S.duration=E*1e3*t/Math.SQRT2,S}return i.rho=function(a){var o=Math.max(.001,+a),l=o*o,c=l*l;return e(o,l,c)},i})(Math.SQRT2,2,4);function qge(e,t){t===void 0&&(t=e,e=es);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function Vge(e){return function(){return e}}function bx(e){return+e}var rz=[0,1];function Xr(e){return e}function nj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Vge(isNaN(t)?NaN:.5)}function Kge(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Yge(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=nj(i,r),a=n(o,a)):(r=nj(r,i),a=n(a,o)),function(l){return a(r(l))}}function Xge(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=nj(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=$p(e,l,1,r)-1;return a[c](i[c](l))}}function Fp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function nb(){var e=rz,t=rz,n=es,r,i,a,o=Xr,l,c,f;function h(){var p=Math.min(e.length,t.length);return o!==Xr&&(o=Kge(e[0],e[p-1])),l=p>2?Xge:Yge,c=f=null,d}function d(p){return p==null||isNaN(p=+p)?a:(c||(c=l(e.map(r),t,n)))(r(o(p)))}return d.invert=function(p){return o(i((f||(f=l(t,e.map(r),Sa)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,bx),h()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),h()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),n=JO,h()},d.clamp=function(p){return arguments.length?(o=p?!0:Xr,h()):o!==Xr},d.interpolate=function(p){return arguments.length?(n=p,h()):n},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,v){return r=p,i=v,h()}}function ek(){return nb()(Xr,Xr)}function Gge(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wx(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function hd(e){return e=wx(Math.abs(e)),e?e[1]:NaN}function Wge(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Qge(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Zge=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ym(e){if(!(t=Zge.exec(e)))throw new Error("invalid format: "+e);var t;return new tk({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ym.prototype=tk.prototype;function tk(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}tk.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 Jge(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Sx;function eve(e,t){var n=wx(e,t);if(!n)return Sx=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Sx=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+wx(e,Math.max(0,t+a-1))[0]}function iz(e,t){var n=wx(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const az={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Gge,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>iz(e*100,t),r:iz,s:eve,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function oz(e){return e}var sz=Array.prototype.map,lz=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tve(e){var t=e.grouping===void 0||e.thousands===void 0?oz:Wge(sz.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?oz:Qge(sz.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(d,p){d=Ym(d);var v=d.fill,b=d.align,w=d.sign,S=d.symbol,E=d.zero,j=d.width,C=d.comma,O=d.precision,N=d.trim,k=d.type;k==="n"?(C=!0,k="g"):az[k]||(O===void 0&&(O=12),N=!0,k="g"),(E||v==="0"&&b==="=")&&(E=!0,v="0",b="=");var T=(p&&p.prefix!==void 0?p.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),M=(S==="$"?r:/[%p]/.test(k)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),I=az[k],L=/[defgprs%]/.test(k);O=O===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function B(z){var G=T,F=M,V,D,q;if(k==="c")F=I(z)+F,z="";else{z=+z;var X=z<0||1/z<0;if(z=isNaN(z)?c:I(Math.abs(z),O),N&&(z=Jge(z)),X&&+z==0&&w!=="+"&&(X=!1),G=(X?w==="("?w:l:w==="-"||w==="("?"":w)+G,F=(k==="s"&&!isNaN(z)&&Sx!==void 0?lz[8+Sx/3]:"")+F+(X&&w==="("?")":""),L){for(V=-1,D=z.length;++V<D;)if(q=z.charCodeAt(V),48>q||q>57){F=(q===46?i+z.slice(V+1):z.slice(V))+F,z=z.slice(0,V);break}}}C&&!E&&(z=t(z,1/0));var Y=G.length+z.length+F.length,R=Y<j?new Array(j-Y+1).join(v):"";switch(C&&E&&(z=t(R+z,R.length?j-F.length:1/0),R=""),b){case"<":z=G+z+F+R;break;case"=":z=G+R+z+F;break;case"^":z=R.slice(0,Y=R.length>>1)+G+z+F+R.slice(Y);break;default:z=R+G+z+F;break}return a(z)}return B.toString=function(){return d+""},B}function h(d,p){var v=Math.max(-8,Math.min(8,Math.floor(hd(p)/3)))*3,b=Math.pow(10,-v),w=f((d=Ym(d),d.type="f",d),{suffix:lz[8+v/3]});return function(S){return w(b*S)}}return{format:f,formatPrefix:h}}var Kv,nk,vq;nve({thousands:",",grouping:[3],currency:["$",""]});function nve(e){return Kv=tve(e),nk=Kv.format,vq=Kv.formatPrefix,Kv}function rve(e){return Math.max(0,-hd(Math.abs(e)))}function ive(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(hd(t)/3)))*3-hd(Math.abs(e)))}function ave(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,hd(t)-hd(e))+1}function yq(e,t,n,r){var i=QC(e,t,n),a;switch(r=Ym(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ive(i,o))&&(r.precision=a),vq(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=ave(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=rve(i))&&(r.precision=a-(r.type==="%")*2);break}}return nk(r)}function Zl(e){var t=e.domain;return e.ticks=function(n){var r=t();return GC(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return yq(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,f,h=10;for(l<o&&(f=o,o=l,l=f,f=i,i=a,a=f);h-- >0;){if(f=WC(o,l,n),f===c)return r[i]=o,r[a]=l,t(r);if(f>0)o=Math.floor(o/f)*f,l=Math.ceil(l/f)*f;else if(f<0)o=Math.ceil(o*f)/f,l=Math.floor(l*f)/f;else break;c=f}return e},e}function xq(){var e=ek();return e.copy=function(){return Fp(e,xq())},ua.apply(e,arguments),Zl(e)}function bq(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,bx),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return bq(e).unknown(t)},e=arguments.length?Array.from(e,bx):[0,1],Zl(n)}function wq(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function uz(e){return Math.log(e)}function cz(e){return Math.exp(e)}function ove(e){return-Math.log(-e)}function sve(e){return-Math.exp(-e)}function lve(e){return isFinite(e)?+("1e"+e):e<0?0:e}function uve(e){return e===10?lve:e===Math.E?Math.exp:t=>Math.pow(e,t)}function cve(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function fz(e){return(t,n)=>-e(-t,n)}function rk(e){const t=e(uz,cz),n=t.domain;let r=10,i,a;function o(){return i=cve(r),a=uve(r),n()[0]<0?(i=fz(i),a=fz(a),e(ove,sve)):e(uz,cz),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let f=c[0],h=c[c.length-1];const d=h<f;d&&([f,h]=[h,f]);let p=i(f),v=i(h),b,w;const S=l==null?10:+l;let E=[];if(!(r%1)&&v-p<S){if(p=Math.floor(p),v=Math.ceil(v),f>0){for(;p<=v;++p)for(b=1;b<r;++b)if(w=p<0?b/a(-p):b*a(p),!(w<f)){if(w>h)break;E.push(w)}}else for(;p<=v;++p)for(b=r-1;b>=1;--b)if(w=p>0?b/a(-p):b*a(p),!(w<f)){if(w>h)break;E.push(w)}E.length*2<S&&(E=GC(f,h,S))}else E=GC(p,v,Math.min(v-p,S)).map(a);return d?E.reverse():E},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ym(c)).precision==null&&(c.trim=!0),c=nk(c)),l===1/0)return c;const f=Math.max(1,r*l/t.ticks().length);return h=>{let d=h/a(Math.round(i(h)));return d*r<r-.5&&(d*=r),d<=f?c(h):""}},t.nice=()=>n(wq(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function Sq(){const e=rk(nb()).domain([1,10]);return e.copy=()=>Fp(e,Sq()).base(e.base()),ua.apply(e,arguments),e}function dz(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function hz(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ik(e){var t=1,n=e(dz(t),hz(t));return n.constant=function(r){return arguments.length?e(dz(t=+r),hz(t)):t},Zl(n)}function Eq(){var e=ik(nb());return e.copy=function(){return Fp(e,Eq()).constant(e.constant())},ua.apply(e,arguments)}function mz(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fve(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function dve(e){return e<0?-e*e:e*e}function ak(e){var t=e(Xr,Xr),n=1;function r(){return n===1?e(Xr,Xr):n===.5?e(fve,dve):e(mz(n),mz(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Zl(t)}function ok(){var e=ak(nb());return e.copy=function(){return Fp(e,ok()).exponent(e.exponent())},ua.apply(e,arguments),e}function hve(){return ok.apply(null,arguments).exponent(.5)}function pz(e){return Math.sign(e)*e*e}function mve(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function _q(){var e=ek(),t=[0,1],n=!1,r;function i(a){var o=mve(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(pz(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,bx)).map(pz)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return _q(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ua.apply(i,arguments),Zl(i)}function Cq(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=dge(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[$p(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(kl),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Cq().domain(e).range(t).unknown(r)},ua.apply(a,arguments)}function jq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[$p(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return jq().domain([e,t]).range(i).unknown(a)},ua.apply(Zl(o),arguments)}function Aq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[$p(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Aq().domain(e).range(t).unknown(n)},ua.apply(i,arguments)}const LE=new Date,zE=new Date;function sr(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let f;do c.push(f=new Date(+a)),t(a,l),e(a);while(f<a&&a<o);return c},i.filter=a=>sr(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(LE.setTime(+a),zE.setTime(+o),e(LE),e(zE),Math.floor(n(LE,zE))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Ex=sr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ex.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?sr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Ex);Ex.range;const Go=1e3,ia=Go*60,Wo=ia*60,ds=Wo*24,sk=ds*7,gz=ds*30,$E=ds*365,Iu=sr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Go)},(e,t)=>(t-e)/Go,e=>e.getUTCSeconds());Iu.range;const lk=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Go)},(e,t)=>{e.setTime(+e+t*ia)},(e,t)=>(t-e)/ia,e=>e.getMinutes());lk.range;const uk=sr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ia)},(e,t)=>(t-e)/ia,e=>e.getUTCMinutes());uk.range;const ck=sr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Go-e.getMinutes()*ia)},(e,t)=>{e.setTime(+e+t*Wo)},(e,t)=>(t-e)/Wo,e=>e.getHours());ck.range;const fk=sr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Wo)},(e,t)=>(t-e)/Wo,e=>e.getUTCHours());fk.range;const Up=sr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ia)/ds,e=>e.getDate()-1);Up.range;const rb=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ds,e=>e.getUTCDate()-1);rb.range;const Oq=sr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ds,e=>Math.floor(e/ds));Oq.range;function Cc(e){return sr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ia)/sk)}const ib=Cc(0),_x=Cc(1),pve=Cc(2),gve=Cc(3),md=Cc(4),vve=Cc(5),yve=Cc(6);ib.range;_x.range;pve.range;gve.range;md.range;vve.range;yve.range;function jc(e){return sr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/sk)}const ab=jc(0),Cx=jc(1),xve=jc(2),bve=jc(3),pd=jc(4),wve=jc(5),Sve=jc(6);ab.range;Cx.range;xve.range;bve.range;pd.range;wve.range;Sve.range;const dk=sr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());dk.range;const hk=sr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());hk.range;const hs=sr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});hs.range;const ms=sr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ms.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:sr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ms.range;function kq(e,t,n,r,i,a){const o=[[Iu,1,Go],[Iu,5,5*Go],[Iu,15,15*Go],[Iu,30,30*Go],[a,1,ia],[a,5,5*ia],[a,15,15*ia],[a,30,30*ia],[i,1,Wo],[i,3,3*Wo],[i,6,6*Wo],[i,12,12*Wo],[r,1,ds],[r,2,2*ds],[n,1,sk],[t,1,gz],[t,3,3*gz],[e,1,$E]];function l(f,h,d){const p=h<f;p&&([f,h]=[h,f]);const v=d&&typeof d.range=="function"?d:c(f,h,d),b=v?v.range(f,+h+1):[];return p?b.reverse():b}function c(f,h,d){const p=Math.abs(h-f)/d,v=XO(([,,S])=>S).right(o,p);if(v===o.length)return e.every(QC(f/$E,h/$E,d));if(v===0)return Ex.every(Math.max(QC(f,h,d),1));const[b,w]=o[p/o[v-1][2]<o[v][2]/p?v-1:v];return b.every(w)}return[l,c]}const[Eve,_ve]=kq(ms,hk,ab,Oq,fk,uk),[Cve,jve]=kq(hs,dk,ib,Up,ck,lk);function BE(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function FE(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Ave(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,f=Jh(i),h=em(i),d=Jh(a),p=em(a),v=Jh(o),b=em(o),w=Jh(l),S=em(l),E=Jh(c),j=em(c),C={a:q,A:X,b:Y,B:R,c:null,d:Sz,e:Sz,f:Wve,g:oye,G:lye,H:Yve,I:Xve,j:Gve,L:Nq,m:Qve,M:Zve,p:H,q:U,Q:Cz,s:jz,S:Jve,u:eye,U:tye,V:nye,w:rye,W:iye,x:null,X:null,y:aye,Y:sye,Z:uye,"%":_z},O={a:$,A:Q,b:J,B:ne,c:null,d:Ez,e:Ez,f:hye,g:Eye,G:Cye,H:cye,I:fye,j:dye,L:Pq,m:mye,M:pye,p:ae,q:re,Q:Cz,s:jz,S:gye,u:vye,U:yye,V:xye,w:bye,W:wye,x:null,X:null,y:Sye,Y:_ye,Z:jye,"%":_z},N={a:L,A:B,b:z,B:G,c:F,d:bz,e:bz,f:Hve,g:xz,G:yz,H:wz,I:wz,j:$ve,L:Uve,m:zve,M:Bve,p:I,q:Lve,Q:Vve,s:Kve,S:Fve,u:Pve,U:Mve,V:Dve,w:Tve,W:Rve,x:V,X:D,y:xz,Y:yz,Z:Ive,"%":qve};C.x=k(n,C),C.X=k(r,C),C.c=k(t,C),O.x=k(n,O),O.X=k(r,O),O.c=k(t,O);function k(ee,se){return function(me){var ie=[],we=-1,be=0,$e=ee.length,Ne,Je,Qe;for(me instanceof Date||(me=new Date(+me));++we<$e;)ee.charCodeAt(we)===37&&(ie.push(ee.slice(be,we)),(Je=vz[Ne=ee.charAt(++we)])!=null?Ne=ee.charAt(++we):Je=Ne==="e"?" ":"0",(Qe=se[Ne])&&(Ne=Qe(me,Je)),ie.push(Ne),be=we+1);return ie.push(ee.slice(be,we)),ie.join("")}}function T(ee,se){return function(me){var ie=Zh(1900,void 0,1),we=M(ie,ee,me+="",0),be,$e;if(we!=me.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(se&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(be=FE(Zh(ie.y,0,1)),$e=be.getUTCDay(),be=$e>4||$e===0?Cx.ceil(be):Cx(be),be=rb.offset(be,(ie.V-1)*7),ie.y=be.getUTCFullYear(),ie.m=be.getUTCMonth(),ie.d=be.getUTCDate()+(ie.w+6)%7):(be=BE(Zh(ie.y,0,1)),$e=be.getDay(),be=$e>4||$e===0?_x.ceil(be):_x(be),be=Up.offset(be,(ie.V-1)*7),ie.y=be.getFullYear(),ie.m=be.getMonth(),ie.d=be.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),$e="Z"in ie?FE(Zh(ie.y,0,1)).getUTCDay():BE(Zh(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-($e+5)%7:ie.w+ie.U*7-($e+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,FE(ie)):BE(ie)}}function M(ee,se,me,ie){for(var we=0,be=se.length,$e=me.length,Ne,Je;we<be;){if(ie>=$e)return-1;if(Ne=se.charCodeAt(we++),Ne===37){if(Ne=se.charAt(we++),Je=N[Ne in vz?se.charAt(we++):Ne],!Je||(ie=Je(ee,me,ie))<0)return-1}else if(Ne!=me.charCodeAt(ie++))return-1}return ie}function I(ee,se,me){var ie=f.exec(se.slice(me));return ie?(ee.p=h.get(ie[0].toLowerCase()),me+ie[0].length):-1}function L(ee,se,me){var ie=v.exec(se.slice(me));return ie?(ee.w=b.get(ie[0].toLowerCase()),me+ie[0].length):-1}function B(ee,se,me){var ie=d.exec(se.slice(me));return ie?(ee.w=p.get(ie[0].toLowerCase()),me+ie[0].length):-1}function z(ee,se,me){var ie=E.exec(se.slice(me));return ie?(ee.m=j.get(ie[0].toLowerCase()),me+ie[0].length):-1}function G(ee,se,me){var ie=w.exec(se.slice(me));return ie?(ee.m=S.get(ie[0].toLowerCase()),me+ie[0].length):-1}function F(ee,se,me){return M(ee,t,se,me)}function V(ee,se,me){return M(ee,n,se,me)}function D(ee,se,me){return M(ee,r,se,me)}function q(ee){return o[ee.getDay()]}function X(ee){return a[ee.getDay()]}function Y(ee){return c[ee.getMonth()]}function R(ee){return l[ee.getMonth()]}function H(ee){return i[+(ee.getHours()>=12)]}function U(ee){return 1+~~(ee.getMonth()/3)}function $(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function J(ee){return c[ee.getUTCMonth()]}function ne(ee){return l[ee.getUTCMonth()]}function ae(ee){return i[+(ee.getUTCHours()>=12)]}function re(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var se=k(ee+="",C);return se.toString=function(){return ee},se},parse:function(ee){var se=T(ee+="",!1);return se.toString=function(){return ee},se},utcFormat:function(ee){var se=k(ee+="",O);return se.toString=function(){return ee},se},utcParse:function(ee){var se=T(ee+="",!0);return se.toString=function(){return ee},se}}}var vz={"-":"",_:" ",0:"0"},xr=/^\s*\d+/,Ove=/^%/,kve=/[\\^$*+?|[\]().{}]/g;function kt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Nve(e){return e.replace(kve,"\\$&")}function Jh(e){return new RegExp("^(?:"+e.map(Nve).join("|")+")","i")}function em(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Tve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Pve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Mve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Dve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Rve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yz(e,t,n){var r=xr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function xz(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ive(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Lve(e,t,n){var r=xr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function zve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function bz(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $ve(e,t,n){var r=xr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function wz(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Bve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Fve(e,t,n){var r=xr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Uve(e,t,n){var r=xr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Hve(e,t,n){var r=xr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function qve(e,t,n){var r=Ove.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Vve(e,t,n){var r=xr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Kve(e,t,n){var r=xr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Sz(e,t){return kt(e.getDate(),t,2)}function Yve(e,t){return kt(e.getHours(),t,2)}function Xve(e,t){return kt(e.getHours()%12||12,t,2)}function Gve(e,t){return kt(1+Up.count(hs(e),e),t,3)}function Nq(e,t){return kt(e.getMilliseconds(),t,3)}function Wve(e,t){return Nq(e,t)+"000"}function Qve(e,t){return kt(e.getMonth()+1,t,2)}function Zve(e,t){return kt(e.getMinutes(),t,2)}function Jve(e,t){return kt(e.getSeconds(),t,2)}function eye(e){var t=e.getDay();return t===0?7:t}function tye(e,t){return kt(ib.count(hs(e)-1,e),t,2)}function Tq(e){var t=e.getDay();return t>=4||t===0?md(e):md.ceil(e)}function nye(e,t){return e=Tq(e),kt(md.count(hs(e),e)+(hs(e).getDay()===4),t,2)}function rye(e){return e.getDay()}function iye(e,t){return kt(_x.count(hs(e)-1,e),t,2)}function aye(e,t){return kt(e.getFullYear()%100,t,2)}function oye(e,t){return e=Tq(e),kt(e.getFullYear()%100,t,2)}function sye(e,t){return kt(e.getFullYear()%1e4,t,4)}function lye(e,t){var n=e.getDay();return e=n>=4||n===0?md(e):md.ceil(e),kt(e.getFullYear()%1e4,t,4)}function uye(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kt(t/60|0,"0",2)+kt(t%60,"0",2)}function Ez(e,t){return kt(e.getUTCDate(),t,2)}function cye(e,t){return kt(e.getUTCHours(),t,2)}function fye(e,t){return kt(e.getUTCHours()%12||12,t,2)}function dye(e,t){return kt(1+rb.count(ms(e),e),t,3)}function Pq(e,t){return kt(e.getUTCMilliseconds(),t,3)}function hye(e,t){return Pq(e,t)+"000"}function mye(e,t){return kt(e.getUTCMonth()+1,t,2)}function pye(e,t){return kt(e.getUTCMinutes(),t,2)}function gye(e,t){return kt(e.getUTCSeconds(),t,2)}function vye(e){var t=e.getUTCDay();return t===0?7:t}function yye(e,t){return kt(ab.count(ms(e)-1,e),t,2)}function Mq(e){var t=e.getUTCDay();return t>=4||t===0?pd(e):pd.ceil(e)}function xye(e,t){return e=Mq(e),kt(pd.count(ms(e),e)+(ms(e).getUTCDay()===4),t,2)}function bye(e){return e.getUTCDay()}function wye(e,t){return kt(Cx.count(ms(e)-1,e),t,2)}function Sye(e,t){return kt(e.getUTCFullYear()%100,t,2)}function Eye(e,t){return e=Mq(e),kt(e.getUTCFullYear()%100,t,2)}function _ye(e,t){return kt(e.getUTCFullYear()%1e4,t,4)}function Cye(e,t){var n=e.getUTCDay();return e=n>=4||n===0?pd(e):pd.ceil(e),kt(e.getUTCFullYear()%1e4,t,4)}function jye(){return"+0000"}function _z(){return"%"}function Cz(e){return+e}function jz(e){return Math.floor(+e/1e3)}var vf,Dq,Rq;Aye({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 Aye(e){return vf=Ave(e),Dq=vf.format,vf.parse,Rq=vf.utcFormat,vf.utcParse,vf}function Oye(e){return new Date(e)}function kye(e){return e instanceof Date?+e:+new Date(+e)}function mk(e,t,n,r,i,a,o,l,c,f){var h=ek(),d=h.invert,p=h.domain,v=f(".%L"),b=f(":%S"),w=f("%I:%M"),S=f("%I %p"),E=f("%a %d"),j=f("%b %d"),C=f("%B"),O=f("%Y");function N(k){return(c(k)<k?v:l(k)<k?b:o(k)<k?w:a(k)<k?S:r(k)<k?i(k)<k?E:j:n(k)<k?C:O)(k)}return h.invert=function(k){return new Date(d(k))},h.domain=function(k){return arguments.length?p(Array.from(k,kye)):p().map(Oye)},h.ticks=function(k){var T=p();return e(T[0],T[T.length-1],k??10)},h.tickFormat=function(k,T){return T==null?N:f(T)},h.nice=function(k){var T=p();return(!k||typeof k.range!="function")&&(k=t(T[0],T[T.length-1],k??10)),k?p(wq(T,k)):h},h.copy=function(){return Fp(h,mk(e,t,n,r,i,a,o,l,c,f))},h}function Nye(){return ua.apply(mk(Cve,jve,hs,dk,ib,Up,ck,lk,Iu,Dq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Tye(){return ua.apply(mk(Eve,_ve,ms,hk,ab,rb,fk,uk,Iu,Rq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ob(){var e=0,t=1,n,r,i,a,o=Xr,l=!1,c;function f(d){return d==null||isNaN(d=+d)?c:o(i===0?.5:(d=(a(d)-n)*i,l?Math.max(0,Math.min(1,d)):d))}f.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(d){return arguments.length?(l=!!d,f):l},f.interpolator=function(d){return arguments.length?(o=d,f):o};function h(d){return function(p){var v,b;return arguments.length?([v,b]=p,o=d(v,b),f):[o(0),o(1)]}}return f.range=h(es),f.rangeRound=h(JO),f.unknown=function(d){return arguments.length?(c=d,f):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),f}}function Jl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Iq(){var e=Zl(ob()(Xr));return e.copy=function(){return Jl(e,Iq())},Ss.apply(e,arguments)}function Lq(){var e=rk(ob()).domain([1,10]);return e.copy=function(){return Jl(e,Lq()).base(e.base())},Ss.apply(e,arguments)}function zq(){var e=ik(ob());return e.copy=function(){return Jl(e,zq()).constant(e.constant())},Ss.apply(e,arguments)}function pk(){var e=ak(ob());return e.copy=function(){return Jl(e,pk()).exponent(e.exponent())},Ss.apply(e,arguments)}function Pye(){return pk.apply(null,arguments).exponent(.5)}function $q(){var e=[],t=Xr;function n(r){if(r!=null&&!isNaN(r=+r))return t(($p(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(kl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>fge(e,a/r))},n.copy=function(){return $q(t).domain(e)},Ss.apply(n,arguments)}function sb(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,f=Xr,h,d=!1,p;function v(w){return isNaN(w=+w)?p:(w=.5+((w=+h(w))-a)*(r*w<r*a?l:c),f(d?Math.max(0,Math.min(1,w)):w))}v.domain=function(w){return arguments.length?([e,t,n]=w,i=h(e=+e),a=h(t=+t),o=h(n=+n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(w){return arguments.length?(d=!!w,v):d},v.interpolator=function(w){return arguments.length?(f=w,v):f};function b(w){return function(S){var E,j,C;return arguments.length?([E,j,C]=S,f=qge(w,[E,j,C]),v):[f(0),f(.5),f(1)]}}return v.range=b(es),v.rangeRound=b(JO),v.unknown=function(w){return arguments.length?(p=w,v):p},function(w){return h=w,i=w(e),a=w(t),o=w(n),l=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function Bq(){var e=Zl(sb()(Xr));return e.copy=function(){return Jl(e,Bq())},Ss.apply(e,arguments)}function Fq(){var e=rk(sb()).domain([.1,1,10]);return e.copy=function(){return Jl(e,Fq()).base(e.base())},Ss.apply(e,arguments)}function Uq(){var e=ik(sb());return e.copy=function(){return Jl(e,Uq()).constant(e.constant())},Ss.apply(e,arguments)}function gk(){var e=ak(sb());return e.copy=function(){return Jl(e,gk()).exponent(e.exponent())},Ss.apply(e,arguments)}function Mye(){return gk.apply(null,arguments).exponent(.5)}const pm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:WO,scaleDiverging:Bq,scaleDivergingLog:Fq,scaleDivergingPow:gk,scaleDivergingSqrt:Mye,scaleDivergingSymlog:Uq,scaleIdentity:bq,scaleImplicit:ZC,scaleLinear:xq,scaleLog:Sq,scaleOrdinal:GO,scalePoint:mge,scalePow:ok,scaleQuantile:Cq,scaleQuantize:jq,scaleRadial:_q,scaleSequential:Iq,scaleSequentialLog:Lq,scaleSequentialPow:pk,scaleSequentialQuantile:$q,scaleSequentialSqrt:Pye,scaleSequentialSymlog:zq,scaleSqrt:hve,scaleSymlog:Eq,scaleThreshold:Aq,scaleTime:Nye,scaleUtc:Tye,tickFormat:yq},Symbol.toStringTag,{value:"Module"}));function Dye(e){if(e in pm)return pm[e]();var t="scale".concat(Ap(e));if(t in pm)return pm[t]()}function Az(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Dye(e);if(r!=null)return r.domain(t).range(n),r}}function vk(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?Az(e.scale,n,r):Az(t,n,r)}function Rye(e){return"scale".concat(Ap(e))}function Iye(e){return Rye(e)in pm}var Hq=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Iye(r)?r:"point"}};function Lye(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function qq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,l,c=Lye(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var f=(o=r[c-1])!==null&&o!==void 0?o:0,h=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-f)<=Math.abs(a-h)?n[c-1]:n[c]}}}function zye(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):qq(e,void 0)}function Oz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oz(Object(n),!0).forEach(function(r){$ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ye(e,t,n){return(t=Bye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bye(e){var t=Fye(e,"string");return typeof t=="symbol"?t:t+""}function Fye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rj=[0,"auto"],er={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},Vq=(e,t)=>e.cartesianAxis.xAxis[t],Es=(e,t)=>{var n=Vq(e,t);return n??er},tr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:rj,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Tp},Kq=(e,t)=>e.cartesianAxis.yAxis[t],_s=(e,t)=>{var n=Kq(e,t);return n??tr},Uye={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},yk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Uye},kn=(e,t,n)=>{switch(t){case"xAxis":return Es(e,n);case"yAxis":return _s(e,n);case"zAxis":return yk(e,n);case"angleAxis":return HO(e,n);case"radiusAxis":return qO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Hye=(e,t,n)=>{switch(t){case"xAxis":return Es(e,n);case"yAxis":return _s(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Fd=(e,t,n)=>{switch(t){case"xAxis":return Es(e,n);case"yAxis":return _s(e,n);case"angleAxis":return HO(e,n);case"radiusAxis":return qO(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Yq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function xk(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var lb=e=>e.graphicalItems.cartesianItems,qye=le([bn,zp],xk),bk=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Hp=le([lb,kn,qye],bk,{memoizeOptions:{resultEqualityCheck:tb}}),Xq=le([Hp],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(J0)),Gq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Vye=le([Hp],Gq),wk=e=>e.map(t=>t.data).filter(Boolean).flat(1),Kye=le([Hp],wk,{memoizeOptions:{resultEqualityCheck:tb}}),Sk=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Ek=le([Kye,IO],Sk),_k=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:qt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:qt(i,r)}))):e.map(r=>({value:r})),qp=le([Ek,kn,Hp],_k);function Ff(e){if(ho(e)||e instanceof Date){var t=Number(e);if(bt(t))return t}}function kz(e){if(Array.isArray(e)){var t=[Ff(e[0]),Ff(e[1])];return ao(t)?t:void 0}var n=Ff(e);if(n!=null)return[n,n]}function ps(e){return e.map(Ff).filter(ci)}function Yye(e,t){var n=Ff(e),r=Ff(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Xye=le([qp],e=>e==null?void 0:e.map(t=>t.value).sort(Yye));function Wq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Gye(e,t,n){return!n||typeof t!="number"||fo(t)?[]:n.length?ps(n.flatMap(r=>{var i=qt(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!bt(a)||!bt(o)))return[t-a,t+o]})):[]}var lr=e=>{var t=yr(e),n=Bd(e);return Fd(e,t,n)},Vp=le([lr],e=>e==null?void 0:e.dataKey),Wye=le([Xq,IO,lr],aq),Qq=(e,t,n,r)=>{var i={},a=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[l,c]=o,f=r?[...c].reverse():c,h=f.map(KO);return[l,{stackedData:Lde(e,h,n),graphicalItems:f}]}))},ij=le([Wye,Xq,Lp,ZH],Qq),Zq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=Ude(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Qye=le([kn],e=>e.allowDataOverflow),Ck=e=>{var t;if(e==null||!("domain"in e))return rj;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=ps(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:rj},jk=le([kn],Ck),Ak=le([jk,Qye],$H),Zye=le([ij,ws,bn,Ak],Zq,{memoizeOptions:{resultEqualityCheck:eb}}),ub=e=>e.errorBars,Jye=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Wq(n,r)),Ax=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),l=Math.max(...a);return[o,l]}},Ok=(e,t,n,r,i)=>{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var f,h,d=(f=r[c.id])===null||f===void 0?void 0:f.filter(E=>Wq(i,E)),p=qt(l,(h=t.dataKey)!==null&&h!==void 0?h:c.dataKey),v=Gye(l,p,d);if(v.length>=2){var b=Math.min(...v),w=Math.max(...v);(a==null||b<a)&&(a=b),(o==null||w>o)&&(o=w)}var S=kz(p);S!=null&&(a=a==null?S[0]:Math.min(a,S[0]),o=o==null?S[1]:Math.max(o,S[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=kz(qt(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),bt(a)&&bt(o))return[a,o]},exe=le([Ek,kn,Vye,ub,bn],Ok,{memoizeOptions:{resultEqualityCheck:eb}});function txe(e){var{value:t}=e;if(ho(t)||t instanceof Date)return t}var nxe=(e,t,n)=>{var r=e.map(txe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&lU(r))?zH(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Jq=e=>e.referenceElements.dots,Ud=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),rxe=le([Jq,bn,zp],Ud),e9=e=>e.referenceElements.areas,ixe=le([e9,bn,zp],Ud),t9=e=>e.referenceElements.lines,axe=le([t9,bn,zp],Ud),n9=(e,t)=>{if(e!=null){var n=ps(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},oxe=le(rxe,bn,n9),r9=(e,t)=>{if(e!=null){var n=ps(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},sxe=le([ixe,bn],r9);function lxe(e){var t;if(e.x!=null)return ps([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:ps(n)}function uxe(e){var t;if(e.y!=null)return ps([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:ps(n)}var i9=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?lxe(r):uxe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},cxe=le([axe,bn],i9),fxe=le(oxe,cxe,sxe,(e,t,n)=>Ax(e,n,t)),kk=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",f=c?Ax(r,a,i):Ax(a,i);return Bpe(t,f,e.allowDataOverflow)},dxe=le([kn,jk,Ak,Zye,exe,fxe,Nt,bn],kk,{memoizeOptions:{resultEqualityCheck:eb}}),hxe=[0,1],Nk=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,f=ys(t,a);if(f&&l==null){var h;return zH(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return c==="category"?nxe(r,e,f):i==="expand"?hxe:o}},Tk=le([kn,Nt,Ek,qp,Lp,bn,dxe],Nk),eu=le([kn,Yq,BO],Hq),Pk=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=Ck(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ao(e)){if(a)return zL(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return $L(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ao(e))return zL(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ao(e))return $L(e,t.tickCount,t.allowDecimals,"adaptive")}}},Mk=le([Tk,Fd,eu],Pk),Dk=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ao(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,f)]}return t},mxe=le([kn,Tk,Mk,bn],Dk),pxe=le(qp,kn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(ps(e.map(d=>d.value))).sort((d,p)=>d-p),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],f=r[l+1];if(!(c==null||f==null)){var h=f-c;n=Math.min(n,h)}}return n/o}}),a9=le(pxe,Nt,QH,or,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!bt(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Lr(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),gxe=(e,t,n)=>{var r=Es(e,t);return r==null||typeof r.padding!="string"?0:a9(e,"xAxis",t,n,r.padding)},vxe=(e,t,n)=>{var r=_s(e,t);return r==null||typeof r.padding!="string"?0:a9(e,"yAxis",t,n,r.padding)},yxe=le(Es,gxe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),xxe=le(_s,vxe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),bxe=le([or,yxe,q0,H0,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),wxe=le([or,Nt,xxe,q0,H0,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Kp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return bxe(e,n,r);case"yAxis":return wxe(e,n,r);case"zAxis":return(i=yk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return nq(e);case"radiusAxis":return rq(e,n);default:return}},o9=le([kn,Kp],W0),Sxe=le([eu,mxe],oq),Rk=le([kn,eu,Sxe,o9],vk),s9=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=ys(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},Ik=le([Nt,qp,Fd,bn],s9),cb=le([Rk],YO);le([Rk],zye);le([Rk,Xye],qq);le([Hp,ub,bn],Jye);function l9(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var fb=(e,t)=>t,db=(e,t,n)=>n,Exe=le(F0,fb,db,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(l9)),_xe=le(U0,fb,db,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(l9)),u9=(e,t)=>({width:e.width,height:t.height}),Cxe=(e,t)=>{var n=typeof t.width=="number"?t.width:Tp;return{width:n,height:e.height}},c9=le(or,Es,u9),jxe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Axe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Oxe=le(bs,or,Exe,fb,db,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=u9(t,l);o==null&&(o=jxe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(f)*c.height,o+=(f?-1:1)*c.height}),a}),kxe=le(xs,or,_xe,fb,db,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=Cxe(t,l);o==null&&(o=Axe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(f)*c.width,o+=(f?-1:1)*c.width}),a}),Nxe=(e,t)=>{var n=Es(e,t);if(n!=null)return Oxe(e,n.orientation,n.mirror)},Txe=le([or,Es,Nxe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),Pxe=(e,t)=>{var n=_s(e,t);if(n!=null)return kxe(e,n.orientation,n.mirror)},Mxe=le([or,_s,Pxe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),f9=le(or,_s,(e,t)=>{var n=typeof t.width=="number"?t.width:Tp;return{width:n,height:e.height}}),Nz=(e,t,n)=>{switch(t){case"xAxis":return c9(e,n).width;case"yAxis":return f9(e,n).height;default:return}},d9=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=ys(e,r),c=t.map(f=>f.value);if(o&&l&&a==="category"&&i&&lU(c))return c}},Lk=le([Nt,qp,kn,bn],d9),Tz=le([Nt,Hye,eu,cb,Lk,Ik,Kp,Mk,bn],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var f=ys(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:l,range:o,realScaleType:n,scale:r}}}),Dxe=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var f=ys(e,c),{type:h,ticks:d,tickCount:p}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,b=h==="category"&&r.bandwidth?r.bandwidth()/v:0;b=c==="angleAxis"&&a!=null&&a.length>=2?pr(a[0]-a[1])*2*b:b;var w=d||i;return w?w.map((S,E)=>{var j=o?o.indexOf(S):S,C=r.map(j);return bt(C)?{index:E,coordinate:C+b,value:S,offset:b}:null}).filter(ci):f&&l?l.map((S,E)=>{var j=r.map(S);return bt(j)?{coordinate:j+b,value:S,index:E,offset:b}:null}).filter(ci):r.ticks?r.ticks(p).map((S,E)=>{var j=r.map(S);return bt(j)?{coordinate:j+b,value:S,index:E,offset:b}:null}).filter(ci):r.domain().map((S,E)=>{var j=r.map(S);return bt(j)?{coordinate:j+b,value:o?o[S]:S,index:E,offset:b}:null}).filter(ci)}},h9=le([Nt,Fd,eu,cb,Mk,Kp,Lk,Ik,bn],Dxe),Rxe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=ys(e,o),{tickCount:c}=t,f=0;return f=o==="angleAxis"&&(r==null?void 0:r.length)>=2?pr(r[0]-r[1])*2*f:f,l&&a?a.map((h,d)=>{var p=n.map(h);return bt(p)?{coordinate:p+f,value:h,index:d,offset:f}:null}).filter(ci):n.ticks?n.ticks(c).map((h,d)=>{var p=n.map(h);return bt(p)?{coordinate:p+f,value:h,index:d,offset:f}:null}).filter(ci):n.domain().map((h,d)=>{var p=n.map(h);return bt(p)?{coordinate:p+f,value:i?i[h]:h,index:d,offset:f}:null}).filter(ci)}},Il=le([Nt,Fd,cb,Kp,Lk,Ik,bn],Rxe),Ll=le(kn,cb,(e,t)=>{if(!(e==null||t==null))return jx(jx({},e),{},{scale:t})}),Ixe=le([kn,eu,Tk,o9],vk),Lxe=le([Ixe],YO);le((e,t,n)=>yk(e,n),Lxe,(e,t)=>{if(!(e==null||t==null))return jx(jx({},e),{},{scale:t})});var zxe=le([Nt,F0,U0],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),$xe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([$xe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var m9=e=>e.options.defaultTooltipEventType,p9=e=>e.options.validateTooltipEventTypes;function g9(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function zk(e,t){var n=m9(e),r=p9(e);return g9(t,n,r)}function Bxe(e){return De(t=>zk(t,e))}var v9=(e,t)=>{var n,r=Number(t);if(!(fo(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},Fxe=e=>e.tooltip.settings,ml={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Uxe={itemInteraction:{click:ml,hover:ml},axisInteraction:{click:ml,hover:ml},keyboardInteraction:ml,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},y9=$r({name:"tooltip",initialState:Uxe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:nn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ra(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:nn()},removeTooltipEntrySettings:{reducer(e,t){var n=ra(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:nn()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Hxe,replaceTooltipEntrySettings:qxe,removeTooltipEntrySettings:Vxe,setTooltipSettingsState:Kxe,setActiveMouseOverItemIndex:x9,mouseLeaveItem:Yxe,mouseLeaveChart:b9,setActiveClickItemIndex:Xxe,setMouseOverAxisIndex:w9,setMouseClickAxisIndex:Gxe,setSyncInteraction:aj,setKeyboardInteraction:Ox}=y9.actions,Wxe=y9.reducer;function Pz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pz(Object(n),!0).forEach(function(r){Qxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qxe(e,t,n){return(t=Zxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zxe(e){var t=Jxe(e,"string");return typeof t=="symbol"?t:t+""}function Jxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e0e(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function t0e(e){return e.index!=null}var S9=(e,t,n,r)=>{if(t==null)return ml;var i=e0e(e,t,n);if(i==null)return ml;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(t0e(i)){if(a)return Yv(Yv({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Yv(Yv({},ml),{},{coordinate:i.coordinate})};function n0e(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function r0e(e,t){var n=n0e(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function i0e(e,t,n){if(n==null||t==null)return!0;var r=qt(e,t);return r==null||!ao(n)?!0:r0e(r,n)}var $k=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!bt(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(a,l)),f=t[c];return f==null||i0e(f,n,r)?String(c):null},E9=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var f=i==null?void 0:i[Number(a)];if(f)switch(n){case"horizontal":return{x:f.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:f.coordinate}}}},_9=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},C9=e=>e.options.tooltipPayloadSearcher,Hd=e=>e.tooltip;function Mz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mz(Object(n),!0).forEach(function(r){a0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function a0e(e,t,n){return(t=o0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o0e(e){var t=s0e(e,"string");return typeof t=="symbol"?t:t+""}function s0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function l0e(e){if(typeof e=="string"||typeof e=="number")return e}function u0e(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function c0e(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function Rz(e){if(typeof e=="string")return e}function f0e(e){if(!(e==null||typeof e!="object")){var t="name"in e?l0e(e.name):void 0,n="unit"in e?u0e(e.unit):void 0,r="dataKey"in e?c0e(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Rz(e.color):void 0,o="fill"in e?Rz(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function d0e(e,t){return e??t}var j9=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:f,dataEndIndex:h}=n,d=[];return e.reduce((p,v)=>{var b,{dataDefinedOnItem:w,settings:S}=v,E=d0e(w,l),j=Array.isArray(E)?iH(E,f,h):E,C=(b=S==null?void 0:S.dataKey)!==null&&b!==void 0?b:r,O=S==null?void 0:S.nameKey,N;if(r&&Array.isArray(j)&&!Array.isArray(j[0])&&o==="axis"?N=uU(j,r,i):N=a(j,t,c,O),Array.isArray(N))N.forEach(T=>{var M,I,L=f0e(T),B=L==null?void 0:L.name,z=L==null?void 0:L.dataKey,G=L==null?void 0:L.payload,F=Dz(Dz({},S),{},{name:B,unit:L==null?void 0:L.unit,color:(M=L==null?void 0:L.color)!==null&&M!==void 0?M:S==null?void 0:S.color,fill:(I=L==null?void 0:L.fill)!==null&&I!==void 0?I:S==null?void 0:S.fill});p.push(jI({tooltipEntrySettings:F,dataKey:z,payload:G,value:qt(G,z),name:B==null?void 0:String(B)}))});else{var k;p.push(jI({tooltipEntrySettings:S,dataKey:C,payload:N,value:qt(N,C),name:(k=qt(N,O))!==null&&k!==void 0?k:S==null?void 0:S.name}))}return p},d)}},Bk=le([lr,Yq,BO],Hq),h0e=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),m0e=le([yr,Bd],xk),qd=le([h0e,lr,m0e],bk,{memoizeOptions:{resultEqualityCheck:tb}}),p0e=le([qd],e=>e.filter(J0)),g0e=le([qd],wk,{memoizeOptions:{resultEqualityCheck:tb}}),Vd=le([g0e,ws],Sk),v0e=le([p0e,ws,lr],aq),Fk=le([Vd,lr,qd],_k),A9=le([lr],Ck),y0e=le([lr],e=>e.allowDataOverflow),O9=le([A9,y0e],$H),x0e=le([qd],e=>e.filter(J0)),b0e=le([v0e,x0e,Lp,ZH],Qq),w0e=le([b0e,ws,yr,O9],Zq),S0e=le([qd],Gq),E0e=le([Vd,lr,S0e,ub,yr],Ok,{memoizeOptions:{resultEqualityCheck:eb}}),_0e=le([Jq,yr,Bd],Ud),C0e=le([_0e,yr],n9),j0e=le([e9,yr,Bd],Ud),A0e=le([j0e,yr],r9),O0e=le([t9,yr,Bd],Ud),k0e=le([O0e,yr],i9),N0e=le([C0e,k0e,A0e],Ax),T0e=le([lr,A9,O9,w0e,E0e,N0e,Nt,yr],kk),Yp=le([lr,Nt,Vd,Fk,Lp,yr,T0e],Nk),P0e=le([Yp,lr,Bk],Pk),M0e=le([lr,Yp,P0e,yr],Dk),k9=e=>{var t=yr(e),n=Bd(e),r=!1;return Kp(e,t,n,r)},N9=le([lr,k9],W0),D0e=le([lr,Bk,M0e,N9],vk),T9=le([D0e],YO),R0e=le([Nt,Fk,lr,yr],d9),I0e=le([Nt,Fk,lr,yr],s9),L0e=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,f=ys(e,l);if(r){var h=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/h:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?pr(i[0]-i[1])*2*d:d,f&&o?o.map((p,v)=>{var b=r.map(p);return bt(b)?{coordinate:b+d,value:p,index:v,offset:d}:null}).filter(ci):r.domain().map((p,v)=>{var b=r.map(p);return bt(b)?{coordinate:b+d,value:a?a[p]:p,index:v,offset:d}:null}).filter(ci)}}},Cs=le([Nt,lr,Bk,T9,k9,R0e,I0e,yr],L0e),Uk=le([m9,p9,Fxe],(e,t,n)=>g9(n.shared,e,t)),P9=e=>e.tooltip.settings.trigger,Hk=e=>e.tooltip.settings.defaultIndex,Xp=le([Hd,Uk,P9,Hk],S9),zl=le([Xp,Vd,Vp,Yp],$k),M9=le([Cs,zl],v9),qk=le([Xp],e=>{if(e)return e.dataKey}),D9=le([Xp],e=>{if(e)return e.graphicalItemId}),R9=le([Hd,Uk,P9,Hk],_9),z0e=le([xs,bs,Nt,or,Cs,Hk,R9],E9),$0e=le([Xp,z0e],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),B0e=le([Xp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),F0e=le([R9,zl,ws,Vp,M9,C9,Uk],j9),U0e=le([F0e],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function Iz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(n),!0).forEach(function(r){H0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H0e(e,t,n){return(t=q0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q0e(e){var t=V0e(e,"string");return typeof t=="symbol"?t:t+""}function V0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var K0e=()=>De(lr),Y0e=()=>{var e=K0e(),t=De(Cs),n=De(T9);return cd(!e||!n?void 0:Lz(Lz({},e),{},{scale:n}),t)};function zz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zz(Object(n),!0).forEach(function(r){X0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function X0e(e,t,n){return(t=G0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G0e(e){var t=W0e(e,"string");return typeof t=="symbol"?t:t+""}function W0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Q0e=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Z0e=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return yf(yf(yf({},r),qn(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return yf(yf(yf({},r),qn(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function J0e(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var I9=(e,t,n,r,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<o;l++){var c,f,h,d,p,v=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,b=(h=n[l])===null||h===void 0?void 0:h.coordinate,w=l>=o-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(p=n[l+1])===null||p===void 0?void 0:p.coordinate,S=void 0;if(!(v==null||b==null||w==null))if(pr(b-v)!==pr(w-b)){var E=[];if(pr(w-b)===pr(i[1]-i[0])){S=w;var j=b+i[1]-i[0];E[0]=Math.min(j,(j+v)/2),E[1]=Math.max(j,(j+v)/2)}else{S=v;var C=w+i[1]-i[0];E[0]=Math.min(b,(C+b)/2),E[1]=Math.max(b,(C+b)/2)}var O=[Math.min(b,(S+b)/2),Math.max(b,(S+b)/2)];if(e>O[0]&&e<=O[1]||e>=E[0]&&e<=E[1]){var N;return(N=n[l])===null||N===void 0?void 0:N.index}}else{var k=Math.min(v,w),T=Math.max(v,w);if(e>(k+b)/2&&e<=(T+b)/2){var M;return(M=n[l])===null||M===void 0?void 0:M.index}}}else if(t)for(var I=0;I<o;I++){var L=t[I];if(L!=null){var B=t[I+1],z=t[I-1];if(I===0&&B!=null&&e<=(L.coordinate+B.coordinate)/2||I===o-1&&z!=null&&e>(L.coordinate+z.coordinate)/2||I>0&&I<o-1&&z!=null&&B!=null&&e>(L.coordinate+z.coordinate)/2&&e<=(L.coordinate+B.coordinate)/2)return L.index}}return-1},ebe=()=>De(BO),Vk=(e,t)=>t,L9=(e,t,n)=>n,Kk=(e,t,n,r)=>r,tbe=le(Cs,e=>T0(e,t=>t.coordinate)),Yk=le([Hd,Vk,L9,Kk],S9),Xk=le([Yk,Vd,Vp,Yp],$k),nbe=(e,t,n)=>{if(t!=null){var r=Hd(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},z9=le([Hd,Vk,L9,Kk],_9),kx=le([xs,bs,Nt,or,Cs,Kk,z9],E9),rbe=le([Yk,kx],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),$9=le([Cs,Xk],v9),ibe=le([z9,Xk,ws,Vp,$9,C9,Vk],j9),abe=le([Yk,Xk],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),obe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&J0e(e,o)){var l=Hde(e,t),c=I9(l,a,i,n,r),f=Q0e(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},sbe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=kpe(e,n);if(l){var c=qde(l,t),f=I9(c,o,a,r,i),h=Z0e(t,a,f,l);return{activeIndex:String(f),activeCoordinate:h}}}},lbe=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?obe(e,t,r,i,a,o,l):sbe(e,t,n,r,i,a,o)},ube=le(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),cbe=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Vn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Jpe}});function $z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$z(Object(n),!0).forEach(function(r){fbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$z(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fbe(e,t,n){return(t=dbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dbe(e){var t=hbe(e,"string");return typeof t=="symbol"?t:t+""}function hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mbe={},pbe={zIndexMap:Object.values(Vn).reduce((e,t)=>Bz(Bz({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),mbe)},gbe=new Set(Object.values(Vn));function vbe(e){return gbe.has(e)}var B9=$r({name:"zIndex",initialState:pbe,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:nn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!vbe(n)&&delete e.zIndexMap[n])},prepare:nn()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:nn()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:nn()}}}),{registerZIndexPortal:ybe,unregisterZIndexPortal:xbe,registerZIndexPortalElement:bbe,unregisterZIndexPortalElement:wbe}=B9.actions,Sbe=B9.reducer;function di(e){var{zIndex:t,children:n}=e,r=whe(),i=r&&t!==void 0&&t!==0,a=Br(),o=Vt();x.useLayoutEffect(()=>i?(o(ybe({zIndex:t})),()=>{o(xbe({zIndex:t}))}):Ql,[o,t,i]);var l=De(c=>ube(c,t,a));return i?l?Ul.createPortal(n,l):null:n}function oj(){return oj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oj.apply(null,arguments)}function Fz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fz(Object(n),!0).forEach(function(r){Ebe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ebe(e,t,n){return(t=_be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _be(e){var t=Cbe(e,"string");return typeof t=="symbol"?t:t+""}function Cbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jbe(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Abe(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:f,chartName:h}=e,d=n,p=r,v=i;if(!c||!d||h!=="ScatterChart"&&f!=="axis")return null;var b,w,S;if(h==="ScatterChart")b=d,w=qme,S=Vn.cursorLine;else if(h==="BarChart")b=Vme(l,d,a,o),w=MH,S=Vn.cursorRectangle;else if(l==="radial"&&fU(d)){var{cx:E,cy:j,radius:C,startAngle:O,endAngle:N}=RH(d);b={cx:E,cy:j,startAngle:O,endAngle:N,innerRadius:C,outerRadius:C},w=LH,S=Vn.cursorLine}else b={points:Mpe(l,d,a)},w=RO,S=Vn.cursorLine;var k=typeof c=="object"&&"className"in c?c.className:void 0,T=Xv(Xv(Xv(Xv({stroke:"#ccc",pointerEvents:"none"},a),b),oc(c)),{},{payload:p,payloadIndex:v,className:Et("recharts-tooltip-cursor",k)});return x.createElement(di,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(jbe,{cursor:c,cursorComp:w,cursorProps:T}))}function Obe(e){var t=Y0e(),n=hH(),r=_c(),i=ebe();return t==null||n==null||r==null||i==null?null:x.createElement(Abe,oj({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var F9=x.createContext(null),kbe=()=>x.useContext(F9),UE={exports:{}},Uz;function Nbe(){return Uz||(Uz=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,f,h){this.fn=c,this.context=f,this.once=h||!1}function a(c,f,h,d,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new i(h,d||c,p),b=n?n+f:f;return c._events[b]?c._events[b].fn?c._events[b]=[c._events[b],v]:c._events[b].push(v):(c._events[b]=v,c._eventsCount++),c}function o(c,f){--c._eventsCount===0?c._events=new r:delete c._events[f]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var f=[],h,d;if(this._eventsCount===0)return f;for(d in h=this._events)t.call(h,d)&&f.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},l.prototype.listeners=function(f){var h=n?n+f:f,d=this._events[h];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,v=d.length,b=new Array(v);p<v;p++)b[p]=d[p].fn;return b},l.prototype.listenerCount=function(f){var h=n?n+f:f,d=this._events[h];return d?d.fn?1:d.length:0},l.prototype.emit=function(f,h,d,p,v,b){var w=n?n+f:f;if(!this._events[w])return!1;var S=this._events[w],E=arguments.length,j,C;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),E){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,h),!0;case 3:return S.fn.call(S.context,h,d),!0;case 4:return S.fn.call(S.context,h,d,p),!0;case 5:return S.fn.call(S.context,h,d,p,v),!0;case 6:return S.fn.call(S.context,h,d,p,v,b),!0}for(C=1,j=new Array(E-1);C<E;C++)j[C-1]=arguments[C];S.fn.apply(S.context,j)}else{var O=S.length,N;for(C=0;C<O;C++)switch(S[C].once&&this.removeListener(f,S[C].fn,void 0,!0),E){case 1:S[C].fn.call(S[C].context);break;case 2:S[C].fn.call(S[C].context,h);break;case 3:S[C].fn.call(S[C].context,h,d);break;case 4:S[C].fn.call(S[C].context,h,d,p);break;default:if(!j)for(N=1,j=new Array(E-1);N<E;N++)j[N-1]=arguments[N];S[C].fn.apply(S[C].context,j)}}return!0},l.prototype.on=function(f,h,d){return a(this,f,h,d,!1)},l.prototype.once=function(f,h,d){return a(this,f,h,d,!0)},l.prototype.removeListener=function(f,h,d,p){var v=n?n+f:f;if(!this._events[v])return this;if(!h)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===h&&(!p||b.once)&&(!d||b.context===d)&&o(this,v);else{for(var w=0,S=[],E=b.length;w<E;w++)(b[w].fn!==h||p&&!b[w].once||d&&b[w].context!==d)&&S.push(b[w]);S.length?this._events[v]=S.length===1?S[0]:S:o(this,v)}return this},l.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(UE)),UE.exports}var Tbe=Nbe();const Pbe=zi(Tbe);var Xm=new Pbe,sj="recharts.syncEvent.tooltip",Hz="recharts.syncEvent.brush",Gk=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!fo(n))return e[n]}},Mbe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},U9=$r({name:"options",initialState:Mbe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Dbe=U9.reducer,{createEventEmitter:Rbe}=U9.actions;function Ibe(e){return e.tooltip.syncInteraction}var Lbe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},H9=$r({name:"chartData",initialState:Lbe,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:qz,setDataStartEndIndexes:zbe,setComputedData:$4e}=H9.actions,$be=H9.reducer,Bbe=["x","y"];function Vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vz(Object(n),!0).forEach(function(r){Fbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fbe(e,t,n){return(t=Ube(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ube(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qbe(e,t){if(e==null)return{};var n,r,i=Vbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Vbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Kbe(){var e=De(FO),t=De(UO),n=Vt(),r=De(JH),i=De(Cs),a=_c(),o=V0(),l=De(c=>c.rootProps.className);x.useEffect(()=>{if(e==null)return Ql;var c=(f,h,d)=>{if(t!==d&&e===f){if(r==="index"){var p;if(o&&h!==null&&h!==void 0&&(p=h.payload)!==null&&p!==void 0&&p.coordinate&&h.payload.sourceViewBox){var v=h.payload.coordinate,{x:b,y:w}=v,S=qbe(v,Bbe),{x:E,y:j,width:C,height:O}=h.payload.sourceViewBox,N=xf(xf({},S),{},{x:o.x+(C?(b-E)/C:0)*o.width,y:o.y+(O?(w-j)/O:0)*o.height});n(xf(xf({},h),{},{payload:xf(xf({},h.payload),{},{coordinate:N})}))}else n(h);return}if(i!=null){var k;if(typeof r=="function"){var T={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},M=r(i,T);k=i[M]}else r==="value"&&(k=i.find(D=>String(D.value)===h.payload.label));var{coordinate:I}=h.payload;if(k==null||h.payload.active===!1||I==null||o==null){n(aj({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:L,y:B}=I,z=Math.min(L,o.x+o.width),G=Math.min(B,o.y+o.height),F={x:a==="horizontal"?k.coordinate:z,y:a==="horizontal"?G:k.coordinate},V=aj({active:h.payload.active,coordinate:F,dataKey:h.payload.dataKey,index:String(k.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(V)}}};return Xm.on(sj,c),()=>{Xm.off(sj,c)}},[l,n,t,e,r,i,a,o])}function Ybe(){var e=De(FO),t=De(UO),n=Vt();x.useEffect(()=>{if(e==null)return Ql;var r=(i,a,o)=>{t!==o&&e===i&&n(zbe(a))};return Xm.on(Hz,r),()=>{Xm.off(Hz,r)}},[n,t,e])}function Xbe(){var e=Vt();x.useEffect(()=>{e(Rbe())},[e]),Kbe(),Ybe()}function Gbe(e,t,n,r,i,a){var o=De(b=>nbe(b,e,t)),l=De(D9),c=De(UO),f=De(FO),h=De(JH),d=De(Ibe),p=d==null?void 0:d.active,v=V0();x.useEffect(()=>{if(!p&&f!=null&&c!=null){var b=aj({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:l});Xm.emit(sj,f,b,c)}},[p,n,o,l,i,r,c,f,h,a,v])}function Kz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kz(Object(n),!0).forEach(function(r){Wbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wbe(e,t,n){return(t=Qbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qbe(e){var t=Zbe(e,"string");return typeof t=="symbol"?t:t+""}function Zbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jbe(e){return e.dataKey}function ewe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(xme,t)}var Xz=[],twe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function q9(e){var t,n,r=Xn(e,twe),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:l,content:c,filterNull:f,isAnimationActive:h,offset:d,payloadUniqBy:p,position:v,reverseDirection:b,useTranslate3d:w,wrapperStyle:S,cursor:E,shared:j,trigger:C,defaultIndex:O,portal:N,axisId:k}=r,T=Vt(),M=typeof O=="number"?String(O):O;x.useEffect(()=>{T(Kxe({shared:j,trigger:C,axisId:k,active:i,defaultIndex:M}))},[T,j,C,k,i,M]);var I=V0(),L=OH(),B=Bxe(j),{activeIndex:z,isActive:G}=(t=De(re=>abe(re,B,C,M)))!==null&&t!==void 0?t:{},F=De(re=>ibe(re,B,C,M)),V=De(re=>$9(re,B,C,M)),D=De(re=>rbe(re,B,C,M)),q=F,X=kbe(),Y=(n=i??G)!==null&&n!==void 0?n:!1,[R,H]=OU([q,Y]),U=B==="axis"?V:void 0;Gbe(B,C,D,U,z,Y);var $=N??X;if($==null||I==null||B==null)return null;var Q=q??Xz;Y||(Q=Xz),f&&Q.length&&(Q=SU(Q.filter(re=>re.value!=null&&(re.hide!==!0||r.includeHidden)),p,Jbe));var J=Q.length>0,ne=Yz(Yz({},r),{},{payload:Q,label:U,active:Y,activeIndex:z,coordinate:D,accessibilityLayer:L}),ae=x.createElement(Nme,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:h,active:Y,coordinate:D,hasPayload:J,offset:d,position:v,reverseDirection:b,useTranslate3d:w,viewBox:I,wrapperStyle:S,lastBoundingBox:R,innerRef:H,hasPortalFromProps:!!N},ewe(c,ne));return x.createElement(x.Fragment,null,Ul.createPortal(ae,$),Y&&x.createElement(Obe,{cursor:E,tooltipEventType:B,coordinate:D,payload:Q,index:z}))}var Gp=e=>null;Gp.displayName="Cell";function nwe(e,t,n){return(t=rwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rwe(e){var t=iwe(e,"string");return typeof t=="symbol"?t:t+""}function iwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class awe{constructor(t){nwe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function Gz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function owe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gz(Object(n),!0).forEach(function(r){swe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gz(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function swe(e,t,n){return(t=lwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lwe(e){var t=uwe(e,"string");return typeof t=="symbol"?t:t+""}function uwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cwe={cacheSize:2e3,enableCache:!0},V9=owe({},cwe),Wz=new awe(V9.cacheSize),fwe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Qz="recharts_measurement_span";function dwe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(l)}var Zz=(e,t)=>{try{var n=document.getElementById(Qz);n||(n=document.createElement("span"),n.setAttribute("id",Qz),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,fwe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},xm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Dp.isSsr)return{width:0,height:0};if(!V9.enableCache)return Zz(t,n);var r=dwe(t,n),i=Wz.get(r);if(i)return i;var a=Zz(t,n);return Wz.set(r,a),a},K9;function hwe(e,t,n){return(t=mwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mwe(e){var t=pwe(e,"string");return typeof t=="symbol"?t:t+""}function pwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jz=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,e3=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gwe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,vwe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ywe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},xwe=["cm","mm","pt","pc","in","Q","px"];function bwe(e){return xwe.includes(e)}var Tf="NaN";function wwe(e,t){return e*ywe[t]}class Cr{static parse(t){var n,[,r,i]=(n=vwe.exec(t))!==null&&n!==void 0?n:[];return r==null?Cr.NaN:new Cr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,fo(t)&&(this.unit=""),n!==""&&!gwe.test(n)&&(this.num=NaN,this.unit=""),bwe(n)&&(this.num=wwe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Cr(NaN,""):new Cr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Cr(NaN,""):new Cr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Cr(NaN,""):new Cr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Cr(NaN,""):new Cr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return fo(this.num)}}K9=Cr;hwe(Cr,"NaN",new K9(NaN,""));function Y9(e){if(e==null||e.includes(Tf))return Tf;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=Jz.exec(t))!==null&&n!==void 0?n:[],o=Cr.parse(r??""),l=Cr.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Tf;t=t.replace(Jz,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,h,d,p]=(f=e3.exec(t))!==null&&f!==void 0?f:[],v=Cr.parse(h??""),b=Cr.parse(p??""),w=d==="+"?v.add(b):v.subtract(b);if(w.isNaN())return Tf;t=t.replace(e3,w.toString())}return t}var t3=/\(([^()]*)\)/;function Swe(e){for(var t=e,n;(n=t3.exec(t))!=null;){var[,r]=n;t=t.replace(t3,Y9(r))}return t}function Ewe(e){var t=e.replace(/\s+/g,"");return t=Swe(t),t=Y9(t),t}function _we(e){try{return Ewe(e)}catch{return Tf}}function HE(e){var t=_we(e.slice(5,-1));return t===Tf?"":t}var Cwe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],jwe=["dx","dy","angle","className","breakAll"];function lj(){return lj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lj.apply(null,arguments)}function n3(e,t){if(e==null)return{};var n,r,i=Awe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Awe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var X9=/[ \f\n\r\t\v\u2028\u2029]+/,G9=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];dn(t)||(n?i=t.toString().split(""):i=t.toString().split(X9));var a=i.map(l=>({word:l,width:xm(l,r).width})),o=n?0:xm(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function W9(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Owe(e){return dn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Q9=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(o),c.width+=l+n;else{var f={words:[o],width:l};i.push(f)}return i},[]),Z9=e=>e.reduce((t,n)=>t.width>n.width?t:n),kwe="…",r3=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),f=G9({breakAll:n,style:r,children:c+kwe});if(!f)return[!1,[]];var h=Q9(f.wordsWithComputedWidth,a,o,l),d=h.length>i||Z9(h).width>Number(a);return[d,h]},Nwe=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,f=Te(a),h=String(o),d=Q9(t,r,n,i);if(!f||i)return d;var p=d.length>a||Z9(d).width>Number(r);if(!p)return d;for(var v=0,b=h.length-1,w=0,S;v<=b&&w<=h.length-1;){var E=Math.floor((v+b)/2),j=E-1,[C,O]=r3(h,j,c,l,a,r,n,i),[N]=r3(h,E,c,l,a,r,n,i);if(!C&&!N&&(v=E+1),C&&N&&(b=E-1),!C&&N){S=O;break}w++}return S||d},i3=e=>{var t=dn(e)?[]:e.toString().split(X9);return[{words:t,width:void 0}]},Twe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Dp.isSsr){var l,c,f=G9({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:h,spaceWidth:d}=f;l=h,c=d}else return i3(r);return Nwe({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return i3(r)},J9="#808080",Pwe={angle:0,breakAll:!1,capHeight:"0.71em",fill:J9,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},hb=x.forwardRef((e,t)=>{var n=Xn(e,Pwe),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:f,verticalAnchor:h}=n,d=n3(n,Cwe),p=x.useMemo(()=>Twe({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:v,dy:b,angle:w,className:S,breakAll:E}=d,j=n3(d,jwe);if(!ho(r)||!ho(i)||p.length===0)return null;var C=Number(r)+(Te(v)?v:0),O=Number(i)+(Te(b)?b:0);if(!bt(C)||!bt(O))return null;var N;switch(h){case"start":N=HE("calc(".concat(o,")"));break;case"middle":N=HE("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:N=HE("calc(".concat(p.length-1," * -").concat(a,")"));break}var k=[],T=p[0];if(c&&T!=null){var M=T.width,{width:I}=d;k.push("scale(".concat(Te(I)&&Te(M)?I/M:1,")"))}return w&&k.push("rotate(".concat(w,", ").concat(C,", ").concat(O,")")),k.length&&(j.transform=k.join(" ")),x.createElement("text",lj({},Gr(j),{ref:t,x:C,y:O,className:Et("recharts-text",S),textAnchor:f,fill:l.includes("url")?J9:l}),p.map((L,B)=>{var z=L.words.join(E?"":" ");return x.createElement("tspan",{x:C,dy:B===0?N:a,key:"".concat(z,"-").concat(B)},z)}))});hb.displayName="Text";function a3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a3(Object(n),!0).forEach(function(r){Mwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mwe(e,t,n){return(t=Dwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dwe(e){var t=Rwe(e,"string");return typeof t=="symbol"?t:t+""}function Rwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iwe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:f}=NO(t),h=a,d=a+(c-f)/2,p=(h+d)/2,v=(c+f)/2,b=h+c/2,w=l>=0?1:-1,S=w*r,E=w>0?"end":"start",j=w>0?"start":"end",C=c>=0?1:-1,O=C*r,N=C>0?"end":"start",k=C>0?"start":"end",T=i;if(n==="top"){var M={x:h+c/2,y:o-S,horizontalAnchor:"middle",verticalAnchor:E};return T&&(M.height=Math.max(o-T.y,0),M.width=c),M}if(n==="bottom"){var I={x:d+f/2,y:o+l+S,horizontalAnchor:"middle",verticalAnchor:j};return T&&(I.height=Math.max(T.y+T.height-(o+l),0),I.width=f),I}if(n==="left"){var L={x:p-O,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"};return T&&(L.width=Math.max(L.x-T.x,0),L.height=l),L}if(n==="right"){var B={x:p+v+O,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return T&&(B.width=Math.max(T.x+T.width-B.x,0),B.height=l),B}var z=T?{width:v,height:l}:{};return n==="insideLeft"?Ya({x:p+O,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},z):n==="insideRight"?Ya({x:p+v-O,y:o+l/2,horizontalAnchor:N,verticalAnchor:"middle"},z):n==="insideTop"?Ya({x:h+c/2,y:o+S,horizontalAnchor:"middle",verticalAnchor:j},z):n==="insideBottom"?Ya({x:d+f/2,y:o+l-S,horizontalAnchor:"middle",verticalAnchor:E},z):n==="insideTopLeft"?Ya({x:h+O,y:o+S,horizontalAnchor:k,verticalAnchor:j},z):n==="insideTopRight"?Ya({x:h+c-O,y:o+S,horizontalAnchor:N,verticalAnchor:j},z):n==="insideBottomLeft"?Ya({x:d+O,y:o+l-S,horizontalAnchor:k,verticalAnchor:E},z):n==="insideBottomRight"?Ya({x:d+f-O,y:o+l-S,horizontalAnchor:N,verticalAnchor:E},z):n&&typeof n=="object"&&(Te(n.x)||uc(n.x))&&(Te(n.y)||uc(n.y))?Ya({x:a+Lr(n.x,v),y:o+Lr(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},z):Ya({x:b,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},z)},Lwe=["labelRef"],zwe=["content"];function o3(e,t){if(e==null)return{};var n,r,i=$we(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $we(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function s3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s3(Object(n),!0).forEach(function(r){Bwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bwe(e,t,n){return(t=Fwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fwe(e){var t=Uwe(e,"string");return typeof t=="symbol"?t:t+""}function Uwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xo.apply(null,arguments)}var e7=x.createContext(null),Hwe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:l}=e,c=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return x.createElement(e7.Provider,{value:c},l)},t7=()=>{var e=x.useContext(e7),t=V0();return e||(t?NO(t):void 0)},qwe=x.createContext(null),Vwe=()=>{var e=x.useContext(qwe),t=De(iq);return e||t},Kwe=e=>{var{value:t,formatter:n}=e,r=dn(e.children)?t:e.children;return typeof n=="function"?n(r):r},Wk=e=>e!=null&&typeof e=="function",Ywe=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Xwe=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:f,outerRadius:h,startAngle:d,endAngle:p,clockWise:v}=i,b=(f+h)/2,w=Ywe(d,p),S=w>=0?1:-1,E,j;switch(t){case"insideStart":E=d+S*a,j=v;break;case"insideEnd":E=p-S*a,j=!v;break;case"end":E=p+S*a,j=v;break;default:throw new Error("Unsupported position ".concat(t))}j=w<=0?j:!j;var C=qn(l,c,b,E),O=qn(l,c,b,E+(j?1:-1)*359),N="M".concat(C.x,",").concat(C.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(j?0:1,`,
    `).concat(O.x,",").concat(O.y),k=dn(e.id)?Im("recharts-radial-line-"):e.id;return x.createElement("text",Xo({},r,{dominantBaseline:"central",className:Et("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:k,d:N})),x.createElement("textPath",{xlinkHref:"#".concat(k)},n))},Gwe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,f=(l+c)/2;if(n==="outside"){var{x:h,y:d}=qn(r,i,o+t,f);return{x:h,y:d,textAnchor:h>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var p=(a+o)/2,{x:v,y:b}=qn(r,i,p,f);return{x:v,y:b,textAnchor:"middle",verticalAnchor:"middle"}},wy=e=>e!=null&&"cx"in e&&Te(e.cx),Wwe={angle:0,offset:5,zIndex:Vn.label,position:"middle",textBreakAll:!1};function Qwe(e){if(!wy(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function dl(e){var t=Xn(e,Wwe),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:f,labelRef:h}=t,d=Vwe(),p=t7(),v=i==="center"?p:d??p,b,w,S;n==null?b=v:wy(n)?b=n:b=NO(n);var E=Qwe(b);if(!b||dn(a)&&dn(o)&&!x.isValidElement(l)&&typeof l!="function")return null;var j=gm(gm({},t),{},{viewBox:b});if(x.isValidElement(l)){var{labelRef:C}=j,O=o3(j,Lwe);return x.cloneElement(l,O)}if(typeof l=="function"){var{content:N}=j,k=o3(j,zwe);if(w=x.createElement(l,k),x.isValidElement(w))return w}else w=Kwe(t);var T=Gr(t);if(wy(b)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Xwe(t,i,w,T,b);S=Gwe(b,t.offset,t.position)}else{if(!E)return null;var M=Iwe({viewBox:E,position:i,offset:t.offset,parentViewBox:wy(r)?void 0:r});S=gm(gm({x:M.x,y:M.y,textAnchor:M.horizontalAnchor,verticalAnchor:M.verticalAnchor},M.width!==void 0?{width:M.width}:{}),M.height!==void 0?{height:M.height}:{})}return x.createElement(di,{zIndex:t.zIndex},x.createElement(hb,Xo({ref:h,className:Et("recharts-label",c)},T,S,{textAnchor:W9(T.textAnchor)?T.textAnchor:S.textAnchor,breakAll:f}),w))}dl.displayName="Label";var Zwe=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(dl,Xo({key:"label-implicit"},r)):ho(e)?x.createElement(dl,Xo({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===dl?x.cloneElement(e,gm({key:"label-implicit"},r)):x.createElement(dl,Xo({key:"label-implicit",content:e},r)):Wk(e)?x.createElement(dl,Xo({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(dl,Xo({},e,{key:"label-implicit"},r)):null};function Jwe(e){var{label:t,labelRef:n}=e,r=t7();return Zwe(t,r,n)||null}var e1e=["valueAccessor"],t1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function Nx(){return Nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nx.apply(null,arguments)}function l3(e,t){if(e==null)return{};var n,r,i=n1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var r1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Owe(t))return t},n7=x.createContext(void 0),r7=n7.Provider,i7=x.createContext(void 0),i1e=i7.Provider;function a1e(){return x.useContext(n7)}function o1e(){return x.useContext(i7)}function Sy(e){var{valueAccessor:t=r1e}=e,n=l3(e,e1e),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=l3(n,t1e),f=a1e(),h=o1e(),d=f||h;return!d||!d.length?null:x.createElement(di,{zIndex:l??Vn.label},x.createElement(ar,{className:"recharts-label-list"},d.map((p,v)=>{var b,w=dn(r)?t(p,v):qt(p.payload,r),S=dn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(dl,Nx({key:"label-".concat(v)},Gr(p),c,S,{fill:(b=n.fill)!==null&&b!==void 0?b:p.fill,parentViewBox:p.parentViewBox,value:w,textBreakAll:o,viewBox:p.viewBox,index:v,zIndex:0}))})))}Sy.displayName="LabelList";function Qk(e){var{label:t}=e;return t?t===!0?x.createElement(Sy,{key:"labelList-implicit"}):x.isValidElement(t)||Wk(t)?x.createElement(Sy,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Sy,Nx({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function uj(){return uj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uj.apply(null,arguments)}var a7=e=>{var{cx:t,cy:n,r,className:i}=e,a=Et("recharts-dot",i);return Te(t)&&Te(n)&&Te(r)?x.createElement("circle",uj({},Di(e),yO(e),{className:a,cx:t,cy:n,r})):null},o7=e=>e.graphicalItems.polarItems,s1e=le([bn,zp],xk),mb=le([o7,kn,s1e],bk),l1e=le([mb],wk),pb=le([l1e,G0],Sk),u1e=le([pb,kn,mb],_k);le([pb,kn,mb],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=qt(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:qt(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var u3=()=>{},c1e=le([pb,kn,mb,ub,bn],Ok),f1e=le([kn,jk,Ak,u3,c1e,u3,Nt,bn],kk),s7=le([kn,Nt,pb,u1e,Lp,bn,f1e],Nk),d1e=le([s7,Fd,eu],Pk),h1e=le([kn,s7,d1e,bn],Dk);le([eu,h1e],oq);var m1e={radiusAxis:{},angleAxis:{}},l7=$r({name:"polarAxis",initialState:m1e,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:B4e,removeRadiusAxis:F4e,addAngleAxis:U4e,removeAngleAxis:H4e}=l7.actions,p1e=l7.reducer;function u7(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function f3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(n),!0).forEach(function(r){g1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g1e(e,t,n){return(t=v1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v1e(e){var t=y1e(e,"string");return typeof t=="symbol"?t:t+""}function y1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var x1e=(e,t)=>t,Zk=le([o7,x1e],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),b1e=[],Jk=(e,t,n)=>(n==null?void 0:n.length)===0?b1e:n,c7=le([G0,Zk,Jk],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>f3(f3({},t.presentationProps),a.props))),i!=null)return i}}),w1e=le([c7,Zk,Jk],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=qt(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Id(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),S1e=le([c7,Zk,Jk,or],(e,t,n,r)=>{if(!(t==null||e==null))return jSe({offset:r,pieSettings:t,displayedData:e,cells:n})}),qE={exports:{}},Ht={};/**
 * @license React
 * react-is.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var d3;function E1e(){if(d3)return Ht;d3=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function b(w){if(typeof w=="object"&&w!==null){var S=w.$$typeof;switch(S){case e:switch(w=w.type,w){case n:case i:case r:case c:case f:case p:return w;default:switch(w=w&&w.$$typeof,w){case o:case l:case d:case h:return w;case a:return w;default:return S}}case t:return S}}}return Ht.ContextConsumer=a,Ht.ContextProvider=o,Ht.Element=e,Ht.ForwardRef=l,Ht.Fragment=n,Ht.Lazy=d,Ht.Memo=h,Ht.Portal=t,Ht.Profiler=i,Ht.StrictMode=r,Ht.Suspense=c,Ht.SuspenseList=f,Ht.isContextConsumer=function(w){return b(w)===a},Ht.isContextProvider=function(w){return b(w)===o},Ht.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Ht.isForwardRef=function(w){return b(w)===l},Ht.isFragment=function(w){return b(w)===n},Ht.isLazy=function(w){return b(w)===d},Ht.isMemo=function(w){return b(w)===h},Ht.isPortal=function(w){return b(w)===t},Ht.isProfiler=function(w){return b(w)===i},Ht.isStrictMode=function(w){return b(w)===r},Ht.isSuspense=function(w){return b(w)===c},Ht.isSuspenseList=function(w){return b(w)===f},Ht.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===c||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===d||w.$$typeof===h||w.$$typeof===o||w.$$typeof===a||w.$$typeof===l||w.$$typeof===v||w.getModuleId!==void 0)},Ht.typeOf=b,Ht}var h3;function _1e(){return h3||(h3=1,qE.exports=E1e()),qE.exports}var C1e=_1e(),m3=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",p3=null,VE=null,f7=e=>{if(e===p3&&Array.isArray(VE))return VE;var t=[];return x.Children.forEach(e,n=>{dn(n)||(C1e.isFragment(n)?t=t.concat(f7(n.props.children)):t.push(n))}),VE=t,p3=e,t};function eN(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>m3(i)):r=[m3(t)],f7(e).forEach(i=>{var a=lc(i,"type.displayName")||lc(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var d7=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,KE={},g3;function j1e(){return g3||(g3=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(KE)),KE}var YE,v3;function A1e(){return v3||(v3=1,YE=j1e().isPlainObject),YE}var O1e=A1e();const k1e=zi(O1e);var y3,x3,b3,w3,S3;function E3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E3(Object(n),!0).forEach(function(r){N1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N1e(e,t,n){return(t=T1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T1e(e){var t=P1e(e,"string");return typeof t=="symbol"?t:t+""}function P1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tx.apply(null,arguments)}function tm(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var C3=(e,t,n,r,i)=>{var a=n-r,o;return o=jn(y3||(y3=tm(["M ",",",""])),e,t),o+=jn(x3||(x3=tm(["L ",",",""])),e+n,t),o+=jn(b3||(b3=tm(["L ",",",""])),e+n-a/2,t+i),o+=jn(w3||(w3=tm(["L ",",",""])),e+n-a/2-r,t+i),o+=jn(S3||(S3=tm(["L ",","," Z"])),e,t),o},M1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},D1e=e=>{var t=Xn(e,M1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:f,animationBegin:h,isUpdateAnimationActive:d}=t,p=x.useRef(null),[v,b]=x.useState(-1),w=x.useRef(i),S=x.useRef(a),E=x.useRef(o),j=x.useRef(n),C=x.useRef(r),O=Ip(e,"trapezoid-");if(x.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var F=p.current.getTotalLength();F&&b(F)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var N=Et("recharts-trapezoid",l);if(!d)return x.createElement("g",null,x.createElement("path",Tx({},Gr(t),{className:N,d:C3(n,r,i,a,o)})));var k=w.current,T=S.current,M=E.current,I=j.current,L=C.current,B="0px ".concat(v===-1?1:v,"px"),z="".concat(v,"px ").concat(v,"px"),G=kH(["strokeDasharray"],f,c);return x.createElement(Rp,{animationId:O,key:O,canBegin:v>0,duration:f,easing:c,isActive:d,begin:h},F=>{var V=ln(k,i,F),D=ln(T,a,F),q=ln(M,o,F),X=ln(I,n,F),Y=ln(L,r,F);p.current&&(w.current=V,S.current=D,E.current=q,j.current=X,C.current=Y);var R=F>0?{transition:G,strokeDasharray:z}:{strokeDasharray:B};return x.createElement("path",Tx({},Gr(t),{className:N,d:C3(X,Y,V,D,q),ref:p,style:_3(_3({},R),t.style)}))})},R1e=["option","shapeType","activeClassName","inActiveClassName"];function I1e(e,t){if(e==null)return{};var n,r,i=L1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function L1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function j3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Px(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j3(Object(n),!0).forEach(function(r){z1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z1e(e,t,n){return(t=$1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $1e(e){var t=B1e(e,"string");return typeof t=="symbol"?t:t+""}function B1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F1e(e,t){return Px(Px({},t),e)}function U1e(e,t){return e==="symbols"}function A3(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(MH,n);case"trapezoid":return x.createElement(D1e,n);case"sector":return x.createElement(LH,n);case"symbols":if(U1e(t))return x.createElement(vO,n);break;case"curve":return x.createElement(RO,n);default:return null}}function H1e(e){return x.isValidElement(e)?e.props:e}function tN(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=I1e(e,R1e),o;if(x.isValidElement(t))o=x.cloneElement(t,Px(Px({},a),H1e(t)));else if(typeof t=="function")o=t(a,a.index);else if(k1e(t)&&typeof t!="boolean"){var l=F1e(t,a);o=x.createElement(A3,{shapeType:n,elementProps:l})}else{var c=a;o=x.createElement(A3,{shapeType:n,elementProps:c})}return a.isActive?x.createElement(ar,{className:r},o):x.createElement(ar,{className:i},o)}var nN=(e,t,n)=>{var r=Vt();return(i,a)=>o=>{e==null||e(i,a,o),r(x9({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},rN=e=>{var t=Vt();return(n,r)=>i=>{e==null||e(n,r,i),t(Yxe())}},iN=(e,t,n)=>{var r=Vt();return(i,a)=>o=>{e==null||e(i,a,o),r(Xxe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function aN(e){var{tooltipEntrySettings:t}=e,n=Vt(),r=Br(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Hxe(t)):i.current!==t&&n(qxe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(Vxe(i.current)),i.current=null)},[n]),null}function h7(e){var{legendPayload:t}=e,n=Vt(),r=Br(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(EH(t)):i.current!==t&&n(_H({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(CH(i.current)),i.current=null)},[n]),null}function q1e(e){var{legendPayload:t}=e,n=Vt(),r=De(Nt),i=x.useRef(null);return x.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(EH(t)):i.current!==t&&n(_H({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(CH(i.current)),i.current=null)},[n]),null}var XE,V1e=()=>{var[e]=x.useState(()=>Im("uid-"));return e},K1e=(XE=Hj.useId)!==null&&XE!==void 0?XE:V1e;function Y1e(e,t){var n=K1e();return t||(e?"".concat(e,"-").concat(n):n)}var X1e=x.createContext(void 0),oN=e=>{var{id:t,type:n,children:r}=e,i=Y1e("recharts-".concat(n),t);return x.createElement(X1e.Provider,{value:i},r(i))},G1e={cartesianItems:[],polarItems:[]},m7=$r({name:"graphicalItems",initialState:G1e,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:nn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ra(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:nn()},removeCartesianGraphicalItem:{reducer(e,t){var n=ra(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:nn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:nn()},removePolarGraphicalItem:{reducer(e,t){var n=ra(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:nn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=ra(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:nn()}}}),{addCartesianGraphicalItem:W1e,replaceCartesianGraphicalItem:Q1e,removeCartesianGraphicalItem:Z1e,addPolarGraphicalItem:J1e,removePolarGraphicalItem:eSe,replacePolarGraphicalItem:tSe}=m7.actions,nSe=m7.reducer,rSe=e=>{var t=Vt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(W1e(e)):n.current!==e&&t(Q1e({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(Z1e(n.current)),n.current=null)},[t]),null},p7=x.memo(rSe),iSe=e=>{var t=Vt(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(J1e(e)):n.current!==e&&t(tSe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(eSe(n.current)),n.current=null)},[t]),null},aSe=x.memo(iSe),oSe=["key"],sSe=["onMouseEnter","onClick","onMouseLeave"],lSe=["id"],uSe=["id"];function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$l.apply(null,arguments)}function gb(e,t){if(e==null)return{};var n,r,i=cSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function O3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O3(Object(n),!0).forEach(function(r){fSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fSe(e,t,n){return(t=dSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dSe(e){var t=hSe(e,"string");return typeof t=="symbol"?t:t+""}function hSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mSe(e){var t=x.useMemo(()=>eN(e.children,Gp),[e.children]),n=De(r=>w1e(r,e.id,t));return n==null?null:x.createElement(q1e,{legendPayload:n})}function pSe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(x.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var gSe=x.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:f,id:h,activeShape:d}=e,p=pSe(d),v=r.map(w=>{var S=w.tooltipPayload;return p==null||S==null?S:S.map(E=>un(un({},E),{},{color:p,fill:p}))}),b={dataDefinedOnItem:v,getPosition:w=>{var S;return(S=r[Number(w)])===null||S===void 0?void 0:S.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:Id(l,t),hide:c,type:f,color:o,unit:"",graphicalItemId:h}};return x.createElement(aN,{tooltipEntrySettings:b})}),vSe=(e,t)=>e>t?"start":e<t?"end":"middle",ySe=(e,t,n)=>Lr(typeof t=="function"?t(e):t,n,n*.8),xSe=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=DH(a,o),c=i+Lr(e.cx,a,a/2),f=r+Lr(e.cy,o,o/2),h=Lr(e.innerRadius,l,0),d=ySe(n,e.outerRadius,l),p=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:f,innerRadius:h,outerRadius:d,maxRadius:p}},bSe=(e,t)=>{var n=pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},wSe=(e,t)=>{if(x.isValidElement(e))return x.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Et("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=gb(t,oSe);return x.createElement(RO,$l({},i,{type:"linear",className:n}))},SSe=(e,t,n)=>{if(x.isValidElement(e))return x.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),x.isValidElement(r)))return r;var i=Et("recharts-pie-label-text",u7(e));return x.createElement(hb,$l({},t,{alignmentBaseline:"middle",className:i}),r)};function ESe(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Di(n),c=oc(i),f=oc(a),h=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((p,v)=>{var b=(p.startAngle+p.endAngle)/2,w=qn(p.cx,p.cy,p.outerRadius+h,b),S=un(un(un(un({},l),p),{},{stroke:"none"},c),{},{index:v,textAnchor:vSe(w.x,p.cx)},w),E=un(un(un(un({},l),p),{},{fill:"none",stroke:p.fill},f),{},{index:v,points:[qn(p.cx,p.cy,p.outerRadius,b),w],key:"line"});return x.createElement(di,{zIndex:Vn.label,key:"label-".concat(p.startAngle,"-").concat(p.endAngle,"-").concat(p.midAngle,"-").concat(v)},x.createElement(ar,null,a&&wSe(a,E),SSe(i,S,qt(p,o))))});return x.createElement(ar,{className:"recharts-pie-labels"},d)}function _Se(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?x.createElement(Qk,{label:i}):x.createElement(ESe,{sectors:t,props:n,showLabels:r})}function CSe(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=De(zl),c=De(qk),f=De(D9),{onMouseEnter:h,onClick:d,onMouseLeave:p}=i,v=gb(i,sSe),b=nN(h,i.dataKey,o),w=rN(p),S=iN(d,i.dataKey,o);return t==null||t.length===0?null:x.createElement(x.Fragment,null,t.map((E,j)=>{if((E==null?void 0:E.startAngle)===0&&(E==null?void 0:E.endAngle)===0&&t.length!==1)return null;var C=f==null||f===o,O=String(j)===l&&(c==null||i.dataKey===c)&&C,N=l?r:null,k=n&&O?n:N,T=un(un({},E),{},{stroke:E.stroke,tabIndex:-1,[lH]:j,[uH]:o});return x.createElement(ar,$l({key:"sector-".concat(E==null?void 0:E.startAngle,"-").concat(E==null?void 0:E.endAngle,"-").concat(E.midAngle,"-").concat(j),tabIndex:-1,className:"recharts-pie-sector"},Op(v,E,j),{onMouseEnter:b(E,j),onMouseLeave:w(E,j),onClick:S(E,j)}),x.createElement(tN,$l({option:a??k,index:j,shapeType:"sector",isActive:O},T)))}))}function jSe(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:f,nameKey:h,tooltipType:d}=n,p=Math.abs(n.minAngle),v=bSe(l,c),b=Math.abs(v),w=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,S=r.filter(k=>qt(k,f,0)!==0).length,E=(b>=360?S:S-1)*w,j=b-S*p-E,C=r.reduce((k,T)=>{var M=qt(T,f,0);return k+(Te(M)?M:0)},0),O;if(C>0){var N;O=r.map((k,T)=>{var M=qt(k,f,0),I=qt(k,h,T),L=xSe(n,a,k),B=(Te(M)?M:0)/C,z,G=un(un({},k),i&&i[T]&&i[T].props),F=G!=null&&"fill"in G&&typeof G.fill=="string"?G.fill:n.fill;T?z=N.endAngle+pr(v)*w*(M!==0?1:0):z=l;var V=z+pr(v)*((M!==0?p:0)+B*j),D=(z+V)/2,q=(L.innerRadius+L.outerRadius)/2,X=[{name:I,value:M,payload:G,dataKey:f,type:d,color:F,fill:F,graphicalItemId:n.id}],Y=qn(L.cx,L.cy,q,D);return N=un(un(un(un({},n.presentationProps),{},{percent:B,cornerRadius:typeof o=="string"?parseFloat(o):o,name:I,tooltipPayload:X,midAngle:D,middleRadius:q,tooltipPosition:Y},G),L),{},{value:M,dataKey:f,startAngle:z,endAngle:V,payload:G,paddingAngle:pr(v)*w}),N})}return O}function ASe(e){var{showLabels:t,sectors:n,children:r}=e,i=x.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return x.createElement(i1e,{value:t?i:void 0},r)}function OSe(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:f,inactiveShape:h,onAnimationStart:d,onAnimationEnd:p}=t,v=Ip(t,"recharts-pie-"),b=n.current,[w,S]=x.useState(!1),E=x.useCallback(()=>{typeof p=="function"&&p(),S(!1)},[p]),j=x.useCallback(()=>{typeof d=="function"&&d(),S(!0)},[d]);return x.createElement(ASe,{showLabels:!w,sectors:i},x.createElement(Rp,{animationId:v,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:j,onAnimationEnd:E,key:v},C=>{var O,N=[],k=i&&i[0],T=(O=k==null?void 0:k.startAngle)!==null&&O!==void 0?O:0;return i==null||i.forEach((M,I)=>{var L=b&&b[I],B=I>0?lc(M,"paddingAngle",0):0;if(L){var z=ln(L.endAngle-L.startAngle,M.endAngle-M.startAngle,C),G=un(un({},M),{},{startAngle:T+B,endAngle:T+z+B});N.push(G),T=G.endAngle}else{var{endAngle:F,startAngle:V}=M,D=ln(0,F-V,C),q=un(un({},M),{},{startAngle:T+B,endAngle:T+D+B});N.push(q),T=q.endAngle}}),n.current=N,x.createElement(ar,null,x.createElement(CSe,{sectors:N,activeShape:f,inactiveShape:h,allOtherPieProps:t,shape:t.shape,id:r}))}),x.createElement(_Se,{showLabels:!w,sectors:i,props:t}),t.children)}var kSe={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Vn.area};function NSe(e){var{id:t}=e,n=gb(e,lSe),{hide:r,className:i,rootTabIndex:a}=e,o=x.useMemo(()=>eN(e.children,Gp),[e.children]),l=De(h=>S1e(h,t,o)),c=x.useRef(null),f=Et("recharts-pie",i);return r||l==null?(c.current=null,x.createElement(ar,{tabIndex:a,className:f})):x.createElement(di,{zIndex:e.zIndex},x.createElement(gSe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),x.createElement(ar,{tabIndex:a,className:f},x.createElement(OSe,{props:un(un({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function TSe(e){var t=Xn(e,kSe),{id:n}=t,r=gb(t,uSe),i=Di(r);return x.createElement(oN,{id:n,type:"pie"},a=>x.createElement(x.Fragment,null,x.createElement(aSe,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),x.createElement(mSe,$l({},r,{id:a})),x.createElement(NSe,$l({},r,{id:a}))))}var g7=TSe;g7.displayName="Pie";var PSe=["points"];function k3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k3(Object(n),!0).forEach(function(r){MSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MSe(e,t,n){return(t=DSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DSe(e){var t=RSe(e,"string");return typeof t=="symbol"?t:t+""}function RSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mx(){return Mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mx.apply(null,arguments)}function ISe(e,t){if(e==null)return{};var n,r,i=LSe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function LSe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zSe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Et(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,l=ISe(a,PSe);return x.createElement(a7,Mx({},l,{className:i}))}function $Se(e,t){return e==null?!1:t?!0:e.length===1}function BSe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:l,clipPathId:c,zIndex:f=Vn.scatter}=e;if(!$Se(t,n))return null;var h=d7(n),d=bue(n),p=t.map((b,w)=>{var S,E,j=GE(GE(GE({r:3},o),d),{},{index:w,cx:(S=b.x)!==null&&S!==void 0?S:void 0,cy:(E=b.y)!==null&&E!==void 0?E:void 0,dataKey:a,value:b.value,payload:b.payload,points:t});return x.createElement(zSe,{key:"dot-".concat(w),option:n,dotProps:j,className:i})}),v={};return l&&c!=null&&(v.clipPath="url(#clipPath-".concat(h?"":"dots-").concat(c,")")),x.createElement(di,{zIndex:f},x.createElement(ar,Mx({className:r},v),p))}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function T3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){FSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FSe(e,t,n){return(t=USe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function USe(e){var t=HSe(e,"string");return typeof t=="symbol"?t:t+""}function HSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v7=0,qSe={xAxis:{},yAxis:{},zAxis:{}},y7=$r({name:"cartesianAxis",initialState:qSe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:nn()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:nn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:nn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:nn()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:nn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:nn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:nn()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:nn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:nn()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...o,r].slice(-3);e.yAxis[n]=T3(T3({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:VSe,replaceXAxis:KSe,removeXAxis:YSe,addYAxis:XSe,replaceYAxis:GSe,removeYAxis:WSe,addZAxis:q4e,replaceZAxis:V4e,removeZAxis:K4e,updateYAxisWidth:QSe}=y7.actions,ZSe=y7.reducer,JSe=le([or],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),eEe=le([JSe,xs,bs],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),sN=()=>De(eEe),tEe=()=>De(U0e);function P3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P3(Object(n),!0).forEach(function(r){nEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nEe(e,t,n){return(t=rEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rEe(e){var t=iEe(e,"string");return typeof t=="symbol"?t:t+""}function iEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aEe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=WE(WE(WE({},l),oc(i)),yO(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,c):typeof i=="function"?f=i(c):f=x.createElement(a7,c),x.createElement(ar,{className:"recharts-active-dot",clipPath:o},f)};function oEe(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Vn.activeDot}=e,l=De(zl),c=tEe();if(t==null||c==null)return null;var f=t.find(h=>c.includes(h.payload));return dn(f)?null:x.createElement(di,{zIndex:o},x.createElement(aEe,{point:f,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var M3=(e,t,n)=>{var r=n??e;if(!dn(r))return Lr(r,t,0)},sEe=(e,t,n)=>{var r={},i=e.filter(J0),a=e.filter(f=>f.stackId==null),o=i.reduce((f,h)=>{var d=f[h.stackId];return d==null&&(d=[]),d.push(h),f[h.stackId]=d,f},r),l=Object.entries(o).map(f=>{var h,[d,p]=f,v=p.map(w=>w.dataKey),b=M3(t,n,(h=p[0])===null||h===void 0?void 0:h.barSize);return{stackId:d,dataKeys:v,barSize:b}}),c=a.map(f=>{var h=[f.dataKey].filter(p=>p!=null),d=M3(t,n,f.barSize);return{stackId:void 0,dataKeys:h,barSize:d}});return[...l,...c]};function D3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D3(Object(n),!0).forEach(function(r){lEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lEe(e,t,n){return(t=uEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uEe(e){var t=cEe(e,"string");return typeof t=="symbol"?t:t+""}function cEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fEe(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var l=Lr(e,n,0,!0),c,f=[];if(bt((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,d=n/o,p=r.reduce((j,C)=>j+(C.barSize||0),0);p+=(o-1)*l,p>=n&&(p-=(o-1)*l,l=0),p>=n&&d>0&&(h=!0,d*=.9,p=o*d);var v=(n-p)/2>>0,b={offset:v-l,size:0};c=r.reduce((j,C)=>{var O,N={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b.offset+b.size+l,size:h?d:(O=C.barSize)!==null&&O!==void 0?O:0}},k=[...j,N];return b=N.position,k},f)}else{var w=Lr(t,n,0,!0);n-2*w-(o-1)*l<=0&&(l=0);var S=(n-2*w-(o-1)*l)/o;S>1&&(S>>=0);var E=bt(i)?Math.min(S,i):S;c=r.reduce((j,C,O)=>[...j,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:w+(S+l)*O+(S-E)/2,size:E}}],f)}return c}}var dEe=(e,t,n,r,i,a,o)=>{var l=dn(o)?t:o,c=fEe(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(f=>Gv(Gv({},f),{},{position:Gv(Gv({},f.position),{},{offset:f.position.offset-i/2})}))),c},hEe=(e,t)=>{var n=KO(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(o=>o.key===n)}}}},mEe=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function pEe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&bt(e.zIndex)?e.zIndex:t}var x7=e=>{var{chartData:t}=e,n=Vt(),r=Br();return x.useEffect(()=>r?()=>{}:(n(qz(t)),()=>{n(qz(void 0))}),[t,n,r]),null},R3={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},b7=$r({name:"brush",initialState:R3,reducers:{setBrushSettings(e,t){return t.payload==null?R3:t.payload}}}),{setBrushSettings:Y4e}=b7.actions,gEe=b7.reducer;function vEe(e){return(e%180+180)%180}var yEe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=vEe(i),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},xEe={dots:[],areas:[],lines:[]},w7=$r({name:"referenceElements",initialState:xEe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ra(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=ra(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=ra(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:X4e,removeDot:G4e,addArea:W4e,removeArea:Q4e,addLine:Z4e,removeLine:J4e}=w7.actions,bEe=w7.reducer,wEe=x.createContext(void 0),SEe=e=>{var{children:t}=e,[n]=x.useState("".concat(Im("recharts"),"-clip")),r=sN();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return x.createElement(wEe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:l,width:o}))),t)};function S7(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function EEe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return yEe(r,n)}function _Ee(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:l}=e;return t===1?{start:r?i:a,end:r?i+o:a+l}:{start:r?i+o:a+l,end:r?i:a}}function Gm(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function CEe(e,t){return S7(e,t+1)}function jEe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:l}=t,c=0,f=1,h=o,d=function(){var b=r==null?void 0:r[c];if(b===void 0)return{v:S7(r,f)};var w=c,S,E=()=>(S===void 0&&(S=n(b,w)),S),j=b.coordinate,C=c===0||Gm(e,j,E,h,l);C||(c=0,h=o,f+=1),C&&(h=j+e*(E()/2+i),c+=f)},p;f<=a.length;)if(p=d(),p)return p.v;return[]}function AEe(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:l,end:c}=t,f=1;f<=o;f++){for(var h=(o-1)%f,d=l,p=!0,v=function(){var O=r[w];if(O==null)return 0;var N=w,k,T=()=>(k===void 0&&(k=n(O,N)),k),M=O.coordinate,I=w===h||Gm(e,M,T,d,c);if(!I)return p=!1,1;I&&(d=M+e*(T()/2+i))},b,w=h;w<o&&(b=v(),!(b!==0&&b===1));w+=f);if(p){for(var S=[],E=h;E<o;E+=f){var j=r[E];j!=null&&S.push(j)}return S}}return[]}function I3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I3(Object(n),!0).forEach(function(r){OEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OEe(e,t,n){return(t=kEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kEe(e){var t=NEe(e,"string");return typeof t=="symbol"?t:t+""}function NEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TEe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:l}=t,{end:c}=t,f=function(p){var v=a[p];if(v==null)return 1;var b=v,w,S=()=>(w===void 0&&(w=n(v,p)),w);if(p===o-1){var E=e*(b.coordinate+e*S()/2-c);a[p]=b=Mr(Mr({},b),{},{tickCoord:E>0?b.coordinate-E*e:b.coordinate})}else a[p]=b=Mr(Mr({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var j=Gm(e,b.tickCoord,S,l,c);j&&(c=b.tickCoord-e*(S()/2+i),a[p]=Mr(Mr({},b),{},{isShow:!0}))}},h=o-1;h>=0;h--)f(h);return a}function PEe(e,t,n,r,i,a){var o=(r||[]).slice(),l=o.length,{start:c,end:f}=t;if(a){var h=r[l-1];if(h!=null){var d=n(h,l-1),p=e*(h.coordinate+e*d/2-f);if(o[l-1]=h=Mr(Mr({},h),{},{tickCoord:p>0?h.coordinate-p*e:h.coordinate}),h.tickCoord!=null){var v=Gm(e,h.tickCoord,()=>d,c,f);v&&(f=h.tickCoord-e*(d/2+i),o[l-1]=Mr(Mr({},h),{},{isShow:!0}))}}}for(var b=a?l-1:l,w=function(j){var C=o[j];if(C==null)return 1;var O=C,N,k=()=>(N===void 0&&(N=n(C,j)),N);if(j===0){var T=e*(O.coordinate-e*k()/2-c);o[j]=O=Mr(Mr({},O),{},{tickCoord:T<0?O.coordinate-T*e:O.coordinate})}else o[j]=O=Mr(Mr({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var M=Gm(e,O.tickCoord,k,c,f);M&&(c=O.tickCoord+e*(k()/2+i),o[j]=Mr(Mr({},O),{},{isShow:!0}))}},S=0;S<b;S++)w(S);return o}function lN(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:l,interval:c,tickFormatter:f,unit:h,angle:d}=e;if(!i||!i.length||!r)return[];if(Te(c)||Dp.isSsr){var p;return(p=CEe(i,Te(c)?c:0))!==null&&p!==void 0?p:[]}var v=[],b=l==="top"||l==="bottom"?"width":"height",w=h&&b==="width"?xm(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(N,k)=>{var T=typeof f=="function"?f(N.value,k):N.value;return b==="width"?EEe(xm(T,{fontSize:t,letterSpacing:n}),w,d):xm(T,{fontSize:t,letterSpacing:n})[b]},E=i[0],j=i[1],C=i.length>=2&&E!=null&&j!=null?pr(j.coordinate-E.coordinate):1,O=_Ee(a,C,b);return c==="equidistantPreserveStart"?jEe(C,O,S,i,o):c==="equidistantPreserveEnd"?AEe(C,O,S,i,o):(c==="preserveStart"||c==="preserveStartEnd"?v=PEe(C,O,S,i,o,c==="preserveStartEnd"):v=TEe(C,O,S,i,o),v.filter(N=>N.isShow))}var MEe=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(h=>{if(h){var d=h.getBoundingClientRect();d.width>o&&(o=d.width)}});var l=n?n.getBoundingClientRect().width:0,c=i+a,f=o+c+l+(n?r:0);return Math.round(f)}return 0},DEe={xAxis:{},yAxis:{}},E7=$r({name:"renderedTicks",initialState:DEe,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:REe,removeRenderedTicks:IEe}=E7.actions,LEe=E7.reducer,zEe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function $Ee(e,t){if(e==null)return{};var n,r,i=BEe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function BEe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pc(){return pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pc.apply(null,arguments)}function L3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L3(Object(n),!0).forEach(function(r){FEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FEe(e,t,n){return(t=UEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UEe(e){var t=HEe(e,"string");return typeof t=="symbol"?t:t+""}function HEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ts={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",zIndex:Vn.axis};function qEe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var f=Cn(Cn(Cn({},c),Di(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!o||a==="bottom"&&o);f=Cn(Cn({},f),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var d=+(a==="left"&&!o||a==="right"&&o);f=Cn(Cn({},f),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return x.createElement("line",pc({},f,{className:Et("recharts-cartesian-axis-line",lc(l,"className"))}))}function VEe(e,t,n,r,i,a,o,l,c){var f,h,d,p,v,b,w=l?-1:1,S=e.tickSize||o,E=Te(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=h=e.coordinate,p=n+ +!l*i,d=p-w*S,b=d-w*c,v=E;break;case"left":d=p=e.coordinate,h=t+ +!l*r,f=h-w*S,v=f-w*c,b=E;break;case"right":d=p=e.coordinate,h=t+ +l*r,f=h+w*S,v=f+w*c,b=E;break;default:f=h=e.coordinate,p=n+ +l*i,d=p+w*S,b=d+w*c,v=E;break}return{line:{x1:f,y1:d,x2:h,y2:p},tick:{x:v,y:b}}}function KEe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function YEe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function XEe(e){var{option:t,tickProps:n,value:r}=e,i,a=Et(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Cn(Cn({},n),{},{className:a}));else if(typeof t=="function")i=t(Cn(Cn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Et(o,u7(t))),i=x.createElement(hb,pc({},n,{className:o}),r)}return i}function GEe(e){var{ticks:t,axisType:n,axisId:r}=e,i=Vt();return x.useEffect(()=>{if(r==null||n==null)return Ql;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(REe({ticks:a,axisId:r,axisType:n})),()=>{i(IEe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var WEe=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:l,padding:c,tickTextProps:f,orientation:h,mirror:d,x:p,y:v,width:b,height:w,tickSize:S,tickMargin:E,fontSize:j,letterSpacing:C,getTicksConfig:O,events:N,axisType:k,axisId:T}=e,M=lN(Cn(Cn({},O),{},{ticks:n}),j,C),I=Di(O),L=oc(r),B=W9(I.textAnchor)?I.textAnchor:KEe(h,d),z=YEe(h,d),G={};typeof i=="object"&&(G=i);var F=Cn(Cn({},I),{},{fill:"none"},G),V=M.map(X=>Cn({entry:X},VEe(X,p,v,b,w,h,S,d,E))),D=V.map(X=>{var{entry:Y,line:R}=X;return x.createElement(ar,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(Y.value,"-").concat(Y.coordinate,"-").concat(Y.tickCoord)},i&&x.createElement("line",pc({},F,R,{className:Et("recharts-cartesian-axis-tick-line",lc(i,"className"))})))}),q=V.map((X,Y)=>{var R,H,{entry:U,tick:$}=X,Q=Cn(Cn(Cn(Cn({verticalAnchor:z},I),{},{textAnchor:B,stroke:"none",fill:a},$),{},{index:Y,payload:U,visibleTicksCount:M.length,tickFormatter:o,padding:c},f),{},{angle:(R=(H=f==null?void 0:f.angle)!==null&&H!==void 0?H:I.angle)!==null&&R!==void 0?R:0}),J=Cn(Cn({},Q),L);return x.createElement(ar,pc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},Op(N,U,Y)),r&&x.createElement(XEe,{option:r,tickProps:J,value:"".concat(typeof o=="function"?o(U.value,Y):U.value).concat(l||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(k,"-ticks")},x.createElement(GEe,{ticks:M,axisId:T,axisType:k}),q.length>0&&x.createElement(di,{zIndex:Vn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(k,"-tick-labels"),ref:t},q)),D.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(k,"-tick-lines")},D))}),QEe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:l,axisType:c,axisId:f}=e,h=$Ee(e,zEe),[d,p]=x.useState(""),[v,b]=x.useState(""),w=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var E;return MEe({ticks:w.current,label:(E=e.labelRef)===null||E===void 0?void 0:E.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=x.useCallback(E=>{if(E){var j=E.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=j;var C=j[0];if(C){var O=window.getComputedStyle(C),N=O.fontSize,k=O.letterSpacing;(N!==d||k!==v)&&(p(N),b(k))}}},[d,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(di,{zIndex:e.zIndex},x.createElement(ar,{className:Et("recharts-cartesian-axis",a)},x.createElement(qEe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Di(e)}),x.createElement(WEe,{ref:S,axisType:c,events:h,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(Hwe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(Jwe,{label:e.label,labelRef:e.labelRef}),e.children)))}),uN=x.forwardRef((e,t)=>{var n=Xn(e,ts);return x.createElement(QEe,pc({},n,{ref:t}))});uN.displayName="CartesianAxis";var ZEe=["x1","y1","x2","y2","key"],JEe=["offset"],e_e=["xAxisId","yAxisId"],t_e=["xAxisId","yAxisId"];function z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z3(Object(n),!0).forEach(function(r){n_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n_e(e,t,n){return(t=r_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r_e(e){var t=i_e(e,"string");return typeof t=="symbol"?t:t+""}function i_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lu(){return Lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lu.apply(null,arguments)}function Dx(e,t){if(e==null)return{};var n,r,i=a_e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function a_e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var o_e=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:l}=e;return x.createElement("rect",{x:r,y:i,ry:l,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function _7(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:l,y2:c,key:f}=n,h=Dx(n,ZEe),d=(i=Di(h))!==null&&i!==void 0?i:{},{offset:p}=d,v=Dx(d,JEe);r=x.createElement("line",Lu({},v,{x1:a,y1:o,x2:l,y2:c,fill:"none",key:f}))}return r}function s_e(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=Dx(e,e_e),c=i.map((f,h)=>{var d=Rr(Rr({},l),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(h),index:h});return x.createElement(_7,{key:"line-".concat(h),option:r,lineItemProps:d})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function l_e(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,l=Dx(e,t_e),c=i.map((f,h)=>{var d=Rr(Rr({},l),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(h),index:h});return x.createElement(_7,{option:r,lineItemProps:d,key:"line-".concat(h)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function u_e(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var f=l.map(d=>Math.round(d+i-i)).sort((d,p)=>d-p);i!==f[0]&&f.unshift(0);var h=f.map((d,p)=>{var v=f[p+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=p%t.length;return x.createElement("rect",{key:"react-".concat(p),y:d,x:r,height:w,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function c_e(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var f=c.map(d=>Math.round(d+i-i)).sort((d,p)=>d-p);i!==f[0]&&f.unshift(0);var h=f.map((d,p)=>{var v=f[p+1],b=v==null,w=b?i+o-d:v-d;if(w<=0)return null;var S=p%n.length;return x.createElement("rect",{key:"react-".concat(p),x:d,y:a,width:w,height:l,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var f_e=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return aH(lN(Rr(Rr(Rr({},ts),n),{},{ticks:oH(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},d_e=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return aH(lN(Rr(Rr(Rr({},ts),n),{},{ticks:oH(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},h_e={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Vn.grid};function cN(e){var t=TO(),n=PO(),r=hH(),i=Rr(Rr({},Xn(e,h_e)),{},{x:Te(e.x)?e.x:r.left,y:Te(e.y)?e.y:r.top,width:Te(e.width)?e.width:r.width,height:Te(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:l,y:c,width:f,height:h,syncWithTicks:d,horizontalValues:p,verticalValues:v}=i,b=Br(),w=De(I=>Tz(I,"xAxis",a,b)),S=De(I=>Tz(I,"yAxis",o,b));if(!mo(f)||!mo(h)||!Te(l)||!Te(c))return null;var E=i.verticalCoordinatesGenerator||f_e,j=i.horizontalCoordinatesGenerator||d_e,{horizontalPoints:C,verticalPoints:O}=i;if((!C||!C.length)&&typeof j=="function"){var N=p&&p.length,k=j({yAxis:S?Rr(Rr({},S),{},{ticks:N?p:S.ticks}):void 0,width:t??f,height:n??h,offset:r},N?!0:d);ax(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(C=k)}if((!O||!O.length)&&typeof E=="function"){var T=v&&v.length,M=E({xAxis:w?Rr(Rr({},w),{},{ticks:T?v:w.ticks}):void 0,width:t??f,height:n??h,offset:r},T?!0:d);ax(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(O=M)}return x.createElement(di,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(o_e,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(u_e,Lu({},i,{horizontalPoints:C})),x.createElement(c_e,Lu({},i,{verticalPoints:O})),x.createElement(s_e,Lu({},i,{offset:r,horizontalPoints:C,xAxis:w,yAxis:S})),x.createElement(l_e,Lu({},i,{offset:r,verticalPoints:O,xAxis:w,yAxis:S}))))}cN.displayName="CartesianGrid";var m_e={},C7=$r({name:"errorBars",initialState:m_e,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:e5e,replaceErrorBar:t5e,removeErrorBar:n5e}=C7.actions,p_e=C7.reducer,g_e=["children"];function v_e(e,t){if(e==null)return{};var n,r,i=y_e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function y_e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var x_e={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},b_e=x.createContext(x_e);function j7(e){var{children:t}=e,n=v_e(e,g_e);return x.createElement(b_e.Provider,{value:n},t)}function fN(e,t){var n,r,i=De(f=>Es(f,e)),a=De(f=>_s(f,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:er.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:tr.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function A7(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=sN(),{needClipX:a,needClipY:o,needClip:l}=fN(t,n);if(!l||!i)return null;var{x:c,y:f,width:h,height:d}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?c:c-h/2,y:o?f:f-d/2,width:a?h:h*2,height:o?d:d*2}))}var O7=(e,t,n,r)=>Ll(e,"xAxis",t,r),k7=(e,t,n,r)=>Il(e,"xAxis",t,r),N7=(e,t,n,r)=>Ll(e,"yAxis",n,r),T7=(e,t,n,r)=>Il(e,"yAxis",n,r),w_e=le([Nt,O7,N7,k7,T7],(e,t,n,r,i)=>ys(e,"xAxis")?cd(t,r,!1):cd(n,i,!1)),S_e=(e,t,n,r,i)=>i;function E_e(e){return e.type==="line"}var __e=le([lb,S_e],(e,t)=>e.filter(E_e).find(n=>n.id===t)),C_e=le([Nt,O7,N7,k7,T7,__e,w_e,IO],(e,t,n,r,i,a,o,l)=>{var{chartData:c,dataStartIndex:f,dataEndIndex:h}=l;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:d,data:p}=a,v;if(p!=null&&p.length>0?v=p:v=c==null?void 0:c.slice(f,h+1),v!=null)return K_e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:v})}});function j_e(e){var t=oc(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),l=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(l)||l<0)&&(l=r),{r:o,strokeWidth:l}}return{r:n,strokeWidth:r}}var A_e=["id"],O_e=["type","layout","connectNulls","needClip","shape"],k_e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Wm(){return Wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wm.apply(null,arguments)}function $3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Za(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$3(Object(n),!0).forEach(function(r){N_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N_e(e,t,n){return(t=T_e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T_e(e){var t=P_e(e,"string");return typeof t=="symbol"?t:t+""}function P_e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dN(e,t){if(e==null)return{};var n,r,i=M_e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function M_e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var D_e=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Id(n,t),payload:e}]},R_e=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:f,id:h}=e,d={dataDefinedOnItem:n,getPosition:Ql,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Id(o,t),hide:l,type:f,color:r,unit:c,graphicalItemId:h}};return x.createElement(aN,{tooltipEntrySettings:d})}),P7=(e,t)=>"".concat(t,"px ").concat(e,"px");function I_e(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var L_e=(e,t,n)=>{var r=n.reduce((p,v)=>p+v,0);if(!r)return P7(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],l=0,c=0;l<n.length;c+=(f=n[l])!==null&&f!==void 0?f:0,++l){var f,h=n[l];if(h!=null&&c+h>a){o=[...n.slice(0,l),a-c];break}}var d=o.length%2===0?[0,t]:[t];return[...I_e(n,i),...o,...d].map(p=>"".concat(p,"px")).join(", ")};function z_e(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:l}=r,c=dN(r,A_e),f=Di(c);return x.createElement(BSe,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:o,clipPathId:t})}function $_e(e){var{showLabels:t,children:n,points:r}=e,i=x.useMemo(()=>r==null?void 0:r.map(a=>{var o,l,c={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Za(Za({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(r7,{value:t?i:void 0},n)}function B3(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:l,connectNulls:c,needClip:f,shape:h}=a,d=dN(a,O_e),p=Za(Za({},Gr(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:o,layout:l,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return x.createElement(x.Fragment,null,(r==null?void 0:r.length)>1&&x.createElement(tN,Wm({shapeType:"curve",option:h},p,{pathRef:n})),x.createElement(z_e,{points:r,clipPathId:t,props:a}))}function B_e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function F_e(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:f,animationDuration:h,animationEasing:d,animateNewValues:p,width:v,height:b,onAnimationEnd:w,onAnimationStart:S}=n,E=i.current,j=Ip(o,"recharts-line-"),C=x.useRef(j),[O,N]=x.useState(!1),k=!O,T=x.useCallback(()=>{typeof w=="function"&&w(),N(!1)},[w]),M=x.useCallback(()=>{typeof S=="function"&&S(),N(!0)},[S]),I=B_e(r.current),L=x.useRef(0);C.current!==j&&(L.current=a.current,C.current=j);var B=L.current;return x.createElement($_e,{points:o,showLabels:k},n.children,x.createElement(Rp,{animationId:j,begin:f,duration:h,isActive:c,easing:d,onAnimationEnd:T,onAnimationStart:M,key:j},z=>{var G=ln(B,I+B,z),F=Math.min(G,I),V;if(c)if(l){var D="".concat(l).split(/[,\s]+/gim).map(Y=>parseFloat(Y));V=L_e(F,I,D)}else V=P7(I,F);else V=l==null?void 0:String(l);if(z>0&&I>0&&(i.current=o,a.current=Math.max(a.current,F)),E){var q=E.length/o.length,X=z===1?o:o.map((Y,R)=>{var H=Math.floor(R*q);if(E[H]){var U=E[H];return Za(Za({},Y),{},{x:ln(U.x,Y.x,z),y:ln(U.y,Y.y,z)})}return p?Za(Za({},Y),{},{x:ln(v*2,Y.x,z),y:ln(b/2,Y.y,z)}):Za(Za({},Y),{},{x:Y.x,y:Y.y})});return i.current=X,x.createElement(B3,{props:n,points:X,clipPathId:t,pathRef:r,strokeDasharray:V})}return x.createElement(B3,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:V})}),x.createElement(Qk,{label:n.label}))}function U_e(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(F_e,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var H_e=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:qt(e.payload,t)}};class q_e extends x.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:l,left:c,width:f,height:h,id:d,needClip:p,zIndex:v}=this.props;if(t)return null;var b=Et("recharts-line",i),w=d,{r:S,strokeWidth:E}=j_e(n),j=d7(n),C=S*2+E,O=p?"url(#clipPath-".concat(j?"":"dots-").concat(w,")"):void 0;return x.createElement(di,{zIndex:v},x.createElement(ar,{className:b},p&&x.createElement("defs",null,x.createElement(A7,{clipPathId:w,xAxisId:a,yAxisId:o}),!j&&x.createElement("clipPath",{id:"clipPath-dots-".concat(w)},x.createElement("rect",{x:c-C/2,y:l-C/2,width:f+C,height:h+C}))),x.createElement(j7,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:H_e,errorBarOffset:0},x.createElement(U_e,{props:this.props,clipPathId:w}))),x.createElement(oEe,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:O}))}}var M7={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Vn.line,type:"linear"};function V_e(e){var t=Xn(e,M7),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,hide:f,isAnimationActive:h,label:d,legendType:p,xAxisId:v,yAxisId:b,id:w}=t,S=dN(t,k_e),{needClip:E}=fN(v,b),j=sN(),C=_c(),O=Br(),N=De(L=>C_e(L,v,b,O,w));if(C!=="horizontal"&&C!=="vertical"||N==null||j==null)return null;var{height:k,width:T,x:M,y:I}=j;return x.createElement(q_e,Wm({},S,{id:w,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:h,hide:f,label:d,legendType:p,xAxisId:v,yAxisId:b,points:N,layout:C,height:k,width:T,left:M,top:I,needClip:E}))}function K_e(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((f,h)=>{var d=qt(f,o);if(t==="horizontal"){var p=SI({axis:n,ticks:i,bandSize:l,entry:f,index:h}),v=dn(d)?null:r.scale.map(d);return{x:p,y:v??null,value:d,payload:f}}var b=dn(d)?null:n.scale.map(d),w=SI({axis:r,ticks:a,bandSize:l,entry:f,index:h});return b==null||w==null?null:{x:b,y:w,value:d,payload:f}}).filter(Boolean)}function Y_e(e){var t=Xn(e,M7),n=Br();return x.createElement(oN,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(h7,{legendPayload:D_e(t)}),x.createElement(R_e,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(p7,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(V_e,Wm({},t,{id:r}))))}var D7=x.memo(Y_e,Ld);D7.displayName="Line";function Ac(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:v7}function Oc(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:v7}var X_e="Invariant failed";function G_e(e,t){throw new Error(X_e)}function cj(){return cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cj.apply(null,arguments)}function hN(e){return x.createElement(tN,cj({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var W_e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Te(t))return t;var a=Te(r)||dn(r);return a?t(r,i):(a||G_e(),n)}},Q_e=(e,t,n)=>n,Z_e=(e,t)=>t,Wp=le([lb,Z_e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),J_e=le([Wp],e=>e==null?void 0:e.maxBarSize),eCe=(e,t,n,r)=>r,tCe=le([Nt,lb,Ac,Oc,Q_e],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),nCe=(e,t,n)=>{var r=Nt(e),i=Ac(e,t),a=Oc(e,t);if(!(i==null||a==null))return r==="horizontal"?ij(e,"yAxis",a,n):ij(e,"xAxis",i,n)},rCe=(e,t)=>{var n=Nt(e),r=Ac(e,t),i=Oc(e,t);if(!(r==null||i==null))return n==="horizontal"?Nz(e,"xAxis",r):Nz(e,"yAxis",i)},iCe=le([tCe,Kpe,rCe],sEe),aCe=(e,t,n)=>{var r,i,a=Wp(e,t);if(a==null)return 0;var o=Ac(e,t),l=Oc(e,t);if(o==null||l==null)return 0;var c=Nt(e),f=WH(e),{maxBarSize:h}=a,d=dn(h)?f:h,p,v;return c==="horizontal"?(p=Ll(e,"xAxis",o,n),v=Il(e,"xAxis",o,n)):(p=Ll(e,"yAxis",l,n),v=Il(e,"yAxis",l,n)),(r=(i=cd(p,v,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},R7=(e,t,n)=>{var r=Nt(e),i=Ac(e,t),a=Oc(e,t);if(!(i==null||a==null)){var o,l;return r==="horizontal"?(o=Ll(e,"xAxis",i,n),l=Il(e,"xAxis",i,n)):(o=Ll(e,"yAxis",a,n),l=Il(e,"yAxis",a,n)),cd(o,l)}},oCe=le([iCe,WH,Vpe,QH,aCe,R7,J_e],dEe),sCe=(e,t,n)=>{var r=Ac(e,t);if(r!=null)return Ll(e,"xAxis",r,n)},lCe=(e,t,n)=>{var r=Oc(e,t);if(r!=null)return Ll(e,"yAxis",r,n)},uCe=(e,t,n)=>{var r=Ac(e,t);if(r!=null)return Il(e,"xAxis",r,n)},cCe=(e,t,n)=>{var r=Oc(e,t);if(r!=null)return Il(e,"yAxis",r,n)},fCe=le([oCe,Wp],mEe),dCe=le([nCe,Wp],hEe),hCe=le([or,AO,sCe,lCe,uCe,cCe,fCe,Nt,$pe,R7,dCe,Wp,eCe],(e,t,n,r,i,a,o,l,c,f,h,d,p)=>{var{chartData:v,dataStartIndex:b,dataEndIndex:w}=c;if(!(d==null||o==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:S}=d,E;if(S!=null&&S.length>0?E=S:E=v==null?void 0:v.slice(b,w+1),E!=null)return FCe({layout:l,barSettings:d,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:E,offset:e,cells:p,dataStartIndex:b})}}),mCe=["index"];function fj(){return fj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fj.apply(null,arguments)}function pCe(e,t){if(e==null)return{};var n,r,i=gCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var I7=x.createContext(void 0),vCe=e=>{var t=x.useContext(I7);if(t!=null)return t.stackId;if(e!=null)return zde(e)},yCe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),xCe=e=>{var t=x.useContext(I7);if(t!=null){var{stackId:n}=t;return"url(#".concat(yCe(n,e),")")}},L7=e=>{var{index:t}=e,n=pCe(e,mCe),r=xCe(t);return x.createElement(ar,fj({className:"recharts-bar-stack-layer",clipPath:r},n))},bCe=["onMouseEnter","onMouseLeave","onClick"],wCe=["value","background","tooltipPosition"],SCe=["id"],ECe=["onMouseEnter","onClick","onMouseLeave"];function Bl(){return Bl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bl.apply(null,arguments)}function F3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F3(Object(n),!0).forEach(function(r){_Ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Ce(e,t,n){return(t=CCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CCe(e){var t=jCe(e,"string");return typeof t=="symbol"?t:t+""}function jCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rx(e,t){if(e==null)return{};var n,r,i=ACe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ACe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var OCe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Id(n,t),payload:e}]},kCe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:l,tooltipType:c,id:f}=e,h={dataDefinedOnItem:void 0,getPosition:Ql,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Id(a,t),hide:o,type:c,color:i,unit:l,graphicalItemId:f}};return x.createElement(aN,{tooltipEntrySettings:h})});function NCe(e){var t=De(zl),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:l,onClick:c}=a,f=Rx(a,bCe),h=nN(o,r,a.id),d=rN(l),p=iN(c,r,a.id);if(!i||n==null)return null;var v=oc(i);return x.createElement(di,{zIndex:pEe(i,Vn.barBackground)},n.map((b,w)=>{var{value:S,background:E,tooltipPosition:j}=b,C=Rx(b,wCe);if(!E)return null;var O=h(b,w),N=d(b,w),k=p(b,w),T=Vr(Vr(Vr(Vr(Vr({option:i,isActive:String(w)===t},C),{},{fill:"#eee"},E),v),Op(f,b,w)),{},{onMouseEnter:O,onMouseLeave:N,onClick:k,dataKey:r,index:w,className:"recharts-bar-background-rectangle"});return x.createElement(hN,Bl({key:"background-bar-".concat(w)},T))}))}function TCe(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Vr(Vr({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return x.createElement(r7,{value:t?i:void 0},n)}function PCe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,l=De(zl),c=De(qk),f=n&&String(i.originalDataIndex)===l&&(c==null||o===c),[h,d]=x.useState(!1),[p,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(d(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var b=x.useCallback(()=>{f||d(!1)},[f]),w=f&&p,S=f||h,E;f?n===!0?E=t:E=n:E=t;var j=x.createElement(hN,Bl({},r,{name:String(r.name)},i,{isActive:w,option:E,index:a,dataKey:o,onTransitionEnd:b}));return S?x.createElement(di,{zIndex:Vn.activeBar},x.createElement(L7,{index:i.originalDataIndex},j)):j}function MCe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(hN,Bl({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function DCe(e){var t,{data:n,props:r}=e,i=(t=Di(r))!==null&&t!==void 0?t:{},{id:a}=i,o=Rx(i,SCe),{shape:l,dataKey:c,activeBar:f}=r,{onMouseEnter:h,onClick:d,onMouseLeave:p}=r,v=Rx(r,ECe),b=nN(h,c,a),w=rN(p),S=iN(d,c,a);return n?x.createElement(x.Fragment,null,n.map((E,j)=>x.createElement(L7,Bl({index:E.originalDataIndex,key:"rectangle-".concat(E==null?void 0:E.x,"-").concat(E==null?void 0:E.y,"-").concat(E==null?void 0:E.value,"-").concat(j),className:"recharts-bar-rectangle"},Op(v,E,j),{onMouseEnter:b(E,j),onMouseLeave:w(E,j),onClick:S(E,j)}),f?x.createElement(PCe,{shape:l,activeBar:f,baseProps:o,entry:E,index:j,dataKey:c}):x.createElement(MCe,{shape:l,baseProps:o,entry:E,index:j,dataKey:c})))):null}function RCe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:f,onAnimationStart:h}=t,d=n.current,p=Ip(t,"recharts-bar-"),[v,b]=x.useState(!1),w=!v,S=x.useCallback(()=>{typeof f=="function"&&f(),b(!1)},[f]),E=x.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);return x.createElement(TCe,{showLabels:w,rects:r},x.createElement(Rp,{animationId:p,begin:o,duration:l,isActive:a,easing:c,onAnimationEnd:S,onAnimationStart:E,key:p},j=>{var C=j===1?r:r==null?void 0:r.map((O,N)=>{var k=d&&d[N];if(k)return Vr(Vr({},O),{},{x:ln(k.x,O.x,j),y:ln(k.y,O.y,j),width:ln(k.width,O.width,j),height:ln(k.height,O.height,j)});if(i==="horizontal"){var T=ln(0,O.height,j),M=ln(O.stackedBarStart,O.y,j);return Vr(Vr({},O),{},{y:M,height:T})}var I=ln(0,O.width,j),L=ln(O.stackedBarStart,O.x,j);return Vr(Vr({},O),{},{width:I,x:L})});return j>0&&(n.current=C??null),C==null?null:x.createElement(ar,null,x.createElement(DCe,{props:t,data:C}))}),x.createElement(Qk,{label:t.label}),t.children)}function ICe(e){var t=x.useRef(null);return x.createElement(RCe,{previousRectanglesRef:t,props:e})}var z7=0,LCe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:qt(e,t)}};class zCe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:l,background:c,id:f}=this.props;if(t||n==null)return null;var h=Et("recharts-bar",i),d=f;return x.createElement(ar,{className:h,id:f},l&&x.createElement("defs",null,x.createElement(A7,{clipPathId:d,xAxisId:a,yAxisId:o})),x.createElement(ar,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},x.createElement(NCe,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),x.createElement(ICe,this.props)))}}var $Ce={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:z7,xAxisId:0,yAxisId:0,zIndex:Vn.bar};function BCe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:f,isAnimationActive:h}=e,{needClip:d}=fN(t,n),p=_c(),v=Br(),b=eN(e.children,Gp),w=De(j=>hCe(j,e.id,v,b));if(p!=="vertical"&&p!=="horizontal")return null;var S,E=w==null?void 0:w[0];return E==null||E.height==null||E.width==null?S=0:S=p==="vertical"?E.height/2:E.width/2,x.createElement(j7,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:LCe,errorBarOffset:S},x.createElement(zCe,Bl({},e,{layout:p,needClip:d,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:f,isAnimationActive:h})))}function FCe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:f,yAxisTicks:h,stackedData:d,displayedData:p,offset:v,cells:b,parentViewBox:w,dataStartIndex:S}=e,E=t==="horizontal"?c:l,j=d?E.scale.domain():null,C=$de({numericAxis:E}),O=E.scale.map(C);return p.map((N,k)=>{var T,M,I,L,B,z;if(d){var G=d[k+S];if(G==null)return null;T=Mde(G,j)}else T=qt(N,n),Array.isArray(T)||(T=[C,T]);var F=W_e(r,z7)(T[1],k);if(t==="horizontal"){var V,D=c.scale.map(T[0]),q=c.scale.map(T[1]);if(D==null||q==null)return null;M=EI({axis:l,ticks:f,bandSize:o,offset:a.offset,entry:N,index:k}),I=(V=q??D)!==null&&V!==void 0?V:void 0,L=a.size;var X=D-q;if(B=fo(X)?0:X,z={x:M,y:v.top,width:L,height:v.height},Math.abs(F)>0&&Math.abs(B)<Math.abs(F)){var Y=pr(B||F)*(Math.abs(F)-Math.abs(B));I-=Y,B+=Y}}else{var R=l.scale.map(T[0]),H=l.scale.map(T[1]);if(R==null||H==null)return null;if(M=R,I=EI({axis:c,ticks:h,bandSize:o,offset:a.offset,entry:N,index:k}),L=H-R,B=a.size,z={x:v.left,y:I,width:v.width,height:B},Math.abs(F)>0&&Math.abs(L)<Math.abs(F)){var U=pr(L||F)*(Math.abs(F)-Math.abs(L));L+=U}}if(M==null||I==null||L==null||B==null||!i&&(L===0||B===0))return null;var $=Vr(Vr({},N),{},{stackedBarStart:O,x:M,y:I,width:L,height:B,value:d?T:T[1],payload:N,background:z,tooltipPosition:{x:M+L/2,y:I+B/2},parentViewBox:w,originalDataIndex:k},b&&b[k]&&b[k].props);return $}).filter(Boolean)}function UCe(e){var t=Xn(e,$Ce),n=vCe(t.stackId),r=Br();return x.createElement(oN,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(h7,{legendPayload:OCe(t)}),x.createElement(kCe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),x.createElement(p7,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(di,{zIndex:t.zIndex},x.createElement(BCe,Bl({},t,{id:i})))))}var dj=x.memo(UCe,Ld);dj.displayName="Bar";var HCe=["domain","range"],qCe=["domain","range"];function U3(e,t){if(e==null)return{};var n,r,i=VCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function H3(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function $7(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=U3(e,HCe),{domain:a,range:o}=t,l=U3(t,qCe);return!H3(n,a)||!H3(r,o)?!1:Ld(i,l)}var KCe=["type"],YCe=["dangerouslySetInnerHTML","ticks","scale"],XCe=["id","scale"];function hj(){return hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hj.apply(null,arguments)}function q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function V3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3(Object(n),!0).forEach(function(r){GCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GCe(e,t,n){return(t=WCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WCe(e){var t=QCe(e,"string");return typeof t=="symbol"?t:t+""}function QCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mj(e,t){if(e==null)return{};var n,r,i=ZCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function JCe(e){var t=Vt(),n=x.useRef(null),r=mH(),{type:i}=e,a=mj(e,KCe),o=Q0(r,"xAxis",i),l=x.useMemo(()=>{if(o!=null)return V3(V3({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{l!=null&&(n.current===null?t(VSe(l)):n.current!==l&&t(KSe({prev:n.current,next:l})),n.current=l)},[l,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(YSe(n.current)),n.current=null)},[t]),null}var eje=e=>{var{xAxisId:t,className:n}=e,r=De(AO),i=Br(),a="xAxis",o=De(E=>h9(E,a,t,i)),l=De(E=>c9(E,t)),c=De(E=>Txe(E,t)),f=De(E=>Vq(E,t));if(l==null||c==null||f==null)return null;var{dangerouslySetInnerHTML:h,ticks:d,scale:p}=e,v=mj(e,YCe),{id:b,scale:w}=f,S=mj(f,XCe);return x.createElement(uN,hj({},v,S,{x:c.x,y:c.y,width:l.width,height:l.height,className:Et("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},tje={allowDataOverflow:er.allowDataOverflow,allowDecimals:er.allowDecimals,allowDuplicatedCategory:er.allowDuplicatedCategory,angle:er.angle,axisLine:ts.axisLine,height:er.height,hide:!1,includeHidden:er.includeHidden,interval:er.interval,label:!1,minTickGap:er.minTickGap,mirror:er.mirror,orientation:er.orientation,padding:er.padding,reversed:er.reversed,scale:er.scale,tick:er.tick,tickCount:er.tickCount,tickLine:ts.tickLine,tickSize:ts.tickSize,type:er.type,niceTicks:er.niceTicks,xAxisId:0},nje=e=>{var t=Xn(e,tje);return x.createElement(x.Fragment,null,x.createElement(JCe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(eje,t))},mN=x.memo(nje,$7);mN.displayName="XAxis";var rje=["type"],ije=["dangerouslySetInnerHTML","ticks","scale"],aje=["id","scale"];function pj(){return pj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pj.apply(null,arguments)}function K3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Y3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K3(Object(n),!0).forEach(function(r){oje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oje(e,t,n){return(t=sje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sje(e){var t=lje(e,"string");return typeof t=="symbol"?t:t+""}function lje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gj(e,t){if(e==null)return{};var n,r,i=uje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function cje(e){var t=Vt(),n=x.useRef(null),r=mH(),{type:i}=e,a=gj(e,rje),o=Q0(r,"yAxis",i),l=x.useMemo(()=>{if(o!=null)return Y3(Y3({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{l!=null&&(n.current===null?t(XSe(l)):n.current!==l&&t(GSe({prev:n.current,next:l})),n.current=l)},[l,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(WSe(n.current)),n.current=null)},[t]),null}function fje(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),l=De(AO),c=Br(),f=Vt(),h="yAxis",d=De(k=>f9(k,t)),p=De(k=>Mxe(k,t)),v=De(k=>h9(k,h,t,c)),b=De(k=>Kq(k,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!d||Wk(i)||x.isValidElement(i)||b==null)){var k=a.current;if(k){var T=k.getCalculatedWidth();Math.round(d.width)!==Math.round(T)&&f(QSe({id:t,width:T}))}}},[v,d,f,i,t,r,b]),d==null||p==null||b==null)return null;var{dangerouslySetInnerHTML:w,ticks:S,scale:E}=e,j=gj(e,ije),{id:C,scale:O}=b,N=gj(b,aje);return x.createElement(uN,pj({},j,N,{ref:a,labelRef:o,x:p.x,y:p.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:Et("recharts-".concat(h," ").concat(h),n),viewBox:l,ticks:v,axisType:h,axisId:t}))}var dje={allowDataOverflow:tr.allowDataOverflow,allowDecimals:tr.allowDecimals,allowDuplicatedCategory:tr.allowDuplicatedCategory,angle:tr.angle,axisLine:ts.axisLine,hide:!1,includeHidden:tr.includeHidden,interval:tr.interval,label:!1,minTickGap:tr.minTickGap,mirror:tr.mirror,orientation:tr.orientation,padding:tr.padding,reversed:tr.reversed,scale:tr.scale,tick:tr.tick,tickCount:tr.tickCount,tickLine:ts.tickLine,tickSize:ts.tickSize,type:tr.type,niceTicks:tr.niceTicks,width:tr.width,yAxisId:0},hje=e=>{var t=Xn(e,dje);return x.createElement(x.Fragment,null,x.createElement(cje,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(fje,t))},pN=x.memo(hje,$7);pN.displayName="YAxis";var mje=(e,t)=>t,gN=le([mje,Nt,iq,yr,N9,Cs,tbe,or],lbe);function pje(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function vN(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(pje(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>o(l.clientX,l.clientY)):o(e.clientX,e.clientY)}var B7=Ri("mouseClick"),F7=Np();F7.startListening({actionCreator:B7,effect:(e,t)=>{var n=e.payload,r=gN(t.getState(),vN(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(Gxe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var vj=Ri("mouseMove"),U7=Np(),bf=null,_u=null,QE=null;U7.startListening({actionCreator:vj,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||(a==null?void 0:a.includes("mousemove"));bf!==null&&(cancelAnimationFrame(bf),bf=null),_u!==null&&(typeof i!="number"||!o)&&(clearTimeout(_u),_u=null),QE=vN(n);var l=()=>{var c=t.getState(),f=zk(c,c.tooltip.settings.shared);if(!QE){bf=null,_u=null;return}if(f==="axis"){var h=gN(c,QE);(h==null?void 0:h.activeIndex)!=null?t.dispatch(w9({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate})):t.dispatch(b9())}bf=null,_u=null};if(!o){l();return}i==="raf"?bf=requestAnimationFrame(l):typeof i=="number"&&_u===null&&(_u=setTimeout(l,i))}});function gje(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var X3={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},H7=$r({name:"rootProps",initialState:X3,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:X3.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),vje=H7.reducer,{updateOptions:yje}=H7.actions,xje=null,bje={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},q7=$r({name:"polarOptions",initialState:xje,reducers:bje}),{updatePolarOptions:wje}=q7.actions,Sje=q7.reducer,V7=Ri("keyDown"),K7=Ri("focus"),Y7=Ri("blur"),vb=Np(),wf=null,Cu=null,Wv=null;vb.startListening({actionCreator:V7,effect:(e,t)=>{Wv=e.payload,wf!==null&&(cancelAnimationFrame(wf),wf=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Cu!==null&&(typeof r!="number"||!a)&&(clearTimeout(Cu),Cu=null);var o=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:f}=l.tooltip,h=Wv;if(h!=="ArrowRight"&&h!=="ArrowLeft"&&h!=="Enter")return;var d=$k(f,Vd(l),Vp(l),Yp(l)),p=d==null?-1:Number(d);if(!Number.isFinite(p)||p<0)return;var v=Cs(l);if(h==="Enter"){var b=kx(l,"axis","hover",String(f.index));t.dispatch(Ox({active:!f.active,activeIndex:f.index,activeCoordinate:b}));return}var w=zxe(l),S=w==="left-to-right"?1:-1,E=h==="ArrowRight"?1:-1,j=p+E*S;if(v==null||j>=v.length||j<0)return;var C=kx(l,"axis","hover",String(j));t.dispatch(Ox({active:!0,activeIndex:j.toString(),activeCoordinate:C}))}finally{wf=null,Cu=null}};if(!a){o();return}r==="raf"?wf=requestAnimationFrame(o):typeof r=="number"&&Cu===null&&(o(),Wv=null,Cu=setTimeout(()=>{Wv?o():(Cu=null,wf=null)},r))}});vb.startListening({actionCreator:K7,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=kx(n,"axis","hover",String(a));t.dispatch(Ox({active:!0,activeIndex:a,activeCoordinate:o}))}}}});vb.startListening({actionCreator:Y7,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Ox({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function X7(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Qi=Ri("externalEvent"),G7=Np(),Qv=new Map,nm=new Map,ZE=new Map;G7.startListening({actionCreator:Qi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=X7(r);ZE.set(i,{handler:n,reactEvent:a});var o=Qv.get(i);o!==void 0&&(cancelAnimationFrame(o),Qv.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:f}=l.eventSettings,h=f,d=h==="all"||(h==null?void 0:h.includes(i)),p=nm.get(i);p!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(p),nm.delete(i));var v=()=>{var S=ZE.get(i);try{if(!S)return;var{handler:E,reactEvent:j}=S,C=t.getState(),O={activeCoordinate:$0e(C),activeDataKey:qk(C),activeIndex:zl(C),activeLabel:M9(C),activeTooltipIndex:zl(C),isTooltipActive:B0e(C)};E&&E(O,j)}finally{Qv.delete(i),nm.delete(i),ZE.delete(i)}};if(!d){v();return}if(c==="raf"){var b=requestAnimationFrame(v);Qv.set(i,b)}else if(typeof c=="number"){if(!nm.has(i)){v();var w=setTimeout(v,c);nm.set(i,w)}}else v()}}});var Eje=le([Hd],e=>e.tooltipItemPayloads),_je=le([Eje,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),W7=Ri("touchMove"),Q7=Np(),ju=null,al=null,G3=null,rm=null;Q7.startListening({actionCreator:W7,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){rm=X7(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");ju!==null&&(cancelAnimationFrame(ju),ju=null),al!==null&&(typeof i!="number"||!o)&&(clearTimeout(al),al=null),G3=Array.from(n.touches).map(c=>vN({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(rm!=null){var c=t.getState(),f=zk(c,c.tooltip.settings.shared);if(f==="axis"){var h,d=(h=G3)===null||h===void 0?void 0:h[0];if(d==null){ju=null,al=null;return}var p=gN(c,d);(p==null?void 0:p.activeIndex)!=null&&t.dispatch(w9({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate}))}else if(f==="item"){var v,b=rm.touches[0];if(document.elementFromPoint==null||b==null)return;var w=document.elementFromPoint(b.clientX,b.clientY);if(!w||!w.getAttribute)return;var S=w.getAttribute(lH),E=(v=w.getAttribute(uH))!==null&&v!==void 0?v:void 0,j=qd(c).find(N=>N.id===E);if(S==null||j==null||E==null)return;var{dataKey:C}=j,O=_je(c,S,E);t.dispatch(x9({activeDataKey:C,activeIndex:S,activeCoordinate:O,activeGraphicalItemId:E}))}ju=null,al=null}};if(!o){l();return}i==="raf"?ju=requestAnimationFrame(l):typeof i=="number"&&al===null&&(l(),rm=null,al=setTimeout(()=>{rm?l():(al=null,ju=null)},i))}}});var yN={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Z7=$r({name:"eventSettings",initialState:yN,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Cje}=Z7.actions,jje=Z7.reducer,Aje=NU({brush:gEe,cartesianAxis:ZSe,chartData:$be,errorBars:p_e,eventSettings:jje,graphicalItems:nSe,layout:Ode,legend:Rhe,options:Dbe,polarAxis:p1e,polarOptions:Sje,referenceElements:bEe,renderedTicks:LEe,rootProps:vje,tooltip:Wxe,zIndex:Sbe}),Oje=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Jfe({reducer:Aje,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([F7.middleware,U7.middleware,vb.middleware,G7.middleware,Q7.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(VU({type:"raf"}))},devTools:{serialize:{replacer:gje},name:"recharts-".concat(n)}})};function J7(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Br(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=Oje(t,r));var o=bO;return x.createElement(Qhe,{context:o,store:a.current},n)}function kje(e){var{layout:t,margin:n}=e,r=Vt(),i=Br();return x.useEffect(()=>{i||(r(Cde(t)),r(_de(n)))},[r,i,t,n]),null}var eV=x.memo(kje,Ld);function tV(e){var t=Vt();return x.useEffect(()=>{t(yje(e))},[t,e]),null}var Nje=e=>{var t=Vt();return x.useEffect(()=>{t(Cje(e))},[t,e]),null},nV=x.memo(Nje,Ld);function W3(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=Vt();return x.useLayoutEffect(()=>(r.current&&i(bbe({zIndex:t,element:r.current,isPanorama:n})),()=>{i(wbe({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Q3(e){var{children:t,isPanorama:n}=e,r=De(cbe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return x.createElement(x.Fragment,null,i.map(o=>x.createElement(W3,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(W3,{key:o,zIndex:o,isPanorama:n})))}var Tje=["children"];function Pje(e,t){if(e==null)return{};var n,r,i=Mje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ix(){return Ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ix.apply(null,arguments)}var Dje={width:"100%",height:"100%",display:"block"},Rje=x.forwardRef((e,t)=>{var n=TO(),r=PO(),i=OH();if(!mo(n)||!mo(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=e,f,h;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?h=o.role:h=i?"application":void 0),x.createElement(cO,Ix({},o,{title:l,desc:c,role:h,tabIndex:f,width:n,height:r,style:Dje,ref:t}),a)}),Ije=e=>{var{children:t}=e,n=De(q0);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(cO,{width:r,height:i,x:o,y:a},t)},Z3=x.forwardRef((e,t)=>{var{children:n}=e,r=Pje(e,Tje),i=Br();return i?x.createElement(Ije,null,x.createElement(Q3,{isPanorama:!0},n)):x.createElement(Rje,Ix({ref:t},r),x.createElement(Q3,{isPanorama:!1},n))});function Lje(){var e=Vt(),[t,n]=x.useState(null),r=De(Vde);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;bt(a)&&a!==r&&e(Ade(a))}},[t,e,r]),n}function J3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J3(Object(n),!0).forEach(function(r){$je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $je(e,t,n){return(t=Bje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bje(e){var t=Fje(e,"string");return typeof t=="symbol"?t:t+""}function Fje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nl(){return Nl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nl.apply(null,arguments)}var Uje=()=>(Xbe(),null);function Lx(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Hje=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:Lx((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Lx((r=e.style)===null||r===void 0?void 0:r.height)}),l=x.useCallback((f,h)=>{o(d=>{var p=Math.round(f),v=Math.round(h);return d.containerWidth===p&&d.containerHeight===v?d:{containerWidth:p,containerHeight:v}})},[]),c=x.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null&&typeof ResizeObserver<"u"){var{width:h,height:d}=f.getBoundingClientRect();l(h,d);var p=b=>{var w=b[0];if(w!=null){var{width:S,height:E}=w.contentRect;l(S,E)}},v=new ResizeObserver(p);v.observe(f),i.current=v}},[t,l]);return x.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[l]),x.createElement(x.Fragment,null,x.createElement(Pp,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Nl({ref:c},e)))}),qje=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:Lx(n),containerHeight:Lx(r)}),o=x.useCallback((c,f)=>{a(h=>{var d=Math.round(c),p=Math.round(f);return h.containerWidth===d&&h.containerHeight===p?h:{containerWidth:d,containerHeight:p}})},[]),l=x.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:f,height:h}=c.getBoundingClientRect();o(f,h)}},[t,o]);return x.createElement(x.Fragment,null,x.createElement(Pp,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Nl({ref:l},e)))}),Vje=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(Pp,{width:n,height:r}),x.createElement("div",Nl({ref:t},e)))}),Kje=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(qje,Nl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(Vje,Nl({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(Pp,{width:n,height:r}),x.createElement("div",Nl({ref:t},e)))});function Yje(e){return e?Hje:Kje}var Xje=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:f,onMouseLeave:h,onMouseMove:d,onMouseUp:p,onTouchEnd:v,onTouchMove:b,onTouchStart:w,style:S,width:E,responsive:j,dispatchTouchEvents:C=!0}=e,O=x.useRef(null),N=Vt(),[k,T]=x.useState(null),[M,I]=x.useState(null),L=Lje(),B=OO(),z=(B==null?void 0:B.width)>0?B.width:E,G=(B==null?void 0:B.height)>0?B.height:i,F=x.useCallback(se=>{L(se),typeof t=="function"&&t(se),T(se),I(se),se!=null&&(O.current=se)},[L,t,T,I]),V=x.useCallback(se=>{N(B7(se)),N(Qi({handler:a,reactEvent:se}))},[N,a]),D=x.useCallback(se=>{N(vj(se)),N(Qi({handler:f,reactEvent:se}))},[N,f]),q=x.useCallback(se=>{N(b9()),N(Qi({handler:h,reactEvent:se}))},[N,h]),X=x.useCallback(se=>{N(vj(se)),N(Qi({handler:d,reactEvent:se}))},[N,d]),Y=x.useCallback(()=>{N(K7())},[N]),R=x.useCallback(()=>{N(Y7())},[N]),H=x.useCallback(se=>{N(V7(se.key))},[N]),U=x.useCallback(se=>{N(Qi({handler:o,reactEvent:se}))},[N,o]),$=x.useCallback(se=>{N(Qi({handler:l,reactEvent:se}))},[N,l]),Q=x.useCallback(se=>{N(Qi({handler:c,reactEvent:se}))},[N,c]),J=x.useCallback(se=>{N(Qi({handler:p,reactEvent:se}))},[N,p]),ne=x.useCallback(se=>{N(Qi({handler:w,reactEvent:se}))},[N,w]),ae=x.useCallback(se=>{C&&N(W7(se)),N(Qi({handler:b,reactEvent:se}))},[N,C,b]),re=x.useCallback(se=>{N(Qi({handler:v,reactEvent:se}))},[N,v]),ee=Yje(j);return x.createElement(F9.Provider,{value:k},x.createElement(qF.Provider,{value:M},x.createElement(ee,{width:z??(S==null?void 0:S.width),height:G??(S==null?void 0:S.height),className:Et("recharts-wrapper",r),style:zje({position:"relative",cursor:"default",width:z,height:G},S),onClick:V,onContextMenu:U,onDoubleClick:$,onFocus:Y,onBlur:R,onKeyDown:H,onMouseDown:Q,onMouseEnter:D,onMouseLeave:q,onMouseMove:X,onMouseUp:J,onTouchEnd:re,onTouchMove:ae,onTouchStart:ne,ref:F},x.createElement(Uje,null),n)))}),Gje=["width","height","responsive","children","className","style","compact","title","desc"];function Wje(e,t){if(e==null)return{};var n,r,i=Qje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rV=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:f,desc:h}=e,d=Wje(e,Gje),p=Di(d);return c?x.createElement(x.Fragment,null,x.createElement(Pp,{width:n,height:r}),x.createElement(Z3,{otherAttributes:p,title:f,desc:h},a)):x.createElement(Xje,{className:o,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(Z3,{otherAttributes:p,title:f,desc:h,ref:t},x.createElement(SEe,null,a)))});function yj(){return yj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yj.apply(null,arguments)}function e4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e4(Object(n),!0).forEach(function(r){Jje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jje(e,t,n){return(t=eAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eAe(e){var t=tAe(e,"string");return typeof t=="symbol"?t:t+""}function tAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nAe={top:5,right:5,bottom:5,left:5},rAe=Zje({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:nAe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},yN),iV=x.forwardRef(function(t,n){var r,i=Xn(t.categoricalChartProps,rAe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:f}=t,h={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return x.createElement(J7,{preloadedState:{options:h},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(x7,{chartData:f.data}),x.createElement(eV,{layout:i.layout,margin:i.margin}),x.createElement(nV,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(tV,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(rV,yj({},i,{ref:n})))}),iAe=["axis"],aAe=x.forwardRef((e,t)=>x.createElement(iV,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:iAe,tooltipPayloadSearcher:Gk,categoricalChartProps:e,ref:t})),oAe=["axis","item"],sAe=x.forwardRef((e,t)=>x.createElement(iV,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:oAe,tooltipPayloadSearcher:Gk,categoricalChartProps:e,ref:t}));function lAe(e){var t=Vt();return x.useEffect(()=>{t(wje(e))},[t,e]),null}var uAe=["layout"];function xj(){return xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xj.apply(null,arguments)}function cAe(e,t){if(e==null)return{};var n,r,i=fAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function t4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dAe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t4(Object(n),!0).forEach(function(r){hAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hAe(e,t,n){return(t=mAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mAe(e){var t=pAe(e,"string");return typeof t=="symbol"?t:t+""}function pAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gAe={top:5,right:5,bottom:5,left:5},aV=dAe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:gAe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},yN),vAe=x.forwardRef(function(t,n){var r,i=Xn(t.categoricalChartProps,aV),{layout:a}=i,o=cAe(i,uAe),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h}=t,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:f,tooltipPayloadSearcher:h,eventEmitter:void 0};return x.createElement(J7,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},x.createElement(x7,{chartData:i.data}),x.createElement(eV,{layout:a,margin:i.margin}),x.createElement(nV,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(tV,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(lAe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),x.createElement(rV,xj({},o,{ref:n})))});function n4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function r4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n4(Object(n),!0).forEach(function(r){yAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yAe(e,t,n){return(t=xAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xAe(e){var t=bAe(e,"string");return typeof t=="symbol"?t:t+""}function bAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wAe=["item"],SAe=r4(r4({},aV),{},{layout:"centric",startAngle:0,endAngle:360}),EAe=x.forwardRef((e,t)=>{var n=Xn(e,SAe);return x.createElement(vAe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:wAe,tooltipPayloadSearcher:Gk,categoricalChartProps:n,ref:t})});function _Ae({completed:e,failed:t}){const n=e+t;if(n===0)return g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsxs("div",{className:"relative h-32 w-32",children:[g.jsx("svg",{viewBox:"0 0 100 100",className:"h-full w-full",children:g.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"hsl(var(--muted))",strokeWidth:"12"})}),g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("span",{className:"text-sm text-muted-foreground",children:"N/A"})})]})});const r=Math.round(e/n*1e3)/10,i=[{name:"Completed",value:e},{name:"Failed",value:t}],a=["#2e7d32","#c62828"];return g.jsxs("div",{className:"relative flex h-full items-center justify-center",children:[g.jsx(kO,{width:140,height:140,children:g.jsx(EAe,{children:g.jsx(g7,{data:i,cx:"50%",cy:"50%",innerRadius:40,outerRadius:56,dataKey:"value",strokeWidth:0,children:i.map((o,l)=>g.jsx(Gp,{fill:a[l]},l))})})}),g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsxs("span",{className:"text-lg font-semibold",children:[r,"%"]})})]})}function i4(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function CAe({data:e}){return e.some(n=>n.total>0)?g.jsx(kO,{width:"100%",height:280,children:g.jsxs(sAe,{data:e,margin:{top:8,right:8,left:-16,bottom:0},children:[g.jsx(cN,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),g.jsx(mN,{dataKey:"date",tickFormatter:i4,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),g.jsx(pN,{allowDecimals:!1,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),g.jsx(q9,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:n=>i4(String(n))}),g.jsx(jH,{wrapperStyle:{fontSize:12,paddingTop:8}}),g.jsx(dj,{dataKey:"completed",name:"Completed",stackId:"a",fill:"#2e7d32",radius:[0,0,0,0]}),g.jsx(dj,{dataKey:"failed",name:"Failed",stackId:"a",fill:"#c62828",radius:[2,2,0,0]})]})}):g.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"})}function a4(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function jAe(e){return e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function AAe({data:e}){if(e.filter(r=>r.avg_duration_ms!==null).length===0)return g.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:"No data"});const n=e.map(r=>({...r,avg_minutes:r.avg_duration_ms!==null?r.avg_duration_ms/6e4:null}));return g.jsx(kO,{width:"100%",height:280,children:g.jsxs(aAe,{data:n,margin:{top:8,right:8,left:-16,bottom:0},children:[g.jsx(cN,{strokeDasharray:"3 3",stroke:"hsl(var(--border))",vertical:!1}),g.jsx(mN,{dataKey:"date",tickFormatter:a4,tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1}),g.jsx(pN,{tick:{fontSize:12,fill:"hsl(var(--muted-foreground))"},tickLine:!1,axisLine:!1,tickFormatter:r=>`${r.toFixed(0)}m`}),g.jsx(q9,{contentStyle:{backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))",border:"1px solid hsl(var(--border))",borderRadius:"6px",fontSize:13},labelFormatter:r=>a4(String(r)),formatter:r=>[jAe(Number(r)*6e4),"Avg Duration"]}),g.jsx(D7,{type:"monotone",dataKey:"avg_minutes",name:"Avg Duration",stroke:"#1565c0",strokeWidth:2,dot:{r:3,fill:"#1565c0"},connectNulls:!0})]})})}const OAe=["7d","30d","90d"];function kAe(e){return e===null?"—":e<6e4?`${Math.round(e/1e3)}s`:`${(e/6e4).toFixed(1)}m`}function NAe({projectId:e}){const[t,n]=x.useState("30d"),{data:r,isLoading:i}=gue(e,t);return i?g.jsxs("div",{className:"space-y-4",children:[g.jsx(On,{className:"h-8 w-48"}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[g.jsx(On,{className:"h-32"}),g.jsx(On,{className:"h-32"}),g.jsx(On,{className:"h-32"})]}),g.jsx(On,{className:"h-72"})]}):r?g.jsxs("div",{className:"space-y-6",children:[g.jsx("div",{className:"flex gap-1",children:OAe.map(a=>g.jsx(je,{size:"sm",variant:t===a?"default":"outline",onClick:()=>n(a),children:a},a))}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[g.jsxs(yn,{children:[g.jsx(Vh,{className:"pb-2",children:g.jsx(Kh,{className:"text-sm font-medium text-muted-foreground",children:"Total Runs"})}),g.jsxs(xn,{children:[g.jsx("div",{className:"text-3xl font-bold",children:r.total_runs}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[r.completed," completed · ",r.failed," failed"]})]})]}),g.jsxs(yn,{children:[g.jsx(Vh,{className:"pb-2",children:g.jsx(Kh,{className:"text-sm font-medium text-muted-foreground",children:"Success Rate"})}),g.jsx(xn,{className:"h-36",children:g.jsx(_Ae,{completed:r.completed,failed:r.failed})})]}),g.jsxs(yn,{children:[g.jsx(Vh,{className:"pb-2",children:g.jsx(Kh,{className:"text-sm font-medium text-muted-foreground",children:"Avg Duration"})}),g.jsxs(xn,{children:[g.jsx("div",{className:"text-3xl font-bold",children:kAe(r.avg_duration_ms)}),g.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"per session"})]})]})]}),g.jsxs(yn,{children:[g.jsx(Vh,{children:g.jsx(Kh,{className:"text-base",children:"Run Frequency"})}),g.jsx(xn,{children:g.jsx(CAe,{data:r.daily})})]}),g.jsxs(yn,{children:[g.jsx(Vh,{children:g.jsx(Kh,{className:"text-base",children:"Duration Trends"})}),g.jsx(xn,{children:g.jsx(AAe,{data:r.daily})})]})]}):null}function xN({className:e,orientation:t="horizontal",...n}){return g.jsx(iie,{"data-slot":"tabs","data-orientation":t,orientation:t,className:ke("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const TAe=j0("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function bN({className:e,variant:t="default",...n}){return g.jsx(aie,{"data-slot":"tabs-list","data-variant":t,className:ke(TAe({variant:t}),e),...n})}function ji({className:e,...t}){return g.jsx(oie,{"data-slot":"tabs-trigger",className:ke("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Ai({className:e,...t}){return g.jsx(sie,{"data-slot":"tabs-content",className:ke("flex-1 outline-none",e),...t})}function PAe(){return g.jsxs("div",{className:"space-y-6",children:[g.jsx(On,{className:"h-8 w-48"}),g.jsx(On,{className:"h-24 rounded-lg"}),g.jsx(On,{className:"h-64 rounded-lg"})]})}function MAe({projectId:e,conversationId:t,title:n,fallback:r}){const[i,a]=x.useState(!1),[o,l]=x.useState(""),c=x.useRef(null),f=iO(e);function h(v){v.stopPropagation(),l(n??""),a(!0),setTimeout(()=>{var b;return(b=c.current)==null?void 0:b.select()},0)}function d(v){v.stopPropagation();const b=o.trim();f.mutate({conversationId:t,title:b||null}),a(!1)}function p(v){v.key==="Enter"&&(v.preventDefault(),d(v)),v.key==="Escape"&&(v.stopPropagation(),a(!1))}return i?g.jsx(ct,{ref:c,value:o,onChange:v=>l(v.target.value),onBlur:d,onKeyDown:p,onClick:v=>v.stopPropagation(),className:"h-7 text-sm font-medium w-full",placeholder:r}):g.jsxs("div",{className:"flex items-center gap-1.5 group",children:[g.jsx("span",{className:"font-medium",children:n??r}),g.jsx(je,{variant:"ghost",size:"icon",className:"h-5 w-5 text-muted-foreground hover:text-foreground",onClick:h,"aria-label":"Rename",children:g.jsx(QA,{className:"h-3 w-3"})})]})}function DAe({projectId:e,conversationId:t,label:n}){const[r,i]=x.useState(!1),a=xF(e);return r?g.jsxs("div",{className:"flex justify-end gap-1",onClick:o=>o.stopPropagation(),children:[g.jsx(je,{size:"sm",variant:"destructive",disabled:a.isPending,onClick:o=>{o.stopPropagation(),a.mutate(t,{onSuccess:()=>i(!1),onError:()=>i(!1)})},children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),i(!1)},children:"No"})]}):g.jsx(je,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),i(!0)},"aria-label":`Delete ${n}`,children:g.jsx(Kl,{className:"h-3.5 w-3.5"})})}const o4={roles:"Role",skills:"Skill",agents:"Agent",memories:"Memory"};function RAe(){var L,B,z;const{projectId:e}=Jx(),t=Number(e),n=Fl(),r=eO(t),[i,a]=x.useState(1),[o]=x.useState(1),l=wse(t,i),c=LF(t),f=rO(t,o),h=yF(),[d,p]=x.useState(!1),[v,b]=x.useState(!1),[w,S]=x.useState("conversations"),E=r.isLoading||l.isLoading,j=r.error||l.error;if(E)return g.jsx(PAe,{});if(j)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",j.message]})]});if(!r.data)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsx("span",{children:"Project not found"})]});const C=r.data,O=l.data,N=(O==null?void 0:O.items)??[],k=(O==null?void 0:O.total)??0,T=O?Math.ceil(O.total/O.per_page):0,M=c.data??[],I=M.reduce((G,F)=>(G[F.type]=(G[F.type]||0)+1,G),{});return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(je,{variant:"outline",size:"sm",asChild:!0,children:g.jsxs(Yr,{to:"/projects",children:[g.jsx(YA,{className:"mr-2 h-4 w-4"}),"Back"]})}),g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:C.display_name})]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsxs(je,{disabled:!C.dir_exists||h.isPending,onClick:()=>{h.mutate({project_id:t},{onSuccess:G=>n(`/projects/${t}/conversations/${G.id}`)})},children:[g.jsx(WA,{className:"mr-2 h-4 w-4"}),"New Conversation"]}),g.jsxs(je,{variant:"outline",onClick:()=>p(!0),disabled:!C.dir_exists,children:[g.jsx(ZA,{className:"mr-2 h-4 w-4"}),"Launch Session"]}),g.jsxs(je,{variant:"outline",onClick:()=>{S("resources"),b(!0)},children:[g.jsx(E0,{className:"mr-2 h-4 w-4"}),"Install Resource"]})]})]}),g.jsx(yn,{children:g.jsx(xn,{className:"pt-6",children:g.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Directory"}),g.jsxs("dd",{className:"flex items-center gap-2 break-all",children:[C.working_dir,C.dir_exists?g.jsx(an,{variant:"outline",className:"border-green-200 bg-green-50 text-xs text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",children:"OK"}):g.jsx(an,{variant:"outline",className:"border-orange-200 bg-orange-50 text-xs text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",children:"Missing"})]}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Created"}),g.jsx("dd",{children:new Date(C.created_at).toLocaleString()}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Resources"}),g.jsx("dd",{children:M.length===0?g.jsx("span",{className:"text-sm text-muted-foreground",children:"None installed"}):g.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(I).map(([G,F])=>g.jsxs(an,{variant:"secondary",className:"cursor-pointer text-xs",onClick:()=>S("resources"),children:[F," ",F===1?o4[G]??G:`${o4[G]??G}s`]},G))})})]})})}),g.jsx(Vle,{projectId:t,open:d,onOpenChange:p}),g.jsx(lO,{open:v,onOpenChange:b,projectId:t}),g.jsxs(xN,{value:w,onValueChange:S,children:[g.jsxs(bN,{children:[g.jsxs(ji,{value:"conversations",children:["Conversations (",((L=f.data)==null?void 0:L.total)??0,")"]}),g.jsxs(ji,{value:"sessions",children:["Sessions (",k,")"]}),g.jsx(ji,{value:"activity",children:"Activity"}),g.jsxs(ji,{value:"resources",children:["Resources (",M.length,")"]}),g.jsx(ji,{value:"files",children:"Files"})]}),g.jsx(Ai,{value:"sessions",className:"mt-4 space-y-3",children:k===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:"No sessions yet."}):g.jsxs(g.Fragment,{children:[g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsx(yC,{sessions:N})})}),g.jsx(Ule,{page:i,totalPages:T,onPageChange:a})]})}),g.jsx(Ai,{value:"conversations",className:"mt-4 space-y-3",children:(((B=f.data)==null?void 0:B.items)??[]).length===0?g.jsx("p",{className:"text-sm italic text-muted-foreground",children:'No conversations yet. Click "New Conversation" to start one.'}):g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs("table",{className:"w-full text-sm",children:[g.jsx("thead",{children:g.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[g.jsx("th",{className:"px-4 py-2 font-medium",children:"Title"}),g.jsx("th",{className:"px-4 py-2 font-medium",children:"Sessions"}),g.jsx("th",{className:"px-4 py-2 font-medium",children:"Last activity"}),g.jsx("th",{className:"px-4 py-2"})]})}),g.jsx("tbody",{children:(((z=f.data)==null?void 0:z.items)??[]).map(G=>g.jsxs("tr",{className:"cursor-pointer border-b border-border last:border-0 hover:bg-muted/50",onClick:()=>n(`/projects/${t}/conversations/${G.id}`),children:[g.jsx("td",{className:"px-4 py-2",children:g.jsx(MAe,{projectId:t,conversationId:G.id,title:G.title,fallback:`Conversation #${G.id}`})}),g.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.session_count}),g.jsx("td",{className:"px-4 py-2 text-muted-foreground",children:G.last_activity?new Date(G.last_activity).toLocaleString():"—"}),g.jsx("td",{className:"px-4 py-2 text-right",children:g.jsx(DAe,{projectId:t,conversationId:G.id,label:G.title??`Conversation #${G.id}`})})]},G.id))})]})})})}),g.jsx(Ai,{value:"activity",className:"mt-4",children:g.jsx(NAe,{projectId:t})}),g.jsx(Ai,{value:"resources",className:"mt-4",children:g.jsx(mue,{projectId:t,installOpen:v,onInstallOpenChange:b})}),g.jsx(Ai,{value:"files",className:"mt-4",children:g.jsx(Yle,{projectId:t})})]})]})}function Gn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Gn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var IAe={value:()=>{}};function yb(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ey(n)}function Ey(e){this._=e}function LAe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ey.prototype=yb.prototype={constructor:Ey,on:function(e,t){var n=this._,r=LAe(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=zAe(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=s4(n[i],e.name,t);else if(t==null)for(i in n)n[i]=s4(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ey(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function zAe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function s4(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=IAe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bj="http://www.w3.org/1999/xhtml";const l4={svg:"http://www.w3.org/2000/svg",xhtml:bj,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),l4.hasOwnProperty(t)?{space:l4[t],local:e}:e}function $Ae(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bj&&t.documentElement.namespaceURI===bj?t.createElement(e):t.createElementNS(n,e)}}function BAe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oV(e){var t=xb(e);return(t.local?BAe:$Ae)(t)}function FAe(){}function wN(e){return e==null?FAe:function(){return this.querySelector(e)}}function UAe(e){typeof e!="function"&&(e=wN(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=new Array(o),c,f,h=0;h<o;++h)(c=a[h])&&(f=e.call(c,c.__data__,h,a))&&("__data__"in c&&(f.__data__=c.__data__),l[h]=f);return new Li(r,this._parents)}function HAe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qAe(){return[]}function sV(e){return e==null?qAe:function(){return this.querySelectorAll(e)}}function VAe(e){return function(){return HAe(e.apply(this,arguments))}}function KAe(e){typeof e=="function"?e=VAe(e):e=sV(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new Li(r,i)}function lV(e){return function(){return this.matches(e)}}function uV(e){return function(t){return t.matches(e)}}var YAe=Array.prototype.find;function XAe(e){return function(){return YAe.call(this.children,e)}}function GAe(){return this.firstElementChild}function WAe(e){return this.select(e==null?GAe:XAe(typeof e=="function"?e:uV(e)))}var QAe=Array.prototype.filter;function ZAe(){return Array.from(this.children)}function JAe(e){return function(){return QAe.call(this.children,e)}}function eOe(e){return this.selectAll(e==null?ZAe:JAe(typeof e=="function"?e:uV(e)))}function tOe(e){typeof e!="function"&&(e=lV(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new Li(r,this._parents)}function cV(e){return new Array(e.length)}function nOe(){return new Li(this._enter||this._groups.map(cV),this._parents)}function zx(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}zx.prototype={constructor:zx,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function rOe(e){return function(){return e}}function iOe(e,t,n,r,i,a){for(var o=0,l,c=t.length,f=a.length;o<f;++o)(l=t[o])?(l.__data__=a[o],r[o]=l):n[o]=new zx(e,a[o]);for(;o<c;++o)(l=t[o])&&(i[o]=l)}function aOe(e,t,n,r,i,a,o){var l,c,f=new Map,h=t.length,d=a.length,p=new Array(h),v;for(l=0;l<h;++l)(c=t[l])&&(p[l]=v=o.call(c,c.__data__,l,t)+"",f.has(v)?i[l]=c:f.set(v,c));for(l=0;l<d;++l)v=o.call(e,a[l],l,a)+"",(c=f.get(v))?(r[l]=c,c.__data__=a[l],f.delete(v)):n[l]=new zx(e,a[l]);for(l=0;l<h;++l)(c=t[l])&&f.get(p[l])===c&&(i[l]=c)}function oOe(e){return e.__data__}function sOe(e,t){if(!arguments.length)return Array.from(this,oOe);var n=t?aOe:iOe,r=this._parents,i=this._groups;typeof e!="function"&&(e=rOe(e));for(var a=i.length,o=new Array(a),l=new Array(a),c=new Array(a),f=0;f<a;++f){var h=r[f],d=i[f],p=d.length,v=lOe(e.call(h,h&&h.__data__,f,r)),b=v.length,w=l[f]=new Array(b),S=o[f]=new Array(b),E=c[f]=new Array(p);n(h,d,w,S,E,v,t);for(var j=0,C=0,O,N;j<b;++j)if(O=w[j]){for(j>=C&&(C=j+1);!(N=S[C])&&++C<b;);O._next=N||null}}return o=new Li(o,r),o._enter=l,o._exit=c,o}function lOe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uOe(){return new Li(this._exit||this._groups.map(cV),this._parents)}function cOe(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function fOe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),l=new Array(i),c=0;c<o;++c)for(var f=n[c],h=r[c],d=f.length,p=l[c]=new Array(d),v,b=0;b<d;++b)(v=f[b]||h[b])&&(p[b]=v);for(;c<i;++c)l[c]=n[c];return new Li(l,this._parents)}function dOe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function hOe(e){e||(e=mOe);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],l=o.length,c=i[a]=new Array(l),f,h=0;h<l;++h)(f=o[h])&&(c[h]=f);c.sort(t)}return new Li(i,this._parents).order()}function mOe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function pOe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function gOe(){return Array.from(this)}function vOe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function yOe(){let e=0;for(const t of this)++e;return e}function xOe(){return!this.node()}function bOe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,l;a<o;++a)(l=i[a])&&e.call(l,l.__data__,a,i);return this}function wOe(e){return function(){this.removeAttribute(e)}}function SOe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EOe(e,t){return function(){this.setAttribute(e,t)}}function _Oe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function COe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function jOe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function AOe(e,t){var n=xb(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?SOe:wOe:typeof t=="function"?n.local?jOe:COe:n.local?_Oe:EOe)(n,t))}function fV(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function OOe(e){return function(){this.style.removeProperty(e)}}function kOe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function NOe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function TOe(e,t,n){return arguments.length>1?this.each((t==null?OOe:typeof t=="function"?NOe:kOe)(e,t,n??"")):gd(this.node(),e)}function gd(e,t){return e.style.getPropertyValue(t)||fV(e).getComputedStyle(e,null).getPropertyValue(t)}function POe(e){return function(){delete this[e]}}function MOe(e,t){return function(){this[e]=t}}function DOe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ROe(e,t){return arguments.length>1?this.each((t==null?POe:typeof t=="function"?DOe:MOe)(e,t)):this.node()[e]}function dV(e){return e.trim().split(/^|\s+/)}function SN(e){return e.classList||new hV(e)}function hV(e){this._node=e,this._names=dV(e.getAttribute("class")||"")}hV.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function mV(e,t){for(var n=SN(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function pV(e,t){for(var n=SN(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function IOe(e){return function(){mV(this,e)}}function LOe(e){return function(){pV(this,e)}}function zOe(e,t){return function(){(t.apply(this,arguments)?mV:pV)(this,e)}}function $Oe(e,t){var n=dV(e+"");if(arguments.length<2){for(var r=SN(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zOe:t?IOe:LOe)(n,t))}function BOe(){this.textContent=""}function FOe(e){return function(){this.textContent=e}}function UOe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function HOe(e){return arguments.length?this.each(e==null?BOe:(typeof e=="function"?UOe:FOe)(e)):this.node().textContent}function qOe(){this.innerHTML=""}function VOe(e){return function(){this.innerHTML=e}}function KOe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function YOe(e){return arguments.length?this.each(e==null?qOe:(typeof e=="function"?KOe:VOe)(e)):this.node().innerHTML}function XOe(){this.nextSibling&&this.parentNode.appendChild(this)}function GOe(){return this.each(XOe)}function WOe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function QOe(){return this.each(WOe)}function ZOe(e){var t=typeof e=="function"?e:oV(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function JOe(){return null}function eke(e,t){var n=typeof e=="function"?e:oV(e),r=t==null?JOe:typeof t=="function"?t:wN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function tke(){var e=this.parentNode;e&&e.removeChild(this)}function nke(){return this.each(tke)}function rke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ike(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ake(e){return this.select(e?ike:rke)}function oke(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ske(e){return function(t){e.call(this,t,this.__data__)}}function lke(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function uke(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function cke(e,t,n){return function(){var r=this.__on,i,a=ske(t);if(r){for(var o=0,l=r.length;o<l;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function fke(e,t,n){var r=lke(e+""),i,a=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,f=l.length,h;c<f;++c)for(i=0,h=l[c];i<a;++i)if((o=r[i]).type===h.type&&o.name===h.name)return h.value}return}for(l=t?cke:uke,i=0;i<a;++i)this.each(l(r[i],t,n));return this}function gV(e,t,n){var r=fV(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function dke(e,t){return function(){return gV(this,e,t)}}function hke(e,t){return function(){return gV(this,e,t.apply(this,arguments))}}function mke(e,t){return this.each((typeof t=="function"?hke:dke)(e,t))}function*pke(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var vV=[null];function Li(e,t){this._groups=e,this._parents=t}function Qp(){return new Li([[document.documentElement]],vV)}function gke(){return this}Li.prototype=Qp.prototype={constructor:Li,select:UAe,selectAll:KAe,selectChild:WAe,selectChildren:eOe,filter:tOe,data:sOe,enter:nOe,exit:uOe,join:cOe,merge:fOe,selection:gke,order:dOe,sort:hOe,call:pOe,nodes:gOe,node:vOe,size:yOe,empty:xOe,each:bOe,attr:AOe,style:TOe,property:ROe,classed:$Oe,text:HOe,html:YOe,raise:GOe,lower:QOe,append:ZOe,insert:eke,remove:nke,clone:ake,datum:oke,on:fke,dispatch:mke,[Symbol.iterator]:pke};function ki(e){return typeof e=="string"?new Li([[document.querySelector(e)]],[document.documentElement]):new Li([[e]],vV)}function vke(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wa(e,t){if(e=vke(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const yke={passive:!1},Qm={capture:!0,passive:!1};function JE(e){e.stopImmediatePropagation()}function Uf(e){e.preventDefault(),e.stopImmediatePropagation()}function yV(e){var t=e.document.documentElement,n=ki(e).on("dragstart.drag",Uf,Qm);"onselectstart"in t?n.on("selectstart.drag",Uf,Qm):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xV(e,t){var n=e.document.documentElement,r=ki(e).on("dragstart.drag",null);t&&(r.on("click.drag",Uf,Qm),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Zv=e=>()=>e;function wj(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:l,dx:c,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}wj.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xke(e){return!e.ctrlKey&&!e.button}function bke(){return this.parentNode}function wke(e,t){return t??{x:e.x,y:e.y}}function Ske(){return navigator.maxTouchPoints||"ontouchstart"in this}function bV(){var e=xke,t=bke,n=wke,r=Ske,i={},a=yb("start","drag","end"),o=0,l,c,f,h,d=0;function p(O){O.on("mousedown.drag",v).filter(r).on("touchstart.drag",S).on("touchmove.drag",E,yke).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(O,N){if(!(h||!e.call(this,O,N))){var k=C(this,t.call(this,O,N),O,N,"mouse");k&&(ki(O.view).on("mousemove.drag",b,Qm).on("mouseup.drag",w,Qm),yV(O.view),JE(O),f=!1,l=O.clientX,c=O.clientY,k("start",O))}}function b(O){if(Uf(O),!f){var N=O.clientX-l,k=O.clientY-c;f=N*N+k*k>d}i.mouse("drag",O)}function w(O){ki(O.view).on("mousemove.drag mouseup.drag",null),xV(O.view,f),Uf(O),i.mouse("end",O)}function S(O,N){if(e.call(this,O,N)){var k=O.changedTouches,T=t.call(this,O,N),M=k.length,I,L;for(I=0;I<M;++I)(L=C(this,T,O,N,k[I].identifier,k[I]))&&(JE(O),L("start",O,k[I]))}}function E(O){var N=O.changedTouches,k=N.length,T,M;for(T=0;T<k;++T)(M=i[N[T].identifier])&&(Uf(O),M("drag",O,N[T]))}function j(O){var N=O.changedTouches,k=N.length,T,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),T=0;T<k;++T)(M=i[N[T].identifier])&&(JE(O),M("end",O,N[T]))}function C(O,N,k,T,M,I){var L=a.copy(),B=wa(I||k,N),z,G,F;if((F=n.call(O,new wj("beforestart",{sourceEvent:k,target:p,identifier:M,active:o,x:B[0],y:B[1],dx:0,dy:0,dispatch:L}),T))!=null)return z=F.x-B[0]||0,G=F.y-B[1]||0,function V(D,q,X){var Y=B,R;switch(D){case"start":i[M]=V,R=o++;break;case"end":delete i[M],--o;case"drag":B=wa(X||q,N),R=o;break}L.call(D,O,new wj(D,{sourceEvent:q,subject:F,target:p,identifier:M,active:R,x:B[0]+z,y:B[1]+G,dx:B[0]-Y[0],dy:B[1]-Y[1],dispatch:L}),T)}}return p.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Zv(!!O),p):e},p.container=function(O){return arguments.length?(t=typeof O=="function"?O:Zv(O),p):t},p.subject=function(O){return arguments.length?(n=typeof O=="function"?O:Zv(O),p):n},p.touchable=function(O){return arguments.length?(r=typeof O=="function"?O:Zv(!!O),p):r},p.on=function(){var O=a.on.apply(a,arguments);return O===a?p:O},p.clickDistance=function(O){return arguments.length?(d=(O=+O)*O,p):Math.sqrt(d)},p}var vd=0,vm=0,im=0,wV=1e3,$x,ym,Bx=0,gc=0,bb=0,Zm=typeof performance=="object"&&performance.now?performance:Date,SV=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function EN(){return gc||(SV(Eke),gc=Zm.now()+bb)}function Eke(){gc=0}function Fx(){this._call=this._time=this._next=null}Fx.prototype=EV.prototype={constructor:Fx,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?EN():+n)+(t==null?0:+t),!this._next&&ym!==this&&(ym?ym._next=this:$x=this,ym=this),this._call=e,this._time=n,Sj()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sj())}};function EV(e,t,n){var r=new Fx;return r.restart(e,t,n),r}function _ke(){EN(),++vd;for(var e=$x,t;e;)(t=gc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vd}function u4(){gc=(Bx=Zm.now())+bb,vd=vm=0;try{_ke()}finally{vd=0,jke(),gc=0}}function Cke(){var e=Zm.now(),t=e-Bx;t>wV&&(bb-=t,Bx=e)}function jke(){for(var e,t=$x,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$x=n);ym=e,Sj(r)}function Sj(e){if(!vd){vm&&(vm=clearTimeout(vm));var t=e-gc;t>24?(e<1/0&&(vm=setTimeout(u4,e-Zm.now()-bb)),im&&(im=clearInterval(im))):(im||(Bx=Zm.now(),im=setInterval(Cke,wV)),vd=1,SV(u4))}}function c4(e,t,n){var r=new Fx;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Ake=yb("start","end","cancel","interrupt"),Oke=[],_V=0,f4=1,Ej=2,_y=3,d4=4,_j=5,Cy=6;function wb(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;kke(e,n,{name:t,index:r,group:i,on:Ake,tween:Oke,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:_V})}function _N(e,t){var n=za(e,t);if(n.state>_V)throw new Error("too late; already scheduled");return n}function xo(e,t){var n=za(e,t);if(n.state>_y)throw new Error("too late; already running");return n}function za(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function kke(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=EV(a,0,n.time);function a(f){n.state=f4,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var h,d,p,v;if(n.state!==f4)return c();for(h in r)if(v=r[h],v.name===n.name){if(v.state===_y)return c4(o);v.state===d4?(v.state=Cy,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete r[h]):+h<t&&(v.state=Cy,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete r[h])}if(c4(function(){n.state===_y&&(n.state=d4,n.timer.restart(l,n.delay,n.time),l(f))}),n.state=Ej,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ej){for(n.state=_y,i=new Array(p=n.tween.length),h=0,d=-1;h<p;++h)(v=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=v);i.length=d+1}}function l(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=_j,1),d=-1,p=i.length;++d<p;)i[d].call(e,h);n.state===_j&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Cy,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function jy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>Ej&&r.state<_j,r.state=Cy,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Nke(e){return this.each(function(){jy(this,e)})}function Tke(e,t){var n,r;return function(){var i=xo(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Pke(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=xo(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var l={name:t,value:n},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=l;break}c===f&&i.push(l)}a.tween=i}}function Mke(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=za(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Tke:Pke)(n,e,t))}function CN(e,t,n){var r=e._id;return e.each(function(){var i=xo(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return za(i,r).value[t]}}function CV(e,t){var n;return(typeof t=="number"?Sa:t instanceof mc?xx:(n=mc(t))?(t=n,xx):mq)(e,t)}function Dke(e){return function(){this.removeAttribute(e)}}function Rke(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ike(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Lke(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function zke(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function $ke(e,t,n){var r,i,a;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l)))}}function Bke(e,t){var n=xb(e),r=n==="transform"?Bge:CV;return this.attrTween(e,typeof t=="function"?(n.local?$ke:zke)(n,r,CN(this,"attr."+e,t)):t==null?(n.local?Rke:Dke)(n):(n.local?Lke:Ike)(n,r,t))}function Fke(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Uke(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Hke(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Uke(e,a)),n}return i._value=t,i}function qke(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&Fke(e,a)),n}return i._value=t,i}function Vke(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=xb(e);return this.tween(n,(r.local?Hke:qke)(r,t))}function Kke(e,t){return function(){_N(this,e).delay=+t.apply(this,arguments)}}function Yke(e,t){return t=+t,function(){_N(this,e).delay=t}}function Xke(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Kke:Yke)(t,e)):za(this.node(),t).delay}function Gke(e,t){return function(){xo(this,e).duration=+t.apply(this,arguments)}}function Wke(e,t){return t=+t,function(){xo(this,e).duration=t}}function Qke(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Gke:Wke)(t,e)):za(this.node(),t).duration}function Zke(e,t){if(typeof t!="function")throw new Error;return function(){xo(this,e).ease=t}}function Jke(e){var t=this._id;return arguments.length?this.each(Zke(t,e)):za(this.node(),t).ease}function eNe(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;xo(this,e).ease=n}}function tNe(e){if(typeof e!="function")throw new Error;return this.each(eNe(this._id,e))}function nNe(e){typeof e!="function"&&(e=lV(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,l=r[i]=[],c,f=0;f<o;++f)(c=a[f])&&e.call(c,c.__data__,f,a)&&l.push(c);return new gs(r,this._parents,this._name,this._id)}function rNe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),l=0;l<a;++l)for(var c=t[l],f=n[l],h=c.length,d=o[l]=new Array(h),p,v=0;v<h;++v)(p=c[v]||f[v])&&(d[v]=p);for(;l<r;++l)o[l]=t[l];return new gs(o,this._parents,this._name,this._id)}function iNe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function aNe(e,t,n){var r,i,a=iNe(t)?_N:xo;return function(){var o=a(this,e),l=o.on;l!==r&&(i=(r=l).copy()).on(t,n),o.on=i}}function oNe(e,t){var n=this._id;return arguments.length<2?za(this.node(),n).on.on(e):this.each(aNe(n,e,t))}function sNe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function lNe(){return this.on("end.remove",sNe(this._id))}function uNe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=wN(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var l=r[o],c=l.length,f=a[o]=new Array(c),h,d,p=0;p<c;++p)(h=l[p])&&(d=e.call(h,h.__data__,p,l))&&("__data__"in h&&(d.__data__=h.__data__),f[p]=d,wb(f[p],t,n,p,f,za(h,n)));return new gs(a,this._parents,t,n)}function cNe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=sV(e));for(var r=this._groups,i=r.length,a=[],o=[],l=0;l<i;++l)for(var c=r[l],f=c.length,h,d=0;d<f;++d)if(h=c[d]){for(var p=e.call(h,h.__data__,d,c),v,b=za(h,n),w=0,S=p.length;w<S;++w)(v=p[w])&&wb(v,t,n,w,p,b);a.push(p),o.push(h)}return new gs(a,o,t,n)}var fNe=Qp.prototype.constructor;function dNe(){return new fNe(this._groups,this._parents)}function hNe(e,t){var n,r,i;return function(){var a=gd(this,e),o=(this.style.removeProperty(e),gd(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function jV(e){return function(){this.style.removeProperty(e)}}function mNe(e,t,n){var r,i=n+"",a;return function(){var o=gd(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function pNe(e,t,n){var r,i,a;return function(){var o=gd(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),gd(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,l))}}function gNe(e,t){var n,r,i,a="style."+t,o="end."+a,l;return function(){var c=xo(this,e),f=c.on,h=c.value[a]==null?l||(l=jV(t)):void 0;(f!==n||i!==h)&&(r=(n=f).copy()).on(o,i=h),c.on=r}}function vNe(e,t,n){var r=(e+="")=="transform"?$ge:CV;return t==null?this.styleTween(e,hNe(e,r)).on("end.style."+e,jV(e)):typeof t=="function"?this.styleTween(e,pNe(e,r,CN(this,"style."+e,t))).each(gNe(this._id,e)):this.styleTween(e,mNe(e,r,t),n).on("end.style."+e,null)}function yNe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function xNe(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&yNe(e,o,n)),r}return a._value=t,a}function bNe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,xNe(e,t,n??""))}function wNe(e){return function(){this.textContent=e}}function SNe(e){return function(){var t=e(this);this.textContent=t??""}}function ENe(e){return this.tween("text",typeof e=="function"?SNe(CN(this,"text",e)):wNe(e==null?"":e+""))}function _Ne(e){return function(t){this.textContent=e.call(this,t)}}function CNe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&_Ne(i)),t}return r._value=e,r}function jNe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,CNe(e))}function ANe(){for(var e=this._name,t=this._id,n=AV(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)if(c=o[f]){var h=za(c,t);wb(c,e,n,f,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new gs(r,this._parents,e,n)}function ONe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var l={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var f=xo(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),f.on=t}),i===0&&a()})}var kNe=0;function gs(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function AV(){return++kNe}var Fo=Qp.prototype;gs.prototype={constructor:gs,select:uNe,selectAll:cNe,selectChild:Fo.selectChild,selectChildren:Fo.selectChildren,filter:nNe,merge:rNe,selection:dNe,transition:ANe,call:Fo.call,nodes:Fo.nodes,node:Fo.node,size:Fo.size,empty:Fo.empty,each:Fo.each,on:oNe,attr:Bke,attrTween:Vke,style:vNe,styleTween:bNe,text:ENe,textTween:jNe,remove:lNe,tween:Mke,delay:Xke,duration:Qke,ease:Jke,easeVarying:tNe,end:ONe,[Symbol.iterator]:Fo[Symbol.iterator]};function NNe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var TNe={time:null,delay:0,duration:250,ease:NNe};function PNe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function MNe(e){var t,n;e instanceof gs?(t=e._id,e=e._name):(t=AV(),(n=TNe).time=EN(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],l=o.length,c,f=0;f<l;++f)(c=o[f])&&wb(c,e,t,f,o,n||PNe(c,t));return new gs(r,this._parents,e,t)}Qp.prototype.interrupt=Nke;Qp.prototype.transition=MNe;const Jv=e=>()=>e;function DNe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Qo(e,t,n){this.k=e,this.x=t,this.y=n}Qo.prototype={constructor:Qo,scale:function(e){return e===1?this:new Qo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Qo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Sb=new Qo(1,0,0);OV.prototype=Qo.prototype;function OV(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Sb;return e.__zoom}function e_(e){e.stopImmediatePropagation()}function am(e){e.preventDefault(),e.stopImmediatePropagation()}function RNe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function INe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function h4(){return this.__zoom||Sb}function LNe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function zNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function $Ne(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function kV(){var e=RNe,t=INe,n=$Ne,r=LNe,i=zNe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=by,f=yb("start","zoom","end"),h,d,p,v=500,b=150,w=0,S=10;function E(F){F.property("__zoom",h4).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",L).filter(i).on("touchstart.zoom",B).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(F,V,D,q){var X=F.selection?F.selection():F;X.property("__zoom",h4),F!==X?N(F,V,D,q):X.interrupt().each(function(){k(this,arguments).event(q).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},E.scaleBy=function(F,V,D,q){E.scaleTo(F,function(){var X=this.__zoom.k,Y=typeof V=="function"?V.apply(this,arguments):V;return X*Y},D,q)},E.scaleTo=function(F,V,D,q){E.transform(F,function(){var X=t.apply(this,arguments),Y=this.__zoom,R=D==null?O(X):typeof D=="function"?D.apply(this,arguments):D,H=Y.invert(R),U=typeof V=="function"?V.apply(this,arguments):V;return n(C(j(Y,U),R,H),X,o)},D,q)},E.translateBy=function(F,V,D,q){E.transform(F,function(){return n(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,q)},E.translateTo=function(F,V,D,q,X){E.transform(F,function(){var Y=t.apply(this,arguments),R=this.__zoom,H=q==null?O(Y):typeof q=="function"?q.apply(this,arguments):q;return n(Sb.translate(H[0],H[1]).scale(R.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof D=="function"?-D.apply(this,arguments):-D),Y,o)},q,X)};function j(F,V){return V=Math.max(a[0],Math.min(a[1],V)),V===F.k?F:new Qo(V,F.x,F.y)}function C(F,V,D){var q=V[0]-D[0]*F.k,X=V[1]-D[1]*F.k;return q===F.x&&X===F.y?F:new Qo(F.k,q,X)}function O(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function N(F,V,D,q){F.on("start.zoom",function(){k(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(q).end()}).tween("zoom",function(){var X=this,Y=arguments,R=k(X,Y).event(q),H=t.apply(X,Y),U=D==null?O(H):typeof D=="function"?D.apply(X,Y):D,$=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),Q=X.__zoom,J=typeof V=="function"?V.apply(X,Y):V,ne=c(Q.invert(U).concat($/Q.k),J.invert(U).concat($/J.k));return function(ae){if(ae===1)ae=J;else{var re=ne(ae),ee=$/re[2];ae=new Qo(ee,U[0]-re[0]*ee,U[1]-re[1]*ee)}R.zoom(null,ae)}})}function k(F,V,D){return!D&&F.__zooming||new T(F,V)}function T(F,V){this.that=F,this.args=V,this.active=0,this.sourceEvent=null,this.extent=t.apply(F,V),this.taps=0}T.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,V){return this.mouse&&F!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var V=ki(this.that).datum();f.call(F,this.that,new DNe(F,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:f}),V)}};function M(F,...V){if(!e.apply(this,arguments))return;var D=k(this,V).event(F),q=this.__zoom,X=Math.max(a[0],Math.min(a[1],q.k*Math.pow(2,r.apply(this,arguments)))),Y=wa(F);if(D.wheel)(D.mouse[0][0]!==Y[0]||D.mouse[0][1]!==Y[1])&&(D.mouse[1]=q.invert(D.mouse[0]=Y)),clearTimeout(D.wheel);else{if(q.k===X)return;D.mouse=[Y,q.invert(Y)],jy(this),D.start()}am(F),D.wheel=setTimeout(R,b),D.zoom("mouse",n(C(j(q,X),D.mouse[0],D.mouse[1]),D.extent,o));function R(){D.wheel=null,D.end()}}function I(F,...V){if(p||!e.apply(this,arguments))return;var D=F.currentTarget,q=k(this,V,!0).event(F),X=ki(F.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),Y=wa(F,D),R=F.clientX,H=F.clientY;yV(F.view),e_(F),q.mouse=[Y,this.__zoom.invert(Y)],jy(this),q.start();function U(Q){if(am(Q),!q.moved){var J=Q.clientX-R,ne=Q.clientY-H;q.moved=J*J+ne*ne>w}q.event(Q).zoom("mouse",n(C(q.that.__zoom,q.mouse[0]=wa(Q,D),q.mouse[1]),q.extent,o))}function $(Q){X.on("mousemove.zoom mouseup.zoom",null),xV(Q.view,q.moved),am(Q),q.event(Q).end()}}function L(F,...V){if(e.apply(this,arguments)){var D=this.__zoom,q=wa(F.changedTouches?F.changedTouches[0]:F,this),X=D.invert(q),Y=D.k*(F.shiftKey?.5:2),R=n(C(j(D,Y),q,X),t.apply(this,V),o);am(F),l>0?ki(this).transition().duration(l).call(N,R,q,F):ki(this).call(E.transform,R,q,F)}}function B(F,...V){if(e.apply(this,arguments)){var D=F.touches,q=D.length,X=k(this,V,F.changedTouches.length===q).event(F),Y,R,H,U;for(e_(F),R=0;R<q;++R)H=D[R],U=wa(H,this),U=[U,this.__zoom.invert(U),H.identifier],X.touch0?!X.touch1&&X.touch0[2]!==U[2]&&(X.touch1=U,X.taps=0):(X.touch0=U,Y=!0,X.taps=1+!!h);h&&(h=clearTimeout(h)),Y&&(X.taps<2&&(d=U[0],h=setTimeout(function(){h=null},v)),jy(this),X.start())}}function z(F,...V){if(this.__zooming){var D=k(this,V).event(F),q=F.changedTouches,X=q.length,Y,R,H,U;for(am(F),Y=0;Y<X;++Y)R=q[Y],H=wa(R,this),D.touch0&&D.touch0[2]===R.identifier?D.touch0[0]=H:D.touch1&&D.touch1[2]===R.identifier&&(D.touch1[0]=H);if(R=D.that.__zoom,D.touch1){var $=D.touch0[0],Q=D.touch0[1],J=D.touch1[0],ne=D.touch1[1],ae=(ae=J[0]-$[0])*ae+(ae=J[1]-$[1])*ae,re=(re=ne[0]-Q[0])*re+(re=ne[1]-Q[1])*re;R=j(R,Math.sqrt(ae/re)),H=[($[0]+J[0])/2,($[1]+J[1])/2],U=[(Q[0]+ne[0])/2,(Q[1]+ne[1])/2]}else if(D.touch0)H=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(C(R,H,U),D.extent,o))}}function G(F,...V){if(this.__zooming){var D=k(this,V).event(F),q=F.changedTouches,X=q.length,Y,R;for(e_(F),p&&clearTimeout(p),p=setTimeout(function(){p=null},v),Y=0;Y<X;++Y)R=q[Y],D.touch0&&D.touch0[2]===R.identifier?delete D.touch0:D.touch1&&D.touch1[2]===R.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(R=wa(R,this),Math.hypot(d[0]-R[0],d[1]-R[1])<S)){var H=ki(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return E.wheelDelta=function(F){return arguments.length?(r=typeof F=="function"?F:Jv(+F),E):r},E.filter=function(F){return arguments.length?(e=typeof F=="function"?F:Jv(!!F),E):e},E.touchable=function(F){return arguments.length?(i=typeof F=="function"?F:Jv(!!F),E):i},E.extent=function(F){return arguments.length?(t=typeof F=="function"?F:Jv([[+F[0][0],+F[0][1]],[+F[1][0],+F[1][1]]]),E):t},E.scaleExtent=function(F){return arguments.length?(a[0]=+F[0],a[1]=+F[1],E):[a[0],a[1]]},E.translateExtent=function(F){return arguments.length?(o[0][0]=+F[0][0],o[1][0]=+F[1][0],o[0][1]=+F[0][1],o[1][1]=+F[1][1],E):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},E.constrain=function(F){return arguments.length?(n=F,E):n},E.duration=function(F){return arguments.length?(l=+F,E):l},E.interpolate=function(F){return arguments.length?(c=F,E):c},E.on=function(){var F=f.on.apply(f,arguments);return F===f?E:F},E.clickDistance=function(F){return arguments.length?(w=(F=+F)*F,E):Math.sqrt(w)},E.tapDistance=function(F){return arguments.length?(S=+F,E):S},E}const go={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Jm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],NV=["Enter"," ","Escape"],TV={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var yd;(function(e){e.Strict="strict",e.Loose="loose"})(yd||(yd={}));var Qu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Qu||(Qu={}));var ep;(function(e){e.Partial="partial",e.Full="full"})(ep||(ep={}));const PV={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pl||(pl={}));var xd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(xd||(xd={}));var Fe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Fe||(Fe={}));const m4={[Fe.Left]:Fe.Right,[Fe.Right]:Fe.Left,[Fe.Top]:Fe.Bottom,[Fe.Bottom]:Fe.Top};function MV(e){return e===null?null:e?"valid":"invalid"}const DV=e=>"id"in e&&"source"in e&&"target"in e,BNe=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),jN=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Zp=(e,t=[0,0])=>{const{width:n,height:r}=js(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},FNe=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const a=typeof i=="string";let o=!t.nodeLookup&&!a?i:void 0;t.nodeLookup&&(o=a?t.nodeLookup.get(i):jN(i)?i:t.nodeLookup.get(i.id));const l=o?Ux(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Eb(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _b(n)},Jp=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Eb(n,Ux(i)),r=!0)}),r?_b(n):{x:0,y:0,width:0,height:0}},AN=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{const l={...tg(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(const f of e.values()){const{measured:h,selectable:d=!0,hidden:p=!1}=f;if(o&&!d||p)continue;const v=h.width??f.width??f.initialWidth??null,b=h.height??f.height??f.initialHeight??null,w=tp(l,wd(f)),S=(v??0)*(b??0),E=a&&w>0;(!f.internals.handleBounds||E||w>=S||f.dragging)&&c.push(f)}return c},UNe=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function HNe(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function qNe({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);const l=HNe(e,o),c=Jp(l),f=ON(c,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??a,(o==null?void 0:o.padding)??.1);return await r.setViewport(f,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function RV({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:f}=l?l.internals.positionAbsolute:{x:0,y:0},h=o.origin??r;let d=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!l)a==null||a("005",go.error005());else{const v=l.measured.width,b=l.measured.height;v&&b&&(d=[[c,f],[c+v,f+b]])}else l&&Sd(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+f],[o.extent[1][0]+c,o.extent[1][1]+f]]);const p=Sd(d)?vc(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(a==null||a("015",go.error015())),{position:{x:p.x-c+(o.measured.width??0)*h[0],y:p.y-f+(o.measured.height??0)*h[1]},positionAbsolute:p}}async function VNe({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const a=new Set(e.map(p=>p.id)),o=[];for(const p of n){if(p.deletable===!1)continue;const v=a.has(p.id),b=!v&&p.parentId&&o.find(w=>w.id===p.parentId);(v||b)&&o.push(p)}const l=new Set(t.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),h=UNe(o,c);for(const p of c)l.has(p.id)&&!h.find(b=>b.id===p.id)&&h.push(p);if(!i)return{edges:h,nodes:o};const d=await i({nodes:o,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:o}:{edges:[],nodes:[]}:d}const bd=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),vc=(e={x:0,y:0},t,n)=>({x:bd(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:bd(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function IV(e,t,n){const{width:r,height:i}=js(n),{x:a,y:o}=n.internals.positionAbsolute;return vc(e,[[a,o],[a+r,o+i]],t)}const p4=(e,t,n)=>e<t?bd(Math.abs(e-t),1,t)/t:e>n?-bd(Math.abs(e-n),1,t)/t:0,LV=(e,t,n=15,r=40)=>{const i=p4(e.x,r,t.width-r)*n,a=p4(e.y,r,t.height-r)*n;return[i,a]},Eb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Cj=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),_b=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),wd=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=jN(e)?e.internals.positionAbsolute:Zp(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Ux=(e,t=[0,0])=>{var i,a;const{x:n,y:r}=jN(e)?e.internals.positionAbsolute:Zp(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},zV=(e,t)=>_b(Eb(Cj(e),Cj(t))),tp=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},g4=e=>ja(e.width)&&ja(e.height)&&ja(e.x)&&ja(e.y),ja=e=>!isNaN(e)&&isFinite(e),KNe=(e,t)=>{},eg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),tg=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{const l={x:(e-n)/i,y:(t-r)/i};return a?eg(l,o):l},Hx=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Sf(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function YNe(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Sf(e,n),i=Sf(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=Sf(e.top??e.y??0,n),i=Sf(e.bottom??e.y??0,n),a=Sf(e.left??e.x??0,t),o=Sf(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function XNe(e,t,n,r,i,a){const{x:o,y:l}=Hx(e,[t,n,r]),{x:c,y:f}=Hx({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=i-c,d=a-f;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const ON=(e,t,n,r,i,a)=>{const o=YNe(a,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,f=Math.min(l,c),h=bd(f,r,i),d=e.x+e.width/2,p=e.y+e.height/2,v=t/2-d*h,b=n/2-p*h,w=XNe(e,v,b,h,t,n),S={left:Math.min(w.left-o.left,0),top:Math.min(w.top-o.top,0),right:Math.min(w.right-o.right,0),bottom:Math.min(w.bottom-o.bottom,0)};return{x:v-S.left+S.right,y:b-S.top+S.bottom,zoom:h}},np=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Sd(e){return e!=null&&e!=="parent"}function js(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function $V(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function BV(e,t={width:0,height:0},n,r,i){const a={...e},o=r.get(n);if(o){const l=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return a}function v4(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function GNe(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function WNe(e){return{...TV,...e||{}}}function bm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:a,y:o}=Aa(e),l=tg({x:a-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:c,y:f}=n?eg(l,t):l;return{xSnapped:c,ySnapped:f,...l}}const kN=e=>({width:e.offsetWidth,height:e.offsetHeight}),FV=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},QNe=["INPUT","SELECT","TEXTAREA"];function UV(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:QNe.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const HV=e=>"clientX"in e,Aa=(e,t)=>{var a,o;const n=HV(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},y4=(e,t,n,r,i)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...kN(o)}})};function qV({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:l}){const c=e*.125+i*.375+o*.375+n*.125,f=t*.125+a*.375+l*.375+r*.125,h=Math.abs(c-e),d=Math.abs(f-t);return[c,f,h,d]}function ey(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function x4({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Fe.Left:return[t-ey(t-r,a),n];case Fe.Right:return[t+ey(r-t,a),n];case Fe.Top:return[t,n-ey(n-i,a)];case Fe.Bottom:return[t,n+ey(i-n,a)]}}function VV({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:i,targetPosition:a=Fe.Top,curvature:o=.25}){const[l,c]=x4({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[f,h]=x4({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,p,v,b]=qV({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${c} ${f},${h} ${r},${i}`,d,p,v,b]}function KV({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[a,l,i,o]}function ZNe({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a="basic"}){if(a==="manual")return r;const o=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+l}function JNe({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const a=Eb(Ux(e),Ux(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return tp(o,_b(a))>0}const eTe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,tTe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),nTe=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||eTe;let i;return DV(e)?i={...e}:i={...e,id:r(e)},tTe(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function YV({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,a,o,l]=KV({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,l]}const b4={[Fe.Left]:{x:-1,y:0},[Fe.Right]:{x:1,y:0},[Fe.Top]:{x:0,y:-1},[Fe.Bottom]:{x:0,y:1}},rTe=({source:e,sourcePosition:t=Fe.Bottom,target:n})=>t===Fe.Left||t===Fe.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},w4=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function iTe({source:e,sourcePosition:t=Fe.Bottom,target:n,targetPosition:r=Fe.Top,center:i,offset:a,stepPosition:o}){const l=b4[t],c=b4[r],f={x:e.x+l.x*a,y:e.y+l.y*a},h={x:n.x+c.x*a,y:n.y+c.y*a},d=rTe({source:f,sourcePosition:t,target:h}),p=d.x!==0?"x":"y",v=d[p];let b=[],w,S;const E={x:0,y:0},j={x:0,y:0},[,,C,O]=KV({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){p==="x"?(w=i.x??f.x+(h.x-f.x)*o,S=i.y??(f.y+h.y)/2):(w=i.x??(f.x+h.x)/2,S=i.y??f.y+(h.y-f.y)*o);const k=[{x:w,y:f.y},{x:w,y:h.y}],T=[{x:f.x,y:S},{x:h.x,y:S}];l[p]===v?b=p==="x"?k:T:b=p==="x"?T:k}else{const k=[{x:f.x,y:h.y}],T=[{x:h.x,y:f.y}];if(p==="x"?b=l.x===v?T:k:b=l.y===v?k:T,t===r){const z=Math.abs(e[p]-n[p]);if(z<=a){const G=Math.min(a-1,a-z);l[p]===v?E[p]=(f[p]>e[p]?-1:1)*G:j[p]=(h[p]>n[p]?-1:1)*G}}if(t!==r){const z=p==="x"?"y":"x",G=l[p]===c[z],F=f[z]>h[z],V=f[z]<h[z];(l[p]===1&&(!G&&F||G&&V)||l[p]!==1&&(!G&&V||G&&F))&&(b=p==="x"?k:T)}const M={x:f.x+E.x,y:f.y+E.y},I={x:h.x+j.x,y:h.y+j.y},L=Math.max(Math.abs(M.x-b[0].x),Math.abs(I.x-b[0].x)),B=Math.max(Math.abs(M.y-b[0].y),Math.abs(I.y-b[0].y));L>=B?(w=(M.x+I.x)/2,S=b[0].y):(w=b[0].x,S=(M.y+I.y)/2)}return[[e,{x:f.x+E.x,y:f.y+E.y},...b,{x:h.x+j.x,y:h.y+j.y},n],w,S,C,O]}function aTe(e,t,n,r){const i=Math.min(w4(e,t)/2,w4(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){const f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${a+i*f},${o}Q ${a},${o} ${a},${o+i*h}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${a},${o+i*c}Q ${a},${o} ${a+i*l},${o}`}function jj({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:i,targetPosition:a=Fe.Top,borderRadius:o=5,centerX:l,centerY:c,offset:f=20,stepPosition:h=.5}){const[d,p,v,b,w]=iTe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:l,y:c},offset:f,stepPosition:h});return[d.reduce((E,j,C)=>{let O="";return C>0&&C<d.length-1?O=aTe(d[C-1],j,d[C+1],o):O=`${C===0?"M":"L"}${j.x} ${j.y}`,E+=O,E},""),p,v,b,w]}function S4(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function oTe(e){var d;const{sourceNode:t,targetNode:n}=e;if(!S4(t)||!S4(n))return null;const r=t.internals.handleBounds||E4(t.handles),i=n.internals.handleBounds||E4(n.handles),a=_4((r==null?void 0:r.source)??[],e.sourceHandle),o=_4(e.connectionMode===yd.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!a||!o)return(d=e.onError)==null||d.call(e,"008",go.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(a==null?void 0:a.position)||Fe.Bottom,c=(o==null?void 0:o.position)||Fe.Top,f=yc(t,a,l),h=yc(n,o,c);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:c}}function E4(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function yc(e,t,n=Fe.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??js(e);if(r)return{x:i+o/2,y:a+l/2};switch((t==null?void 0:t.position)??n){case Fe.Top:return{x:i+o/2,y:a};case Fe.Right:return{x:i+o,y:a+l/2};case Fe.Bottom:return{x:i+o/2,y:a+l};case Fe.Left:return{x:i,y:a+l/2}}}function _4(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Aj(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function sTe(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const a=new Set;return e.reduce((o,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const f=Aj(c,t);a.has(f)||(o.push({id:f,color:c.color||n,...c}),a.add(f))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const XV=1e3,lTe=10,NN={nodeOrigin:[0,0],nodeExtent:Jm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},uTe={...NN,checkEquality:!0};function TN(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function cTe(e,t,n){const r=TN(NN,n);for(const i of e.values())if(i.parentId)MN(i,e,t,r);else{const a=Zp(i,r.nodeOrigin),o=Sd(i.extent)?i.extent:r.nodeExtent,l=vc(a,o,js(i));i.internals.positionAbsolute=l}}function fTe(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const a={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(a):i.type==="target"&&r.push(a)}return{source:n,target:r}}function PN(e){return e==="manual"}function Oj(e,t,n,r={}){var f,h;const i=TN(uTe,r),a={i:0},o=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!PN(i.zIndexMode)?XV:0;let c=e.length>0;t.clear(),n.clear();for(const d of e){let p=o.get(d.id);if(i.checkEquality&&d===(p==null?void 0:p.internals.userNode))t.set(d.id,p);else{const v=Zp(d,i.nodeOrigin),b=Sd(d.extent)?d.extent:i.nodeExtent,w=vc(v,b,js(d));p={...i.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:fTe(d,p),z:GV(d,l,i.zIndexMode),userNode:d}},t.set(d.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(c=!1),d.parentId&&MN(p,t,n,r,a)}return c}function dTe(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function MN(e,t,n,r,i){const{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=TN(NN,r),f=e.parentId,h=t.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dTe(e,n),i&&!h.parentId&&h.internals.rootParentIndex===void 0&&c==="auto"&&(h.internals.rootParentIndex=++i.i,h.internals.z=h.internals.z+i.i*lTe),i&&h.internals.rootParentIndex!==void 0&&(i.i=h.internals.rootParentIndex);const d=a&&!PN(c)?XV:0,{x:p,y:v,z:b}=hTe(e,h,o,l,d,c),{positionAbsolute:w}=e.internals,S=p!==w.x||v!==w.y;(S||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:p,y:v}:w,z:b}})}function GV(e,t,n){const r=ja(e.zIndex)?e.zIndex:0;return PN(n)?r:r+(e.selected?t:0)}function hTe(e,t,n,r,i,a){const{x:o,y:l}=t.internals.positionAbsolute,c=js(e),f=Zp(e,n),h=Sd(e.extent)?vc(f,e.extent,c):f;let d=vc({x:o+h.x,y:l+h.y},r,c);e.extent==="parent"&&(d=IV(d,c,t));const p=GV(e,i,a),v=t.internals.z??0;return{x:d.x,y:d.y,z:v>=p?v+1:p}}function DN(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const f=((o=a.get(l.parentId))==null?void 0:o.expandedRect)??wd(c),h=zV(f,l.rect);a.set(l.parentId,{expandedRect:h,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{var C;const h=c.internals.positionAbsolute,d=js(c),p=c.origin??r,v=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,b=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),E=(w-d.width)*p[0],j=(S-d.height)*p[1];(v>0||b>0||E||j)&&(i.push({id:f,type:"position",position:{x:c.position.x-v+E,y:c.position.y-b+j}}),(C=n.get(f))==null||C.forEach(O=>{e.some(N=>N.id===O.id)||i.push({id:O.id,type:"position",position:{x:O.position.x+v,y:O.position.y+b}})})),(d.width<l.width||d.height<l.height||v||b)&&i.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:w+(v?p[0]*v-E:0),height:S+(b?p[1]*b-j:0)}})}),i}function mTe(e,t,n,r,i,a,o){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const f=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.transform),p=[];for(const v of e.values()){const b=t.get(v.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),c=!0;continue}const w=kN(v.nodeElement),S=b.measured.width!==w.width||b.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!b.internals.handleBounds||v.force))){const j=v.nodeElement.getBoundingClientRect(),C=Sd(b.extent)?b.extent:a;let{positionAbsolute:O}=b.internals;b.parentId&&b.extent==="parent"?O=IV(O,w,t.get(b.parentId)):C&&(O=vc(O,C,w));const N={...b,measured:w,internals:{...b.internals,positionAbsolute:O,handleBounds:{source:y4("source",v.nodeElement,j,d,b.id),target:y4("target",v.nodeElement,j,d,b.id)}}};t.set(b.id,N),b.parentId&&MN(N,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,S&&(f.push({id:b.id,type:"dimensions",dimensions:w}),b.expandParent&&b.parentId&&p.push({id:b.id,parentId:b.parentId,rect:wd(N,i)}))}}if(p.length>0){const v=DN(p,t,n,i);f.push(...v)}return{changes:f,updatedInternals:c}}async function pTe({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function C4(e,t,n,r,i,a){let o=i;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${i}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;const f=r.get(o)||new Map;r.set(o,f.set(n,t))}}function WV(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:a,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:a,sourceHandle:o,targetHandle:l},f=`${i}-${o}--${a}-${l}`,h=`${a}-${l}--${i}-${o}`;C4("source",c,h,e,i,o),C4("target",c,f,e,a,l),t.set(r.id,r)}}function QV(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:QV(n,t):!1}function j4(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function gTe(e,t,n,r){const i=new Map;for(const[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!QV(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(a);l&&i.set(a,{id:a,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function t_({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const i=[];for(const[f,h]of t){const d=(o=n.get(f))==null?void 0:o.internals.userNode;d&&i.push({...d,position:h.position,dragging:r})}if(!e)return[i[0],i];const a=(l=n.get(e))==null?void 0:l.internals.userNode;return[a?{...a,position:((c=t.get(e))==null?void 0:c.position)||a.position,dragging:r}:i[0],i]}function vTe({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const a={x:n-i.distance.x,y:r-i.distance.y},o=eg(a,t);return{x:o.x-a.x,y:o.y-a.y}}function yTe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,l=new Map,c=!1,f={x:0,y:0},h=null,d=!1,p=null,v=!1,b=!1,w=null;function S({noDragClassName:j,handleSelector:C,domNode:O,isSelectable:N,nodeId:k,nodeClickDistance:T=0}){p=ki(O);function M({x:z,y:G}){const{nodeLookup:F,nodeExtent:V,snapGrid:D,snapToGrid:q,nodeOrigin:X,onNodeDrag:Y,onSelectionDrag:R,onError:H,updateNodePositions:U}=t();a={x:z,y:G};let $=!1;const Q=l.size>1,J=Q&&V?Cj(Jp(l)):null,ne=Q&&q?vTe({dragItems:l,snapGrid:D,x:z,y:G}):null;for(const[ae,re]of l){if(!F.has(ae))continue;let ee={x:z-re.distance.x,y:G-re.distance.y};q&&(ee=ne?{x:Math.round(ee.x+ne.x),y:Math.round(ee.y+ne.y)}:eg(ee,D));let se=null;if(Q&&V&&!re.extent&&J){const{positionAbsolute:we}=re.internals,be=we.x-J.x+V[0][0],$e=we.x+re.measured.width-J.x2+V[1][0],Ne=we.y-J.y+V[0][1],Je=we.y+re.measured.height-J.y2+V[1][1];se=[[be,Ne],[$e,Je]]}const{position:me,positionAbsolute:ie}=RV({nodeId:ae,nextPosition:ee,nodeLookup:F,nodeExtent:se||V,nodeOrigin:X,onError:H});$=$||re.position.x!==me.x||re.position.y!==me.y,re.position=me,re.internals.positionAbsolute=ie}if(b=b||$,!!$&&(U(l,!0),w&&(r||Y||!k&&R))){const[ae,re]=t_({nodeId:k,dragItems:l,nodeLookup:F});r==null||r(w,l,ae,re),Y==null||Y(w,ae,re),k||R==null||R(w,re)}}async function I(){if(!h)return;const{transform:z,panBy:G,autoPanSpeed:F,autoPanOnNodeDrag:V}=t();if(!V){c=!1,cancelAnimationFrame(o);return}const[D,q]=LV(f,h,F);(D!==0||q!==0)&&(a.x=(a.x??0)-D/z[2],a.y=(a.y??0)-q/z[2],await G({x:D,y:q})&&M(a)),o=requestAnimationFrame(I)}function L(z){var Q;const{nodeLookup:G,multiSelectionActive:F,nodesDraggable:V,transform:D,snapGrid:q,snapToGrid:X,selectNodesOnDrag:Y,onNodeDragStart:R,onSelectionDragStart:H,unselectNodesAndEdges:U}=t();d=!0,(!Y||!N)&&!F&&k&&((Q=G.get(k))!=null&&Q.selected||U()),N&&Y&&k&&(e==null||e(k));const $=bm(z.sourceEvent,{transform:D,snapGrid:q,snapToGrid:X,containerBounds:h});if(a=$,l=gTe(G,V,$,k),l.size>0&&(n||R||!k&&H)){const[J,ne]=t_({nodeId:k,dragItems:l,nodeLookup:G});n==null||n(z.sourceEvent,l,J,ne),R==null||R(z.sourceEvent,J,ne),k||H==null||H(z.sourceEvent,ne)}}const B=bV().clickDistance(T).on("start",z=>{const{domNode:G,nodeDragThreshold:F,transform:V,snapGrid:D,snapToGrid:q}=t();h=(G==null?void 0:G.getBoundingClientRect())||null,v=!1,b=!1,w=z.sourceEvent,F===0&&L(z),a=bm(z.sourceEvent,{transform:V,snapGrid:D,snapToGrid:q,containerBounds:h}),f=Aa(z.sourceEvent,h)}).on("drag",z=>{const{autoPanOnNodeDrag:G,transform:F,snapGrid:V,snapToGrid:D,nodeDragThreshold:q,nodeLookup:X}=t(),Y=bm(z.sourceEvent,{transform:F,snapGrid:V,snapToGrid:D,containerBounds:h});if(w=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||k&&!X.has(k))&&(v=!0),!v){if(!c&&G&&d&&(c=!0,I()),!d){const R=Aa(z.sourceEvent,h),H=R.x-f.x,U=R.y-f.y;Math.sqrt(H*H+U*U)>q&&L(z)}(a.x!==Y.xSnapped||a.y!==Y.ySnapped)&&l&&d&&(f=Aa(z.sourceEvent,h),M(Y))}}).on("end",z=>{if(!(!d||v)&&(c=!1,d=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:G,updateNodePositions:F,onNodeDragStop:V,onSelectionDragStop:D}=t();if(b&&(F(l,!1),b=!1),i||V||!k&&D){const[q,X]=t_({nodeId:k,dragItems:l,nodeLookup:G,dragging:!1});i==null||i(z.sourceEvent,l,q,X),V==null||V(z.sourceEvent,q,X),k||D==null||D(z.sourceEvent,X)}}}).filter(z=>{const G=z.target;return!z.button&&(!j||!j4(G,`.${j}`,O))&&(!C||j4(G,C,O))});p.call(B)}function E(){p==null||p.on(".drag",null)}return{update:S,destroy:E}}function xTe(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())tp(i,wd(a))>0&&r.push(a);return r}const bTe=250;function wTe(e,t,n,r){var l,c;let i=[],a=1/0;const o=xTe(e,n,t+bTe);for(const f of o){const h=[...((l=f.internals.handleBounds)==null?void 0:l.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:p,y:v}=yc(f,d,d.position,!0),b=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(v-e.y,2));b>t||(b<a?(i=[{...d,x:p,y:v}],a=b):b===a&&i.push({...d,x:p,y:v}))}}if(!i.length)return null;if(i.length>1){const f=r.type==="source"?"target":"source";return i.find(h=>h.type===f)??i[0]}return i[0]}function ZV(e,t,n,r,i,a=!1){var f,h,d;const o=r.get(e);if(!o)return null;const l=i==="strict"?(f=o.internals.handleBounds)==null?void 0:f[t]:[...((h=o.internals.handleBounds)==null?void 0:h.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?l==null?void 0:l.find(p=>p.id===n):l==null?void 0:l[0])??null;return c&&a?{...c,...yc(o,c,c.position,!0)}:c}function JV(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function STe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const eK=()=>!0;function ETe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:l,nodeLookup:c,lib:f,autoPanOnConnect:h,flowId:d,panBy:p,cancelConnection:v,onConnectStart:b,onConnect:w,onConnectEnd:S,isValidConnection:E=eK,onReconnectEnd:j,updateConnection:C,getTransform:O,getFromHandle:N,autoPanSpeed:k,dragThreshold:T=1,handleDomNode:M}){const I=FV(e.target);let L=0,B;const{x:z,y:G}=Aa(e),F=JV(a,M),V=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!V||!F)return;const q=ZV(i,F,r,c,t);if(!q)return;let X=Aa(e,V),Y=!1,R=null,H=!1,U=null;function $(){if(!h||!V)return;const[me,ie]=LV(X,V,k);p({x:me,y:ie}),L=requestAnimationFrame($)}const Q={...q,nodeId:i,type:F,position:q.position},J=c.get(i);let ae={inProgress:!0,isValid:null,from:yc(J,Q,Fe.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:J,to:X,toHandle:null,toPosition:m4[Q.position],toNode:null,pointer:X};function re(){D=!0,C(ae),b==null||b(e,{nodeId:i,handleId:r,handleType:F})}T===0&&re();function ee(me){if(!D){const{x:Je,y:Qe}=Aa(me),nt=Je-z,Nn=Qe-G;if(!(nt*nt+Nn*Nn>T*T))return;re()}if(!N()||!Q){se(me);return}const ie=O();X=Aa(me,V),B=wTe(tg(X,ie,!1,[1,1]),n,c,Q),Y||($(),Y=!0);const we=tK(me,{handle:B,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:E,doc:I,lib:f,flowId:d,nodeLookup:c});U=we.handleDomNode,R=we.connection,H=STe(!!B,we.isValid);const be=c.get(i),$e=be?yc(be,Q,Fe.Left,!0):ae.from,Ne={...ae,from:$e,isValid:H,to:we.toHandle&&H?Hx({x:we.toHandle.x,y:we.toHandle.y},ie):X,toHandle:we.toHandle,toPosition:H&&we.toHandle?we.toHandle.position:m4[Q.position],toNode:we.toHandle?c.get(we.toHandle.nodeId):null,pointer:X};C(Ne),ae=Ne}function se(me){if(!("touches"in me&&me.touches.length>0)){if(D){(B||U)&&R&&H&&(w==null||w(R));const{inProgress:ie,...we}=ae,be={...we,toPosition:ae.toHandle?ae.toPosition:null};S==null||S(me,be),a&&(j==null||j(me,be))}v(),cancelAnimationFrame(L),Y=!1,H=!1,R=null,U=null,I.removeEventListener("mousemove",ee),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",ee),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",ee),I.addEventListener("mouseup",se),I.addEventListener("touchmove",ee),I.addEventListener("touchend",se)}function tK(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:l,flowId:c,isValidConnection:f=eK,nodeLookup:h}){const d=a==="target",p=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:v,y:b}=Aa(e),w=o.elementFromPoint(v,b),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:p,E={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const j=JV(void 0,S),C=S.getAttribute("data-nodeid"),O=S.getAttribute("data-handleid"),N=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!C||!j)return E;const T={source:d?C:r,sourceHandle:d?O:i,target:d?r:C,targetHandle:d?i:O};E.connection=T;const I=N&&k&&(n===yd.Strict?d&&j==="source"||!d&&j==="target":C!==r||O!==i);E.isValid=I&&f(T),E.toHandle=ZV(C,j,O,h,n,!0)}return E}const kj={onPointerDown:ETe,isValid:tK};function _Te({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=ki(e);function a({translateExtent:l,width:c,height:f,zoomStep:h=1,pannable:d=!0,zoomable:p=!0,inversePan:v=!1}){const b=C=>{if(C.sourceEvent.type!=="wheel"||!t)return;const O=n(),N=C.sourceEvent.ctrlKey&&np()?10:1,k=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*h,T=O[2]*Math.pow(2,k*N);t.scaleTo(T)};let w=[0,0];const S=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(w=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},E=C=>{const O=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const N=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],k=[N[0]-w[0],N[1]-w[1]];w=N;const T=r()*Math.max(O[2],Math.log(O[2]))*(v?-1:1),M={x:O[0]-k[0]*T,y:O[1]-k[1]*T},I=[[0,0],[c,f]];t.setViewportConstrained({x:M.x,y:M.y,zoom:O[2]},I,l)},j=kV().on("start",S).on("zoom",d?E:null).on("zoom.wheel",p?b:null);i.call(j,{})}function o(){i.on("zoom",null)}return{update:a,destroy:o,pointer:wa}}const Cb=e=>({x:e.x,y:e.y,zoom:e.k}),n_=({x:e,y:t,zoom:n})=>Sb.translate(e,t).scale(n),Pf=(e,t)=>e.target.closest(`.${t}`),nK=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),CTe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,r_=(e,t=0,n=CTe,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},rK=e=>{const t=e.ctrlKey&&np()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function jTe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:f}){return h=>{if(Pf(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&o){const S=wa(h),E=rK(h),j=d*Math.pow(2,E);r.scaleTo(n,j,S,h);return}const p=h.deltaMode===1?20:1;let v=i===Qu.Vertical?0:h.deltaX*p,b=i===Qu.Horizontal?0:h.deltaY*p;!np()&&h.shiftKey&&i!==Qu.Vertical&&(v=h.deltaY*p,b=0),r.translateBy(n,-(v/d)*a,-(b/d)*a,{internal:!0});const w=Cb(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(h,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function ATe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const a=r.type==="wheel",o=!t&&a&&!r.ctrlKey,l=Pf(r,e);if(r.ctrlKey&&a&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,i)}}function OTe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,o,l;if((a=r.sourceEvent)!=null&&a.internal)return;const i=Cb(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function kTe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{var o,l;e.usedRightMouseButton=!!(n&&nK(t,e.mouseButton??0)),(o=a.sourceEvent)!=null&&o.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!((l=a.sourceEvent)!=null&&l.internal)&&(i==null||i(a.sourceEvent,Cb(a.transform)))}}function NTe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,a&&nK(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const c=Cb(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,c)},n?150:0)}}}function TTe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:f,connectionInProgress:h}){return d=>{var S;const p=e||t,v=n&&d.ctrlKey,b=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Pf(d,`${f}-flow__node`)||Pf(d,`${f}-flow__edge`)))return!0;if(!r&&!p&&!i&&!a&&!n||o||h&&!b||Pf(d,l)&&b||Pf(d,c)&&(!b||i&&b&&!e)||!n&&d.ctrlKey&&b)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!p&&!i&&!v&&b||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||b)&&w}}function PTe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=kV().scaleExtent([t,n]).translateExtent(r),p=ki(e).call(d);j({x:i.x,y:i.y,zoom:bd(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const v=p.on("wheel.zoom"),b=p.on("dblclick.zoom");d.wheelDelta(rK);function w(B,z){return p?new Promise(G=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?es:by).transform(r_(p,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function S({noWheelClassName:B,noPanClassName:z,onPaneContextMenu:G,userSelectionActive:F,panOnScroll:V,panOnDrag:D,panOnScrollMode:q,panOnScrollSpeed:X,preventScrolling:Y,zoomOnPinch:R,zoomOnScroll:H,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:J,connectionInProgress:ne,paneClickDistance:ae,selectionOnDrag:re}){F&&!f.isZoomingOrPanning&&E();const ee=V&&!$&&!F;d.clickDistance(re?1/0:!ja(ae)||ae<0?0:ae);const se=ee?jTe({zoomPanValues:f,noWheelClassName:B,d3Selection:p,d3Zoom:d,panOnScrollMode:q,panOnScrollSpeed:X,zoomOnPinch:R,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:l}):ATe({noWheelClassName:B,preventScrolling:Y,d3ZoomHandler:v});if(p.on("wheel.zoom",se,{passive:!1}),!F){const ie=OTe({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:o});d.on("start",ie);const we=kTe({zoomPanValues:f,panOnDrag:D,onPaneContextMenu:!!G,onPanZoom:a,onTransformChange:J});d.on("zoom",we);const be=NTe({zoomPanValues:f,panOnDrag:D,panOnScroll:V,onPaneContextMenu:G,onPanZoomEnd:l,onDraggingChange:c});d.on("end",be)}const me=TTe({zoomActivationKeyPressed:$,panOnDrag:D,zoomOnScroll:H,panOnScroll:V,zoomOnDoubleClick:U,zoomOnPinch:R,userSelectionActive:F,noPanClassName:z,noWheelClassName:B,lib:Q,connectionInProgress:ne});d.filter(me),U?p.on("dblclick.zoom",b):p.on("dblclick.zoom",null)}function E(){d.on("zoom",null)}async function j(B,z,G){const F=n_(B),V=d==null?void 0:d.constrain()(F,z,G);return V&&await w(V),new Promise(D=>D(V))}async function C(B,z){const G=n_(B);return await w(G,z),new Promise(F=>F(G))}function O(B){if(p){const z=n_(B),G=p.property("__zoom");(G.k!==B.zoom||G.x!==B.x||G.y!==B.y)&&(d==null||d.transform(p,z,null,{sync:!0}))}}function N(){const B=p?OV(p.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}function k(B,z){return p?new Promise(G=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?es:by).scaleTo(r_(p,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function T(B,z){return p?new Promise(G=>{d==null||d.interpolate((z==null?void 0:z.interpolate)==="linear"?es:by).scaleBy(r_(p,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>G(!0)),B)}):Promise.resolve(!1)}function M(B){d==null||d.scaleExtent(B)}function I(B){d==null||d.translateExtent(B)}function L(B){const z=!ja(B)||B<0?0:B;d==null||d.clickDistance(z)}return{update:S,destroy:E,setViewport:C,setViewportConstrained:j,getViewport:N,scaleTo:k,scaleBy:T,setScaleExtent:M,setTranslateExtent:I,syncViewport:O,setClickDistance:L}}var Ed;(function(e){e.Line="line",e.Handle="handle"})(Ed||(Ed={}));function MTe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&i&&(c[0]=c[0]*-1),l&&a&&(c[1]=c[1]*-1),c}function A4(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ol(e,t){return Math.max(0,t-e)}function sl(e,t){return Math.max(0,e-t)}function ty(e,t,n){return Math.max(0,t-e,e-n)}function O4(e,t){return e?!t:t}function DTe(e,t,n,r,i,a,o,l){let{affectsX:c,affectsY:f}=t;const{isHorizontal:h,isVertical:d}=t,p=h&&d,{xSnapped:v,ySnapped:b}=n,{minWidth:w,maxWidth:S,minHeight:E,maxHeight:j}=r,{x:C,y:O,width:N,height:k,aspectRatio:T}=e;let M=Math.floor(h?v-e.pointerX:0),I=Math.floor(d?b-e.pointerY:0);const L=N+(c?-M:M),B=k+(f?-I:I),z=-a[0]*N,G=-a[1]*k;let F=ty(L,w,S),V=ty(B,E,j);if(o){let X=0,Y=0;c&&M<0?X=ol(C+M+z,o[0][0]):!c&&M>0&&(X=sl(C+L+z,o[1][0])),f&&I<0?Y=ol(O+I+G,o[0][1]):!f&&I>0&&(Y=sl(O+B+G,o[1][1])),F=Math.max(F,X),V=Math.max(V,Y)}if(l){let X=0,Y=0;c&&M>0?X=sl(C+M,l[0][0]):!c&&M<0&&(X=ol(C+L,l[1][0])),f&&I>0?Y=sl(O+I,l[0][1]):!f&&I<0&&(Y=ol(O+B,l[1][1])),F=Math.max(F,X),V=Math.max(V,Y)}if(i){if(h){const X=ty(L/T,E,j)*T;if(F=Math.max(F,X),o){let Y=0;!c&&!f||c&&!f&&p?Y=sl(O+G+L/T,o[1][1])*T:Y=ol(O+G+(c?M:-M)/T,o[0][1])*T,F=Math.max(F,Y)}if(l){let Y=0;!c&&!f||c&&!f&&p?Y=ol(O+L/T,l[1][1])*T:Y=sl(O+(c?M:-M)/T,l[0][1])*T,F=Math.max(F,Y)}}if(d){const X=ty(B*T,w,S)/T;if(V=Math.max(V,X),o){let Y=0;!c&&!f||f&&!c&&p?Y=sl(C+B*T+z,o[1][0])/T:Y=ol(C+(f?I:-I)*T+z,o[0][0])/T,V=Math.max(V,Y)}if(l){let Y=0;!c&&!f||f&&!c&&p?Y=ol(C+B*T,l[1][0])/T:Y=sl(C+(f?I:-I)*T,l[0][0])/T,V=Math.max(V,Y)}}}I=I+(I<0?V:-V),M=M+(M<0?F:-F),i&&(p?L>B*T?I=(O4(c,f)?-M:M)/T:M=(O4(c,f)?-I:I)*T:h?(I=M/T,f=c):(M=I*T,c=f));const D=c?C+M:C,q=f?O+I:O;return{width:N+(c?-M:M),height:k+(f?-I:I),x:a[0]*M*(c?-1:1)+D,y:a[1]*I*(f?-1:1)+q}}const iK={width:0,height:0,x:0,y:0},RTe={...iK,pointerX:0,pointerY:0,aspectRatio:1};function ITe(e){return[[0,0],[e.measured.width,e.measured.height]]}function LTe(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,l=n[0]*a,c=n[1]*o;return[[r-l,i-c],[r+a-l,i+o-c]]}function zTe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const a=ki(e);let o={controlDirection:A4("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:f,boundaries:h,keepAspectRatio:d,resizeDirection:p,onResizeStart:v,onResize:b,onResizeEnd:w,shouldResize:S}){let E={...iK},j={...RTe};o={boundaries:h,resizeDirection:p,keepAspectRatio:d,controlDirection:A4(f)};let C,O=null,N=[],k,T,M,I=!1;const L=bV().on("start",B=>{const{nodeLookup:z,transform:G,snapGrid:F,snapToGrid:V,nodeOrigin:D,paneDomNode:q}=n();if(C=z.get(t),!C)return;O=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:X,ySnapped:Y}=bm(B.sourceEvent,{transform:G,snapGrid:F,snapToGrid:V,containerBounds:O});E={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},j={...E,pointerX:X,pointerY:Y,aspectRatio:E.width/E.height},k=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(k=z.get(C.parentId),T=k&&C.extent==="parent"?ITe(k):void 0),N=[],M=void 0;for(const[R,H]of z)if(H.parentId===t&&(N.push({id:R,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const U=LTe(H,C,H.origin??D);M?M=[[Math.min(U[0][0],M[0][0]),Math.min(U[0][1],M[0][1])],[Math.max(U[1][0],M[1][0]),Math.max(U[1][1],M[1][1])]]:M=U}v==null||v(B,{...E})}).on("drag",B=>{const{transform:z,snapGrid:G,snapToGrid:F,nodeOrigin:V}=n(),D=bm(B.sourceEvent,{transform:z,snapGrid:G,snapToGrid:F,containerBounds:O}),q=[];if(!C)return;const{x:X,y:Y,width:R,height:H}=E,U={},$=C.origin??V,{width:Q,height:J,x:ne,y:ae}=DTe(j,o.controlDirection,D,o.boundaries,o.keepAspectRatio,$,T,M),re=Q!==R,ee=J!==H,se=ne!==X&&re,me=ae!==Y&&ee;if(!se&&!me&&!re&&!ee)return;if((se||me||$[0]===1||$[1]===1)&&(U.x=se?ne:E.x,U.y=me?ae:E.y,E.x=U.x,E.y=U.y,N.length>0)){const $e=ne-X,Ne=ae-Y;for(const Je of N)Je.position={x:Je.position.x-$e+$[0]*(Q-R),y:Je.position.y-Ne+$[1]*(J-H)},q.push(Je)}if((re||ee)&&(U.width=re&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Q:E.width,U.height=ee&&(!o.resizeDirection||o.resizeDirection==="vertical")?J:E.height,E.width=U.width,E.height=U.height),k&&C.expandParent){const $e=$[0]*(U.width??0);U.x&&U.x<$e&&(E.x=$e,j.x=j.x-(U.x-$e));const Ne=$[1]*(U.height??0);U.y&&U.y<Ne&&(E.y=Ne,j.y=j.y-(U.y-Ne))}const ie=MTe({width:E.width,prevWidth:R,height:E.height,prevHeight:H,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),we={...E,direction:ie};(S==null?void 0:S(B,we))!==!1&&(I=!0,b==null||b(B,we),r(U,q))}).on("end",B=>{I&&(w==null||w(B,{...E}),i==null||i({...E}),I=!1)});a.call(L)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}const $Te={},k4=e=>{let t;const n=new Set,r=(h,d)=>{const p=typeof h=="function"?h(t):h;if(!Object.is(p,t)){const v=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{($Te?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,i,c);return c},BTe=e=>e?k4(e):k4,{useDebugValue:FTe}=_e,{useSyncExternalStoreWithSelector:UTe}=ife,HTe=e=>e;function aK(e,t=HTe,n){const r=UTe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FTe(r),r}const N4=(e,t)=>{const n=BTe(e),r=(i,a=t)=>aK(n,i,a);return Object.assign(r,n),r},qTe=(e,t)=>e?N4(e,t):N4;function hn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const jb=x.createContext(null),VTe=jb.Provider,oK=go.error001();function St(e,t){const n=x.useContext(jb);if(n===null)throw new Error(oK);return aK(n,e,t)}function mn(){const e=x.useContext(jb);if(e===null)throw new Error(oK);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const T4={display:"none"},KTe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sK="react-flow__node-desc",lK="react-flow__edge-desc",YTe="react-flow__aria-live",XTe=e=>e.ariaLiveMessage,GTe=e=>e.ariaLabelConfig;function WTe({rfId:e}){const t=St(XTe);return g.jsx("div",{id:`${YTe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:KTe,children:t})}function QTe({rfId:e,disableKeyboardA11y:t}){const n=St(GTe);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${sK}-${e}`,style:T4,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${lK}-${e}`,style:T4,children:n["edge.a11yDescription.default"]}),!t&&g.jsx(WTe,{rfId:e})]})}const Ab=x.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},a)=>{const o=`${e}`.split("-");return g.jsx("div",{className:Gn(["react-flow__panel",n,...o]),style:r,ref:a,...i,children:t})});Ab.displayName="Panel";function ZTe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:g.jsx(Ab,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:g.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const JTe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ny=e=>e.id;function ePe(e,t){return hn(e.selectedNodes.map(ny),t.selectedNodes.map(ny))&&hn(e.selectedEdges.map(ny),t.selectedEdges.map(ny))}function tPe({onSelectionChange:e}){const t=mn(),{selectedNodes:n,selectedEdges:r}=St(JTe,ePe);return x.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(a=>a(i))},[n,r,e]),null}const nPe=e=>!!e.onSelectionChangeHandlers;function rPe({onSelectionChange:e}){const t=St(nPe);return e||t?g.jsx(tPe,{onSelectionChange:e}):null}const uK=[0,0],iPe={x:0,y:0,zoom:1},aPe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],P4=[...aPe,"rfId"],oPe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),M4={translateExtent:Jm,nodeOrigin:uK,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function sPe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=St(oPe,hn),f=mn();x.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=M4,l()}),[]);const h=x.useRef(M4);return x.useEffect(()=>{for(const d of P4){const p=e[d],v=h.current[d];p!==v&&(typeof e[d]>"u"||(d==="nodes"?t(p):d==="edges"?n(p):d==="minZoom"?r(p):d==="maxZoom"?i(p):d==="translateExtent"?a(p):d==="nodeExtent"?o(p):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:WNe(p)}):d==="fitView"?f.setState({fitViewQueued:p}):d==="fitViewOptions"?f.setState({fitViewOptions:p}):f.setState({[d]:p})))}h.current=e},P4.map(d=>e[d])),null}function D4(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lPe(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const i=D4(),a=()=>n(i!=null&&i.matches?"dark":"light");return a(),i==null||i.addEventListener("change",a),()=>{i==null||i.removeEventListener("change",a)}},[e]),t!==null?t:(r=D4())!=null&&r.matches?"dark":"light"}const R4=typeof document<"u"?document:null;function rp(e=null,t={target:R4,actInsideInputWithModifier:!0}){const[n,r]=x.useState(!1),i=x.useRef(!1),a=x.useRef(new Set([])),[o,l]=x.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
`).replace(`

`,`
+`).split(`
`)),h=f.reduce((d,p)=>d.concat(...p),[]);return[f,h]}return[[],[]]},[e]);return x.useEffect(()=>{const c=(t==null?void 0:t.target)??R4,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=v=>{var S,E;if(i.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!i.current||i.current&&!f)&&UV(v))return!1;const w=L4(v.code,l);if(a.current.add(v[w]),I4(o,a.current,!1)){const j=((E=(S=v.composedPath)==null?void 0:S.call(v))==null?void 0:E[0])||v.target,C=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";t.preventDefault!==!1&&(i.current||!C)&&v.preventDefault(),r(!0)}},d=v=>{const b=L4(v.code,l);I4(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(v[b]),v.key==="Meta"&&a.current.clear(),i.current=!1},p=()=>{a.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",h),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",h),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),n}function I4(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function L4(e,t){return t.includes(e)?"code":"key"}const uPe=()=>{const e=mn();return x.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:a,maxZoom:o,panZoom:l}=e.getState(),c=ON(t,r,i,a,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),f={x:t.x-l,y:t.y-c},h=n.snapGrid??i,d=n.snapToGrid??a;return tg(f,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:a}=r.getBoundingClientRect(),o=Hx(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function cK(e,t){const n=[],r=new Map,i=[];for(const a of e)if(a.type==="add"){i.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const o=r.get(a.id);o?o.push(a):r.set(a.id,[a])}for(const a of t){const o=r.get(a.id);if(!o){n.push(a);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...a};for(const c of o)cPe(c,l);n.push(l)}return i.length&&i.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function cPe(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function fPe(e,t){return cK(e,t)}function dPe(e,t){return cK(e,t)}function Pu(e,t){return{id:e,type:"select",selected:t}}function Mf(e,t=new Set,n=!1){const r=[];for(const[i,a]of e){const o=t.has(i);!(a.selected===void 0&&!o)&&a.selected!==o&&(n&&(a.selected=o),r.push(Pu(a.id,o)))}return r}function z4({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,o]of e.entries()){const l=t.get(o.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function $4(e){return{id:e.id,type:"remove"}}const B4=e=>BNe(e),hPe=e=>DV(e);function fK(e){return x.forwardRef(e)}const mPe=typeof window<"u"?x.useLayoutEffect:x.useEffect;function F4(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>pPe(()=>n(i=>i+BigInt(1))));return mPe(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function pPe(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const dK=x.createContext(null);function gPe({children:e}){const t=mn(),n=x.useCallback(l=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:h,onNodesChange:d,nodeLookup:p,fitViewQueued:v,onNodesChangeMiddlewareMap:b}=t.getState();let w=c;for(const E of l)w=typeof E=="function"?E(w):E;let S=z4({items:w,lookup:p});for(const E of b.values())S=E(S);h&&f(w),S.length>0?d==null||d(S):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:j,setNodes:C}=t.getState();E&&C(j)})},[]),r=F4(n),i=x.useCallback(l=>{const{edges:c=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:p}=t.getState();let v=c;for(const b of l)v=typeof b=="function"?b(v):b;h?f(v):d&&d(z4({items:v,lookup:p}))},[]),a=F4(i),o=x.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return g.jsx(dK.Provider,{value:o,children:e})}function vPe(){const e=x.useContext(dK);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const yPe=e=>!!e.panZoom;function Ob(){const e=uPe(),t=mn(),n=vPe(),r=St(yPe),i=x.useMemo(()=>{const a=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},c=d=>{var E,j;const{nodeLookup:p,nodeOrigin:v}=t.getState(),b=B4(d)?d:p.get(d.id),w=b.parentId?BV(b.position,b.measured,b.parentId,p,v):b.position,S={...b,position:w,width:((E=b.measured)==null?void 0:E.width)??b.width,height:((j=b.measured)==null?void 0:j.height)??b.height};return wd(S)},f=(d,p,v={replace:!1})=>{o(b=>b.map(w=>{if(w.id===d){const S=typeof p=="function"?p(w):p;return v.replace&&B4(S)?S:{...w,...S}}return w}))},h=(d,p,v={replace:!1})=>{l(b=>b.map(w=>{if(w.id===d){const S=typeof p=="function"?p(w):p;return v.replace&&hPe(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var p;return(p=a(d))==null?void 0:p.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(p=>({...p}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:l,addNodes:d=>{const p=Array.isArray(d)?d:[d];n.nodeQueue.push(v=>[...v,...p])},addEdges:d=>{const p=Array.isArray(d)?d:[d];n.edgeQueue.push(v=>[...v,...p])},toObject:()=>{const{nodes:d=[],edges:p=[],transform:v}=t.getState(),[b,w,S]=v;return{nodes:d.map(E=>({...E})),edges:p.map(E=>({...E})),viewport:{x:b,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:p=[]})=>{const{nodes:v,edges:b,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:E,triggerEdgeChanges:j,onDelete:C,onBeforeDelete:O}=t.getState(),{nodes:N,edges:k}=await VNe({nodesToRemove:d,edgesToRemove:p,nodes:v,edges:b,onBeforeDelete:O}),T=k.length>0,M=N.length>0;if(T){const I=k.map($4);S==null||S(k),j(I)}if(M){const I=N.map($4);w==null||w(N),E(I)}return(M||T)&&(C==null||C({nodes:N,edges:k})),{deletedNodes:N,deletedEdges:k}},getIntersectingNodes:(d,p=!0,v)=>{const b=g4(d),w=b?d:c(d),S=v!==void 0;return w?(v||t.getState().nodes).filter(E=>{const j=t.getState().nodeLookup.get(E.id);if(j&&!b&&(E.id===d.id||!j.internals.positionAbsolute))return!1;const C=wd(S?E:j),O=tp(C,w);return p&&O>0||O>=C.width*C.height||O>=w.width*w.height}):[]},isNodeIntersecting:(d,p,v=!0)=>{const w=g4(d)?d:c(d);if(!w)return!1;const S=tp(w,p);return v&&S>0||S>=p.width*p.height||S>=w.width*w.height},updateNode:f,updateNodeData:(d,p,v={replace:!1})=>{f(d,b=>{const w=typeof p=="function"?p(b):p;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},updateEdge:h,updateEdgeData:(d,p,v={replace:!1})=>{h(d,b=>{const w=typeof p=="function"?p(b):p;return v.replace?{...b,data:w}:{...b,data:{...b.data,...w}}},v)},getNodesBounds:d=>{const{nodeLookup:p,nodeOrigin:v}=t.getState();return FNe(d,{nodeLookup:p,nodeOrigin:v})},getHandleConnections:({type:d,id:p,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}-${d}${p?`-${p}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:d,handleId:p,nodeId:v})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${v}${d?p?`-${d}-${p}`:`-${d}`:""}`))==null?void 0:b.values())??[])},fitView:async d=>{const p=t.getState().fitViewResolver??GNe();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:p}),n.nodeQueue.push(v=>[...v]),p.promise}}},[]);return x.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const U4=e=>e.selected,xPe=typeof window<"u"?window:void 0;function bPe({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=mn(),{deleteElements:r}=Ob(),i=rp(e,{actInsideInputWithModifier:!1}),a=rp(t,{target:xPe});x.useEffect(()=>{if(i){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(U4),edges:o.filter(U4)}),n.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function wPe(e){const t=mn();x.useEffect(()=>{const n=()=>{var i,a,o,l;if(!e.current||!(((a=(i=e.current).checkVisibility)==null?void 0:a.call(i))??!0))return!1;const r=kN(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",go.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const kb={position:"absolute",width:"100%",height:"100%",top:0,left:0},SPe=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function EPe({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Qu.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:f,minZoom:h,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:v=!0,children:b,noWheelClassName:w,noPanClassName:S,onViewportChange:E,isControlledViewport:j,paneClickDistance:C,selectionOnDrag:O}){const N=mn(),k=x.useRef(null),{userSelectionActive:T,lib:M,connectionInProgress:I}=St(SPe,hn),L=rp(p),B=x.useRef();wPe(k);const z=x.useCallback(G=>{E==null||E({x:G[0],y:G[1],zoom:G[2]}),j||N.setState({transform:G})},[E,j]);return x.useEffect(()=>{if(k.current){B.current=PTe({domNode:k.current,minZoom:h,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:D=>N.setState(q=>q.paneDragging===D?q:{paneDragging:D}),onPanZoomStart:(D,q)=>{const{onViewportChangeStart:X,onMoveStart:Y}=N.getState();Y==null||Y(D,q),X==null||X(q)},onPanZoom:(D,q)=>{const{onViewportChange:X,onMove:Y}=N.getState();Y==null||Y(D,q),X==null||X(q)},onPanZoomEnd:(D,q)=>{const{onViewportChangeEnd:X,onMoveEnd:Y}=N.getState();Y==null||Y(D,q),X==null||X(q)}});const{x:G,y:F,zoom:V}=B.current.getViewport();return N.setState({panZoom:B.current,transform:[G,F,V],domNode:k.current.closest(".react-flow")}),()=>{var D;(D=B.current)==null||D.destroy()}}},[]),x.useEffect(()=>{var G;(G=B.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:L,preventScrolling:v,noPanClassName:S,userSelectionActive:T,noWheelClassName:w,lib:M,onTransformChange:z,connectionInProgress:I,selectionOnDrag:O,paneClickDistance:C})},[e,t,n,r,i,a,o,l,L,v,S,T,w,M,z,I,O,C]),g.jsx("div",{className:"react-flow__renderer",ref:k,style:kb,children:b})}const _Pe=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function CPe(){const{userSelectionActive:e,userSelectionRect:t}=St(_Pe,hn);return e&&t?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const i_=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},jPe=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function APe({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ep.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:v,children:b}){const w=mn(),{userSelectionActive:S,elementsSelectable:E,dragging:j,connectionInProgress:C}=St(jPe,hn),O=E&&(e||S),N=x.useRef(null),k=x.useRef(),T=x.useRef(new Set),M=x.useRef(new Set),I=x.useRef(!1),L=X=>{if(I.current||C){I.current=!1;return}c==null||c(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},B=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}f==null||f(X)},z=h?X=>h(X):void 0,G=X=>{I.current&&(X.stopPropagation(),I.current=!1)},F=X=>{var J,ne;const{domNode:Y}=w.getState();if(k.current=Y==null?void 0:Y.getBoundingClientRect(),!k.current)return;const R=X.target===N.current;if(!R&&!!X.target.closest(".nokey")||!e||!(a&&R||t)||X.button!==0||!X.isPrimary)return;(ne=(J=X.target)==null?void 0:J.setPointerCapture)==null||ne.call(J,X.pointerId),I.current=!1;const{x:$,y:Q}=Aa(X.nativeEvent,k.current);w.setState({userSelectionRect:{width:0,height:0,startX:$,startY:Q,x:$,y:Q}}),R||(X.stopPropagation(),X.preventDefault())},V=X=>{const{userSelectionRect:Y,transform:R,nodeLookup:H,edgeLookup:U,connectionLookup:$,triggerNodeChanges:Q,triggerEdgeChanges:J,defaultEdgeOptions:ne,resetSelectedElements:ae}=w.getState();if(!k.current||!Y)return;const{x:re,y:ee}=Aa(X.nativeEvent,k.current),{startX:se,startY:me}=Y;if(!I.current){const Ne=t?0:i;if(Math.hypot(re-se,ee-me)<=Ne)return;ae(),o==null||o(X)}I.current=!0;const ie={startX:se,startY:me,x:re<se?re:se,y:ee<me?ee:me,width:Math.abs(re-se),height:Math.abs(ee-me)},we=T.current,be=M.current;T.current=new Set(AN(H,ie,R,n===ep.Partial,!0).map(Ne=>Ne.id)),M.current=new Set;const $e=(ne==null?void 0:ne.selectable)??!0;for(const Ne of T.current){const Je=$.get(Ne);if(Je)for(const{edgeId:Qe}of Je.values()){const nt=U.get(Qe);nt&&(nt.selectable??$e)&&M.current.add(Qe)}}if(!v4(we,T.current)){const Ne=Mf(H,T.current,!0);Q(Ne)}if(!v4(be,M.current)){const Ne=Mf(U,M.current);J(Ne)}w.setState({userSelectionRect:ie,userSelectionActive:!0,nodesSelectionActive:!1})},D=X=>{var Y,R;X.button===0&&((R=(Y=X.target)==null?void 0:Y.releasePointerCapture)==null||R.call(Y,X.pointerId),!S&&X.target===N.current&&w.getState().userSelectionRect&&(L==null||L(X)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(X),w.setState({nodesSelectionActive:T.current.size>0})))},q=r===!0||Array.isArray(r)&&r.includes(0);return g.jsxs("div",{className:Gn(["react-flow__pane",{draggable:q,dragging:j,selection:e}]),onClick:O?void 0:i_(L,N),onContextMenu:i_(B,N),onWheel:i_(z,N),onPointerEnter:O?void 0:d,onPointerMove:O?V:p,onPointerUp:O?D:void 0,onPointerDownCapture:O?F:void 0,onClickCapture:O?G:void 0,onPointerLeave:v,ref:N,style:kb,children:[b,g.jsx(CPe,{})]})}function Nj({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),f=l.get(e);if(!f){c==null||c("012",go.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&o)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([e])}function hK({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){const l=mn(),[c,f]=x.useState(!1),h=x.useRef();return x.useEffect(()=>{h.current=yTe({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Nj({id:d,store:l,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),x.useEffect(()=>{if(!(t||!e.current||!h.current))return h.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{var d;(d=h.current)==null||d.destroy()}},[n,r,t,a,e,i,o]),c}const OPe=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function mK(){const e=mn();return x.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:a,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:f,nodeOrigin:h}=e.getState(),d=new Map,p=OPe(o),v=i?a[0]:5,b=i?a[1]:5,w=n.direction.x*v*n.factor,S=n.direction.y*b*n.factor;for(const[,E]of f){if(!p(E))continue;let j={x:E.internals.positionAbsolute.x+w,y:E.internals.positionAbsolute.y+S};i&&(j=eg(j,a));const{position:C,positionAbsolute:O}=RV({nodeId:E.id,nextPosition:j,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:l});E.position=C,E.internals.positionAbsolute=O,d.set(E.id,E)}c(d)},[])}const RN=x.createContext(null),kPe=RN.Provider;RN.Consumer;const pK=()=>x.useContext(RN),NPe=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),TPe=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:l,toHandle:c,isValid:f}=o,h=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:a===yd.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:h&&f}};function PPe({type:e="source",position:t=Fe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:l,children:c,className:f,onMouseDown:h,onTouchStart:d,...p},v){var V,D;const b=o||null,w=e==="target",S=mn(),E=pK(),{connectOnClick:j,noPanClassName:C,rfId:O}=St(NPe,hn),{connectingFrom:N,connectingTo:k,clickConnecting:T,isPossibleEndHandle:M,connectionInProcess:I,clickConnectionInProcess:L,valid:B}=St(TPe(E,b,e),hn);E||(D=(V=S.getState()).onError)==null||D.call(V,"010",go.error010());const z=q=>{const{defaultEdgeOptions:X,onConnect:Y,hasDefaultEdges:R}=S.getState(),H={...X,...q};if(R){const{edges:U,setEdges:$}=S.getState();$(nTe(H,U))}Y==null||Y(H),l==null||l(H)},G=q=>{if(!E)return;const X=HV(q.nativeEvent);if(i&&(X&&q.button===0||!X)){const Y=S.getState();kj.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:Y.autoPanOnConnect,connectionMode:Y.connectionMode,connectionRadius:Y.connectionRadius,domNode:Y.domNode,nodeLookup:Y.nodeLookup,lib:Y.lib,isTarget:w,handleId:b,nodeId:E,flowId:Y.rfId,panBy:Y.panBy,cancelConnection:Y.cancelConnection,onConnectStart:Y.onConnectStart,onConnectEnd:(...R)=>{var H,U;return(U=(H=S.getState()).onConnectEnd)==null?void 0:U.call(H,...R)},updateConnection:Y.updateConnection,onConnect:z,isValidConnection:n||((...R)=>{var H,U;return((U=(H=S.getState()).isValidConnection)==null?void 0:U.call(H,...R))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:Y.autoPanSpeed,dragThreshold:Y.connectionDragThreshold})}X?h==null||h(q):d==null||d(q)},F=q=>{const{onClickConnectStart:X,onClickConnectEnd:Y,connectionClickStartHandle:R,connectionMode:H,isValidConnection:U,lib:$,rfId:Q,nodeLookup:J,connection:ne}=S.getState();if(!E||!R&&!i)return;if(!R){X==null||X(q.nativeEvent,{nodeId:E,handleId:b,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:E,type:e,id:b}});return}const ae=FV(q.target),re=n||U,{connection:ee,isValid:se}=kj.isValid(q.nativeEvent,{handle:{nodeId:E,id:b,type:e},connectionMode:H,fromNodeId:R.nodeId,fromHandleId:R.id||null,fromType:R.type,isValidConnection:re,flowId:Q,doc:ae,lib:$,nodeLookup:J});se&&ee&&z(ee);const me=structuredClone(ne);delete me.inProgress,me.toPosition=me.toHandle?me.toHandle.position:null,Y==null||Y(q,me),S.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":b,"data-nodeid":E,"data-handlepos":t,"data-id":`${O}-${E}-${b}-${e}`,className:Gn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,f,{source:!w,target:w,connectable:r,connectablestart:i,connectableend:a,clickconnecting:T,connectingfrom:N,connectingto:k,valid:B,connectionindicator:r&&(!I||M)&&(I||L?a:i)}]),onMouseDown:G,onTouchStart:G,onClick:j?F:void 0,ref:v,...p,children:c})}const _d=x.memo(fK(PPe));function MPe({data:e,isConnectable:t,sourcePosition:n=Fe.Bottom}){return g.jsxs(g.Fragment,{children:[e==null?void 0:e.label,g.jsx(_d,{type:"source",position:n,isConnectable:t})]})}function DPe({data:e,isConnectable:t,targetPosition:n=Fe.Top,sourcePosition:r=Fe.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(_d,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,g.jsx(_d,{type:"source",position:r,isConnectable:t})]})}function RPe(){return null}function IPe({data:e,isConnectable:t,targetPosition:n=Fe.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(_d,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qx={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},H4={input:MPe,default:DPe,output:IPe,group:RPe};function LPe(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const zPe=e=>{const{width:t,height:n,x:r,y:i}=Jp(e.nodeLookup,{filter:a=>!!a.selected});return{width:ja(t)?t:null,height:ja(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function $Pe({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=mn(),{width:i,height:a,transformString:o,userSelectionActive:l}=St(zPe,hn),c=mK(),f=x.useRef(null);x.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]);const h=!l&&i!==null&&a!==null;if(hK({nodeRef:f,disabled:!h}),!h)return null;const d=e?v=>{const b=r.getState().nodes.filter(w=>w.selected);e(v,b)}:void 0,p=v=>{Object.prototype.hasOwnProperty.call(qx,v.key)&&(v.preventDefault(),c({direction:qx[v.key],factor:v.shiftKey?4:1}))};return g.jsx("div",{className:Gn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:g.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:i,height:a}})})}const q4=typeof window<"u"?window:void 0,BPe=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gK({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:h,selectionMode:d,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:b,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:E,zoomOnScroll:j,zoomOnPinch:C,panOnScroll:O,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:T,panOnDrag:M,defaultViewport:I,translateExtent:L,minZoom:B,maxZoom:z,preventScrolling:G,onSelectionContextMenu:F,noWheelClassName:V,noPanClassName:D,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:Y}){const{nodesSelectionActive:R,userSelectionActive:H}=St(BPe,hn),U=rp(f,{target:q4}),$=rp(w,{target:q4}),Q=$||M,J=$||O,ne=h&&Q!==!0,ae=U||H||ne;return bPe({deleteKeyCode:c,multiSelectionKeyCode:b}),g.jsx(EPe,{onPaneContextMenu:a,elementsSelectable:E,zoomOnScroll:j,zoomOnPinch:C,panOnScroll:J,panOnScrollSpeed:N,panOnScrollMode:k,zoomOnDoubleClick:T,panOnDrag:!U&&Q,defaultViewport:I,translateExtent:L,minZoom:B,maxZoom:z,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:V,noPanClassName:D,onViewportChange:X,isControlledViewport:Y,paneClickDistance:l,selectionOnDrag:ne,children:g.jsxs(APe,{onSelectionStart:p,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:Q,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:ne,children:[e,R&&g.jsx($Pe,{onSelectionContextMenu:F,noPanClassName:D,disableKeyboardA11y:q})]})})}gK.displayName="FlowRenderer";const FPe=x.memo(gK),UPe=e=>t=>e?AN(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function HPe(e){return St(x.useCallback(UPe(e),[e]),hn)}const qPe=e=>e.updateNodeInternals;function VPe(){const e=St(qPe),[t]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const a=i.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:i.target,force:!0})}),e(r)}));return x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function KPe({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=mn(),a=x.useRef(null),o=x.useRef(null),l=x.useRef(e.sourcePosition),c=x.useRef(e.targetPosition),f=x.useRef(t),h=n&&!!e.internals.handleBounds;return x.useEffect(()=>{a.current&&!e.hidden&&(!h||o.current!==a.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(a.current),o.current=a.current)},[h,e.hidden]),x.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),x.useEffect(()=>{if(a.current){const d=f.current!==t,p=l.current!==e.sourcePosition,v=c.current!==e.targetPosition;(d||p||v)&&(f.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function YPe({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:f,nodesFocusable:h,resizeObserver:d,noDragClassName:p,noPanClassName:v,disableKeyboardA11y:b,rfId:w,nodeTypes:S,nodeClickDistance:E,onError:j}){const{node:C,internals:O,isParent:N}=St(re=>{const ee=re.nodeLookup.get(e),se=re.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:se}},hn);let k=C.type||"default",T=(S==null?void 0:S[k])||H4[k];T===void 0&&(j==null||j("003",go.error003(k)),k="default",T=(S==null?void 0:S.default)||H4.default);const M=!!(C.draggable||l&&typeof C.draggable>"u"),I=!!(C.selectable||c&&typeof C.selectable>"u"),L=!!(C.connectable||f&&typeof C.connectable>"u"),B=!!(C.focusable||h&&typeof C.focusable>"u"),z=mn(),G=$V(C),F=KPe({node:C,nodeType:k,hasDimensions:G,resizeObserver:d}),V=hK({nodeRef:F,disabled:C.hidden||!M,noDragClassName:p,handleSelector:C.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:E}),D=mK();if(C.hidden)return null;const q=js(C),X=LPe(C),Y=I||M||t||n||r||i,R=n?re=>n(re,{...O.userNode}):void 0,H=r?re=>r(re,{...O.userNode}):void 0,U=i?re=>i(re,{...O.userNode}):void 0,$=a?re=>a(re,{...O.userNode}):void 0,Q=o?re=>o(re,{...O.userNode}):void 0,J=re=>{const{selectNodesOnDrag:ee,nodeDragThreshold:se}=z.getState();I&&(!ee||!M||se>0)&&Nj({id:e,store:z,nodeRef:F}),t&&t(re,{...O.userNode})},ne=re=>{if(!(UV(re.nativeEvent)||b)){if(NV.includes(re.key)&&I){const ee=re.key==="Escape";Nj({id:e,store:z,unselect:ee,nodeRef:F})}else if(M&&C.selected&&Object.prototype.hasOwnProperty.call(qx,re.key)){re.preventDefault();const{ariaLabelConfig:ee}=z.getState();z.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:qx[re.key],factor:re.shiftKey?4:1})}}},ae=()=>{var be;if(b||!((be=F.current)!=null&&be.matches(":focus-visible")))return;const{transform:re,width:ee,height:se,autoPanOnNodeFocus:me,setCenter:ie}=z.getState();if(!me)return;AN(new Map([[e,C]]),{x:0,y:0,width:ee,height:se},re,!0).length>0||ie(C.position.x+q.width/2,C.position.y+q.height/2,{zoom:re[2]})};return g.jsx("div",{className:Gn(["react-flow__node",`react-flow__node-${k}`,{[v]:M},C.className,{selected:C.selected,selectable:I,parent:N,draggable:M,dragging:V}]),ref:F,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:Y?"all":"none",visibility:G?"visible":"hidden",...C.style,...X},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:H,onMouseLeave:U,onContextMenu:$,onClick:J,onDoubleClick:Q,onKeyDown:B?ne:void 0,tabIndex:B?0:void 0,onFocus:B?ae:void 0,role:C.ariaRole??(B?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${sK}-${w}`,"aria-label":C.ariaLabel,...C.domAttributes,children:g.jsx(kPe,{value:e,children:g.jsx(T,{id:e,data:C.data,type:k,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:C.selected??!1,selectable:I,draggable:M,deletable:C.deletable??!0,isConnectable:L,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:V,dragHandle:C.dragHandle,zIndex:O.z,parentId:C.parentId,...q})})})}var XPe=x.memo(YPe);const GPe=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function vK(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=St(GPe,hn),o=HPe(e.onlyRenderVisibleElements),l=VPe();return g.jsx("div",{className:"react-flow__nodes",style:kb,children:o.map(c=>g.jsx(XPe,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},c))})}vK.displayName="NodeRenderer";const WPe=x.memo(vK);function QPe(e){return St(x.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const a=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);a&&o&&JNe({sourceNode:a,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),hn)}const ZPe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},JPe=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},V4={[xd.Arrow]:ZPe,[xd.ArrowClosed]:JPe};function e2e(e){const t=mn();return x.useMemo(()=>{var i,a;return Object.prototype.hasOwnProperty.call(V4,e)?V4[e]:((a=(i=t.getState()).onError)==null||a.call(i,"009",go.error009(e)),null)},[e])}const t2e=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=e2e(t);return c?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0",children:g.jsx(c,{color:n,strokeWidth:o})}):null},yK=({defaultColor:e,rfId:t})=>{const n=St(a=>a.edges),r=St(a=>a.defaultEdgeOptions),i=x.useMemo(()=>sTe(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:i.map(a=>g.jsx(t2e,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};yK.displayName="MarkerDefinitions";var n2e=x.memo(yK);function xK({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:f,...h}){const[d,p]=x.useState({x:1,y:0,width:0,height:0}),v=Gn(["react-flow__edge-textwrapper",f]),b=x.useRef(null);return x.useEffect(()=>{if(b.current){const w=b.current.getBBox();p({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?g.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...h,children:[i&&g.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),g.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:b,style:r,children:n}),c]}):null}xK.displayName="EdgeText";const r2e=x.memo(xK);function Nb({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:f=20,...h}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...h,d:e,fill:"none",className:Gn(["react-flow__edge-path",h.className])}),f?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&ja(t)&&ja(n)?g.jsx(r2e,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function K4({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Fe.Left||e===Fe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function bK({sourceX:e,sourceY:t,sourcePosition:n=Fe.Bottom,targetX:r,targetY:i,targetPosition:a=Fe.Top}){const[o,l]=K4({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,f]=K4({pos:a,x1:r,y1:i,x2:e,y2:t}),[h,d,p,v]=qV({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:f});return[`M${e},${t} C${o},${l} ${c},${f} ${r},${i}`,h,d,p,v]}function wK(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:l,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:E})=>{const[j,C,O]=bK({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l}),N=e.isInternal?void 0:t;return g.jsx(Nb,{id:N,path:j,labelX:C,labelY:O,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:E})})}const i2e=wK({isInternal:!1}),SK=wK({isInternal:!0});i2e.displayName="SimpleBezierEdge";SK.displayName="SimpleBezierEdgeInternal";function EK(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:p,sourcePosition:v=Fe.Bottom,targetPosition:b=Fe.Top,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:j})=>{const[C,O,N]=jj({sourceX:n,sourceY:r,sourcePosition:v,targetX:i,targetY:a,targetPosition:b,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),k=e.isInternal?void 0:t;return g.jsx(Nb,{id:k,path:C,labelX:O,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:p,markerEnd:w,markerStart:S,interactionWidth:j})})}const _K=EK({isInternal:!1}),CK=EK({isInternal:!0});_K.displayName="SmoothStepEdge";CK.displayName="SmoothStepEdgeInternal";function jK(e){return x.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return g.jsx(_K,{...n,id:r,pathOptions:x.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const a2e=jK({isInternal:!1}),AK=jK({isInternal:!0});a2e.displayName="StepEdge";AK.displayName="StepEdgeInternal";function OK(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:p,markerEnd:v,markerStart:b,interactionWidth:w})=>{const[S,E,j]=YV({sourceX:n,sourceY:r,targetX:i,targetY:a}),C=e.isInternal?void 0:t;return g.jsx(Nb,{id:C,path:S,labelX:E,labelY:j,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:d,style:p,markerEnd:v,markerStart:b,interactionWidth:w})})}const o2e=OK({isInternal:!1}),kK=OK({isInternal:!0});o2e.displayName="StraightEdge";kK.displayName="StraightEdgeInternal";function NK(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Fe.Bottom,targetPosition:l=Fe.Top,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,pathOptions:E,interactionWidth:j})=>{const[C,O,N]=VV({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:l,curvature:E==null?void 0:E.curvature}),k=e.isInternal?void 0:t;return g.jsx(Nb,{id:k,path:C,labelX:O,labelY:N,label:c,labelStyle:f,labelShowBg:h,labelBgStyle:d,labelBgPadding:p,labelBgBorderRadius:v,style:b,markerEnd:w,markerStart:S,interactionWidth:j})})}const s2e=NK({isInternal:!1}),TK=NK({isInternal:!0});s2e.displayName="BezierEdge";TK.displayName="BezierEdgeInternal";const Y4={default:TK,straight:kK,step:AK,smoothstep:CK,simplebezier:SK},X4={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},l2e=(e,t,n)=>n===Fe.Left?e-t:n===Fe.Right?e+t:e,u2e=(e,t,n)=>n===Fe.Top?e-t:n===Fe.Bottom?e+t:e,G4="react-flow__edgeupdater";function W4({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:l}){return g.jsx("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Gn([G4,`${G4}-${l}`]),cx:l2e(t,r,e),cy:u2e(n,r,e),r,stroke:"transparent",fill:"transparent"})}function c2e({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:f,onReconnectStart:h,onReconnectEnd:d,setReconnecting:p,setUpdateHover:v}){const b=mn(),w=(O,N)=>{if(O.button!==0)return;const{autoPanOnConnect:k,domNode:T,connectionMode:M,connectionRadius:I,lib:L,onConnectStart:B,cancelConnection:z,nodeLookup:G,rfId:F,panBy:V,updateConnection:D}=b.getState(),q=N.type==="target",X=(H,U)=>{p(!1),d==null||d(H,n,N.type,U)},Y=H=>f==null?void 0:f(n,H),R=(H,U)=>{p(!0),h==null||h(O,n,N.type),B==null||B(H,U)};kj.onPointerDown(O.nativeEvent,{autoPanOnConnect:k,connectionMode:M,connectionRadius:I,domNode:T,handleId:N.id,nodeId:N.nodeId,nodeLookup:G,isTarget:q,edgeUpdaterType:N.type,lib:L,flowId:F,cancelConnection:z,panBy:V,isValidConnection:(...H)=>{var U,$;return(($=(U=b.getState()).isValidConnection)==null?void 0:$.call(U,...H))??!0},onConnect:Y,onConnectStart:R,onConnectEnd:(...H)=>{var U,$;return($=(U=b.getState()).onConnectEnd)==null?void 0:$.call(U,...H)},onReconnectEnd:X,updateConnection:D,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},S=O=>w(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=O=>w(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),j=()=>v(!0),C=()=>v(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(W4,{position:l,centerX:r,centerY:i,radius:t,onMouseDown:S,onMouseEnter:j,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&g.jsx(W4,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:E,onMouseEnter:j,onMouseOut:C,type:"target"})]})}function f2e({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,reconnectRadius:h,onReconnect:d,onReconnectStart:p,onReconnectEnd:v,rfId:b,edgeTypes:w,noPanClassName:S,onError:E,disableKeyboardA11y:j}){let C=St(ie=>ie.edgeLookup.get(e));const O=St(ie=>ie.defaultEdgeOptions);C=O?{...O,...C}:C;let N=C.type||"default",k=(w==null?void 0:w[N])||Y4[N];k===void 0&&(E==null||E("011",go.error011(N)),N="default",k=(w==null?void 0:w.default)||Y4.default);const T=!!(C.focusable||t&&typeof C.focusable>"u"),M=typeof d<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),I=!!(C.selectable||r&&typeof C.selectable>"u"),L=x.useRef(null),[B,z]=x.useState(!1),[G,F]=x.useState(!1),V=mn(),{zIndex:D,sourceX:q,sourceY:X,targetX:Y,targetY:R,sourcePosition:H,targetPosition:U}=St(x.useCallback(ie=>{const we=ie.nodeLookup.get(C.source),be=ie.nodeLookup.get(C.target);if(!we||!be)return{zIndex:C.zIndex,...X4};const $e=oTe({id:e,sourceNode:we,targetNode:be,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:ie.connectionMode,onError:E});return{zIndex:ZNe({selected:C.selected,zIndex:C.zIndex,sourceNode:we,targetNode:be,elevateOnSelect:ie.elevateEdgesOnSelect,zIndexMode:ie.zIndexMode}),...$e||X4}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),hn),$=x.useMemo(()=>C.markerStart?`url('#${Aj(C.markerStart,b)}')`:void 0,[C.markerStart,b]),Q=x.useMemo(()=>C.markerEnd?`url('#${Aj(C.markerEnd,b)}')`:void 0,[C.markerEnd,b]);if(C.hidden||q===null||X===null||Y===null||R===null)return null;const J=ie=>{var Ne;const{addSelectedEdges:we,unselectNodesAndEdges:be,multiSelectionActive:$e}=V.getState();I&&(V.setState({nodesSelectionActive:!1}),C.selected&&$e?(be({nodes:[],edges:[C]}),(Ne=L.current)==null||Ne.blur()):we([e])),i&&i(ie,C)},ne=a?ie=>{a(ie,{...C})}:void 0,ae=o?ie=>{o(ie,{...C})}:void 0,re=l?ie=>{l(ie,{...C})}:void 0,ee=c?ie=>{c(ie,{...C})}:void 0,se=f?ie=>{f(ie,{...C})}:void 0,me=ie=>{var we;if(!j&&NV.includes(ie.key)&&I){const{unselectNodesAndEdges:be,addSelectedEdges:$e}=V.getState();ie.key==="Escape"?((we=L.current)==null||we.blur(),be({edges:[C]})):$e([e])}};return g.jsx("svg",{style:{zIndex:D},children:g.jsxs("g",{className:Gn(["react-flow__edge",`react-flow__edge-${N}`,C.className,S,{selected:C.selected,animated:C.animated,inactive:!I&&!i,updating:B,selectable:I}]),onClick:J,onDoubleClick:ne,onContextMenu:ae,onMouseEnter:re,onMouseMove:ee,onMouseLeave:se,onKeyDown:T?me:void 0,tabIndex:T?0:void 0,role:C.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":T?`${lK}-${b}`:void 0,ref:L,...C.domAttributes,children:[!G&&g.jsx(k,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:I,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:q,sourceY:X,targetX:Y,targetY:R,sourcePosition:H,targetPosition:U,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:$,markerEnd:Q,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),M&&g.jsx(c2e,{edge:C,isReconnectable:M,reconnectRadius:h,onReconnect:d,onReconnectStart:p,onReconnectEnd:v,sourceX:q,sourceY:X,targetX:Y,targetY:R,sourcePosition:H,targetPosition:U,setUpdateHover:z,setReconnecting:F})]})})}var d2e=x.memo(f2e);const h2e=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function PK({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:p,onReconnectStart:v,onReconnectEnd:b,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:E,elementsSelectable:j,onError:C}=St(h2e,hn),O=QPe(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(n2e,{defaultColor:e,rfId:n}),O.map(N=>g.jsx(d2e,{id:N,edgesFocusable:S,edgesReconnectable:E,elementsSelectable:j,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:f,onClick:h,reconnectRadius:d,onDoubleClick:p,onReconnectStart:v,onReconnectEnd:b,rfId:n,onError:C,edgeTypes:r,disableKeyboardA11y:w},N))]})}PK.displayName="EdgeRenderer";const m2e=x.memo(PK),p2e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function g2e({children:e}){const t=St(p2e);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function v2e(e){const t=Ob(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const y2e=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function x2e(e){const t=St(y2e),n=mn();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function b2e(e){return e.connection.inProgress?{...e.connection,to:tg(e.connection.to,e.transform)}:{...e.connection}}function w2e(e){return b2e}function S2e(e){const t=w2e();return St(t,hn)}const E2e=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _2e({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:a,height:o,isValid:l,inProgress:c}=St(E2e,hn);return!(a&&i&&c)?null:g.jsx("svg",{style:e,width:a,height:o,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:Gn(["react-flow__connection",MV(l)]),children:g.jsx(MK,{style:t,type:n,CustomComponent:r,isValid:l})})})}const MK=({style:e,type:t=pl.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:a,fromNode:o,fromHandle:l,fromPosition:c,to:f,toNode:h,toHandle:d,toPosition:p,pointer:v}=S2e();if(!i)return;if(n)return g.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:p,connectionStatus:MV(r),toNode:h,toHandle:d,pointer:v});let b="";const w={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:p};switch(t){case pl.Bezier:[b]=VV(w);break;case pl.SimpleBezier:[b]=bK(w);break;case pl.Step:[b]=jj({...w,borderRadius:0});break;case pl.SmoothStep:[b]=jj(w);break;default:[b]=YV(w)}return g.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};MK.displayName="ConnectionLine";const C2e={};function Q4(e=C2e){x.useRef(e),mn(),x.useEffect(()=>{},[e])}function j2e(){mn(),x.useRef(!1),x.useEffect(()=>{},[])}function DK({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:p,onSelectionEnd:v,connectionLineType:b,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:E,selectionKeyCode:j,selectionOnDrag:C,selectionMode:O,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:T,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:L,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:F,preventScrolling:V,defaultMarkerColor:D,zoomOnScroll:q,zoomOnPinch:X,panOnScroll:Y,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:U,panOnDrag:$,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneScroll:re,onPaneContextMenu:ee,paneClickDistance:se,nodeClickDistance:me,onEdgeContextMenu:ie,onEdgeMouseEnter:we,onEdgeMouseMove:be,onEdgeMouseLeave:$e,reconnectRadius:Ne,onReconnect:Je,onReconnectStart:Qe,onReconnectEnd:nt,noDragClassName:Nn,noWheelClassName:Wn,noPanClassName:Mt,disableKeyboardA11y:Tn,nodeExtent:Rt,rfId:pn,viewport:de,onViewportChange:xe}){return Q4(e),Q4(t),j2e(),v2e(n),x2e(de),g.jsx(FPe,{onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:ae,onPaneContextMenu:ee,onPaneScroll:re,paneClickDistance:se,deleteKeyCode:M,selectionKeyCode:j,selectionOnDrag:C,selectionMode:O,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:N,panActivationKeyCode:k,zoomActivationKeyCode:T,elementsSelectable:L,zoomOnScroll:q,zoomOnPinch:X,zoomOnDoubleClick:U,panOnScroll:Y,panOnScrollSpeed:R,panOnScrollMode:H,panOnDrag:$,defaultViewport:B,translateExtent:z,minZoom:G,maxZoom:F,onSelectionContextMenu:d,preventScrolling:V,noDragClassName:Nn,noWheelClassName:Wn,noPanClassName:Mt,disableKeyboardA11y:Tn,onViewportChange:xe,isControlledViewport:!!de,children:g.jsxs(g2e,{children:[g.jsx(m2e,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:Je,onReconnectStart:Qe,onReconnectEnd:nt,onlyRenderVisibleElements:I,onEdgeContextMenu:ie,onEdgeMouseEnter:we,onEdgeMouseMove:be,onEdgeMouseLeave:$e,reconnectRadius:Ne,defaultMarkerColor:D,noPanClassName:Mt,disableKeyboardA11y:Tn,rfId:pn}),g.jsx(_2e,{style:w,type:b,component:S,containerStyle:E}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(WPe,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:me,onlyRenderVisibleElements:I,noPanClassName:Mt,noDragClassName:Nn,disableKeyboardA11y:Tn,nodeExtent:Rt,rfId:pn}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}DK.displayName="GraphView";const A2e=x.memo(DK),Z4=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:d,zIndexMode:p="basic"}={})=>{const v=new Map,b=new Map,w=new Map,S=new Map,E=r??t??[],j=n??e??[],C=h??[0,0],O=d??Jm;WV(w,S,E);const N=Oj(j,v,b,{nodeOrigin:C,nodeExtent:O,zIndexMode:p});let k=[0,0,1];if(o&&i&&a){const T=Jp(v,{filter:B=>!!((B.width||B.initialWidth)&&(B.height||B.initialHeight))}),{x:M,y:I,zoom:L}=ON(T,i,a,c,f,(l==null?void 0:l.padding)??.1);k=[M,I,L]}return{rfId:"1",width:i??0,height:a??0,transform:k,nodes:j,nodesInitialized:N,nodeLookup:v,parentLookup:b,edges:E,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:Jm,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...PV},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:KNe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:TV,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},O2e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:h,nodeExtent:d,zIndexMode:p})=>qTe((v,b)=>{async function w(){const{nodeLookup:S,panZoom:E,fitViewOptions:j,fitViewResolver:C,width:O,height:N,minZoom:k,maxZoom:T}=b();E&&(await qNe({nodes:S,width:O,height:N,panZoom:E,minZoom:k,maxZoom:T},j),C==null||C.resolve(!0),v({fitViewResolver:null}))}return{...Z4({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:f,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:p}),setNodes:S=>{const{nodeLookup:E,parentLookup:j,nodeOrigin:C,elevateNodesOnSelect:O,fitViewQueued:N,zIndexMode:k}=b(),T=Oj(S,E,j,{nodeOrigin:C,nodeExtent:d,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:k});N&&T?(w(),v({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:S,nodesInitialized:T})},setEdges:S=>{const{connectionLookup:E,edgeLookup:j}=b();WV(E,j,S),v({edges:S})},setDefaultNodesAndEdges:(S,E)=>{if(S){const{setNodes:j}=b();j(S),v({hasDefaultNodes:!0})}if(E){const{setEdges:j}=b();j(E),v({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:E,nodeLookup:j,parentLookup:C,domNode:O,nodeOrigin:N,nodeExtent:k,debug:T,fitViewQueued:M,zIndexMode:I}=b(),{changes:L,updatedInternals:B}=mTe(S,j,C,O,N,k,I);B&&(cTe(j,C,{nodeOrigin:N,nodeExtent:k,zIndexMode:I}),M?(w(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(L==null?void 0:L.length)>0&&(T&&console.log("React Flow: trigger node changes",L),E==null||E(L)))},updateNodePositions:(S,E=!1)=>{const j=[];let C=[];const{nodeLookup:O,triggerNodeChanges:N,connection:k,updateConnection:T,onNodesChangeMiddlewareMap:M}=b();for(const[I,L]of S){const B=O.get(I),z=!!(B!=null&&B.expandParent&&(B!=null&&B.parentId)&&(L!=null&&L.position)),G={id:I,type:"position",position:z?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:E};if(B&&k.inProgress&&k.fromNode.id===B.id){const F=yc(B,k.fromHandle,Fe.Left,!0);T({...k,from:F})}z&&B.parentId&&j.push({id:I,parentId:B.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),C.push(G)}if(j.length>0){const{parentLookup:I,nodeOrigin:L}=b(),B=DN(j,O,I,L);C.push(...B)}for(const I of M.values())C=I(C);N(C)},triggerNodeChanges:S=>{const{onNodesChange:E,setNodes:j,nodes:C,hasDefaultNodes:O,debug:N}=b();if(S!=null&&S.length){if(O){const k=fPe(S,C);j(k)}N&&console.log("React Flow: trigger node changes",S),E==null||E(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:E,setEdges:j,edges:C,hasDefaultEdges:O,debug:N}=b();if(S!=null&&S.length){if(O){const k=dPe(S,C);j(k)}N&&console.log("React Flow: trigger edge changes",S),E==null||E(S)}},addSelectedNodes:S=>{const{multiSelectionActive:E,edgeLookup:j,nodeLookup:C,triggerNodeChanges:O,triggerEdgeChanges:N}=b();if(E){const k=S.map(T=>Pu(T,!0));O(k);return}O(Mf(C,new Set([...S]),!0)),N(Mf(j))},addSelectedEdges:S=>{const{multiSelectionActive:E,edgeLookup:j,nodeLookup:C,triggerNodeChanges:O,triggerEdgeChanges:N}=b();if(E){const k=S.map(T=>Pu(T,!0));N(k);return}N(Mf(j,new Set([...S]))),O(Mf(C,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:E}={})=>{const{edges:j,nodes:C,nodeLookup:O,triggerNodeChanges:N,triggerEdgeChanges:k}=b(),T=S||C,M=E||j,I=[];for(const B of T){if(!B.selected)continue;const z=O.get(B.id);z&&(z.selected=!1),I.push(Pu(B.id,!1))}const L=[];for(const B of M)B.selected&&L.push(Pu(B.id,!1));N(I),k(L)},setMinZoom:S=>{const{panZoom:E,maxZoom:j}=b();E==null||E.setScaleExtent([S,j]),v({minZoom:S})},setMaxZoom:S=>{const{panZoom:E,minZoom:j}=b();E==null||E.setScaleExtent([j,S]),v({maxZoom:S})},setTranslateExtent:S=>{var E;(E=b().panZoom)==null||E.setTranslateExtent(S),v({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:E,triggerNodeChanges:j,triggerEdgeChanges:C,elementsSelectable:O}=b();if(!O)return;const N=E.reduce((T,M)=>M.selected?[...T,Pu(M.id,!1)]:T,[]),k=S.reduce((T,M)=>M.selected?[...T,Pu(M.id,!1)]:T,[]);j(N),C(k)},setNodeExtent:S=>{const{nodes:E,nodeLookup:j,parentLookup:C,nodeOrigin:O,elevateNodesOnSelect:N,nodeExtent:k,zIndexMode:T}=b();S[0][0]===k[0][0]&&S[0][1]===k[0][1]&&S[1][0]===k[1][0]&&S[1][1]===k[1][1]||(Oj(E,j,C,{nodeOrigin:O,nodeExtent:S,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:T}),v({nodeExtent:S}))},panBy:S=>{const{transform:E,width:j,height:C,panZoom:O,translateExtent:N}=b();return pTe({delta:S,panZoom:O,transform:E,translateExtent:N,width:j,height:C})},setCenter:async(S,E,j)=>{const{width:C,height:O,maxZoom:N,panZoom:k}=b();if(!k)return Promise.resolve(!1);const T=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:N;return await k.setViewport({x:C/2-S*T,y:O/2-E*T,zoom:T},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...PV}})},updateConnection:S=>{v({connection:S})},reset:()=>v({...Z4()})}},Object.is);function RK({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:f,nodeOrigin:h,nodeExtent:d,zIndexMode:p,children:v}){const[b]=x.useState(()=>O2e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:f,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:h,nodeExtent:d,zIndexMode:p}));return g.jsx(VTe,{value:b,children:g.jsx(gPe,{children:v})})}function k2e({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:d,nodeExtent:p,zIndexMode:v}){return x.useContext(jb)?g.jsx(g.Fragment,{children:e}):g.jsx(RK,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:d,nodeExtent:p,zIndexMode:v,children:e})}const N2e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function T2e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:f,onMove:h,onMoveStart:d,onMoveEnd:p,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,onNodeMouseEnter:j,onNodeMouseMove:C,onNodeMouseLeave:O,onNodeContextMenu:N,onNodeDoubleClick:k,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:L,onEdgesDelete:B,onDelete:z,onSelectionChange:G,onSelectionDragStart:F,onSelectionDrag:V,onSelectionDragStop:D,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:Y,onBeforeDelete:R,connectionMode:H,connectionLineType:U=pl.Bezier,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:J,deleteKeyCode:ne="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:re=!1,selectionMode:ee=ep.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:me=np()?"Meta":"Control",zoomActivationKeyCode:ie=np()?"Meta":"Control",snapToGrid:we,snapGrid:be,onlyRenderVisibleElements:$e=!1,selectNodesOnDrag:Ne,nodesDraggable:Je,autoPanOnNodeFocus:Qe,nodesConnectable:nt,nodesFocusable:Nn,nodeOrigin:Wn=uK,edgesFocusable:Mt,edgesReconnectable:Tn,elementsSelectable:Rt=!0,defaultViewport:pn=iPe,minZoom:de=.5,maxZoom:xe=2,translateExtent:ze=Jm,preventScrolling:Ke=!0,nodeExtent:et,defaultMarkerColor:gn="#b1b1b7",zoomOnScroll:on=!0,zoomOnPinch:Kt=!0,panOnScroll:Se=!1,panOnScrollSpeed:lt=.5,panOnScrollMode:Xe=Qu.Free,zoomOnDoubleClick:Pn=!0,panOnDrag:vn=!0,onPaneClick:In,onPaneMouseEnter:$i,onPaneMouseMove:ca,onPaneMouseLeave:Bi,onPaneScroll:Ur,onPaneContextMenu:Ge,paneClickDistance:$t=1,nodeClickDistance:wn=0,children:Ln,onReconnect:mi,onReconnectStart:It,onReconnectEnd:ur,onEdgeContextMenu:fa,onEdgeDoubleClick:Qn,onEdgeMouseEnter:cr,onEdgeMouseMove:$a,onEdgeMouseLeave:Or,reconnectRadius:ve=10,onNodesChange:Ct,onEdgesChange:Mn,noDragClassName:Yt="nodrag",noWheelClassName:fr="nowheel",noPanClassName:pi="nopan",fitView:Nc,fitViewOptions:ag,connectOnClick:Ib,attributionPosition:og,proOptions:nu,defaultEdgeOptions:Xd,elevateNodesOnSelect:Os=!0,elevateEdgesOnSelect:ks=!1,disableKeyboardA11y:Ns=!1,autoPanOnConnect:Ts,autoPanOnNodeDrag:zn,autoPanSpeed:sg,connectionRadius:lg,isValidConnection:wo,onError:Ps,style:Lb,id:Gd,nodeDragThreshold:ug,connectionDragThreshold:zb,viewport:Tc,onViewportChange:Pc,width:da,height:Zr,colorMode:cg="light",debug:$b,onScroll:Ms,ariaLabelConfig:fg,zIndexMode:ru="basic",...Bb},Jr){const iu=Gd||"1",dg=lPe(cg),Wd=x.useCallback(So=>{So.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ms==null||Ms(So)},[Ms]);return g.jsx("div",{"data-testid":"rf__wrapper",...Bb,onScroll:Wd,style:{...Lb,...N2e},ref:Jr,className:Gn(["react-flow",i,dg]),id:Gd,role:"application",children:g.jsxs(k2e,{nodes:e,edges:t,width:da,height:Zr,fitView:Nc,fitViewOptions:ag,minZoom:de,maxZoom:xe,nodeOrigin:Wn,nodeExtent:et,zIndexMode:ru,children:[g.jsx(A2e,{onInit:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:j,onNodeMouseMove:C,onNodeMouseLeave:O,onNodeContextMenu:N,onNodeDoubleClick:k,nodeTypes:a,edgeTypes:o,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:J,selectionKeyCode:ae,selectionOnDrag:re,selectionMode:ee,deleteKeyCode:ne,multiSelectionKeyCode:me,panActivationKeyCode:se,zoomActivationKeyCode:ie,onlyRenderVisibleElements:$e,defaultViewport:pn,translateExtent:ze,minZoom:de,maxZoom:xe,preventScrolling:Ke,zoomOnScroll:on,zoomOnPinch:Kt,zoomOnDoubleClick:Pn,panOnScroll:Se,panOnScrollSpeed:lt,panOnScrollMode:Xe,panOnDrag:vn,onPaneClick:In,onPaneMouseEnter:$i,onPaneMouseMove:ca,onPaneMouseLeave:Bi,onPaneScroll:Ur,onPaneContextMenu:Ge,paneClickDistance:$t,nodeClickDistance:wn,onSelectionContextMenu:q,onSelectionStart:X,onSelectionEnd:Y,onReconnect:mi,onReconnectStart:It,onReconnectEnd:ur,onEdgeContextMenu:fa,onEdgeDoubleClick:Qn,onEdgeMouseEnter:cr,onEdgeMouseMove:$a,onEdgeMouseLeave:Or,reconnectRadius:ve,defaultMarkerColor:gn,noDragClassName:Yt,noWheelClassName:fr,noPanClassName:pi,rfId:iu,disableKeyboardA11y:Ns,nodeExtent:et,viewport:Tc,onViewportChange:Pc}),g.jsx(sPe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:v,onConnectStart:b,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:E,nodesDraggable:Je,autoPanOnNodeFocus:Qe,nodesConnectable:nt,nodesFocusable:Nn,edgesFocusable:Mt,edgesReconnectable:Tn,elementsSelectable:Rt,elevateNodesOnSelect:Os,elevateEdgesOnSelect:ks,minZoom:de,maxZoom:xe,nodeExtent:et,onNodesChange:Ct,onEdgesChange:Mn,snapToGrid:we,snapGrid:be,connectionMode:H,translateExtent:ze,connectOnClick:Ib,defaultEdgeOptions:Xd,fitView:Nc,fitViewOptions:ag,onNodesDelete:L,onEdgesDelete:B,onDelete:z,onNodeDragStart:T,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:V,onSelectionDragStart:F,onSelectionDragStop:D,onMove:h,onMoveStart:d,onMoveEnd:p,noPanClassName:pi,nodeOrigin:Wn,rfId:iu,autoPanOnConnect:Ts,autoPanOnNodeDrag:zn,autoPanSpeed:sg,onError:Ps,connectionRadius:lg,isValidConnection:wo,selectNodesOnDrag:Ne,nodeDragThreshold:ug,connectionDragThreshold:zb,onBeforeDelete:R,debug:$b,ariaLabelConfig:fg,zIndexMode:ru}),g.jsx(rPe,{onSelectionChange:G}),Ln,g.jsx(ZTe,{proOptions:nu,position:og}),g.jsx(QTe,{rfId:iu,disableKeyboardA11y:Ns})]})})}var P2e=fK(T2e);function M2e({dimensions:e,lineWidth:t,variant:n,className:r}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Gn(["react-flow__background-pattern",n,r])})}function D2e({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:Gn(["react-flow__background-pattern","dots",t])})}var Tl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Tl||(Tl={}));const R2e={[Tl.Dots]:1,[Tl.Lines]:1,[Tl.Cross]:6},I2e=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function IK({id:e,variant:t=Tl.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:l,style:c,className:f,patternClassName:h}){const d=x.useRef(null),{transform:p,patternId:v}=St(I2e,hn),b=r||R2e[t],w=t===Tl.Dots,S=t===Tl.Cross,E=Array.isArray(n)?n:[n,n],j=[E[0]*p[2]||1,E[1]*p[2]||1],C=b*p[2],O=Array.isArray(a)?a:[a,a],N=S?[C,C]:j,k=[O[0]*p[2]||1+N[0]/2,O[1]*p[2]||1+N[1]/2],T=`${v}${e||""}`;return g.jsxs("svg",{className:Gn(["react-flow__background",f]),style:{...c,...kb,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[g.jsx("pattern",{id:T,x:p[0]%j[0],y:p[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:w?g.jsx(D2e,{radius:C/2,className:h}):g.jsx(M2e,{dimensions:N,lineWidth:i,variant:t,className:h})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}IK.displayName="Background";x.memo(IK);function L2e(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function z2e(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function $2e(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function B2e(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function F2e(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function ry({children:e,className:t,...n}){return g.jsx("button",{type:"button",className:Gn(["react-flow__controls-button",t]),...n,children:e})}const U2e=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function LK({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:f,children:h,position:d="bottom-left",orientation:p="vertical","aria-label":v}){const b=mn(),{isInteractive:w,minZoomReached:S,maxZoomReached:E,ariaLabelConfig:j}=St(U2e,hn),{zoomIn:C,zoomOut:O,fitView:N}=Ob(),k=()=>{C(),a==null||a()},T=()=>{O(),o==null||o()},M=()=>{N(i),l==null||l()},I=()=>{b.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},L=p==="horizontal"?"horizontal":"vertical";return g.jsxs(Ab,{className:Gn(["react-flow__controls",L,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":v??j["controls.ariaLabel"],children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(ry,{onClick:k,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:E,children:g.jsx(L2e,{})}),g.jsx(ry,{onClick:T,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:S,children:g.jsx(z2e,{})})]}),n&&g.jsx(ry,{className:"react-flow__controls-fitview",onClick:M,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:g.jsx($2e,{})}),r&&g.jsx(ry,{className:"react-flow__controls-interactive",onClick:I,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:w?g.jsx(F2e,{}):g.jsx(B2e,{})}),h]})}LK.displayName="Controls";x.memo(LK);function H2e({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:l,strokeWidth:c,className:f,borderRadius:h,shapeRendering:d,selected:p,onClick:v}){const{background:b,backgroundColor:w}=a||{},S=o||b||w;return g.jsx("rect",{className:Gn(["react-flow__minimap-node",{selected:p},f]),x:t,y:n,rx:h,ry:h,width:r,height:i,style:{fill:S,stroke:l,strokeWidth:c},shapeRendering:d,onClick:v?E=>v(E,e):void 0})}const q2e=x.memo(H2e),V2e=e=>e.nodes.map(t=>t.id),a_=e=>e instanceof Function?e:()=>e;function K2e({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=q2e,onClick:o}){const l=St(V2e,hn),c=a_(t),f=a_(e),h=a_(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:l.map(p=>g.jsx(X2e,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},p))})}function Y2e({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:f,x:h,y:d,width:p,height:v}=St(b=>{const w=b.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:E,y:j}=w.internals.positionAbsolute,{width:C,height:O}=js(S);return{node:S,x:E,y:j,width:C,height:O}},hn);return!f||f.hidden||!$V(f)?null:g.jsx(l,{x:h,y:d,width:p,height:v,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:i,strokeColor:n(f),strokeWidth:a,shapeRendering:o,onClick:c,id:f.id})}const X2e=x.memo(Y2e);var G2e=x.memo(K2e);const W2e=200,Q2e=150,Z2e=e=>!e.hidden,J2e=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?zV(Jp(e.nodeLookup,{filter:Z2e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},eMe="react-flow__minimap-desc";function zK({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:f,maskStrokeColor:h,maskStrokeWidth:d,position:p="bottom-right",onClick:v,onNodeClick:b,pannable:w=!1,zoomable:S=!1,ariaLabel:E,inversePan:j,zoomStep:C=1,offsetScale:O=5}){const N=mn(),k=x.useRef(null),{boundingRect:T,viewBB:M,rfId:I,panZoom:L,translateExtent:B,flowWidth:z,flowHeight:G,ariaLabelConfig:F}=St(J2e,hn),V=(e==null?void 0:e.width)??W2e,D=(e==null?void 0:e.height)??Q2e,q=T.width/V,X=T.height/D,Y=Math.max(q,X),R=Y*V,H=Y*D,U=O*Y,$=T.x-(R-T.width)/2-U,Q=T.y-(H-T.height)/2-U,J=R+U*2,ne=H+U*2,ae=`${eMe}-${I}`,re=x.useRef(0),ee=x.useRef();re.current=Y,x.useEffect(()=>{if(k.current&&L)return ee.current=_Te({domNode:k.current,panZoom:L,getTransform:()=>N.getState().transform,getViewScale:()=>re.current}),()=>{var we;(we=ee.current)==null||we.destroy()}},[L]),x.useEffect(()=>{var we;(we=ee.current)==null||we.update({translateExtent:B,width:z,height:G,inversePan:j,pannable:w,zoomStep:C,zoomable:S})},[w,S,j,C,B,z,G]);const se=v?we=>{var Ne;const[be,$e]=((Ne=ee.current)==null?void 0:Ne.pointer(we))||[0,0];v(we,{x:be,y:$e})}:void 0,me=b?x.useCallback((we,be)=>{const $e=N.getState().nodeLookup.get(be).internals.userNode;b(we,$e)},[]):void 0,ie=E??F["minimap.ariaLabel"];return g.jsx(Ab,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*Y:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Gn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:V,height:D,viewBox:`${$} ${Q} ${J} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:k,onClick:se,children:[ie&&g.jsx("title",{id:ae,children:ie}),g.jsx(G2e,{onClick:me,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:l}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-U},${Q-U}h${J+U*2}v${ne+U*2}h${-J-U*2}z
        M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zK.displayName="MiniMap";x.memo(zK);const tMe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,nMe={[Ed.Line]:"right",[Ed.Handle]:"bottom-right"};function rMe({nodeId:e,position:t,variant:n=Ed.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:l=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:p,autoScale:v=!0,shouldResize:b,onResizeStart:w,onResize:S,onResizeEnd:E}){const j=pK(),C=typeof e=="string"?e:j,O=mn(),N=x.useRef(null),k=n===Ed.Handle,T=St(x.useCallback(tMe(k&&v),[k,v]),hn),M=x.useRef(null),I=t??nMe[n];x.useEffect(()=>{if(!(!N.current||!C))return M.current||(M.current=zTe({domNode:N.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:B,transform:z,snapGrid:G,snapToGrid:F,nodeOrigin:V,domNode:D}=O.getState();return{nodeLookup:B,transform:z,snapGrid:G,snapToGrid:F,nodeOrigin:V,paneDomNode:D}},onChange:(B,z)=>{const{triggerNodeChanges:G,nodeLookup:F,parentLookup:V,nodeOrigin:D}=O.getState(),q=[],X={x:B.x,y:B.y},Y=F.get(C);if(Y&&Y.expandParent&&Y.parentId){const R=Y.origin??D,H=B.width??Y.measured.width??0,U=B.height??Y.measured.height??0,$={id:Y.id,parentId:Y.parentId,rect:{width:H,height:U,...BV({x:B.x??Y.position.x,y:B.y??Y.position.y},{width:H,height:U},Y.parentId,F,R)}},Q=DN([$],F,V,D);q.push(...Q),X.x=B.x?Math.max(R[0]*H,B.x):void 0,X.y=B.y?Math.max(R[1]*U,B.y):void 0}if(X.x!==void 0&&X.y!==void 0){const R={id:C,type:"position",position:{...X}};q.push(R)}if(B.width!==void 0&&B.height!==void 0){const H={id:C,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:B.width,height:B.height}};q.push(H)}for(const R of z){const H={...R,type:"position"};q.push(H)}G(q)},onEnd:({width:B,height:z})=>{const G={id:C,type:"dimensions",resizing:!1,dimensions:{width:B,height:z}};O.getState().triggerNodeChanges([G])}})),M.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:c,maxWidth:f,maxHeight:h},keepAspectRatio:d,resizeDirection:p,onResizeStart:w,onResize:S,onResizeEnd:E,shouldResize:b}),()=>{var B;(B=M.current)==null||B.destroy()}},[I,l,c,f,h,d,w,S,E,b]);const L=I.split("-");return g.jsx("div",{className:Gn(["react-flow__resize-control","nodrag",...L,n,r]),ref:N,style:{...i,scale:T,...o&&{[k?"backgroundColor":"borderColor"]:o}},children:a})}x.memo(rMe);const $K=180,iMe=70,Vx=24,aMe=60;function oMe({data:e}){const t=e.pending?"agent-flow-node pending":`agent-flow-node ${nR(e.status)}`;return g.jsxs("div",{className:t,children:[g.jsx(_d,{type:"target",position:Fe.Top}),g.jsx("div",{className:"agent-flow-role",children:e.pending?`[pending: ${e.role}]`:e.role}),!e.pending&&g.jsxs("div",{className:"agent-flow-meta",children:[g.jsx("span",{className:`status-dot ${nR(e.status)}`}),g.jsx("span",{children:e.status}),e.duration_ms!=null&&g.jsx("span",{children:A0(e.duration_ms)}),e.exit_code!=null&&g.jsxs("span",{children:["exit ",e.exit_code]})]}),g.jsx(_d,{type:"source",position:Fe.Bottom})]})}const sMe={agent:oMe};function lMe(e,t){const n=new Map(e.map(l=>[l.agent_id,l])),r=new Map;for(const l of e){const c=l.parent;r.has(c)||r.set(c,[]),r.get(c).push(l.agent_id)}const i=new Map;for(const l of t){const c=l.requested_by;c&&n.has(c)&&(i.has(c)||i.set(c,[]),i.get(c).push(l))}function a(l){const c=(r.get(l)||[]).map(a),f=(i.get(l)||[]).map(h=>({id:`pending-${h.span_id}`,children:[]}));return{id:l,children:[...c,...f]}}return(r.get(null)||[]).map(a)}function Kx(e){return e.children.length===0?$K:e.children.reduce((t,n)=>t+Kx(n)+Vx,-Vx)}function BK(e,t,n,r){if(r.set(e.id,{x:t-$K/2,y:n}),e.children.length===0)return;const i=Kx(e);let a=t-i/2;for(const o of e.children){const l=Kx(o),c=a+l/2;BK(o,c,n+iMe+aMe,r),a+=l+Vx}}function uMe({treeData:e,connected:t}){return g.jsx(RK,{children:g.jsx(cMe,{treeData:e,connected:t})})}function cMe({treeData:e,connected:t}){const{fitView:n}=Ob(),r=x.useCallback(()=>{n({duration:300})},[n]),{flowNodes:i,flowEdges:a}=x.useMemo(()=>{if(!e)return{flowNodes:[],flowEdges:[]};const o=lMe(e.nodes,e.pending_delegations),l=new Map;let c=0;for(const v of o){const b=Kx(v),w=c+b/2;BK(v,w,0,l),c+=b+Vx*2}const f=new Map(e.nodes.map(v=>[v.agent_id,v])),h=new Map(e.pending_delegations.map(v=>[`pending-${v.span_id}`,v])),d=[];for(const[v,b]of l){const w=f.get(v),S=h.get(v);w?d.push({id:v,type:"agent",position:b,data:{label:w.role,role:w.role,status:w.status,runtime:w.runtime,duration_ms:w.duration_ms,exit_code:w.exit_code}}):S&&d.push({id:v,type:"agent",position:b,data:{label:S.role,role:S.role,status:"running",runtime:"",duration_ms:null,exit_code:null,pending:!0}})}const p=[];for(const v of e.nodes)v.parent&&p.push({id:`e-${v.parent}-${v.agent_id}`,source:v.parent,target:v.agent_id,type:"smoothstep",markerEnd:{type:xd.ArrowClosed,width:16,height:16}});for(const v of e.pending_delegations)v.requested_by&&p.push({id:`e-${v.requested_by}-pending-${v.span_id}`,source:v.requested_by,target:`pending-${v.span_id}`,type:"smoothstep",markerEnd:{type:xd.ArrowClosed,width:16,height:16},style:{strokeDasharray:"5 3"}});return{flowNodes:d,flowEdges:p}},[e]);return e?g.jsxs("div",{children:[g.jsxs("div",{className:"react-flow-wrapper",children:[g.jsx(P2e,{nodes:i,edges:a,nodeTypes:sMe,fitView:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0}}),g.jsx("button",{className:"tree-reset-btn",onClick:r,children:"Reset View"})]}),e.denied_delegations.length>0&&g.jsxs("div",{className:"denied-list",children:[g.jsx("strong",{children:"Denied delegations:"}),e.denied_delegations.map(o=>g.jsxs("span",{className:"denied-item",children:[o.role," (",o.reason,")"]},o.span_id))]})]}):g.jsx("div",{className:"agent-tree",children:g.jsx("p",{className:"agent-meta",children:t?"Loading tree...":"Connecting..."})})}const Au=18,J4=10;function fMe({runId:e,agents:t,active:n}){var V;const r=Object.keys(t),i=r.find(D=>t[D].parent===null)??r[0]??"",[a,o]=x.useState(i),{lines:l,connected:c,done:f}=DF(e,a,!0),[h,d]=x.useState(""),p=h.toLowerCase(),v=h?l.reduce((D,q,X)=>(q.toLowerCase().includes(p)&&D.push(X),D),[]):[],b=x.useRef(null),[w,S]=x.useState(0),[E,j]=x.useState(0),[C,O]=x.useState(!0),N=x.useRef(0),k=l.length*Au,T=Math.max(0,Math.floor(w/Au)-J4),M=Math.ceil(E/Au)+J4*2,I=Math.min(l.length,T+M),L=l.slice(T,I),B=String(l.length).length,z=x.useCallback(()=>{const D=b.current;if(!D)return;S(D.scrollTop),j(D.clientHeight);const q=D.scrollTop+D.clientHeight>=D.scrollHeight-Au*2;O(q)},[]);x.useEffect(()=>{const D=b.current;D&&j(D.clientHeight)},[]),x.useEffect(()=>{if(C&&l.length>N.current){const D=b.current;D&&(D.scrollTop=D.scrollHeight)}N.current=l.length},[l.length,C]);const G=()=>{const D=b.current;D&&(D.scrollTop=D.scrollHeight,O(!0))},F=async()=>{try{const D=await fetch(`/api/sessions/${e}/logs/${a}/full`);if(!D.ok)return;const q=await D.text(),X=new Blob([q],{type:"text/plain"}),Y=URL.createObjectURL(X),R=document.createElement("a");R.href=Y,R.download=`${a}.log`,R.click(),URL.revokeObjectURL(Y)}catch{}};return g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[r.length>1&&g.jsxs(so,{value:a,onValueChange:o,children:[g.jsx(uo,{className:"w-[220px]",children:g.jsx(lo,{})}),g.jsx(co,{children:r.map(D=>g.jsxs(ir,{value:D,children:[t[D].role," (",D.slice(0,8),")"]},D))})]}),r.length===1&&g.jsxs("span",{className:"text-sm text-muted-foreground",children:[(V=t[a])==null?void 0:V.role," (",a.slice(0,8),")"]}),g.jsxs("div",{className:"relative ml-auto",children:[g.jsx(fF,{className:"absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),g.jsx(ct,{className:"h-8 w-[200px] pl-7 text-xs",placeholder:"Search logs...",value:h,onChange:D=>d(D.target.value)})]}),h&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:[v.length," match",v.length!==1?"es":""]}),g.jsxs(je,{variant:"outline",size:"sm",onClick:F,children:[g.jsx(E0,{className:"mr-1 h-3.5 w-3.5"}),"Download"]}),g.jsx(dMe,{connected:c,done:f,active:n})]}),g.jsxs("div",{className:"relative",children:[g.jsx("div",{ref:b,className:"h-[500px] overflow-auto rounded-md bg-[#1e1e1e] font-mono text-xs text-[#d4d4d4]",onScroll:z,children:l.length===0?g.jsx("div",{className:"flex h-full items-center justify-center text-[#666]",children:n&&!f?"Waiting for log output...":"No log output."}):g.jsx("div",{style:{height:k,position:"relative"},children:g.jsx("div",{style:{position:"absolute",top:T*Au,left:0,right:0},children:L.map((D,q)=>{const X=T+q,Y=h&&D.toLowerCase().includes(p);return g.jsxs("div",{className:Y?"bg-yellow-900/30":void 0,style:{height:Au,lineHeight:`${Au}px`,display:"flex",whiteSpace:"pre"},children:[g.jsx("span",{className:"select-none text-right text-[#555]",style:{width:`${(B+2)*.6}em`,paddingRight:"1em",flexShrink:0},children:X+1}),g.jsx("span",{children:Y?g.jsx(hMe,{line:D,search:p}):D})]},X)})})})}),!C&&l.length>0&&g.jsxs(je,{size:"sm",variant:"secondary",className:"absolute bottom-3 right-4 shadow-md",onClick:G,children:[g.jsx(Aae,{className:"mr-1 h-3.5 w-3.5"}),"Jump to bottom"]})]})]})}function dMe({connected:e,done:t,active:n}){return t||!n?g.jsx("span",{className:"text-xs text-muted-foreground",children:"Session ended"}):g.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[g.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e?"animate-pulse bg-green-500":"bg-orange-400"}`}),e?"Live":"Connecting..."]})}function hMe({line:e,search:t}){const n=[],r=e.toLowerCase();let i=0,a=r.indexOf(t,i),o=0;for(;a!==-1;)a>i&&n.push(e.slice(i,a)),n.push(g.jsx("span",{className:"bg-yellow-500/60 text-white",children:e.slice(a,a+t.length)},o++)),i=a+t.length,a=r.indexOf(t,i);return i<e.length&&n.push(e.slice(i)),g.jsx(g.Fragment,{children:n})}function mMe({pendingAskUsers:e,initialMessages:t,respond:n}){const[r,i]=x.useState([]),[a,o]=x.useState(""),l=x.useRef(null),c=x.useRef(new Set);x.useEffect(()=>{!t||t.length===0||i(d=>{const p=new Set(d.map(w=>w.id)),v=t.filter(w=>!p.has(w.id));if(v.length===0)return d;const b=[...v,...d];b.sort((w,S)=>w.timestamp-S.timestamp);for(const w of b)c.current.add(w.id);return b})},[t]),x.useEffect(()=>{if(e.length===0)return;const d=[];for(const p of e)c.current.has(p.request_id)||(c.current.add(p.request_id),d.push({id:p.request_id,role:"agent",text:p.question,timestamp:p.timestamp}));d.length>0&&i(p=>[...p,...d])},[e]),x.useEffect(()=>{var d;(d=l.current)==null||d.scrollIntoView({behavior:"smooth"})},[r]);const f=(d,p)=>{if(!d.trim())return;const v=`user-${p.request_id}`;c.current.has(v)||(c.current.add(v),i(b=>[...b,{id:v,role:"user",text:d.trim(),timestamp:Date.now()/1e3}])),o(""),n(p.request_id,d.trim())},h=e.length>0?e[0]:null;return g.jsx(yn,{className:"flex h-[500px] flex-col",children:g.jsxs(xn,{className:"flex flex-1 flex-col gap-3 overflow-hidden p-4",children:[g.jsx(jp,{className:"flex-1",children:g.jsxs("div",{className:"space-y-3 pr-3",children:[r.length===0&&g.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-muted-foreground",children:[g.jsx(WA,{className:"h-8 w-8"}),g.jsx("p",{className:"text-sm",children:"Waiting for the agent to ask a question..."})]}),r.map(d=>{const p=d.role==="agent"?e.find(v=>v.request_id===d.id):void 0;return g.jsxs("div",{children:[g.jsx("div",{className:ke("flex",d.role==="user"?"justify-end":"justify-start"),children:g.jsx("div",{className:ke("max-w-[80%] rounded-lg px-3 py-2 text-sm",d.role==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:g.jsx("p",{className:"whitespace-pre-wrap",children:d.text})})}),(p==null?void 0:p.choices)&&p.choices.length>0&&g.jsx("div",{className:"ml-3 mt-1 flex flex-wrap gap-1.5",children:p.choices.map(v=>g.jsx(je,{variant:"outline",size:"sm",onClick:()=>f(v,p),children:v},v))})]},d.id)}),g.jsx("div",{ref:l})]})}),e.length>0&&g.jsx("div",{className:"flex items-center gap-2",children:g.jsxs(an,{variant:"outline",className:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-400",children:[g.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-amber-500"}),e.length===1?"Waiting for response":`${e.length} questions waiting`]})}),g.jsxs("form",{className:"flex gap-2",onSubmit:d=>{d.preventDefault(),h&&f(a,h)},children:[g.jsx(ct,{value:a,onChange:d=>o(d.target.value),placeholder:h?"Type your response...":"Waiting for agent question...",disabled:!h}),g.jsx(je,{type:"submit",size:"icon",disabled:!h||!a.trim(),children:g.jsx(joe,{className:"h-4 w-4"})})]})]})})}function FK(e,t){const[n,r]=x.useState([]),[i,a]=x.useState([]),[o,l]=x.useState([]),[c,f]=x.useState(null),[h,d]=x.useState(!1),p=x.useRef(null),v=x.useRef(0),b=x.useRef(void 0),w=x.useRef(1e3),S=x.useRef(!1),E=x.useCallback((j,C)=>{var O;(O=p.current)==null||O.send(JSON.stringify({type:"ask_user_response",request_id:j,text:C}))},[]);return x.useEffect(()=>{r([]),a([]),l([]),f(null),S.current=!1,v.current=0},[e]),x.useEffect(()=>{if(!t){r([]),d(!1);return}function j(){if(S.current)return;const O=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/sessions/${e}`,N=new WebSocket(O);p.current=N,N.onopen=()=>{d(!0),w.current=1e3,N.send(JSON.stringify({type:"init",trace_offset:v.current}))},N.onmessage=k=>{let T;try{T=JSON.parse(k.data)}catch{return}switch(T.type){case"tree_snapshot":case"tree_delta":{const{type:M,...I}=T;f(I);break}case"trace_snapshot":Array.isArray(T.events)&&l(T.events),typeof T.next_offset=="number"&&(v.current=T.next_offset);break;case"trace_delta":Array.isArray(T.events)&&l(M=>[...M,...T.events]),typeof T.next_offset=="number"&&(v.current=T.next_offset);break;case"ask_user":{const M=T;r(I=>I.some(L=>L.request_id===M.request_id)?I:[...I,M]);break}case"ask_user_resolved":typeof T.request_id=="string"?r(M=>M.filter(I=>I.request_id!==T.request_id)):r([]);break;case"chat_history":Array.isArray(T.messages)&&a(T.messages);break;case"stream_complete":S.current=!0,N.close(),p.current=null,d(!1);break}},N.onclose=()=>{p.current=null,d(!1),!S.current&&(b.current=setTimeout(()=>{w.current=Math.min(w.current*2,15e3),j()},w.current))},N.onerror=()=>{N.close()}}return j(),()=>{var C;(C=p.current)==null||C.close(),p.current=null,b.current&&clearTimeout(b.current)}},[e,t]),{pendingAskUsers:n,chatMessages:i,traceEvents:o,treeData:c,connected:h,respond:E}}function pMe(){return g.jsxs("div",{className:"space-y-6",children:[g.jsx(On,{className:"h-8 w-64"}),g.jsx(On,{className:"h-32 rounded-lg"}),g.jsx(On,{className:"h-64 rounded-lg"})]})}function gMe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vMe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yMe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xMe={};function e5(e,t){return(xMe.jsx?yMe:vMe).test(e)}const bMe=/[ \t\n\f\r]/g;function wMe(e){return typeof e=="object"?e.type==="text"?t5(e.value):!1:t5(e)}function t5(e){return e.replace(bMe,"")===""}class ng{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ng.prototype.normal={};ng.prototype.property={};ng.prototype.space=void 0;function UK(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ng(n,r,t)}function Tj(e){return e.toLowerCase()}class hi{constructor(t,n){this.attribute=n,this.property=t}}hi.prototype.attribute="";hi.prototype.booleanish=!1;hi.prototype.boolean=!1;hi.prototype.commaOrSpaceSeparated=!1;hi.prototype.commaSeparated=!1;hi.prototype.defined=!1;hi.prototype.mustUseProperty=!1;hi.prototype.number=!1;hi.prototype.overloadedBoolean=!1;hi.prototype.property="";hi.prototype.spaceSeparated=!1;hi.prototype.space=void 0;let SMe=0;const st=kc(),Hn=kc(),Pj=kc(),Ee=kc(),Zt=kc(),Hf=kc(),Ei=kc();function kc(){return 2**++SMe}const Mj=Object.freeze(Object.defineProperty({__proto__:null,boolean:st,booleanish:Hn,commaOrSpaceSeparated:Ei,commaSeparated:Hf,number:Ee,overloadedBoolean:Pj,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),o_=Object.keys(Mj);class IN extends hi{constructor(t,n,r,i){let a=-1;if(super(t,n),n5(this,"space",i),typeof r=="number")for(;++a<o_.length;){const o=o_[a];n5(this,o_[a],(r&Mj[o])===Mj[o])}}}IN.prototype.defined=!0;function n5(e,t,n){n&&(e[t]=n)}function Kd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new IN(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Tj(r)]=r,n[Tj(a.attribute)]=r}return new ng(t,n,e.space)}const HK=Kd({properties:{ariaActiveDescendant:null,ariaAtomic:Hn,ariaAutoComplete:null,ariaBusy:Hn,ariaChecked:Hn,ariaColCount:Ee,ariaColIndex:Ee,ariaColSpan:Ee,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:Hn,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:Hn,ariaFlowTo:Zt,ariaGrabbed:Hn,ariaHasPopup:null,ariaHidden:Hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:Ee,ariaLive:null,ariaModal:Hn,ariaMultiLine:Hn,ariaMultiSelectable:Hn,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:Ee,ariaPressed:Hn,ariaReadOnly:Hn,ariaRelevant:null,ariaRequired:Hn,ariaRoleDescription:Zt,ariaRowCount:Ee,ariaRowIndex:Ee,ariaRowSpan:Ee,ariaSelected:Hn,ariaSetSize:Ee,ariaSort:null,ariaValueMax:Ee,ariaValueMin:Ee,ariaValueNow:Ee,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qK(e,t){return t in e?e[t]:t}function VK(e,t){return qK(e,t.toLowerCase())}const EMe=Kd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hf,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:st,allowPaymentRequest:st,allowUserMedia:st,alt:null,as:null,async:st,autoCapitalize:null,autoComplete:Zt,autoFocus:st,autoPlay:st,blocking:Zt,capture:null,charSet:null,checked:st,cite:null,className:Zt,cols:Ee,colSpan:null,content:null,contentEditable:Hn,controls:st,controlsList:Zt,coords:Ee|Hf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:st,defer:st,dir:null,dirName:null,disabled:st,download:Pj,draggable:Hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:st,formTarget:null,headers:Zt,height:Ee,hidden:Pj,high:Ee,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:st,inputMode:null,integrity:null,is:null,isMap:st,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:st,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:st,low:Ee,manifest:null,max:null,maxLength:Ee,media:null,method:null,min:null,minLength:Ee,multiple:st,muted:st,name:null,nonce:null,noModule:st,noValidate:st,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:st,optimum:Ee,pattern:null,ping:Zt,placeholder:null,playsInline:st,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:st,referrerPolicy:null,rel:Zt,required:st,reversed:st,rows:Ee,rowSpan:Ee,sandbox:Zt,scope:null,scoped:st,seamless:st,selected:st,shadowRootClonable:st,shadowRootDelegatesFocus:st,shadowRootMode:null,shape:null,size:Ee,sizes:null,slot:null,span:Ee,spellCheck:Hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ee,step:null,style:null,tabIndex:Ee,target:null,title:null,translate:null,type:null,typeMustMatch:st,useMap:null,value:Hn,width:Ee,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:Ee,borderColor:null,bottomMargin:Ee,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:st,declare:st,event:null,face:null,frame:null,frameBorder:null,hSpace:Ee,leftMargin:Ee,link:null,longDesc:null,lowSrc:null,marginHeight:Ee,marginWidth:Ee,noResize:st,noHref:st,noShade:st,noWrap:st,object:null,profile:null,prompt:null,rev:null,rightMargin:Ee,rules:null,scheme:null,scrolling:Hn,standby:null,summary:null,text:null,topMargin:Ee,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ee,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:st,disableRemotePlayback:st,prefix:null,property:null,results:Ee,security:null,unselectable:null},space:"html",transform:VK}),_Me=Kd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ei,accentHeight:Ee,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ee,amplitude:Ee,arabicForm:null,ascent:Ee,attributeName:null,attributeType:null,azimuth:Ee,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ee,by:null,calcMode:null,capHeight:Ee,className:Zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ee,diffuseConstant:Ee,direction:null,display:null,dur:null,divisor:Ee,dominantBaseline:null,download:st,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ee,enableBackground:null,end:null,event:null,exponent:Ee,externalResourcesRequired:null,fill:null,fillOpacity:Ee,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Hf,g2:Hf,glyphName:Hf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ee,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ee,horizOriginX:Ee,horizOriginY:Ee,id:null,ideographic:Ee,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ee,k:Ee,k1:Ee,k2:Ee,k3:Ee,k4:Ee,kernelMatrix:Ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ee,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ee,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ee,overlineThickness:Ee,paintOrder:null,panose1:null,path:null,pathLength:Ee,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ee,pointsAtY:Ee,pointsAtZ:Ee,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ei,rev:Ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ei,requiredFeatures:Ei,requiredFonts:Ei,requiredFormats:Ei,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ee,specularExponent:Ee,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ee,strikethroughThickness:Ee,string:null,stroke:null,strokeDashArray:Ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ee,strokeOpacity:Ee,strokeWidth:null,style:null,surfaceScale:Ee,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ei,tabIndex:Ee,tableValues:null,target:null,targetX:Ee,targetY:Ee,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ee,underlineThickness:Ee,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ee,values:null,vAlphabetic:Ee,vMathematical:Ee,vectorEffect:null,vHanging:Ee,vIdeographic:Ee,version:null,vertAdvY:Ee,vertOriginX:Ee,vertOriginY:Ee,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ee,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qK}),KK=Kd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),YK=Kd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VK}),XK=Kd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),CMe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},jMe=/[A-Z]/g,r5=/-[a-z]/g,AMe=/^data[-\w.:]+$/i;function OMe(e,t){const n=Tj(t);let r=t,i=hi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&AMe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(r5,NMe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!r5.test(a)){let o=a.replace(jMe,kMe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=IN}return new i(r,t)}function kMe(e){return"-"+e.toLowerCase()}function NMe(e){return e.charAt(1).toUpperCase()}const TMe=UK([HK,EMe,KK,YK,XK],"html"),LN=UK([HK,_Me,KK,YK,XK],"svg");function PMe(e){return e.join(" ").trim()}var Ef={},s_,i5;function MMe(){if(i5)return s_;i5=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
`,f="/",h="*",d="",p="comment",v="declaration";function b(S,E){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];E=E||{};var j=1,C=1;function O(F){var V=F.match(t);V&&(j+=V.length);var D=F.lastIndexOf(c);C=~D?F.length-D:C+F.length}function N(){var F={line:j,column:C};return function(V){return V.position=new k(F),I(),V}}function k(F){this.start=F,this.end={line:j,column:C},this.source=E.source}k.prototype.content=S;function T(F){var V=new Error(E.source+":"+j+":"+C+": "+F);if(V.reason=F,V.filename=E.source,V.line=j,V.column=C,V.source=S,!E.silent)throw V}function M(F){var V=F.exec(S);if(V){var D=V[0];return O(D),S=S.slice(D.length),V}}function I(){M(n)}function L(F){var V;for(F=F||[];V=B();)V!==!1&&F.push(V);return F}function B(){var F=N();if(!(f!=S.charAt(0)||h!=S.charAt(1))){for(var V=2;d!=S.charAt(V)&&(h!=S.charAt(V)||f!=S.charAt(V+1));)++V;if(V+=2,d===S.charAt(V-1))return T("End of comment missing");var D=S.slice(2,V-2);return C+=2,O(D),S=S.slice(V),C+=2,F({type:p,comment:D})}}function z(){var F=N(),V=M(r);if(V){if(B(),!M(i))return T("property missing ':'");var D=M(a),q=F({type:v,property:w(V[0].replace(e,d)),value:D?w(D[0].replace(e,d)):d});return M(o),q}}function G(){var F=[];L(F);for(var V;V=z();)V!==!1&&(F.push(V),L(F));return F}return I(),G()}function w(S){return S?S.replace(l,d):d}return s_=b,s_}var a5;function DMe(){if(a5)return Ef;a5=1;var e=Ef&&Ef.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.default=n;const t=e(MMe());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:h}=c;l?i(f,h,c):h&&(a=a||{},a[f]=h)}),a}return Ef}var om={},o5;function RMe(){if(o5)return om;o5=1,Object.defineProperty(om,"__esModule",{value:!0}),om.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,h){return h.toUpperCase()},l=function(f,h){return"".concat(h,"-")},c=function(f,h){return h===void 0&&(h={}),a(f)?f:(f=f.toLowerCase(),h.reactCompat?f=f.replace(i,l):f=f.replace(r,l),f.replace(t,o))};return om.camelCase=c,om}var sm,s5;function IMe(){if(s5)return sm;s5=1;var e=sm&&sm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(DMe()),n=RMe();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,sm=r,sm}var LMe=IMe();const zMe=zi(LMe),GK=WK("end"),zN=WK("start");function WK(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $Me(e){const t=zN(e),n=GK(e);if(t&&n)return{start:t,end:n}}function wm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?l5(e.position):"start"in e||"end"in e?l5(e):"line"in e||"column"in e?Dj(e):""}function Dj(e){return u5(e&&e.line)+":"+u5(e&&e.column)}function l5(e){return Dj(e&&e.start)+"-"+Dj(e&&e.end)}function u5(e){return e&&typeof e=="number"?e:1}class Fr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=wm(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Fr.prototype.file="";Fr.prototype.name="";Fr.prototype.reason="";Fr.prototype.message="";Fr.prototype.stack="";Fr.prototype.column=void 0;Fr.prototype.line=void 0;Fr.prototype.ancestors=void 0;Fr.prototype.cause=void 0;Fr.prototype.fatal=void 0;Fr.prototype.place=void 0;Fr.prototype.ruleId=void 0;Fr.prototype.source=void 0;const $N={}.hasOwnProperty,BMe=new Map,FMe=/[A-Z]/g,UMe=new Set(["table","tbody","thead","tfoot","tr"]),HMe=new Set(["td","th"]),QK="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qMe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ZMe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=QMe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?LN:TMe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ZK(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ZK(e,t,n){if(t.type==="element")return VMe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return KMe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XMe(e,t,n);if(t.type==="mdxjsEsm")return YMe(e,t);if(t.type==="root")return GMe(e,t,n);if(t.type==="text")return WMe(e,t)}function VMe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=LN,e.schema=i),e.ancestors.push(t);const a=eY(e,t.tagName,!1),o=JMe(e,t);let l=FN(e,t);return UMe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!wMe(c):!0})),JK(e,o,a,t),BN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function KMe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ip(e,t.position)}function YMe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ip(e,t.position)}function XMe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=LN,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:eY(e,t.name,!0),o=eDe(e,t),l=FN(e,t);return JK(e,o,a,t),BN(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function GMe(e,t,n){const r={};return BN(r,FN(e,t)),e.create(t,e.Fragment,r,n)}function WMe(e,t){return t.value}function JK(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BN(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QMe(e,t,n){return r;function r(i,a,o,l){const f=Array.isArray(o.children)?n:t;return l?f(a,o,l):f(a,o)}}function ZMe(e,t){return n;function n(r,i,a,o){const l=Array.isArray(a.children),c=zN(r);return t(i,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function JMe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&$N.call(t.properties,i)){const a=tDe(e,i,t.properties[i]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&HMe.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function eDe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else ip(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else ip(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function FN(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:BMe;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const f=i.get(c)||0;o=c+"-"+f,i.set(c,f+1)}}const l=ZK(e,a,o);l!==void 0&&n.push(l)}return n}function tDe(e,t,n){const r=OMe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?gMe(n):PMe(n)),r.property==="style"){let i=typeof n=="object"?n:nDe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=rDe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?CMe[r.property]||r.property:r.attribute,n]}}function nDe(e,t){try{return zMe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Fr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=QK+"#cannot-parse-style-attribute",i}}function eY(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const l=e5(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=e5(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return $N.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ip(e)}function ip(e,t){const n=new Fr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=QK+"#cannot-handle-mdx-estrees-without-createevaluater",n}function rDe(e){const t={};let n;for(n in e)$N.call(e,n)&&(t[iDe(n)]=e[n]);return t}function iDe(e){let t=e.replace(FMe,aDe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function aDe(e){return"-"+e.toLowerCase()}const l_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oDe={};function UN(e,t){const n=oDe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return tY(e,r,i)}function tY(e,t,n){if(sDe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return c5(e.children,t,n)}return Array.isArray(e)?c5(e,t,n):""}function c5(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=tY(e[i],t,n);return r.join("")}function sDe(e){return!!(e&&typeof e=="object")}const f5=document.createElement("i");function HN(e){const t="&"+e+";";f5.innerHTML=t;const n=f5.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Mi(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function na(e,t){return e.length>0?(Mi(e,e.length,0,t),e):t}const d5={}.hasOwnProperty;function nY(e){const t={};let n=-1;for(;++n<e.length;)lDe(t,e[n]);return t}function lDe(e,t){let n;for(n in t){const i=(d5.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){d5.call(i,o)||(i[o]=[]);const l=a[o];uDe(i[o],Array.isArray(l)?l:l?[l]:[])}}}function uDe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Mi(e,0,0,r)}function rY(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Kr=tu(/[A-Za-z]/),Ir=tu(/[\dA-Za-z]/),cDe=tu(/[#-'*+\--9=?A-Z^-~]/);function Yx(e){return e!==null&&(e<32||e===127)}const Rj=tu(/\d/),fDe=tu(/[\dA-Fa-f]/),dDe=tu(/[!-/:-@[-`{-~]/);function Ve(e){return e!==null&&e<-2}function Wt(e){return e!==null&&(e<0||e===32)}function ht(e){return e===-2||e===-1||e===32}const Tb=tu(new RegExp("\\p{P}|\\p{S}","u")),xc=tu(/\s/);function tu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ir(e.charCodeAt(n+1))&&Ir(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function wt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return ht(c)?(e.enter(n),l(c)):t(c)}function l(c){return ht(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const hDe={tokenize:mDe};function mDe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),wt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ve(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const pDe={tokenize:gDe},h5={tokenize:vDe};function gDe(e){const t=this,n=[];let r=0,i,a,o;return l;function l(C){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,c,f)(C)}return f(C)}function c(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&j();const O=t.events.length;let N=O,k;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){k=t.events[N][1].end;break}E(r);let T=O;for(;T<t.events.length;)t.events[T][1].end={...k},T++;return Mi(t.events,N+1,0,t.events.slice(O)),t.events.length=T,f(C)}return l(C)}function f(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return b(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(h5,h,d)(C)}function h(C){return i&&j(),E(r),p(C)}function d(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,b(C)}function p(C){return t.containerState={},e.attempt(h5,v,b)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function b(C){if(C===null){i&&j(),E(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),w(C)}function w(C){if(C===null){S(e.exit("chunkFlow"),!0),E(0),e.consume(C);return}return Ve(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(C),w)}function S(C,O){const N=t.sliceStream(C);if(O&&N.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(N),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const T=t.events.length;let M=T,I,L;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(I){L=t.events[M][1].end;break}I=!0}for(E(r),k=T;k<t.events.length;)t.events[k][1].end={...L},k++;Mi(t.events,M+1,0,t.events.slice(T)),t.events.length=k}}function E(C){let O=n.length;for(;O-- >C;){const N=n[O];t.containerState=N[1],N[0].exit.call(t,e)}n.length=C}function j(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vDe(e,t,n){return wt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Cd(e){if(e===null||Wt(e)||xc(e))return 1;if(Tb(e))return 2}function Pb(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ij={name:"attention",resolveAll:yDe,tokenize:xDe};function yDe(e,t){let n=-1,r,i,a,o,l,c,f,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};m5(d,-c),m5(p,c),o={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=na(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=na(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=na(f,Pb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=na(f,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=na(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Mi(e,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function xDe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Cd(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const f=e.exit("attentionSequence"),h=Cd(c),d=!h||h===2&&i||n.includes(c),p=!i||i===2&&h||n.includes(r);return f._open=!!(a===42?d:d&&(i||!p)),f._close=!!(a===42?p:p&&(h||!d)),t(c)}}function m5(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bDe={name:"autolink",tokenize:wDe};function wDe(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Kr(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Ir(v)?(r=1,l(v)):f(v)}function l(v){return v===58?(e.consume(v),r=0,c):(v===43||v===45||v===46||Ir(v))&&r++<32?(e.consume(v),l):(r=0,f(v))}function c(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Yx(v)?n(v):(e.consume(v),c)}function f(v){return v===64?(e.consume(v),h):cDe(v)?(e.consume(v),f):n(v)}function h(v){return Ir(v)?d(v):n(v)}function d(v){return v===46?(e.consume(v),r=0,h):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):p(v)}function p(v){if((v===45||Ir(v))&&r++<63){const b=v===45?p:d;return e.consume(v),b}return n(v)}}const rg={partial:!0,tokenize:SDe};function SDe(e,t,n){return r;function r(a){return ht(a)?wt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ve(a)?t(a):n(a)}}const iY={continuation:{tokenize:_De},exit:CDe,name:"blockQuote",tokenize:EDe};function EDe(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return ht(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function _De(e,t,n){const r=this;return i;function i(o){return ht(o)?wt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(iY,t,n)(o)}}function CDe(e){e.exit("blockQuote")}const aY={name:"characterEscape",tokenize:jDe};function jDe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return dDe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const oY={name:"characterReference",tokenize:ADe};function ADe(e,t,n){const r=this;let i=0,a,o;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Ir,h(d))}function f(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=fDe,h):(e.enter("characterReferenceValue"),a=7,o=Rj,h(d))}function h(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return o===Ir&&!HN(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<a?(e.consume(d),h):n(d)}}const p5={partial:!0,tokenize:kDe},g5={concrete:!0,name:"codeFenced",tokenize:ODe};function ODe(e,t,n){const r=this,i={partial:!0,tokenize:N};let a=0,o=0,l;return c;function c(k){return f(k)}function f(k){const T=r.events[r.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===l?(o++,e.consume(k),h):o<3?n(k):(e.exit("codeFencedFenceSequence"),ht(k)?wt(e,d,"whitespace")(k):d(k))}function d(k){return k===null||Ve(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(p5,w,O)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||Ve(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):ht(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wt(e,v,"whitespace")(k)):k===96&&k===l?n(k):(e.consume(k),p)}function v(k){return k===null||Ve(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===null||Ve(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===l?n(k):(e.consume(k),b)}function w(k){return e.attempt(i,O,S)(k)}function S(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return a>0&&ht(k)?wt(e,j,"linePrefix",a+1)(k):j(k)}function j(k){return k===null||Ve(k)?e.check(p5,w,O)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||Ve(k)?(e.exit("codeFlowValue"),j(k)):(e.consume(k),C)}function O(k){return e.exit("codeFenced"),t(k)}function N(k,T,M){let I=0;return L;function L(V){return k.enter("lineEnding"),k.consume(V),k.exit("lineEnding"),B}function B(V){return k.enter("codeFencedFence"),ht(V)?wt(k,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):z(V)}function z(V){return V===l?(k.enter("codeFencedFenceSequence"),G(V)):M(V)}function G(V){return V===l?(I++,k.consume(V),G):I>=o?(k.exit("codeFencedFenceSequence"),ht(V)?wt(k,F,"whitespace")(V):F(V)):M(V)}function F(V){return V===null||Ve(V)?(k.exit("codeFencedFence"),T(V)):M(V)}}}function kDe(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const u_={name:"codeIndented",tokenize:TDe},NDe={partial:!0,tokenize:PDe};function TDe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),wt(e,a,"linePrefix",5)(f)}function a(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?c(f):Ve(f)?e.attempt(NDe,o,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||Ve(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function PDe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):wt(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Ve(o)?i(o):n(o)}}const MDe={name:"codeText",previous:RDe,resolve:DDe,tokenize:IDe};function DDe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function RDe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IDe(e,t,n){let r=0,i,a;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),i=0,h(d)):Ve(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(d))}function f(d){return d===null||d===32||d===96||Ve(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),f)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",f(d))}}class LDe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&lm(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),lm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);lm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lm(this.left,n.reverse())}}}function lm(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function sY(e){const t={};let n=-1,r,i,a,o,l,c,f;const h=new LDe(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,zDe(h,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=h.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return Mi(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!f}function zDe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],f={};let h,d,p=-1,v=n,b=0,w=0;const S=[w];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(h=r.sliceStream(v),v.next||h.push(null),d&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=v,v=v.next}for(v=n;++p<l.length;)l[p][0]==="exit"&&l[p-1][0]==="enter"&&l[p][1].type===l[p-1][1].type&&l[p][1].start.line!==l[p][1].end.line&&(w=p+1,S.push(w),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),p=S.length;p--;){const E=l.slice(S[p],S[p+1]),j=a.pop();c.push([j,j+E.length-1]),e.splice(j,2,E)}for(c.reverse(),p=-1;++p<c.length;)f[b+c[p][0]]=b+c[p][1],b+=c[p][1]-c[p][0]-1;return f}const $De={resolve:FDe,tokenize:UDe},BDe={partial:!0,tokenize:HDe};function FDe(e){return sY(e),e}function UDe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Ve(l)?e.check(BDe,o,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function HDe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),wt(e,a,"linePrefix")}function a(o){if(o===null||Ve(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function lY(e,t,n,r,i,a,o,l,c){const f=c||Number.POSITIVE_INFINITY;let h=0;return d;function d(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),p):E===null||E===32||E===41||Yx(E)?n(E):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),w(E))}function p(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),v(E))}function v(E){return E===62?(e.exit("chunkString"),e.exit(l),p(E)):E===null||E===60||Ve(E)?n(E):(e.consume(E),E===92?b:v)}function b(E){return E===60||E===62||E===92?(e.consume(E),v):v(E)}function w(E){return!h&&(E===null||E===41||Wt(E))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(E)):h<f&&E===40?(e.consume(E),h++,w):E===41?(e.consume(E),h--,w):E===null||E===32||E===40||Yx(E)?n(E):(e.consume(E),E===92?S:w)}function S(E){return E===40||E===41||E===92?(e.consume(E),w):w(E)}}function uY(e,t,n,r,i,a){const o=this;let l=0,c;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),h}function h(v){return l>999||v===null||v===91||v===93&&!c||v===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ve(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===null||v===91||v===93||Ve(v)||l++>999?(e.exit("chunkString"),h(v)):(e.consume(v),c||(c=!ht(v)),v===92?p:d)}function p(v){return v===91||v===92||v===93?(e.consume(v),l++,d):d(v)}}function cY(e,t,n,r,i,a){let o;return l;function l(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,c):n(p)}function c(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(a),f(p))}function f(p){return p===o?(e.exit(a),c(o)):p===null?n(p):Ve(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),wt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===o||p===null||Ve(p)?(e.exit("chunkString"),f(p)):(e.consume(p),p===92?d:h)}function d(p){return p===o||p===92?(e.consume(p),h):h(p)}}function Sm(e,t){let n;return r;function r(i){return Ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ht(i)?wt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const qDe={name:"definition",tokenize:KDe},VDe={partial:!0,tokenize:YDe};function KDe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return uY.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function l(v){return i=Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),c):n(v)}function c(v){return Wt(v)?Sm(e,f)(v):f(v)}function f(v){return lY(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function h(v){return e.attempt(VDe,d,d)(v)}function d(v){return ht(v)?wt(e,p,"whitespace")(v):p(v)}function p(v){return v===null||Ve(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function YDe(e,t,n){return r;function r(l){return Wt(l)?Sm(e,i)(l):n(l)}function i(l){return cY(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return ht(l)?wt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ve(l)?t(l):n(l)}}const XDe={name:"hardBreakEscape",tokenize:GDe};function GDe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ve(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const WDe={name:"headingAtx",resolve:QDe,tokenize:ZDe};function QDe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Mi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function ZDe(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(e.consume(h),o):h===null||Wt(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||Ve(h)?(e.exit("atxHeading"),t(h)):ht(h)?wt(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||Wt(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const JDe=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],v5=["pre","script","style","textarea"],eRe={concrete:!0,name:"htmlFlow",resolveTo:rRe,tokenize:iRe},tRe={partial:!0,tokenize:oRe},nRe={partial:!0,tokenize:aRe};function rRe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function iRe(e,t,n){const r=this;let i,a,o,l,c;return f;function f($){return h($)}function h($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),d}function d($){return $===33?(e.consume($),p):$===47?(e.consume($),a=!0,w):$===63?(e.consume($),i=3,r.interrupt?t:R):Kr($)?(e.consume($),o=String.fromCharCode($),S):n($)}function p($){return $===45?(e.consume($),i=2,v):$===91?(e.consume($),i=5,l=0,b):Kr($)?(e.consume($),i=4,r.interrupt?t:R):n($)}function v($){return $===45?(e.consume($),r.interrupt?t:R):n($)}function b($){const Q="CDATA[";return $===Q.charCodeAt(l++)?(e.consume($),l===Q.length?r.interrupt?t:z:b):n($)}function w($){return Kr($)?(e.consume($),o=String.fromCharCode($),S):n($)}function S($){if($===null||$===47||$===62||Wt($)){const Q=$===47,J=o.toLowerCase();return!Q&&!a&&v5.includes(J)?(i=1,r.interrupt?t($):z($)):JDe.includes(o.toLowerCase())?(i=6,Q?(e.consume($),E):r.interrupt?t($):z($)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):a?j($):C($))}return $===45||Ir($)?(e.consume($),o+=String.fromCharCode($),S):n($)}function E($){return $===62?(e.consume($),r.interrupt?t:z):n($)}function j($){return ht($)?(e.consume($),j):L($)}function C($){return $===47?(e.consume($),L):$===58||$===95||Kr($)?(e.consume($),O):ht($)?(e.consume($),C):L($)}function O($){return $===45||$===46||$===58||$===95||Ir($)?(e.consume($),O):N($)}function N($){return $===61?(e.consume($),k):ht($)?(e.consume($),N):C($)}function k($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),c=$,T):ht($)?(e.consume($),k):M($)}function T($){return $===c?(e.consume($),c=null,I):$===null||Ve($)?n($):(e.consume($),T)}function M($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||Wt($)?N($):(e.consume($),M)}function I($){return $===47||$===62||ht($)?C($):n($)}function L($){return $===62?(e.consume($),B):n($)}function B($){return $===null||Ve($)?z($):ht($)?(e.consume($),B):n($)}function z($){return $===45&&i===2?(e.consume($),D):$===60&&i===1?(e.consume($),q):$===62&&i===4?(e.consume($),H):$===63&&i===3?(e.consume($),R):$===93&&i===5?(e.consume($),Y):Ve($)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(tRe,U,G)($)):$===null||Ve($)?(e.exit("htmlFlowData"),G($)):(e.consume($),z)}function G($){return e.check(nRe,F,U)($)}function F($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),V}function V($){return $===null||Ve($)?G($):(e.enter("htmlFlowData"),z($))}function D($){return $===45?(e.consume($),R):z($)}function q($){return $===47?(e.consume($),o="",X):z($)}function X($){if($===62){const Q=o.toLowerCase();return v5.includes(Q)?(e.consume($),H):z($)}return Kr($)&&o.length<8?(e.consume($),o+=String.fromCharCode($),X):z($)}function Y($){return $===93?(e.consume($),R):z($)}function R($){return $===62?(e.consume($),H):$===45&&i===2?(e.consume($),R):z($)}function H($){return $===null||Ve($)?(e.exit("htmlFlowData"),U($)):(e.consume($),H)}function U($){return e.exit("htmlFlow"),t($)}}function aRe(e,t,n){const r=this;return i;function i(o){return Ve(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function oRe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(rg,t,n)}}const sRe={name:"htmlText",tokenize:lRe};function lRe(e,t,n){const r=this;let i,a,o;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),f):R===47?(e.consume(R),N):R===63?(e.consume(R),C):Kr(R)?(e.consume(R),M):n(R)}function f(R){return R===45?(e.consume(R),h):R===91?(e.consume(R),a=0,b):Kr(R)?(e.consume(R),j):n(R)}function h(R){return R===45?(e.consume(R),v):n(R)}function d(R){return R===null?n(R):R===45?(e.consume(R),p):Ve(R)?(o=d,q(R)):(e.consume(R),d)}function p(R){return R===45?(e.consume(R),v):d(R)}function v(R){return R===62?D(R):R===45?p(R):d(R)}function b(R){const H="CDATA[";return R===H.charCodeAt(a++)?(e.consume(R),a===H.length?w:b):n(R)}function w(R){return R===null?n(R):R===93?(e.consume(R),S):Ve(R)?(o=w,q(R)):(e.consume(R),w)}function S(R){return R===93?(e.consume(R),E):w(R)}function E(R){return R===62?D(R):R===93?(e.consume(R),E):w(R)}function j(R){return R===null||R===62?D(R):Ve(R)?(o=j,q(R)):(e.consume(R),j)}function C(R){return R===null?n(R):R===63?(e.consume(R),O):Ve(R)?(o=C,q(R)):(e.consume(R),C)}function O(R){return R===62?D(R):C(R)}function N(R){return Kr(R)?(e.consume(R),k):n(R)}function k(R){return R===45||Ir(R)?(e.consume(R),k):T(R)}function T(R){return Ve(R)?(o=T,q(R)):ht(R)?(e.consume(R),T):D(R)}function M(R){return R===45||Ir(R)?(e.consume(R),M):R===47||R===62||Wt(R)?I(R):n(R)}function I(R){return R===47?(e.consume(R),D):R===58||R===95||Kr(R)?(e.consume(R),L):Ve(R)?(o=I,q(R)):ht(R)?(e.consume(R),I):D(R)}function L(R){return R===45||R===46||R===58||R===95||Ir(R)?(e.consume(R),L):B(R)}function B(R){return R===61?(e.consume(R),z):Ve(R)?(o=B,q(R)):ht(R)?(e.consume(R),B):I(R)}function z(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,G):Ve(R)?(o=z,q(R)):ht(R)?(e.consume(R),z):(e.consume(R),F)}function G(R){return R===i?(e.consume(R),i=void 0,V):R===null?n(R):Ve(R)?(o=G,q(R)):(e.consume(R),G)}function F(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||Wt(R)?I(R):(e.consume(R),F)}function V(R){return R===47||R===62||Wt(R)?I(R):n(R)}function D(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function q(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),X}function X(R){return ht(R)?wt(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Y(R)}function Y(R){return e.enter("htmlTextData"),o(R)}}const qN={name:"labelEnd",resolveAll:dRe,resolveTo:hRe,tokenize:mRe},uRe={tokenize:pRe},cRe={tokenize:gRe},fRe={tokenize:vRe};function dRe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Mi(e,0,e.length,n),e}function hRe(e,t){let n=e.length,r=0,i,a,o,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=na(l,e.slice(a+1,a+r+3)),l=na(l,[["enter",h,t]]),l=na(l,Pb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=na(l,[["exit",h,t],e[o-2],e[o-1],["exit",f,t]]),l=na(l,e.slice(o+1)),l=na(l,[["exit",c,t]]),Mi(e,a,e.length,l),e}function mRe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(p){return a?a._inactive?d(p):(o=r.parser.defined.includes(Oa(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(uRe,h,o?h:d)(p):p===91?e.attempt(cRe,h,o?f:d)(p):o?h(p):d(p)}function f(p){return e.attempt(fRe,h,d)(p)}function h(p){return t(p)}function d(p){return a._balanced=!0,n(p)}}function pRe(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Wt(d)?Sm(e,a)(d):a(d)}function a(d){return d===41?h(d):lY(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Wt(d)?Sm(e,c)(d):h(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?cY(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function f(d){return Wt(d)?Sm(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function gRe(e,t,n){const r=this;return i;function i(l){return uY.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Oa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function vRe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const yRe={name:"labelStartImage",resolveAll:qN.resolveAll,tokenize:xRe};function xRe(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const bRe={name:"labelStartLink",resolveAll:qN.resolveAll,tokenize:wRe};function wRe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const c_={name:"lineEnding",tokenize:SRe};function SRe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),wt(e,t,"linePrefix")}}const Ay={name:"thematicBreak",tokenize:ERe};function ERe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,l(f)}function l(f){return f===i?(e.enter("thematicBreakSequence"),c(f)):r>=3&&(f===null||Ve(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===i?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),ht(f)?wt(e,l,"whitespace")(f):l(f))}}const oi={continuation:{tokenize:ARe},exit:kRe,name:"list",tokenize:jRe},_Re={partial:!0,tokenize:NRe},CRe={partial:!0,tokenize:ORe};function jRe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(v){const b=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:Rj(v)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ay,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(v)}return n(v)}function c(v){return Rj(v)&&++o<10?(e.consume(v),c):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(rg,r.interrupt?n:h,e.attempt(_Re,p,d))}function h(v){return r.containerState.initialBlankLine=!0,a++,p(v)}function d(v){return ht(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),p):n(v)}function p(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function ARe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(rg,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!ht(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(CRe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,wt(e,e.attempt(oi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ORe(e,t,n){const r=this;return wt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function kRe(e){e.exit(this.containerState.type)}function NRe(e,t,n){const r=this;return wt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!ht(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const y5={name:"setextUnderline",resolveTo:TRe,tokenize:PRe};function TRe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function PRe(e,t,n){const r=this;let i;return a;function a(f){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),ht(f)?wt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Ve(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const MRe={tokenize:DRe};function DRe(e){const t=this,n=e.attempt(rg,r,e.attempt(this.parser.constructs.flowInitial,i,wt(e,e.attempt(this.parser.constructs.flow,i,e.attempt($De,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const RRe={resolveAll:dY()},IRe=fY("string"),LRe=fY("text");function fY(e){return{resolveAll:dY(e==="text"?zRe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,l);return o;function o(h){return f(h)?a(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return f(h)?(n.exit("data"),a(h)):(n.consume(h),c)}function f(h){if(h===null)return!0;const d=i[h];let p=-1;if(d)for(;++p<d.length;){const v=d[p];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function dY(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function zRe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,l=0,c;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(f===-2)c=!0,l++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const f={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const $Re={42:oi,43:oi,45:oi,48:oi,49:oi,50:oi,51:oi,52:oi,53:oi,54:oi,55:oi,56:oi,57:oi,62:iY},BRe={91:qDe},FRe={[-2]:u_,[-1]:u_,32:u_},URe={35:WDe,42:Ay,45:[y5,Ay],60:eRe,61:y5,95:Ay,96:g5,126:g5},HRe={38:oY,92:aY},qRe={[-5]:c_,[-4]:c_,[-3]:c_,33:yRe,38:oY,42:Ij,60:[bDe,sRe],91:bRe,92:[XDe,aY],93:qN,95:Ij,96:MDe},VRe={null:[Ij,RRe]},KRe={null:[42,95]},YRe={null:[]},XRe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:KRe,contentInitial:BRe,disable:YRe,document:$Re,flow:URe,flowInitial:FRe,insideSpan:VRe,string:HRe,text:qRe},Symbol.toStringTag,{value:"Module"}));function GRe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],l=[];const c={attempt:T(N),check:T(k),consume:j,enter:C,exit:O,interrupt:T(k,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:v,write:d};let h=t.tokenize.call(f,c);return t.resolveAll&&a.push(t),f;function d(B){return o=na(o,B),S(),o[o.length-1]!==null?[]:(M(t,0),f.events=Pb(a,f.events,f),f.events)}function p(B,z){return QRe(v(B),z)}function v(B){return WRe(o,B)}function b(){const{_bufferIndex:B,_index:z,line:G,column:F,offset:V}=r;return{_bufferIndex:B,_index:z,line:G,column:F,offset:V}}function w(B){i[B.line]=B.column,L()}function S(){let B;for(;r._index<o.length;){const z=o[r._index];if(typeof z=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<z.length;)E(z.charCodeAt(r._bufferIndex));else E(z)}}function E(B){h=h(B)}function j(B){Ve(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,L()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=B}function C(B,z){const G=z||{};return G.type=B,G.start=b(),f.events.push(["enter",G,f]),l.push(G),G}function O(B){const z=l.pop();return z.end=b(),f.events.push(["exit",z,f]),z}function N(B,z){M(B,z.from)}function k(B,z){z.restore()}function T(B,z){return G;function G(F,V,D){let q,X,Y,R;return Array.isArray(F)?U(F):"tokenize"in F?U([F]):H(F);function H(ne){return ae;function ae(re){const ee=re!==null&&ne[re],se=re!==null&&ne.null,me=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(se)?se:se?[se]:[]];return U(me)(re)}}function U(ne){return q=ne,X=0,ne.length===0?D:$(ne[X])}function $(ne){return ae;function ae(re){return R=I(),Y=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?J():ne.tokenize.call(z?Object.assign(Object.create(f),z):f,c,Q,J)(re)}}function Q(ne){return B(Y,R),V}function J(ne){return R.restore(),++X<q.length?$(q[X]):D}}}function M(B,z){B.resolveAll&&!a.includes(B)&&a.push(B),B.resolve&&Mi(f.events,z,f.events.length-z,B.resolve(f.events.slice(z),f)),B.resolveTo&&(f.events=B.resolveTo(f.events,f))}function I(){const B=b(),z=f.previous,G=f.currentConstruct,F=f.events.length,V=Array.from(l);return{from:F,restore:D};function D(){r=B,f.previous=z,f.currentConstruct=G,f.events.length=F,l=V,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function WRe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function QRe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
`;break}case-3:{o=`\r
`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function ZRe(e){const r={constructs:nY([XRe,...(e||{}).extensions||[]]),content:i(hDe),defined:[],document:i(pDe),flow:i(MRe),lazy:{},string:i(IRe),text:i(LRe)};return r;function i(a){return o;function o(l){return GRe(r,a,l)}}}function JRe(e){for(;!sY(e););return e}const x5=/[\0\t\n\r]/g;function eIe(){let e=1,t="",n=!0,r;return i;function i(a,o,l){const c=[];let f,h,d,p,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(x5.lastIndex=d,f=x5.exec(a),p=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(p),!f){t=a.slice(d);break}if(v===10&&d===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<p&&(c.push(a.slice(d,p)),e+=p-d),v){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const tIe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nIe(e){return e.replace(tIe,rIe)}function rIe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return rY(n.slice(a?2:1),a?16:10)}return HN(n)||e}const hY={}.hasOwnProperty;function iIe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),aIe(n)(JRe(ZRe(n).document().write(eIe()(e,t,!0))))}function aIe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(nt),autolinkProtocol:I,autolinkEmail:I,atxHeading:a($e),blockQuote:a(se),characterEscape:I,characterReference:I,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(ie,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(be),hardBreakEscape:a(Ne),hardBreakTrailing:a(Ne),htmlFlow:a(Je,o),htmlFlowData:I,htmlText:a(Je,o),htmlTextData:I,image:a(Qe),label:o,link:a(nt),listItem:a(Wn),listItemValue:p,listOrdered:a(Nn,d),listUnordered:a(Nn),paragraph:a(Mt),reference:$,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a($e),strong:a(Tn),thematicBreak:a(pn)},exit:{atxHeading:c(),atxHeadingSequence:N,autolink:c(),autolinkEmail:ee,autolinkProtocol:re,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:ne,characterReference:ae,codeFenced:c(S),codeFencedFence:w,codeFencedFenceInfo:v,codeFencedFenceMeta:b,codeFlowValue:L,codeIndented:c(E),codeText:c(V),codeTextData:L,data:L,definition:c(),definitionDestinationString:O,definitionLabelString:j,definitionTitleString:C,emphasis:c(),hardBreakEscape:c(z),hardBreakTrailing:c(z),htmlFlow:c(G),htmlFlowData:L,htmlText:c(F),htmlTextData:L,image:c(q),label:Y,labelText:X,lineEnding:B,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Q,resourceDestinationString:R,resourceTitleString:H,resource:U,setextHeading:c(M),setextHeadingLineSequence:T,setextHeadingText:k,strong:c(),thematicBreak:c()}};mY(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let xe={type:"root",children:[]};const ze={stack:[xe],tokenStack:[],config:t,enter:l,exit:f,buffer:o,resume:h,data:n},Ke=[];let et=-1;for(;++et<de.length;)if(de[et][1].type==="listOrdered"||de[et][1].type==="listUnordered")if(de[et][0]==="enter")Ke.push(et);else{const gn=Ke.pop();et=i(de,gn,et)}for(et=-1;++et<de.length;){const gn=t[de[et][0]];hY.call(gn,de[et][1].type)&&gn[de[et][1].type].call(Object.assign({sliceSerialize:de[et][2].sliceSerialize},ze),de[et][1])}if(ze.tokenStack.length>0){const gn=ze.tokenStack[ze.tokenStack.length-1];(gn[1]||b5).call(ze,void 0,gn[0])}for(xe.position={start:ll(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:ll(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)xe=t.transforms[et](xe)||xe;return xe}function i(de,xe,ze){let Ke=xe-1,et=-1,gn=!1,on,Kt,Se,lt;for(;++Ke<=ze;){const Xe=de[Ke];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?et++:et--,lt=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(on&&!lt&&!et&&!Se&&(Se=Ke),lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:lt=void 0}if(!et&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||et===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(on){let Pn=Ke;for(Kt=void 0;Pn--;){const vn=de[Pn];if(vn[1].type==="lineEnding"||vn[1].type==="lineEndingBlank"){if(vn[0]==="exit")continue;Kt&&(de[Kt][1].type="lineEndingBlank",gn=!0),vn[1].type="lineEnding",Kt=Pn}else if(!(vn[1].type==="linePrefix"||vn[1].type==="blockQuotePrefix"||vn[1].type==="blockQuotePrefixWhitespace"||vn[1].type==="blockQuoteMarker"||vn[1].type==="listItemIndent"))break}Se&&(!Kt||Se<Kt)&&(on._spread=!0),on.end=Object.assign({},Kt?de[Kt][1].start:Xe[1].end),de.splice(Kt||Ke,0,["exit",on,Xe[2]]),Ke++,ze++}if(Xe[1].type==="listItemPrefix"){const Pn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};on=Pn,de.splice(Ke,0,["enter",Pn,Xe[2]]),Ke++,ze++,Se=void 0,lt=!0}}}return de[xe][1]._spread=gn,ze}function a(de,xe){return ze;function ze(Ke){l.call(this,de(Ke),Ke),xe&&xe.call(this,Ke)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(de,xe,ze){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([xe,ze||void 0]),de.position={start:ll(xe.start),end:void 0}}function c(de){return xe;function xe(ze){de&&de.call(this,ze),f.call(this,ze)}}function f(de,xe){const ze=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==de.type&&(xe?xe.call(this,de,Ke[0]):(Ke[1]||b5).call(this,de,Ke[0]));else throw new Error("Cannot close `"+de.type+"` ("+wm({start:de.start,end:de.end})+"): it’s not open");ze.position.end=ll(de.end)}function h(){return UN(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(de){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function v(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=de}function b(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=de}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de.replace(/(\r?\n|\r)$/g,"")}function j(de){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Oa(this.sliceSerialize(de)).toLowerCase()}function C(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function O(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function N(de){const xe=this.stack[this.stack.length-1];if(!xe.depth){const ze=this.sliceSerialize(de).length;xe.depth=ze}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function T(de){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function I(de){const ze=this.stack[this.stack.length-1].children;let Ke=ze[ze.length-1];(!Ke||Ke.type!=="text")&&(Ke=Rt(),Ke.position={start:ll(de.start),end:void 0},ze.push(Ke)),this.stack.push(Ke)}function L(de){const xe=this.stack.pop();xe.value+=this.sliceSerialize(de),xe.position.end=ll(de.end)}function B(de){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ze=xe.children[xe.children.length-1];ze.position.end=ll(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(xe.type)&&(I.call(this,de),L.call(this,de))}function z(){this.data.atHardBreak=!0}function G(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function F(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function V(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.value=de}function D(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function q(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=xe,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function X(de){const xe=this.sliceSerialize(de),ze=this.stack[this.stack.length-2];ze.label=nIe(xe),ze.identifier=Oa(xe).toLowerCase()}function Y(){const de=this.stack[this.stack.length-1],xe=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){const Ke=de.children;ze.children=Ke}else ze.alt=xe}function R(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.url=de}function H(){const de=this.resume(),xe=this.stack[this.stack.length-1];xe.title=de}function U(){this.data.inReference=void 0}function $(){this.data.referenceType="collapsed"}function Q(de){const xe=this.resume(),ze=this.stack[this.stack.length-1];ze.label=xe,ze.identifier=Oa(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function J(de){this.data.characterReferenceType=de.type}function ne(de){const xe=this.sliceSerialize(de),ze=this.data.characterReferenceType;let Ke;ze?(Ke=rY(xe,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=HN(xe);const et=this.stack[this.stack.length-1];et.value+=Ke}function ae(de){const xe=this.stack.pop();xe.position.end=ll(de.end)}function re(de){L.call(this,de);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(de)}function ee(de){L.call(this,de);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(de)}function se(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function be(){return{type:"emphasis",children:[]}}function $e(){return{type:"heading",depth:0,children:[]}}function Ne(){return{type:"break"}}function Je(){return{type:"html",value:""}}function Qe(){return{type:"image",title:null,url:"",alt:null}}function nt(){return{type:"link",title:null,url:"",children:[]}}function Nn(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function Wn(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function Mt(){return{type:"paragraph",children:[]}}function Tn(){return{type:"strong",children:[]}}function Rt(){return{type:"text",value:""}}function pn(){return{type:"thematicBreak"}}}function ll(e){return{line:e.line,column:e.column,offset:e.offset}}function mY(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?mY(e,r):oIe(e,r)}}function oIe(e,t){let n;for(n in t)if(hY.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function b5(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wm({start:t.start,end:t.end})+") is still open")}function sIe(e){const t=this;t.parser=n;function n(r){return iIe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lIe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function uIe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function cIe(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function fIe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dIe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hIe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Yd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function mIe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pIe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pY(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function gIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pY(e,t);const i={src:Yd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function vIe(e,t){const n={src:Yd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function yIe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function xIe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return pY(e,t);const i={href:Yd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bIe(e,t){const n={href:Yd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function wIe(e,t,n){const r=e.all(t),i=n?SIe(n):gY(t),a={},o=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const h=r[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function SIe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=gY(n[r])}return t}function gY(e){const t=e.spread;return t??e.children.length>1}function EIe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function _Ie(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CIe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jIe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AIe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=zN(t.children[1]),c=GK(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function OIe(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const f=[];for(;++c<l;){const d=t.children[c],p={},v=o?o[c]:void 0;v&&(p.align=v);let b={type:"element",tagName:a,properties:p,children:[]};d&&(b.children=e.all(d),e.patch(d,b),b=e.applyData(d,b)),f.push(b)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,h),e.applyData(t,h)}function kIe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const w5=9,S5=32;function NIe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(E5(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(E5(t.slice(i),i>0,!1)),a.join("")}function E5(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===w5||a===S5;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===w5||a===S5;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function TIe(e,t){const n={type:"text",value:NIe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PIe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const MIe={blockquote:lIe,break:uIe,code:cIe,delete:fIe,emphasis:dIe,footnoteReference:hIe,heading:mIe,html:pIe,imageReference:gIe,image:vIe,inlineCode:yIe,linkReference:xIe,link:bIe,listItem:wIe,list:EIe,paragraph:_Ie,root:CIe,strong:jIe,table:AIe,tableCell:kIe,tableRow:OIe,text:TIe,thematicBreak:PIe,toml:iy,yaml:iy,definition:iy,footnoteDefinition:iy};function iy(){}const vY=-1,Mb=0,Em=1,Xx=2,VN=3,KN=4,YN=5,XN=6,yY=7,xY=8,_5=typeof self=="object"?self:globalThis,DIe=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Mb:case vY:return n(o,i);case Em:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Xx:{const l=n({},i);for(const[c,f]of o)l[r(c)]=r(f);return l}case VN:return n(new Date(o),i);case KN:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case YN:{const l=n(new Map,i);for(const[c,f]of o)l.set(r(c),r(f));return l}case XN:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case yY:{const{name:l,message:c}=o;return n(new _5[l](c),i)}case xY:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new _5[a](o),i)};return r},C5=e=>DIe(new Map,e)(0),_f="",{toString:RIe}={},{keys:IIe}=Object,um=e=>{const t=typeof e;if(t!=="object"||!e)return[Mb,t];const n=RIe.call(e).slice(8,-1);switch(n){case"Array":return[Em,_f];case"Object":return[Xx,_f];case"Date":return[VN,_f];case"RegExp":return[KN,_f];case"Map":return[YN,_f];case"Set":return[XN,_f];case"DataView":return[Em,n]}return n.includes("Array")?[Em,n]:n.includes("Error")?[yY,n]:[Xx,n]},ay=([e,t])=>e===Mb&&(t==="function"||t==="symbol"),LIe=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=um(o);switch(l){case Mb:{let h=o;switch(c){case"bigint":l=xY,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([vY],o)}return i([l,h],o)}case Em:{if(c){let p=o;return c==="DataView"?p=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(o)),i([c,[...p]],o)}const h=[],d=i([l,h],o);for(const p of o)h.push(a(p));return d}case Xx:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const h=[],d=i([l,h],o);for(const p of IIe(o))(e||!ay(um(o[p])))&&h.push([a(p),a(o[p])]);return d}case VN:return i([l,o.toISOString()],o);case KN:{const{source:h,flags:d}=o;return i([l,{source:h,flags:d}],o)}case YN:{const h=[],d=i([l,h],o);for(const[p,v]of o)(e||!(ay(um(p))||ay(um(v))))&&h.push([a(p),a(v)]);return d}case XN:{const h=[],d=i([l,h],o);for(const p of o)(e||!ay(um(p)))&&h.push(a(p));return d}}const{message:f}=o;return i([l,{name:c,message:f}],o)};return a},j5=(e,{json:t,lossy:n}={})=>{const r=[];return LIe(!(t||n),!!t,new Map,r)(e),r},Gx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?C5(j5(e,t)):structuredClone(e):(e,t)=>C5(j5(e,t));function zIe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function $Ie(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function BIe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||zIe,r=e.options.footnoteBackLabel||$Ie,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[c]);if(!f)continue;const h=e.all(f),d=String(f.identifier).toUpperCase(),p=Yd(d.toLowerCase());let v=0;const b=[],w=e.footnoteCounts.get(d);for(;w!==void 0&&++v<=w;){b.length>0&&b.push({type:"text",value:" "});let j=typeof n=="string"?n:n(c,v);typeof j=="string"&&(j={type:"text",value:j}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,v),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const j=S.children[S.children.length-1];j&&j.type==="text"?j.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else h.push(...b);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(h,!0)};e.patch(f,E),l.push(E)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Gx(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
`}]}}const Db=(function(e){if(e==null)return qIe;if(typeof e=="function")return Rb(e);if(typeof e=="object")return Array.isArray(e)?FIe(e):UIe(e);if(typeof e=="string")return HIe(e);throw new Error("Expected function, string, or object as test")});function FIe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Db(e[n]);return Rb(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function UIe(e){const t=e;return Rb(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function HIe(e){return Rb(t);function t(n){return n&&n.type===e}}function Rb(e){return t;function t(n,r,i){return!!(VIe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function qIe(){return!0}function VIe(e){return e!==null&&typeof e=="object"&&"type"in e}const bY=[],KIe=!0,Lj=!1,YIe="skip";function wY(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=Db(i),o=r?-1:1;l(e,void 0,[])();function l(c,f,h){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const v=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(c.type+(v?"<"+v+">":""))+")"})}return p;function p(){let v=bY,b,w,S;if((!t||a(c,f,h[h.length-1]||void 0))&&(v=XIe(n(c,h)),v[0]===Lj))return v;if("children"in c&&c.children){const E=c;if(E.children&&v[0]!==YIe)for(w=(r?E.children.length:-1)+o,S=h.concat(E);w>-1&&w<E.children.length;){const j=E.children[w];if(b=l(j,w,S)(),b[0]===Lj)return b;w=typeof b[1]=="number"?b[1]:w+o}}return v}}}function XIe(e){return Array.isArray(e)?e:typeof e=="number"?[KIe,e]:e==null?bY:[e]}function GN(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),wY(e,a,l,i);function l(c,f){const h=f[f.length-1],d=h?h.children.indexOf(c):void 0;return o(c,d,h)}}const zj={}.hasOwnProperty,GIe={};function WIe(e,t){const n=t||GIe,r=new Map,i=new Map,a=new Map,o={...MIe,...n.handlers},l={all:f,applyData:ZIe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:QIe,wrap:eLe};return GN(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,p=String(h.identifier).toUpperCase();d.has(p)||d.set(p,h)}}),l;function c(h,d){const p=h.type,v=l.handlers[p];if(zj.call(l.handlers,p)&&v)return v(l,h,d);if(l.options.passThrough&&l.options.passThrough.includes(p)){if("children"in h){const{children:w,...S}=h,E=Gx(S);return E.children=l.all(h),E}return Gx(h)}return(l.options.unknownHandler||JIe)(l,h,d)}function f(h){const d=[];if("children"in h){const p=h.children;let v=-1;for(;++v<p.length;){const b=l.one(p[v],h);if(b){if(v&&p[v-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=A5(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=A5(w.value))}Array.isArray(b)?d.push(...b):d.push(b)}}}return d}}function QIe(e,t){e.position&&(t.position=$Me(e))}function ZIe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,Gx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function JIe(e,t){const n=t.data||{},r="value"in t&&!(zj.call(n,"hProperties")||zj.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eLe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function A5(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function O5(e,t){const n=WIe(e,t),r=n.one(e,void 0),i=BIe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function tLe(e,t){return e&&"run"in e?async function(n,r){const i=O5(n,{file:r,...t});await e.run(i,r)}:function(n,r){return O5(n,{file:r,...e||t})}}function k5(e){if(e)throw e}var f_,N5;function nLe(){if(N5)return f_;N5=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var h=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!h&&!d)return!1;var p;for(p in f);return typeof p>"u"||e.call(f,p)},o=function(f,h){n&&h.name==="__proto__"?n(f,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):f[h.name]=h.newValue},l=function(f,h){if(h==="__proto__")if(e.call(f,h)){if(r)return r(f,h).value}else return;return f[h]};return f_=function c(){var f,h,d,p,v,b,w=arguments[0],S=1,E=arguments.length,j=!1;for(typeof w=="boolean"&&(j=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});S<E;++S)if(f=arguments[S],f!=null)for(h in f)d=l(w,h),p=l(f,h),w!==p&&(j&&p&&(a(p)||(v=i(p)))?(v?(v=!1,b=d&&i(d)?d:[]):b=d&&a(d)?d:{},o(w,{name:h,newValue:c(j,b,p)})):typeof p<"u"&&o(w,{name:h,newValue:p}));return w},f_}var rLe=nLe();const d_=zi(rLe);function $j(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function iLe(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...f){const h=e[++a];let d=-1;if(c){o(c);return}for(;++d<i.length;)(f[d]===null||f[d]===void 0)&&(f[d]=i[d]);i=f,h?aLe(h,l)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function aLe(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(f){const h=f;if(l&&n)throw h;return i(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(o,...l){n||(n=!0,t(o,...l))}function a(o){i(null,o)}}const Xa={basename:oLe,dirname:sLe,extname:lLe,join:uLe,sep:"/"};function oLe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ig(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function sLe(e){if(ig(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function lLe(e){ig(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function uLe(...e){let t=-1,n;for(;++t<e.length;)ig(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":cLe(n)}function cLe(e){ig(e);const t=e.codePointAt(0)===47;let n=fLe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function fLe(e,t){let n="",r=0,i=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function ig(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dLe={cwd:hLe};function hLe(){return"/"}function Bj(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function mLe(e){if(typeof e=="string")e=new URL(e);else if(!Bj(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return pLe(e)}function pLe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const h_=["history","path","basename","stem","extname","dirname"];class SY{constructor(t){let n;t?Bj(t)?n={path:t}:typeof t=="string"||gLe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":dLe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<h_.length;){const a=h_[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)h_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Xa.basename(this.path):void 0}set basename(t){p_(t,"basename"),m_(t,"basename"),this.path=Xa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xa.dirname(this.path):void 0}set dirname(t){T5(this.basename,"dirname"),this.path=Xa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xa.extname(this.path):void 0}set extname(t){if(m_(t,"extname"),T5(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bj(t)&&(t=mLe(t)),p_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xa.basename(this.path,this.extname):void 0}set stem(t){p_(t,"stem"),m_(t,"stem"),this.path=Xa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Fr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function m_(e,t){if(e&&e.includes(Xa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xa.sep+"`")}function p_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function T5(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function gLe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vLe=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),yLe={}.hasOwnProperty;class WN extends vLe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=iLe()}copy(){const t=new WN;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(d_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(y_("data",this.frozen),this.namespace[t]=n,this):yLe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(y_("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=oy(t),r=this.parser||this.Parser;return g_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),g_("process",this.parser||this.Parser),v_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const l=oy(t),c=r.parse(l);r.run(c,l,function(h,d,p){if(h||!d||!p)return f(h);const v=d,b=r.stringify(v,p);wLe(b)?p.value=b:p.result=b,f(h,p)});function f(h,d){h||!d?o(h):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),g_("processSync",this.parser||this.Parser),v_("processSync",this.compiler||this.Compiler),this.process(t,i),M5("processSync","process",n),r;function i(a,o){n=!0,k5(a),r=o}}run(t,n,r){P5(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=oy(n);i.run(t,c,f);function f(h,d,p){const v=d||t;h?l(h):o?o(v):r(void 0,v,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),M5("runSync","run",r),i;function a(o,l){k5(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=oy(n),i=this.compiler||this.Compiler;return v_("stringify",i),P5(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(y_("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")c(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[h,...d]=f;c(h,d)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(i.settings=d_(!0,i.settings,f.settings))}function l(f){let h=-1;if(f!=null)if(Array.isArray(f))for(;++h<f.length;){const d=f[h];a(d)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function c(f,h){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===f){p=d;break}if(p===-1)r.push([f,...h]);else if(h.length>0){let[v,...b]=h;const w=r[p][1];$j(w)&&$j(v)&&(v=d_(!0,w,v)),r[p]=[f,v,...b]}}}}const xLe=new WN().freeze();function g_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function v_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function y_(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P5(e){if(!$j(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function M5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oy(e){return bLe(e)?e:new SY(e)}function bLe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wLe(e){return typeof e=="string"||SLe(e)}function SLe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ELe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",D5=[],R5={allowDangerousHtml:!0},_Le=/^(https?|ircs?|mailto|xmpp)$/i,CLe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function jLe(e){const t=ALe(e),n=OLe(e);return kLe(t.runSync(t.parse(n),n),e)}function ALe(e){const t=e.rehypePlugins||D5,n=e.remarkPlugins||D5,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...R5}:R5;return xLe().use(sIe).use(n).use(tLe,r).use(t)}function OLe(e){const t=e.children||"",n=new SY;return typeof t=="string"&&(n.value=t),n}function kLe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||NLe;for(const h of CLe)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+ELe+h.id,void 0);return GN(e,f),qMe(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(h,d,p){if(h.type==="raw"&&p&&typeof d=="number")return o?p.children.splice(d,1):p.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let v;for(v in l_)if(Object.hasOwn(l_,v)&&Object.hasOwn(h.properties,v)){const b=h.properties[v],w=l_[v];(w===null||w.includes(h.tagName))&&(h.properties[v]=c(String(b||""),v,h))}}if(h.type==="element"){let v=n?!n.includes(h.tagName):a?a.includes(h.tagName):!1;if(!v&&r&&typeof d=="number"&&(v=!r(h,d,p)),v&&p&&typeof d=="number")return l&&h.children?p.children.splice(d,1,...h.children):p.children.splice(d,1),d}}}function NLe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||_Le.test(e.slice(0,t))?e:""}function I5(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function TLe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function PLe(e,t,n){const i=Db((n||{}).ignore||[]),a=MLe(t);let o=-1;for(;++o<a.length;)wY(e,"text",l);function l(f,h){let d=-1,p;for(;++d<h.length;){const v=h[d],b=p?p.children:void 0;if(i(v,b?b.indexOf(v):void 0,p))return;p=v}if(p)return c(f,h)}function c(f,h){const d=h[h.length-1],p=a[o][0],v=a[o][1];let b=0;const S=d.children.indexOf(f);let E=!1,j=[];p.lastIndex=0;let C=p.exec(f.value);for(;C;){const O=C.index,N={index:C.index,input:C.input,stack:[...h,f]};let k=v(...C,N);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=O+1:(b!==O&&j.push({type:"text",value:f.value.slice(b,O)}),Array.isArray(k)?j.push(...k):k&&j.push(k),b=O+C[0].length,E=!0),!p.global)break;C=p.exec(f.value)}return E?(b<f.value.length&&j.push({type:"text",value:f.value.slice(b)}),d.children.splice(S,1,...j)):j=[f],S+j.length}}function MLe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([DLe(i[0]),RLe(i[1])])}return t}function DLe(e){return typeof e=="string"?new RegExp(TLe(e),"g"):e}function RLe(e){return typeof e=="function"?e:function(){return e}}const x_="phrasing",b_=["autolink","link","image","label"];function ILe(){return{transforms:[HLe],enter:{literalAutolink:zLe,literalAutolinkEmail:w_,literalAutolinkHttp:w_,literalAutolinkWww:w_},exit:{literalAutolink:ULe,literalAutolinkEmail:FLe,literalAutolinkHttp:$Le,literalAutolinkWww:BLe}}}function LLe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:x_,notInConstruct:b_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:x_,notInConstruct:b_},{character:":",before:"[ps]",after:"\\/",inConstruct:x_,notInConstruct:b_}]}}function zLe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function w_(e){this.config.enter.autolinkProtocol.call(this,e)}function $Le(e){this.config.exit.autolinkProtocol.call(this,e)}function BLe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function FLe(e){this.config.exit.autolinkEmail.call(this,e)}function ULe(e){this.exit(e)}function HLe(e){PLe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qLe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VLe]],{ignore:["link","linkReference"]})}function qLe(e,t,n,r,i){let a="";if(!EY(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!KLe(n)))return!1;const o=YLe(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function VLe(e,t,n,r){return!EY(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function KLe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function YLe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=I5(e,"(");let a=I5(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function EY(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||xc(n)||Tb(n))&&(!t||n!==47)}_Y.peek=nze;function XLe(){this.buffer()}function GLe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function WLe(){this.buffer()}function QLe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZLe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JLe(e){this.exit(e)}function eze(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tze(e){this.exit(e)}function nze(){return"["}function _Y(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=i.move("]"),a}function rze(){return{enter:{gfmFootnoteCallString:XLe,gfmFootnoteCall:GLe,gfmFootnoteDefinitionLabelString:WLe,gfmFootnoteDefinition:QLe},exit:{gfmFootnoteCallString:ZLe,gfmFootnoteCall:JLe,gfmFootnoteDefinitionLabelString:eze,gfmFootnoteDefinition:tze}}}function ize(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_Y},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const l=a.createTracker(o);let c=l.move("[^");const f=a.enter("footnoteDefinition"),h=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?CY:aze))),f(),c}}function aze(e,t,n){return t===0?e:CY(e,t,n)}function CY(e,t,n){return(n?"":"    ")+e}const oze=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];jY.peek=fze;function sze(){return{canContainEols:["delete"],enter:{strikethrough:uze},exit:{strikethrough:cze}}}function lze(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oze}],handlers:{delete:jY}}}function uze(e){this.enter({type:"delete",children:[]},e)}function cze(e){this.exit(e)}function jY(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function fze(){return"~"}function dze(e){return e.length}function hze(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dze,a=[],o=[],l=[],c=[];let f=0,h=-1;for(;++h<e.length;){const w=[],S=[];let E=-1;for(e[h].length>f&&(f=e[h].length);++E<e[h].length;){const j=mze(e[h][E]);if(n.alignDelimiters!==!1){const C=i(j);S[E]=C,(c[E]===void 0||C>c[E])&&(c[E]=C)}w.push(j)}o[h]=w,l[h]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<f;)a[d]=L5(r[d]);else{const w=L5(r);for(;++d<f;)a[d]=w}d=-1;const p=[],v=[];for(;++d<f;){const w=a[d];let S="",E="";w===99?(S=":",E=":"):w===108?S=":":w===114&&(E=":");let j=n.alignDelimiters===!1?1:Math.max(1,c[d]-S.length-E.length);const C=S+"-".repeat(j)+E;n.alignDelimiters!==!1&&(j=S.length+j+E.length,j>c[d]&&(c[d]=j),v[d]=j),p[d]=C}o.splice(1,0,p),l.splice(1,0,v),h=-1;const b=[];for(;++h<o.length;){const w=o[h],S=l[h];d=-1;const E=[];for(;++d<f;){const j=w[d]||"";let C="",O="";if(n.alignDelimiters!==!1){const N=c[d]-(S[d]||0),k=a[d];k===114?C=" ".repeat(N):k===99?N%2?(C=" ".repeat(N/2+.5),O=" ".repeat(N/2-.5)):(C=" ".repeat(N/2),O=C):O=" ".repeat(N)}n.delimiterStart!==!1&&!d&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&j==="")&&(n.delimiterStart!==!1||d)&&E.push(" "),n.alignDelimiters!==!1&&E.push(C),E.push(j),n.alignDelimiters!==!1&&E.push(O),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||d!==f-1)&&E.push("|")}b.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return b.join(`
`)}function mze(e){return e==null?"":String(e)}function L5(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function pze(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),gze);return i(),o}function gze(e,t,n){return">"+(n?"":" ")+e}function vze(e,t){return z5(e,t.inConstruct,!0)&&!z5(e,t.notInConstruct,!1)}function z5(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $5(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&vze(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function yze(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function xze(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function bze(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wze(e,t,n,r){const i=bze(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(xze(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(a,Sze);return d(),p}const l=n.createTracker(r),c=i.repeat(Math.max(yze(a,i)+1,3)),f=n.enter("codeFenced");let h=l.move(c);if(e.lang){const d=n.enter(`codeFencedLang${o}`);h+=l.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(n.safe(e.meta,{before:h,after:`
`,encode:["`"],...l.current()})),d()}return h+=l.move(`
`),a&&(h+=l.move(a+`
`)),h+=l.move(c),f(),h}function Sze(e,t,n){return(n?"":"    ")+e}function QN(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Eze(e,t,n,r){const i=QN(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":`
`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=c.move(" "+i),f+=c.move(n.safe(e.title,{before:f,after:i,...c.current()})),f+=c.move(i),l()),o(),f}function _ze(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ap(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wx(e,t,n){const r=Cd(e),i=Cd(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}AY.peek=Cze;function AY(e,t,n,r){const i=_ze(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const f=c.charCodeAt(0),h=Wx(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=ap(f)+c.slice(1));const d=c.charCodeAt(c.length-1),p=Wx(r.after.charCodeAt(0),d,i);p.inside&&(c=c.slice(0,-1)+ap(d));const v=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+c+v}function Cze(e,t,n){return n.options.emphasis||"*"}function jze(e,t){let n=!1;return GN(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Lj}),!!((!e.depth||e.depth<3)&&UN(e)&&(t.options.setext||n))}function Aze(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(jze(e,n)){const h=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return d(),h(),p+`
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(f)&&(f=ap(f.charCodeAt(0))+f.slice(1)),f=f?o+" "+f:o,n.options.closeAtx&&(f+=" "+o),c(),l(),f}OY.peek=Oze;function OY(e){return e.value||""}function Oze(){return"<"}kY.peek=kze;function kY(e,t,n,r){const i=QN(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(l=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),f+=c.move(" "+i),f+=c.move(n.safe(e.title,{before:f,after:i,...c.current()})),f+=c.move(i),l()),f+=c.move(")"),o(),f}function kze(){return"!"}NY.peek=Nze;function NY(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const f=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Nze(){return"!"}TY.peek=Tze;function TY(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let f=c.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(c.index+1)}}return i+r+i}function Tze(){return"`"}function PY(e,t){const n=UN(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}MY.peek=Pze;function MY(e,t,n,r){const i=QN(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(PY(e,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),l(),n.stack=h,d}l=n.enter("link"),c=n.enter("label");let f=o.move("[");return f+=o.move(n.containerPhrasing(e,{before:f,after:"](",...o.current()})),f+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=o.move("<"),f+=o.move(n.safe(e.url,{before:f,after:">",...o.current()})),f+=o.move(">")):(c=n.enter("destinationRaw"),f+=o.move(n.safe(e.url,{before:f,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),f+=o.move(" "+i),f+=o.move(n.safe(e.title,{before:f,after:i,...o.current()})),f+=o.move(i),c()),f+=o.move(")"),l(),f}function Pze(e,t,n){return PY(e,n)?"<":"["}DY.peek=Mze;function DY(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(f+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,a(),i==="full"||!f||f!==d?c+=l.move(d+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Mze(){return"["}function ZN(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Dze(e){const t=ZN(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Rze(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function RY(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ize(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?Rze(n):ZN(n);const l=e.ordered?o==="."?")":".":Dze(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),RY(n)===o&&h){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const f=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),f}function Lze(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zze(e,t,n,r){const i=Lze(n);let a=n.bulletCurrent||ZN(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,l.current()),h);return c(),f;function h(d,p,v){return p?(v?"":" ".repeat(o))+d:(v?a:a+" ".repeat(o-a.length))+d}}function $ze(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const Bze=Db(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Fze(e,t,n,r){return(e.children.some(function(o){return Bze(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Uze(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IY.peek=Hze;function IY(e,t,n,r){const i=Uze(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const f=c.charCodeAt(0),h=Wx(r.before.charCodeAt(r.before.length-1),f,i);h.inside&&(c=ap(f)+c.slice(1));const d=c.charCodeAt(c.length-1),p=Wx(r.after.charCodeAt(0),d,i);p.inside&&(c=c.slice(0,-1)+ap(d));const v=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:p.outside,before:h.outside},l+c+v}function Hze(e,t,n){return n.options.strong||"*"}function qze(e,t,n,r){return n.safe(e.value,r)}function Vze(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Kze(e,t,n){const r=(RY(n)+(n.options.ruleSpaces?" ":"")).repeat(Vze(n));return n.options.ruleSpaces?r.slice(0,-1):r}const LY={blockquote:pze,break:$5,code:wze,definition:Eze,emphasis:AY,hardBreak:$5,heading:Aze,html:OY,image:kY,imageReference:NY,inlineCode:TY,link:MY,linkReference:DY,list:Ize,listItem:zze,paragraph:$ze,root:Fze,strong:IY,text:qze,thematicBreak:Kze};function Yze(){return{enter:{table:Xze,tableData:B5,tableHeader:B5,tableRow:Wze},exit:{codeText:Qze,table:Gze,tableData:S_,tableHeader:S_,tableRow:S_}}}function Xze(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Gze(e){this.exit(e),this.data.inTable=void 0}function Wze(e){this.enter({type:"tableRow",children:[]},e)}function S_(e){this.exit(e)}function B5(e){this.enter({type:"tableCell",children:[]},e)}function Qze(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Zze));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Zze(e,t){return t==="|"?t:e}function Jze(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:c,tableRow:l}};function o(v,b,w,S){return f(h(v,w,S),v.align)}function l(v,b,w,S){const E=d(v,w,S),j=f([E]);return j.slice(0,j.indexOf(`
`))}function c(v,b,w,S){const E=w.enter("tableCell"),j=w.enter("phrasing"),C=w.containerPhrasing(v,{...S,before:a,after:a});return j(),E(),C}function f(v,b){return hze(v,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function h(v,b,w){const S=v.children;let E=-1;const j=[],C=b.enter("table");for(;++E<S.length;)j[E]=d(S[E],b,w);return C(),j}function d(v,b,w){const S=v.children;let E=-1;const j=[],C=b.enter("tableRow");for(;++E<S.length;)j[E]=c(S[E],v,b,w);return C(),j}function p(v,b,w){let S=LY.inlineCode(v,b,w);return w.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function e3e(){return{exit:{taskListCheckValueChecked:F5,taskListCheckValueUnchecked:F5,paragraph:n3e}}}function t3e(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r3e}}}function F5(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function n3e(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const l=i[a];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function r3e(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(o);let c=LY.listItem(e,t,n,{...r,...l.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),c;function f(h){return h+o}}function i3e(){return[ILe(),rze(),sze(),Yze(),e3e()]}function a3e(e){return{extensions:[LLe(),ize(e),lze(),Jze(e),t3e()]}}const o3e={tokenize:d3e,partial:!0},zY={tokenize:h3e,partial:!0},$Y={tokenize:m3e,partial:!0},BY={tokenize:p3e,partial:!0},s3e={tokenize:g3e,partial:!0},FY={name:"wwwAutolink",tokenize:c3e,previous:HY},UY={name:"protocolAutolink",tokenize:f3e,previous:qY},As={name:"emailAutolink",tokenize:u3e,previous:VY},bo={};function l3e(){return{text:bo}}let Ou=48;for(;Ou<123;)bo[Ou]=As,Ou++,Ou===58?Ou=65:Ou===91&&(Ou=97);bo[43]=As;bo[45]=As;bo[46]=As;bo[95]=As;bo[72]=[As,UY];bo[104]=[As,UY];bo[87]=[As,FY];bo[119]=[As,FY];function u3e(e,t,n){const r=this;let i,a;return o;function o(d){return!Fj(d)||!VY.call(r,r.previous)||JN(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return Fj(d)?(e.consume(d),l):d===64?(e.consume(d),c):n(d)}function c(d){return d===46?e.check(s3e,h,f)(d):d===45||d===95||Ir(d)?(a=!0,e.consume(d),c):h(d)}function f(d){return e.consume(d),i=!0,c}function h(d){return a&&i&&Kr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function c3e(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!HY.call(r,r.previous)||JN(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(o3e,e.attempt(zY,e.attempt($Y,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function f3e(e,t,n){const r=this;let i="",a=!1;return o;function o(d){return(d===72||d===104)&&qY.call(r,r.previous)&&!JN(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(Kr(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),c}return n(d)}function c(d){return d===47?(e.consume(d),a?f:(a=!0,c)):n(d)}function f(d){return d===null||Yx(d)||Wt(d)||xc(d)||Tb(d)?n(d):e.attempt(zY,e.attempt($Y,h),n)(d)}function h(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function d3e(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function h3e(e,t,n){let r,i,a;return o;function o(f){return f===46||f===95?e.check(BY,c,l)(f):f===null||Wt(f)||xc(f)||f!==45&&Tb(f)?c(f):(a=!0,e.consume(f),o)}function l(f){return f===95?r=!0:(i=r,r=void 0),e.consume(f),o}function c(f){return i||r||!a?n(f):t(f)}}function m3e(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(BY,t,a)(o):o===null||Wt(o)||xc(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function p3e(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),a):l===93?(e.consume(l),i):l===60||l===null||Wt(l)||xc(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||Wt(l)||xc(l)?t(l):r(l)}function a(l){return Kr(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):Kr(l)?(e.consume(l),o):n(l)}}function g3e(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return Ir(a)?n(a):t(a)}}function HY(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Wt(e)}function qY(e){return!Kr(e)}function VY(e){return!(e===47||Fj(e))}function Fj(e){return e===43||e===45||e===46||e===95||Ir(e)}function JN(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const v3e={tokenize:C3e,partial:!0};function y3e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:S3e,continuation:{tokenize:E3e},exit:_3e}},text:{91:{name:"gfmFootnoteCall",tokenize:w3e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:x3e,resolveTo:b3e}}}}function x3e(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const f=Oa(r.sliceSerialize({start:o.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function b3e(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function w3e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(a>999||d===93&&!o||d===null||d===91||Wt(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Oa(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Wt(d)||(o=!0),a++,e.consume(d),d===92?h:f}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,f):f(d)}}function S3e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(o>999||b===93&&!l||b===null||b===91||Wt(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return a=Oa(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Wt(b)||(l=!0),o++,e.consume(b),b===92?d:h}function d(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),wt(e,v,"gfmFootnoteDefinitionWhitespace")):n(b)}function v(b){return t(b)}}function E3e(e,t,n){return e.check(rg,t,e.attempt(v3e,t,n))}function _3e(e){e.exit("gfmFootnoteDefinition")}function C3e(e,t,n){const r=this;return wt(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function j3e(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let f=c;for(;f--;)if(o[f][0]==="exit"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[f][1].end.offset-o[f][1].start.offset){o[c][1].type="strikethroughSequence",o[f][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[f][1].start),end:Object.assign({},o[c][1].end)},d={type:"strikethroughText",start:Object.assign({},o[f][1].end),end:Object.assign({},o[c][1].start)},p=[["enter",h,l],["enter",o[f][1],l],["exit",o[f][1],l],["enter",d,l]],v=l.parser.constructs.insideSpan.null;v&&Mi(p,p.length,0,Pb(v,o.slice(f+1,c),l)),Mi(p,p.length,0,[["exit",d,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",h,l]]),Mi(o,f-1,c-f+3,p),c=f+p.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function a(o,l,c){const f=this.previous,h=this.events;let d=0;return p;function p(b){return f===126&&h[h.length-1][1].type!=="characterEscape"?c(b):(o.enter("strikethroughSequenceTemporary"),v(b))}function v(b){const w=Cd(f);if(b===126)return d>1?c(b):(o.consume(b),d++,v);if(d<2&&!n)return c(b);const S=o.exit("strikethroughSequenceTemporary"),E=Cd(b);return S._open=!E||E===2&&!!w,S._close=!w||w===2&&!!E,l(b)}}}class A3e{constructor(){this.map=[]}add(t,n,r){O3e(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function O3e(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function k3e(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function N3e(){return{flow:{null:{name:"table",tokenize:T3e,resolveAll:P3e}}}}function T3e(e,t,n){const r=this;let i=0,a=0,o;return l;function l(L){let B=r.events.length-1;for(;B>-1;){const F=r.events[B][1].type;if(F==="lineEnding"||F==="linePrefix")B--;else break}const z=B>-1?r.events[B][1].type:null,G=z==="tableHead"||z==="tableRow"?k:c;return G===k&&r.parser.lazy[r.now().line]?n(L):G(L)}function c(L){return e.enter("tableHead"),e.enter("tableRow"),f(L)}function f(L){return L===124||(o=!0,a+=1),h(L)}function h(L){return L===null?n(L):Ve(L)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),v):n(L):ht(L)?wt(e,h,"whitespace")(L):(a+=1,o&&(o=!1,i+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),d(L)))}function d(L){return L===null||L===124||Wt(L)?(e.exit("data"),h(L)):(e.consume(L),L===92?p:d)}function p(L){return L===92||L===124?(e.consume(L),d):d(L)}function v(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,ht(L)?wt(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):b(L))}function b(L){return L===45||L===58?S(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),w):N(L)}function w(L){return ht(L)?wt(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),E):L===45?(a+=1,E(L)):L===null||Ve(L)?O(L):N(L)}function E(L){return L===45?(e.enter("tableDelimiterFiller"),j(L)):N(L)}function j(L){return L===45?(e.consume(L),j):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(L))}function C(L){return ht(L)?wt(e,O,"whitespace")(L):O(L)}function O(L){return L===124?b(L):L===null||Ve(L)?!o||i!==a?N(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):N(L)}function N(L){return n(L)}function k(L){return e.enter("tableRow"),T(L)}function T(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),T):L===null||Ve(L)?(e.exit("tableRow"),t(L)):ht(L)?wt(e,T,"whitespace")(L):(e.enter("data"),M(L))}function M(L){return L===null||L===124||Wt(L)?(e.exit("data"),T(L)):(e.consume(L),L===92?I:M)}function I(L){return L===92||L===124?(e.consume(L),M):M(L)}}function P3e(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,f,h,d;const p=new A3e;for(;++n<e.length;){const v=e[n],b=v[1];v[0]==="enter"?b.type==="tableHead"?(l=!1,c!==0&&(U5(p,t,c,f,h),h=void 0,c=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",h,t]])),i=b.type==="tableDelimiterRow"?2:h?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=sy(p,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=sy(p,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):b.type==="tableHead"?(l=!0,c=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(c=n,a[1]!==0?(o[0]=o[1],d=sy(p,t,a,i,n,d)):o[1]!==0&&(d=sy(p,t,o,i,n,d)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&U5(p,t,c,f,h),p.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=k3e(t.events,n))}return e}function sy(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},kf(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const c=kf(t.events,n[1]);if(a={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const f=kf(t.events,n[2]),h=kf(t.events,n[3]),d={type:l,start:Object.assign({},f),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],v=t.events[n[3]];if(p[1].end=Object.assign({},v[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,w=n[3]-n[2]-1;e.add(b,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(a.end=Object.assign({},kf(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function U5(e,t,n,r,i){const a=[],o=kf(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function kf(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const M3e={name:"tasklistCheck",tokenize:R3e};function D3e(){return{text:{91:M3e}}}function R3e(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Wt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return Ve(c)?t(c):ht(c)?e.check({tokenize:I3e},t,n)(c):n(c)}}function I3e(e,t,n){return wt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function L3e(e){return nY([l3e(),y3e(),j3e(e),N3e(),D3e()])}const z3e={};function $3e(e){const t=this,n=e||z3e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(L3e(n)),a.push(i3e()),o.push(a3e(n))}function Qx({content:e,className:t}){return g.jsx("div",{className:t,children:g.jsx(jLe,{remarkPlugins:[$3e],components:{h1:({children:n})=>g.jsx("h1",{className:"mb-2 mt-4 text-base font-bold first:mt-0",children:n}),h2:({children:n})=>g.jsx("h2",{className:"mb-2 mt-3 text-sm font-bold first:mt-0",children:n}),h3:({children:n})=>g.jsx("h3",{className:"mb-1 mt-3 text-sm font-semibold first:mt-0",children:n}),p:({children:n})=>g.jsx("p",{className:"mb-2 last:mb-0 leading-relaxed",children:n}),ul:({children:n})=>g.jsx("ul",{className:"mb-2 ml-4 list-disc space-y-0.5",children:n}),ol:({children:n})=>g.jsx("ol",{className:"mb-2 ml-4 list-decimal space-y-0.5",children:n}),li:({children:n})=>g.jsx("li",{className:"leading-relaxed",children:n}),code:({children:n,className:r})=>(r==null?void 0:r.startsWith("language-"))?g.jsx("code",{className:"block whitespace-pre-wrap break-words rounded bg-muted/60 px-2 py-1.5 font-mono text-xs leading-relaxed",children:n}):g.jsx("code",{className:"rounded bg-muted/60 px-1 py-0.5 font-mono text-xs",children:n}),pre:({children:n})=>g.jsx("pre",{className:"mb-2 overflow-x-auto rounded-md bg-muted/60 p-0",children:n}),blockquote:({children:n})=>g.jsx("blockquote",{className:"mb-2 border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground",children:n}),a:({href:n,children:r})=>g.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:no-underline",children:r}),table:({children:n})=>g.jsx("div",{className:"mb-2 overflow-x-auto",children:g.jsx("table",{className:"w-full border-collapse text-xs",children:n})}),th:({children:n})=>g.jsx("th",{className:"border border-border bg-muted/50 px-2 py-1 text-left font-medium",children:n}),td:({children:n})=>g.jsx("td",{className:"border border-border px-2 py-1",children:n}),hr:()=>g.jsx("hr",{className:"my-3 border-border"}),strong:({children:n})=>g.jsx("strong",{className:"font-semibold",children:n}),em:({children:n})=>g.jsx("em",{className:"italic",children:n})},children:e})})}function B3e(){const{projectId:e,runId:t}=Jx(),[n]=LQ(),r=Number(e),i=T=>T==="starting"||T==="running",a=Sse(r,t??"",{refetchInterval:void 0}),o=a.data,l=i(o==null?void 0:o.status);x.useEffect(()=>{if(!l)return;const T=setInterval(()=>a.refetch(),2e3);return()=>clearInterval(T)},[l,a]);const c=!!(o!=null&&o.interactive),{pendingAskUsers:f,chatMessages:h,traceEvents:d,treeData:p,connected:v,respond:b}=FK(t??"",l||c),w=p??(o==null?void 0:o.tree)??null,S=(o==null?void 0:o.events)??[],E=d.length>0?d:S,[j,C]=x.useState(void 0);if(x.useEffect(()=>{f.length>0&&C("chat")},[f]),a.isLoading)return g.jsx(pMe,{});if(a.error)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",a.error.message]})]});if(!o)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsx("span",{children:"Session not found"})]});const O=Y3e(E),N=K3e(E),k=n.get("tab")??(l?"agent-tree":"overview");return g.jsxs("div",{className:"space-y-6",children:[g.jsx(F3e,{session:o,projectId:r,runId:t??"",onStopped:()=>a.refetch()}),g.jsx(q3e,{session:o}),g.jsxs(xN,{value:j??k,onValueChange:C,children:[g.jsxs(bN,{children:[g.jsx(ji,{value:"overview",children:"Overview"}),c&&g.jsxs(ji,{value:"chat",className:"relative",children:["Chat",f.length>0&&g.jsx("span",{className:"ml-1.5 inline-block h-2 w-2 animate-pulse rounded-full bg-amber-500"})]}),g.jsx(ji,{value:"agent-tree",children:"Agent Tree"}),g.jsx(ji,{value:"logs",children:"Logs"}),g.jsxs(ji,{value:"trace",children:["Trace",E.length>0&&` (${E.length})`]}),g.jsxs(ji,{value:"artifacts",children:["Artifacts",O.length>0&&` (${O.length})`]})]}),g.jsxs(Ai,{value:"overview",className:"space-y-4",children:[o.user_task&&g.jsx(If,{defaultOpen:!0,children:g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Lf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[g.jsx(Yu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"User Task"]}),g.jsx(zf,{children:g.jsx(yn,{children:g.jsx(xn,{className:"pt-4",children:g.jsx(Qx,{content:o.user_task,className:"text-sm"})})})})]})}),o.task&&g.jsx(If,{defaultOpen:!o.user_task,children:g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Lf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[g.jsx(Yu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"Task"]}),g.jsx(zf,{children:g.jsx(yn,{children:g.jsx(xn,{className:"pt-4",children:g.jsx(Qx,{content:o.task,className:"text-sm"})})})})]})}),N&&g.jsx(If,{defaultOpen:!0,children:g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Lf,{className:"flex items-center gap-1 text-sm font-medium text-muted-foreground hover:text-foreground",children:[g.jsx(Yu,{className:"h-3.5 w-3.5 transition-transform [[data-state=open]>&]:rotate-90"}),"Output"]}),g.jsx(zf,{children:g.jsx(yn,{children:g.jsx(xn,{className:"pt-4",children:g.jsx(V3e,{runId:o.run_id,hash:N})})})})]})}),!o.user_task&&!o.task&&!N&&g.jsx("p",{className:"text-sm text-muted-foreground",children:"No overview information available yet."})]}),c&&g.jsx(Ai,{value:"chat",children:g.jsx(mMe,{pendingAskUsers:f,initialMessages:h,respond:b})}),g.jsx(Ai,{value:"agent-tree",children:g.jsx(uMe,{treeData:w,connected:v})}),g.jsx(Ai,{value:"logs",children:Object.keys(o.agents).length>0?g.jsx(fMe,{runId:o.run_id,agents:o.agents,active:l}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents registered yet."})}),g.jsx(Ai,{value:"trace",children:E.length>0?g.jsx(Z3e,{events:E,runId:o.run_id}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No trace events recorded yet."})}),g.jsx(Ai,{value:"artifacts",children:O.length>0?g.jsx(X3e,{artifacts:O,runId:o.run_id}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No artifacts recorded yet."})})]})]})}function F3e({session:e,projectId:t,runId:n,onStopped:r}){const[i,a]=x.useState(!1),o=PF(),l=e.status==="starting"||e.status==="running";return g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(je,{variant:"outline",size:"sm",asChild:!0,children:g.jsxs(Yr,{to:`/projects/${t}`,children:[g.jsx(YA,{className:"mr-2 h-4 w-4"}),"Back"]})}),g.jsxs("h1",{className:"text-2xl font-bold tracking-tight",children:["Session ",e.run_id.slice(0,16)]})]}),g.jsx("div",{className:"flex gap-2",children:l&&(i?g.jsxs("div",{className:"flex gap-1",children:[g.jsx(je,{size:"sm",variant:"destructive",onClick:async()=>{await o.mutateAsync(n),a(!1),r()},disabled:o.isPending,children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:()=>a(!1),children:"Cancel"})]}):g.jsxs(je,{variant:"destructive",onClick:()=>a(!0),children:[g.jsx(lF,{className:"mr-2 h-4 w-4"}),"Stop Session"]}))})]})}function U3e({status:e}){const t=H3e(e);return g.jsxs(an,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="warning"&&"border-orange-200 bg-orange-50 text-orange-700 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:[e==="running"&&g.jsx("span",{className:"mr-1.5 inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),e]})}function H3e(e){switch(e){case"running":case"starting":return"running";case"completed":return"success";case"failed":return"error";case"stopped":return"warning";default:return"default"}}function q3e({session:e}){return g.jsx(yn,{children:g.jsx(xn,{className:"pt-6",children:g.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Status"}),g.jsx("dd",{children:g.jsx(U3e,{status:e.status})}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Role"}),g.jsx("dd",{children:e.role}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Runtime"}),g.jsx("dd",{children:e.runtime}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Isolation"}),g.jsx("dd",{children:e.isolation}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Started"}),g.jsx("dd",{children:Uy(e.started_at)}),e.ended_at&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Ended"}),g.jsx("dd",{children:Uy(e.ended_at)})]}),g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Duration"}),g.jsx("dd",{children:A0(e.duration_ms)}),e.exit_code!==null&&g.jsxs(g.Fragment,{children:[g.jsx("dt",{className:"font-medium text-muted-foreground",children:"Exit Code"}),g.jsx("dd",{children:e.exit_code})]})]})})})}function V3e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?g.jsxs("span",{className:"text-destructive",children:["Error: ",i]}):n===null?g.jsx("span",{className:"text-muted-foreground",children:"Loading..."}):g.jsx(Qx,{content:n,className:"text-sm"})}function K3e(e){for(const t of e)if(t.event==="session_end"&&t.data.output_ref)return String(t.data.output_ref);return null}function Y3e(e){const t=[];for(const n of e){const r=n.data;n.event==="agent_spawn"&&(r.context_ref&&t.push({label:`Agent Context (${r.role||"agent"})`,hash:String(r.context_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),r.task_ref&&t.push({label:`Agent Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0})),n.event==="session_end"&&r.output_ref&&t.push({label:"Session Output",hash:String(r.output_ref),event:n.event}),n.event==="agent_end"&&r.output_ref&&t.push({label:`Agent Output (${r.agent_id||"agent"})`,hash:String(r.output_ref),event:n.event,agentId:r.agent_id?String(r.agent_id):void 0}),n.event==="memory_get"&&(r.cards_ref&&t.push({label:`Memory Cards (${r.provider||"memory"})`,hash:String(r.cards_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Get Behavior (${r.role||"agent"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Get Task (${r.role||"agent"})`,hash:String(r.task_ref),event:n.event})),n.event==="memory_dump"&&(r.output_ref&&t.push({label:`Memory Dump Output (${r.provider||"memory"})`,hash:String(r.output_ref),event:n.event}),r.behavior_ref&&t.push({label:`Memory Dump Behavior (${r.provider||"memory"})`,hash:String(r.behavior_ref),event:n.event}),r.task_ref&&t.push({label:`Memory Dump Task (${r.provider||"memory"})`,hash:String(r.task_ref),event:n.event})),n.event==="delegate_start"&&r.context_ref&&t.push({label:`Delegation Context (${r.role||"delegate"})`,hash:String(r.context_ref),event:n.event}),n.event==="delegate_end"&&r.output_ref&&t.push({label:`Delegation Output (${r.role||"delegate"})`,hash:String(r.output_ref),event:n.event})}return t}function X3e({artifacts:e,runId:t}){return g.jsx("div",{className:"space-y-1",children:e.map(n=>g.jsxs(If,{children:[g.jsxs(Lf,{className:"flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-sm hover:bg-muted",children:[g.jsx(Yu,{className:"h-3 w-3 transition-transform [[data-state=open]>&]:rotate-90"}),g.jsx("span",{className:"font-medium text-primary",children:n.label})]}),g.jsx(zf,{children:g.jsx(G3e,{runId:t,hash:n.hash})})]},`${n.event}-${n.hash}`))})}function G3e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?g.jsxs("p",{className:"px-3 py-2 text-sm text-destructive",children:["Error: ",i]}):n===null?g.jsx("p",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading..."}):g.jsx(jp,{className:"max-h-[300px] overflow-hidden",children:g.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-b-md bg-muted/30 px-3 py-2 font-mono text-xs leading-relaxed",children:n})})}function W3e({event:e}){const t=Q3e(e);return g.jsx(an,{variant:"outline",className:ke("text-xs font-medium",t==="running"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="success"&&"border-green-200 bg-green-50 text-green-700 dark:border-green-800 dark:bg-green-950 dark:text-green-400",t==="error"&&"border-red-200 bg-red-50 text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-400",t==="default"&&"border-muted bg-muted text-muted-foreground"),children:e})}function Q3e(e){return e.endsWith("_start")||e==="agent_spawn"?"running":e.endsWith("_end")?"success":e.includes("denied")||e.includes("error")?"error":"default"}function Z3e({events:e,runId:t}){const[n,r]=x.useState(null);return g.jsxs(g.Fragment,{children:[g.jsx(yn,{children:g.jsx(xn,{className:"p-0",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Time"}),g.jsx(rt,{children:"Event"}),g.jsx(rt,{children:"Span"}),g.jsx(rt,{children:"Details"})]})}),g.jsx(cs,{children:e.map((i,a)=>g.jsxs(rr,{children:[g.jsx(tt,{className:"text-sm text-muted-foreground",children:Uy(i.ts)}),g.jsx(tt,{children:g.jsx(W3e,{event:i.event})}),g.jsx(tt,{className:"font-mono text-xs text-muted-foreground",children:i.span_id.slice(0,8)}),g.jsx(tt,{className:"max-w-[400px] text-sm",children:e4e(i,(o,l)=>r({hash:o,label:l}))})]},a))})]})})}),g.jsx(Yl,{open:!!n,onOpenChange:()=>r(null),children:g.jsxs(Xl,{className:"max-w-3xl overflow-hidden",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:n==null?void 0:n.label})}),n&&g.jsx(J3e,{runId:t,hash:n.hash})]})})]})}function J3e({runId:e,hash:t}){const[n,r]=x.useState(null),[i,a]=x.useState(null);return x.useEffect(()=>{fetch(`/api/sessions/${e}/artifacts/${t}`).then(o=>{if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);return o.text()}).then(r).catch(o=>a(o.message))},[e,t]),i?g.jsxs("p",{className:"text-sm text-destructive",children:["Error: ",i]}):n===null?g.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):g.jsx(jp,{className:"max-h-[60vh]",children:g.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted/30 p-4 font-mono text-xs leading-relaxed",children:n})})}function e4e(e,t){const n=e.data,r=[];for(const[a,o]of Object.entries(n))if(a.endsWith("_ref")&&o){const l=a.replace(/_ref$/,"");r.push(g.jsx("button",{className:"rounded border border-primary/30 bg-primary/5 px-1.5 py-0.5 font-mono text-xs text-primary hover:bg-primary/10",onClick:()=>t(String(o),l),children:l},a))}const i=[];for(const[a,o]of Object.entries(n)){if(a.endsWith("_ref")||o==null||o==="")continue;const l=a==="duration_ms"?A0(o):Array.isArray(o)?o.join(", "):String(o);i.push(g.jsxs("span",{children:[g.jsxs("span",{className:"text-muted-foreground",children:[a,"="]}),g.jsx("span",{children:l})]},a))}return g.jsxs(g.Fragment,{children:[r.length>0&&g.jsx("div",{className:"mb-1 flex flex-wrap gap-1",children:r}),i.length>0&&g.jsx("div",{className:"flex flex-wrap gap-x-2 gap-y-0.5 text-xs text-muted-foreground",children:i})]})}function t4e(e){if(e===null)return"";const t=Math.round(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}m ${r}s`:`${n}m`}function n4e({status:e}){return e==="running"||e==="starting"?g.jsxs(an,{variant:"outline",className:"gap-1 border-blue-200 text-blue-700 dark:border-blue-800 dark:text-blue-400",children:[g.jsx(jl,{className:"h-3 w-3 animate-spin"}),e==="starting"?"Starting":"Running"]}):e==="completed"?g.jsxs(an,{variant:"outline",className:"gap-1 border-green-200 text-green-700 dark:border-green-800 dark:text-green-400",children:[g.jsx(GA,{className:"h-3 w-3"}),"Completed"]}):e==="failed"?g.jsxs(an,{variant:"outline",className:"gap-1 border-red-200 text-red-700 dark:border-red-800 dark:text-red-400",children:[g.jsx(aF,{className:"h-3 w-3"}),"Failed"]}):g.jsx(an,{variant:"outline",children:e})}function r4e({session:e,projectId:t}){const n=e.status==="running"||e.status==="starting";return g.jsxs("div",{className:"flex flex-col gap-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"StrawPot"}),g.jsx(n4e,{status:e.status}),e.duration_ms!==null&&g.jsx("span",{className:"text-xs text-muted-foreground",children:t4e(e.duration_ms)}),g.jsx("span",{className:"text-xs text-muted-foreground",children:e.role})]}),g.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-3 text-sm",children:n?g.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[g.jsx(jl,{className:"h-3.5 w-3.5 animate-spin"}),"Working…"]}):e.summary?g.jsx(Qx,{content:e.summary,className:"text-sm text-foreground"}):g.jsx("span",{className:"text-muted-foreground italic",children:e.status==="failed"?"Session failed without output.":e.status==="stopped"?"Interrupted.":"No summary available."})}),g.jsxs("a",{href:`/projects/${t}/sessions/${e.run_id}`,target:"_blank",rel:"noopener noreferrer",className:"flex w-fit items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[g.jsx(Xae,{className:"h-3 w-3"}),"View session"]})]})}function i4e({task:e}){return g.jsxs("div",{className:"flex flex-col gap-1.5 items-end",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"You"}),g.jsx("div",{className:"max-w-[80%] rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:g.jsx("p",{className:"whitespace-pre-wrap",children:e})})]})}function a4e(){var Or;const{projectId:e,conversationId:t}=Jx(),n=Number(e),r=Number(t),[i,a]=x.useState(""),[o,l]=x.useState(""),[c,f]=x.useState([]),[h,d]=x.useState(!1),[p,v]=x.useState(!1),[b,w]=x.useState(!1),[S,E]=x.useState(""),[j,C]=x.useState(!1),[O,N]=x.useState(""),[k,T]=x.useState(!1),[M,I]=x.useState(""),[L,B]=x.useState(""),[z,G]=x.useState(""),[F,V]=x.useState(""),[D,q]=x.useState(""),[X,Y]=x.useState(""),[R,H]=x.useState(""),[U,$]=x.useState(!0),[Q,J]=x.useState(""),ne=x.useRef(null),ae=x.useRef(null),re=x.useRef(0),ee=x.useRef(void 0),se=x.useRef(0),me=x.useRef(null),ie=_t(),we=sO(),{data:be}=Zo("agents"),{data:$e}=Zo("memories"),Ne=nO(n),Je=tO(n),Qe=(Or=Ne.data)==null?void 0:Or.merged,{data:nt,isLoading:Nn,error:Wn,fetchPreviousPage:Mt,hasPreviousPage:Tn,isFetchingPreviousPage:Rt}=GD(r),pn=(nt==null?void 0:nt.pages.flatMap(ve=>ve.sessions))??[],de=nt==null?void 0:nt.pages[nt.pages.length-1],xe=pn[pn.length-1],ze=(xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="starting";GD(r,{refetchInterval:ze?2e3:!1});const Ke=vse(r),et=PF(),gn=iO(n),{pendingAskUsers:on,chatMessages:Kt,respond:Se}=FK((xe==null?void 0:xe.run_id)??"",!!xe&&U),lt=o.trim()&&!(we.data??[]).includes(o.trim())?"Role not found in installed roles":"",Xe=ze;x.useEffect(()=>{if(!ne.current)return;const ve=ne.current.scrollHeight-re.current;ve>0&&(ne.current.scrollTop+=ve,re.current=0)},[nt==null?void 0:nt.pages.length]),x.useEffect(()=>{ne.current&&((xe==null?void 0:xe.run_id)!==ee.current&&(ne.current.scrollTop=ne.current.scrollHeight),ee.current=xe==null?void 0:xe.run_id)},[xe==null?void 0:xe.run_id]),x.useEffect(()=>{ne.current&&(Kt.length>se.current&&(ne.current.scrollTop=ne.current.scrollHeight),se.current=Kt.length)},[Kt.length]),x.useEffect(()=>{if(!ae.current||!ne.current)return;const ve=new IntersectionObserver(([Ct])=>{var Mn;Ct.isIntersecting&&Tn&&!Rt&&(re.current=((Mn=ne.current)==null?void 0:Mn.scrollHeight)??0,Mt())},{root:ne.current,threshold:.1});return ve.observe(ae.current),()=>ve.disconnect()},[Tn,Rt,Mt]);const Pn=(be??[]).map(ve=>ve.name),vn=[...new Set(($e??[]).map(ve=>ve.name)),"none"].sort(),In=M.trim()&&Pn.length>0&&!Pn.includes(M.trim())?"Runtime not found in installed agents":"",$i=L.trim()&&vn.length>0&&!vn.includes(L.trim())?"Memory not found in installed providers":"",ca=!!In||!!$i,Bi=[M,L,z,F,D,X,R].filter(ve=>ve.trim()).length,Ur=ve=>f(Ct=>Ct.includes(ve)?Ct.filter(Mn=>Mn!==ve):[...Ct,ve]),Ge=ve=>{ve.preventDefault(),v(!0)},$t=ve=>{ve.preventDefault(),v(!0)},wn=ve=>{ve.preventDefault(),v(!1)},Ln=async ve=>{ve.preventDefault(),v(!1);const Ct=Array.from(ve.dataTransfer.files);if(Ct.length){w(!0);try{const Mn=await He.upload(`/projects/${n}/files`,Ct);ie.invalidateQueries({queryKey:qe.projects.files(n)}),f(Yt=>{const fr=Mn.map(pi=>pi.path).filter(pi=>!Yt.includes(pi));return[...Yt,...fr]})}catch{}finally{w(!1)}}};function mi(ve){ve.preventDefault();const Ct=i.trim();if(!Ct||Xe||lt||ca)return;const Mn={task:Ct,role:o.trim()||void 0,context_files:c.length>0?c:void 0,interactive:U,system_prompt:z.trim()||void 0,runtime:M.trim()||void 0,memory:L.trim()||void 0,max_num_delegations:F.trim()?Number(F):void 0,cache_delegations:D?D==="true":void 0,cache_max_entries:X.trim()?Number(X):void 0,cache_ttl_seconds:R.trim()?Number(R):void 0};Ke.mutate(Mn,{onSuccess:()=>{a(""),f([]),d(!1)}})}function It(ve,Ct){Ct.trim()&&(Se(ve.request_id,Ct.trim()),J(""))}function ur(ve){ve.key==="Enter"&&!ve.shiftKey&&(ve.preventDefault(),mi(ve))}function fa(){N((de==null?void 0:de.title)??""),C(!0),setTimeout(()=>{var ve;return(ve=me.current)==null?void 0:ve.select()},0)}function Qn(){const ve=O.trim();gn.mutate({conversationId:r,title:ve||null}),C(!1)}function cr(ve){ve.key==="Enter"&&(ve.preventDefault(),Qn()),ve.key==="Escape"&&C(!1)}if(Wn)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",Wn.message]})]});const $a=(de==null?void 0:de.title)??`Conversation #${r}`;return g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border pb-3 mb-4",children:[g.jsx("div",{className:"flex items-center gap-3",children:j?g.jsx(ct,{ref:me,value:O,onChange:ve=>N(ve.target.value),onBlur:Qn,onKeyDown:cr,className:"h-7 text-sm font-semibold w-64",placeholder:`Conversation #${r}`}):g.jsx("h1",{className:"text-sm font-semibold cursor-pointer hover:text-muted-foreground",onClick:fa,title:"Click to rename",children:$a})}),pn.length>0&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:[pn.length," session",pn.length!==1?"s":""]})]}),g.jsx("div",{ref:ne,className:"min-h-0 flex-1 overflow-y-auto",children:g.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-6 py-4",children:[g.jsx("div",{ref:ae,className:"h-1"}),Rt&&g.jsx("div",{className:"flex justify-center py-2",children:g.jsx(jl,{className:"h-4 w-4 animate-spin text-muted-foreground"})}),!Nn&&pn.length===0&&g.jsx("p",{className:"text-center text-sm text-muted-foreground py-12",children:"Start the conversation by submitting a task below."}),pn.map((ve,Ct)=>{const Mn=Ct===pn.length-1;return g.jsxs("div",{className:"space-y-4",children:[(ve.user_task??ve.task)&&g.jsx(i4e,{task:ve.user_task??ve.task}),Mn&&Kt.map(Yt=>g.jsx("div",{className:`flex ${Yt.role==="user"?"justify-end":"justify-start"}`,children:g.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${Yt.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:g.jsx("p",{className:"whitespace-pre-wrap",children:Yt.text})})},Yt.id)),g.jsx(r4e,{session:ve,projectId:n})]},ve.run_id)})]})}),on.length>0&&g.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 pt-3 pb-1",children:g.jsx("div",{className:"mx-auto max-w-2xl space-y-2",children:on.map(ve=>g.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2",children:[g.jsx("p",{className:"text-sm font-medium",children:ve.question}),ve.why&&g.jsx("p",{className:"text-xs text-muted-foreground",children:ve.why}),ve.choices?g.jsx("div",{className:"flex flex-wrap gap-1.5",children:ve.choices.map(Ct=>g.jsx(je,{type:"button",size:"sm",variant:"outline",onClick:()=>It(ve,Ct),children:Ct},Ct))}):g.jsxs("div",{className:"flex gap-2",children:[g.jsx(ct,{value:Q,onChange:Ct=>J(Ct.target.value),onKeyDown:Ct=>{Ct.key==="Enter"&&!Ct.shiftKey&&(Ct.preventDefault(),It(ve,Q))},placeholder:"Your answer…",autoFocus:!0,className:"text-sm"}),g.jsx(je,{type:"button",size:"icon",disabled:!Q.trim(),onClick:()=>It(ve,Q),children:g.jsx(KD,{className:"h-4 w-4"})})]})]},ve.request_id))})}),g.jsx("div",{className:"flex-shrink-0 border-t border-border bg-background pt-4",children:g.jsxs("form",{onSubmit:mi,className:"mx-auto max-w-2xl space-y-2",children:[g.jsxs("div",{className:"relative",onDragOver:Ge,onDragEnter:$t,onDragLeave:wn,onDrop:Ln,children:[g.jsx(ld,{value:i,onChange:ve=>a(ve.target.value),onKeyDown:ur,placeholder:Xe?"Agent is working…":"Describe the next task… (Enter to submit, Shift+Enter for new line, drag & drop files to attach)",disabled:Xe||Ke.isPending,className:"h-[80px] resize-none overflow-y-auto",autoFocus:!0}),(p||b)&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-md border-2 border-dashed border-primary bg-background/80 pointer-events-none",children:b?g.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[g.jsx(jl,{className:"h-4 w-4 animate-spin"})," Uploading…"]}):g.jsxs("span",{className:"flex items-center gap-2 text-sm text-primary",children:[g.jsx(JA,{className:"h-4 w-4"})," Drop to upload & attach"]})})]}),(Je.data??[]).length>0&&g.jsxs("div",{className:"space-y-1.5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Mm,{children:[g.jsx(Dm,{asChild:!0,children:g.jsxs(je,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",children:[g.jsx(uF,{className:"mr-1 h-3 w-3"}),"Annotate files"]})}),g.jsxs(Rm,{align:"start",className:"w-64",onCloseAutoFocus:ve=>ve.preventDefault(),children:[g.jsx("div",{className:"px-2 py-1.5",children:g.jsx(ct,{placeholder:"Filter files…",value:S,onChange:ve=>E(ve.target.value),className:"h-7 text-xs",onKeyDown:ve=>ve.stopPropagation()})}),g.jsx("div",{className:"max-h-48 overflow-y-auto",children:(Je.data??[]).filter(ve=>ve.path.toLowerCase().includes(S.toLowerCase())).map(ve=>g.jsx(TF,{checked:c.includes(ve.path),onCheckedChange:()=>Ur(ve.path),onSelect:Ct=>Ct.preventDefault(),children:g.jsx("span",{className:"font-mono text-xs",children:ve.path})},ve.path))})]})]}),c.length>0&&g.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length," attached"]})]}),c.length>0&&g.jsxs("div",{className:"flex flex-wrap gap-1",children:[(h?c:c.slice(0,3)).map(ve=>g.jsxs(an,{variant:"secondary",className:"gap-1 font-mono text-xs",children:[g.jsx("button",{type:"button",onClick:()=>Ur(ve),className:"mr-0.5 rounded-sm hover:bg-muted",children:g.jsx(_0,{className:"h-3 w-3"})}),"@",ve]},ve)),!h&&c.length>3&&g.jsxs("button",{type:"button",onClick:()=>d(!0),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:["+",c.length-3," more"]}),h&&c.length>3&&g.jsx("button",{type:"button",onClick:()=>d(!1),className:"basis-full text-left text-xs text-muted-foreground hover:text-foreground",children:"Show less"})]})]}),g.jsx("div",{className:"flex flex-col gap-1.5",children:g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx(ct,{list:"datalist-role",value:o,onChange:ve=>l(ve.target.value),placeholder:"Default role",className:"w-48 text-sm"}),lt&&g.jsx("p",{className:"text-xs text-destructive",children:lt})]}),g.jsx("datalist",{id:"datalist-role",children:(we.data??[]).map(ve=>g.jsx("option",{value:ve},ve))}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsxs(je,{type:"button",variant:U?"secondary":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>$(ve=>!ve),title:U?"Interactive: agent can ask questions":"Auto: agent cannot ask questions",children:[g.jsx(WA,{className:"h-3.5 w-3.5"}),U?"Interactive":"Auto"]}),g.jsxs(je,{type:"button",variant:"ghost",size:"icon",className:"relative h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>T(!0),title:"Advanced options",children:[g.jsx(dF,{className:"h-4 w-4"}),Bi>0&&g.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-primary text-[9px] text-primary-foreground",children:Bi})]}),Xe?g.jsxs(je,{type:"button",variant:"destructive",onClick:()=>xe&&et.mutate(xe.run_id),disabled:et.isPending,children:[et.isPending?g.jsx(jl,{className:"mr-2 h-4 w-4 animate-spin"}):g.jsx(koe,{className:"mr-2 h-4 w-4 fill-current"}),"Stop"]}):g.jsx(je,{type:"submit",disabled:!i.trim()||Ke.isPending||!!lt||ca,children:Ke.isPending?g.jsx(jl,{className:"h-4 w-4 animate-spin"}):g.jsx(KD,{className:"h-4 w-4"})})]})]})})]})}),g.jsx(Yl,{open:k,onOpenChange:T,children:g.jsxs(Xl,{className:"max-w-lg",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:"Advanced Options"})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Runtime"}),g.jsx(ct,{list:"adv-datalist-runtime",value:M,onChange:ve=>I(ve.target.value),placeholder:(Qe==null?void 0:Qe.runtime)??"default",className:"text-sm"}),g.jsx("datalist",{id:"adv-datalist-runtime",children:Pn.map(ve=>g.jsx("option",{value:ve},ve))}),In&&g.jsx("p",{className:"text-xs text-destructive",children:In})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Memory"}),g.jsx(ct,{list:"adv-datalist-memory",value:L,onChange:ve=>B(ve.target.value),placeholder:(Qe==null?void 0:Qe.memory)??"dial",className:"text-sm"}),g.jsx("datalist",{id:"adv-datalist-memory",children:vn.map(ve=>g.jsx("option",{value:ve},ve))}),$i&&g.jsx("p",{className:"text-xs text-destructive",children:$i})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"System Prompt"}),g.jsx(ld,{value:z,onChange:ve=>G(ve.target.value),placeholder:"Additional instructions appended to conversation context…",rows:3,className:"text-sm"})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Max Delegations"}),g.jsx(ct,{type:"number",min:"0",value:F,onChange:ve=>V(ve.target.value),placeholder:Qe!=null&&Qe.max_num_delegations?String(Qe.max_num_delegations):"0 (unlimited)",className:"h-8 text-xs"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache Delegations"}),g.jsxs(so,{value:D||"__empty__",onValueChange:ve=>q(ve==="__empty__"?"":ve),children:[g.jsx(uo,{className:"h-8 text-xs",children:g.jsx(lo,{placeholder:`Default (${(Qe==null?void 0:Qe.cache_delegations)!==!1?"true":"false"})`})}),g.jsxs(co,{children:[g.jsxs(ir,{value:"__empty__",className:"text-muted-foreground",children:["Default (",(Qe==null?void 0:Qe.cache_delegations)!==!1?"true":"false",")"]}),g.jsx(ir,{value:"true",children:"true"}),g.jsx(ir,{value:"false",children:"false"})]})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache Max Entries"}),g.jsx(ct,{type:"number",min:"0",value:X,onChange:ve=>Y(ve.target.value),placeholder:Qe!=null&&Qe.cache_max_entries?String(Qe.cache_max_entries):"0 (unlimited)",className:"h-8 text-xs"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{children:"Cache TTL (seconds)"}),g.jsx(ct,{type:"number",min:"0",value:R,onChange:ve=>H(ve.target.value),placeholder:Qe!=null&&Qe.cache_ttl_seconds?String(Qe.cache_ttl_seconds):"0 (unlimited)",className:"h-8 text-xs"})]})]})]}),g.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[g.jsx(je,{variant:"ghost",size:"sm",onClick:()=>{I(""),B(""),G(""),V(""),q(""),Y(""),H("")},children:"Reset"}),g.jsx(je,{size:"sm",onClick:()=>T(!1),children:"Done"})]})]})})]})}const o4e={skills:["denden"],roles:["ai-ceo","ai-employee"],agents:["strawpot-claude-code"],memories:["dial"]},s4e={roles:"Roles",skills:"Skills",agents:"Agents",memories:"Memory Providers"};function l4e(){const{resourceType:e="roles"}=Jx(),{data:t,isLoading:n}=Zo(e),[r,i]=x.useState(null),[a,o]=x.useState(!1),[l,c]=x.useState(!1),{data:f}=qle(e,r??"",{enabled:a&&!!r}),h=s4e[e]??e;return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:h}),g.jsxs("p",{className:"text-sm text-muted-foreground",children:["Installed ",h.toLowerCase()," from StrawHub"]})]}),g.jsxs(je,{onClick:()=>c(!0),size:"sm",children:[g.jsx(E0,{className:"mr-2 h-4 w-4"}),"Install"]})]}),n?g.jsx("div",{className:"space-y-2",children:Array.from({length:3}).map((d,p)=>g.jsx(On,{className:"h-12 w-full"},p))}):!t||t.length===0?g.jsxs("div",{className:"rounded-lg border border-dashed border-border p-8 text-center text-muted-foreground",children:["No ",h.toLowerCase()," installed yet."]}):g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{children:"Version"}),g.jsx(rt,{children:"Description"}),g.jsx(rt,{children:"Source"}),g.jsx(rt,{className:"w-24"})]})}),g.jsx(cs,{children:t.map(d=>{var p;return g.jsxs(rr,{className:"cursor-pointer",onClick:()=>{i(d.name),o(!0)},children:[g.jsx(tt,{className:"font-medium",children:d.name}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:d.version??"—"}),g.jsx(tt,{className:"max-w-[300px] truncate text-sm",children:d.description||"—"}),g.jsx(tt,{children:g.jsx(an,{variant:"outline",className:"text-xs",children:d.source})}),g.jsx(tt,{children:!((p=o4e[e])!=null&&p.includes(d.name))&&g.jsx(u4e,{resourceType:e,name:d.name})})]},d.name)})})]}),g.jsx(FF,{resource:f??null,resourceType:e,open:a,onOpenChange:o}),g.jsx(lO,{open:l,onOpenChange:c,defaultType:e})]})}function u4e({resourceType:e,name:t}){const[n,r]=x.useState(!1),i=$F(),a=o=>{o.stopPropagation(),i.mutate({type:e,name:t},{onSuccess:l=>{l.exit_code===0?Pt.success(`Uninstalled ${t}`):Pt.error(`Uninstall failed: ${l.stderr||l.stdout}`),r(!1)},onError:()=>{Pt.error("Uninstall request failed"),r(!1)}})};return n?g.jsxs("div",{className:"flex gap-1",children:[g.jsx(je,{size:"sm",variant:"destructive",onClick:a,disabled:i.isPending,children:"Confirm"}),g.jsx(je,{size:"sm",variant:"outline",onClick:o=>{o.stopPropagation(),r(!1)},children:"No"})]}):g.jsx(je,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:o=>{o.stopPropagation(),r(!0)},children:g.jsx(Kl,{className:"h-4 w-4"})})}function c4e(){return Yn({queryKey:qe.schedules.all,queryFn:()=>He.get("/schedules")})}function f4e(){const e=_t();return Qt({mutationFn:t=>He.post("/schedules",t),onSuccess:()=>{e.invalidateQueries({queryKey:qe.schedules.all})}})}function d4e(){const e=_t();return Qt({mutationFn:({id:t,...n})=>He.put(`/schedules/${t}`,n),onSuccess:()=>{e.invalidateQueries({queryKey:qe.schedules.all})}})}function h4e(){const e=_t();return Qt({mutationFn:t=>He.delete(`/schedules/${t}`),onSuccess:()=>{e.invalidateQueries({queryKey:qe.schedules.all})}})}function m4e(){const e=_t();return Qt({mutationFn:({id:t,enable:n})=>He.post(`/schedules/${t}/${n?"enable":"disable"}`),onSuccess:()=>{e.invalidateQueries({queryKey:qe.schedules.all})}})}var E_={exports:{}},H5;function p4e(){return H5||(H5=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.CronParser=void 0;var f=c(515),h=(function(){function d(p,v,b){v===void 0&&(v=!0),b===void 0&&(b=!1),this.expression=p,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=b}return d.prototype.parse=function(){var p,v,b=(p=this.expression)!==null&&p!==void 0?p:"";if(b==="@reboot")return v=["@reboot","","","","","",""],v;if(b.startsWith("@")){var w=this.parseSpecial(this.expression);v=this.extractParts(w)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},d.prototype.parseSpecial=function(p){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},b=v[p];if(!b)throw new Error("Unknown special expression.");return b},d.prototype.extractParts=function(p){if(!this.expression)throw new Error("cron expression is empty");for(var v=p.trim().split(/[ ]+/),b=0;b<v.length;b++)if(v[b].includes(",")){var w=v[b].split(",").map(function(E){return E.trim()}).filter(function(E){return E!==""}).map(function(E){return isNaN(Number(E))?E:Number(E)}).filter(function(E){return E!==null&&E!==""});w.length===0&&w.push("*"),w.sort(function(E,j){return E!==null&&j!==null?E-j:0}),v[b]=w.map(function(E){return E!==null?E.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var S=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";S?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},d.prototype.normalize=function(p){var v=this;if(p[3]=p[3].replace("?","*"),p[5]=p[5].replace("?","*"),p[2]=p[2].replace("?","*"),p[0].indexOf("0/")==0&&(p[0]=p[0].replace("0/","*/")),p[1].indexOf("0/")==0&&(p[1]=p[1].replace("0/","*/")),p[2].indexOf("0/")==0&&(p[2]=p[2].replace("0/","*/")),p[3].indexOf("1/")==0&&(p[3]=p[3].replace("1/","*/")),p[4].indexOf("1/")==0&&(p[4]=p[4].replace("1/","*/")),p[6].indexOf("1/")==0&&(p[6]=p[6].replace("1/","*/")),p[5]=p[5].replace(/(^\d)|([^#/\s]\d)/g,function(N){var k=N.replace(/\D/,""),T=k;return v.dayOfWeekStartIndexZero?k=="7"&&(T="0"):T=(parseInt(k)-1).toString(),N.replace(k,T)}),p[5]=="L"&&(p[5]="6"),p[3]=="?"&&(p[3]="*"),p[3].indexOf("W")>-1&&(p[3].indexOf(",")>-1||p[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var w in b)p[5]=p[5].replace(new RegExp(w,"gi"),b[w].toString());p[4]=p[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(N){var k=N.replace(/\D/,""),T=k;return v.monthStartIndexZero&&(T=(parseInt(k)+1).toString()),N.replace(k,T)});var S={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var E in S)p[4]=p[4].replace(new RegExp(E,"gi"),S[E].toString());p[0]=="0"&&(p[0]=""),!/\*|\-|\,|\//.test(p[2])&&(/\*|\//.test(p[1])||/\*|\//.test(p[0]))&&(p[2]+="-".concat(p[2]));for(var j=0;j<p.length;j++)if(p[j].indexOf(",")!=-1&&(p[j]=p[j].split(",").filter(function(N){return N!==""}).join(",")||"*"),p[j]=="*/1"&&(p[j]="*"),p[j].indexOf("/")>-1&&!/^\*|\-|\,/.test(p[j])){var C=null;switch(j){case 4:C="12";break;case 5:C="6";break;case 6:C="9999";break;default:C=null;break}if(C!==null){var O=p[j].split("/");p[j]="".concat(O[0],"-").concat(C,"/").concat(O[1])}}},d.prototype.validate=function(p){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(p[0],v),this.validateOnlyExpectedCharactersFound(p[1],v),this.validateOnlyExpectedCharactersFound(p[2],v),this.validateOnlyExpectedCharactersFound(p[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(p[4],v),this.validateOnlyExpectedCharactersFound(p[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(p[6],v),this.validateAnyRanges(p)},d.prototype.validateAnyRanges=function(p){f.default.secondRange(p[0]),f.default.minuteRange(p[1]),f.default.hourRange(p[2]),f.default.dayOfMonthRange(p[3]),f.default.monthRange(p[4],this.monthStartIndexZero),f.default.dayOfWeekRange(p[5],this.dayOfWeekStartIndexZero)},d.prototype.validateOnlyExpectedCharactersFound=function(p,v){var b=p.match(new RegExp("[^".concat(v,"]+"),"gi"));if(b&&b.length)throw new Error("Expression contains invalid values: '".concat(b.toString(),"'"))},d})();l.CronParser=h},333(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.ExpressionDescriptor=void 0;var f=c(823),h=c(949),d=(function(){function p(v,b){if(this.expression=v,this.options=b,this.expressionParts=new Array(5),!this.options.locale&&p.defaultLocale&&(this.options.locale=p.defaultLocale),!p.locales[this.options.locale]){var w=Object.keys(p.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(w,"'.")),this.options.locale=w}this.i18n=p.locales[this.options.locale],b.use24HourTimeFormat===void 0&&(b.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return p.toString=function(v,b){var w=b===void 0?{}:b,S=w.throwExceptionOnParseError,E=S===void 0?!0:S,j=w.verbose,C=j===void 0?!1:j,O=w.dayOfWeekStartIndexZero,N=O===void 0?!0:O,k=w.monthStartIndexZero,T=k===void 0?!1:k,M=w.use24HourTimeFormat,I=w.locale,L=I===void 0?null:I,B=w.logicalAndDayFields,z=B===void 0?!1:B,G={throwExceptionOnParseError:E,verbose:C,dayOfWeekStartIndexZero:N,monthStartIndexZero:T,use24HourTimeFormat:M,locale:L,logicalAndDayFields:z};G.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var F=new p(v,G);return F.getFullDescription()},p.initialize=function(v,b){b===void 0&&(b="en"),p.specialCharacters=["/","-",",","*"],p.defaultLocale=b,v.load(p.locales)},p.prototype.getFullDescription=function(){var v,b,w="";try{var S=new h.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=S.parse(),this.expressionParts[0]==="@reboot")return((b=(v=this.i18n).atReboot)===null||b===void 0?void 0:b.call(v))||"Run once, at startup";var E=this.getTimeOfDayDescription(),j=this.getDayOfMonthDescription(),C=this.getMonthDescription(),O=this.getDayOfWeekDescription(),N=this.getYearDescription();w+=E+j+O+C+N,w=this.transformVerbosity(w,!!this.options.verbose),w=w.charAt(0).toLocaleUpperCase()+w.substr(1)}catch(k){if(!this.options.throwExceptionOnParseError)w=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(k)}return w},p.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],b=this.expressionParts[1],w=this.expressionParts[2],S="";if(!f.StringUtilities.containsAny(b,p.specialCharacters)&&!f.StringUtilities.containsAny(w,p.specialCharacters)&&!f.StringUtilities.containsAny(v,p.specialCharacters))S+=this.i18n.atSpace()+this.formatTime(w,b,v);else if(!v&&b.indexOf("-")>-1&&!(b.indexOf(",")>-1)&&!(b.indexOf("/")>-1)&&!f.StringUtilities.containsAny(w,p.specialCharacters)){var E=b.split("-");S+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(w,E[0],""),this.formatTime(w,E[1],""))}else if(!v&&w.indexOf(",")>-1&&w.indexOf("-")==-1&&w.indexOf("/")==-1&&!f.StringUtilities.containsAny(b,p.specialCharacters)){var j=w.split(",");S+=this.i18n.at();for(var C=0;C<j.length;C++)S+=" ",S+=this.formatTime(j[C],b,""),C<j.length-2&&(S+=","),C==j.length-2&&(S+=this.i18n.spaceAnd())}else{var O=this.getSecondsDescription(),N=this.getMinutesDescription(),k=this.getHoursDescription();if(S+=O,S&&N&&(S+=", "),S+=N,N===k)return S;S&&k&&(S+=", "),S+=k}return S},p.prototype.getSecondsDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(w){return w},function(w){return f.StringUtilities.format(v.i18n.everyX0Seconds(w),w)},function(w){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(w){return w=="0"?"":parseInt(w)<20?v.i18n.atX0SecondsPastTheMinute(w):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(w)});return b},p.prototype.getMinutesDescription=function(){var v=this,b=this.expressionParts[0],w=this.expressionParts[2],S=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(E){return E},function(E){return f.StringUtilities.format(v.i18n.everyX0Minutes(E),E)},function(E){return v.i18n.minutesX0ThroughX1PastTheHour()},function(E){var j,C;try{return E=="0"&&w.indexOf("/")==-1&&b==""?v.i18n.everyHour():E=="0"?((C=(j=v.i18n).onTheHour)===null||C===void 0?void 0:C.call(j))||v.i18n.atX0MinutesPastTheHour(E):parseInt(E)<20?v.i18n.atX0MinutesPastTheHour(E):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(E)}catch{return v.i18n.atX0MinutesPastTheHour(E)}});return S},p.prototype.getHoursDescription=function(){var v=this,b=this.expressionParts[2],w=0,S=[];b.split("/")[0].split(",").forEach(function(C){var O=C.split("-");O.length===2&&S.push({value:O[1],index:w+1}),w+=O.length});var E=0,j=this.getSegmentDescription(b,this.i18n.everyHour(),function(C){var O=S.find(function(k){return k.value===C&&k.index===E}),N=O&&v.expressionParts[1]!=="0";return E++,N?v.formatTime(C,"59",""):v.formatTime(C,"0","")},function(C){return f.StringUtilities.format(v.i18n.everyX0Hours(C),C)},function(C){return v.i18n.betweenX0AndX1()},function(C){return v.i18n.atX0()});return j},p.prototype.getDayOfWeekDescription=function(){var v=this,b=this.i18n.daysOfTheWeek(),w=null;return this.expressionParts[5]=="*"?w="":w=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(S,E){var j=S;S.indexOf("#")>-1?j=S.substring(0,S.indexOf("#")):S.indexOf("L")>-1&&(j=j.replace("L",""));var C=parseInt(j),O=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(E)[C]:b[C];if(S.indexOf("#")>-1){var N=null,k=S.substring(S.indexOf("#")+1),T=S.substring(0,S.indexOf("#"));switch(k){case"1":N=v.i18n.first(T);break;case"2":N=v.i18n.second(T);break;case"3":N=v.i18n.third(T);break;case"4":N=v.i18n.fourth(T);break;case"5":N=v.i18n.fifth(T);break}O=N+" "+O}return O},function(S){return parseInt(S)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(S),S)},function(S){var E=S.substring(0,S.indexOf("-")),j=v.expressionParts[3]!="*";return j?v.i18n.commaAndX0ThroughX1(E):v.i18n.commaX0ThroughX1(E)},function(S){var E=null;if(S.indexOf("#")>-1){var j=S.substring(S.indexOf("#")+1),C=S.substring(0,S.indexOf("#"));E=v.i18n.commaOnThe(j,C).trim()+v.i18n.spaceX0OfTheMonth()}else if(S.indexOf("L")>-1)E=v.i18n.commaOnTheLastX0OfTheMonth(S.replace("L",""));else{var O=v.expressionParts[3]!="*";O?v.options.logicalAndDayFields?E=v.i18n.commaOnlyOnX0(S):E=v.i18n.commaAndOnX0():E=v.i18n.commaOnlyOnX0(S)}return E}),w},p.prototype.getMonthDescription=function(){var v=this,b=this.i18n.monthsOfTheYear(),w=this.getSegmentDescription(this.expressionParts[4],"",function(S,E){return E&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(E)[parseInt(S)-1]:b[parseInt(S)-1]},function(S){return parseInt(S)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0Months(S),S)},function(S){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(S){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return w},p.prototype.getDayOfMonthDescription=function(){var v=this,b=null,w=this.expressionParts[3];switch(w){case"L":b=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":b=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var S=w.match(/(\d{1,2}W)|(W\d{1,2})/);if(S){var E=parseInt(S[0].replace("W","")),j=E==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),E.toString());b=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),j);break}else{var C=w.match(/L-(\d{1,2})/);if(C){var O=C[1];b=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(O),O);break}else{if(w=="*"&&this.expressionParts[5]!="*")return"";b=this.getSegmentDescription(w,this.i18n.commaEveryDay(),function(N){return N=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),N):N},function(N){return N=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(N)},function(N){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(N)},function(N){return v.i18n.commaOnDayX0OfTheMonth(N)})}break}}return b},p.prototype.getYearDescription=function(){var v=this,b=this.getSegmentDescription(this.expressionParts[6],"",function(w){return/^\d+$/.test(w)?new Date(parseInt(w),1).getFullYear().toString():w},function(w){return f.StringUtilities.format(v.i18n.commaEveryX0Years(w),w)},function(w){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return b},p.prototype.getSegmentDescription=function(v,b,w,S,E,j){var C=null,O=v.indexOf("/")>-1,N=v.indexOf("-")>-1,k=v.indexOf(",")>-1;if(!v)C="";else if(v==="*")C=b;else if(!O&&!N&&!k)C=f.StringUtilities.format(j(v),w(v));else if(k){for(var T=v.split(","),M="",I=0;I<T.length;I++)if(I>0&&T.length>2&&(M+=",",I<T.length-1&&(M+=" ")),I>0&&T.length>1&&(I==T.length-1||T.length==2)&&(M+="".concat(this.i18n.spaceAnd()," ")),T[I].indexOf("/")>-1||T[I].indexOf("-")>-1){var L=T[I].indexOf("-")>-1&&T[I].indexOf("/")==-1,B=this.getSegmentDescription(T[I],b,w,S,L?this.i18n.commaX0ThroughX1:E,j);L&&(B=B.replace(", ","")),M+=B}else if(!O)M+=w(T[I]);else{var z=this.getSegmentDescription(T[I],b,w,S,E,j);z&&z.startsWith(", ")&&(z=z.substring(2)),M+=z}O?C=M:C=f.StringUtilities.format(j(v),M)}else if(O){var T=v.split("/");if(C=f.StringUtilities.format(S(T[1]),T[1]),T[0].indexOf("-")>-1){var G=this.generateRangeSegmentDescription(T[0],E,w);G.indexOf(", ")!=0&&(C+=", "),C+=G}else if(T[0].indexOf("*")==-1){var F=f.StringUtilities.format(j(T[0]),w(T[0]));F=F.replace(", ",""),C+=f.StringUtilities.format(this.i18n.commaStartingX0(),F)}}else N&&(C=this.generateRangeSegmentDescription(v,E,w));return C},p.prototype.generateRangeSegmentDescription=function(v,b,w){var S="",E=v.split("-"),j=w(E[0],1),C=w(E[1],2),O=b(v);return S+=f.StringUtilities.format(O,j,C),S},p.prototype.formatTime=function(v,b,w){var S=0,E=0,j=parseInt(v)+S,C=parseInt(b)+E;C>=60?(C-=60,j+=1):C<0&&(C+=60,j-=1),j>=24?j=j-24:j<0&&(j=24+j);var O="",N=!1;this.options.use24HourTimeFormat||(N=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),O=N?"".concat(this.getPeriod(j)," "):" ".concat(this.getPeriod(j)),j>12&&(j-=12),j===0&&(j=12));var k="";return w&&(k=":".concat(("00"+w).substring(w.length))),"".concat(N?O:"").concat(("00"+j.toString()).substring(j.toString().length),":").concat(("00"+C.toString()).substring(C.toString().length)).concat(k).concat(N?"":O)},p.prototype.transformVerbosity=function(v,b){if(!b&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var w=0,S=Object.entries(this.i18n.conciseVerbosityReplacements());w<S.length;w++){var E=S[w],j=E[0],C=E[1];v=v.replace(new RegExp(j,"g"),C)}return v},p.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},p.locales={},p})();l.ExpressionDescriptor=d},747(o,l,c){Object.defineProperty(l,"__esModule",{value:!0}),l.enLocaleLoader=void 0;var f=c(486),h=(function(){function d(){}return d.prototype.load=function(p){p.en=new f.en},d})();l.enLocaleLoader=h},486(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.en=void 0;var c=(function(){function f(){}return f.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},f.prototype.atX0MinutesPastTheHourGt20=function(){return null},f.prototype.commaMonthX0ThroughMonthX1=function(){return null},f.prototype.commaYearX0ThroughYearX1=function(){return null},f.prototype.use24HourTimeFormatByDefault=function(){return!1},f.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},f.prototype.everyMinute=function(){return"every minute"},f.prototype.everyHour=function(){return"every hour"},f.prototype.atSpace=function(){return"At "},f.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},f.prototype.at=function(){return"At"},f.prototype.spaceAnd=function(){return" and"},f.prototype.everySecond=function(){return"every second"},f.prototype.everyX0Seconds=function(){return"every %s seconds"},f.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},f.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},f.prototype.everyX0Minutes=function(){return"every %s minutes"},f.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},f.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},f.prototype.everyX0Hours=function(){return"every %s hours"},f.prototype.betweenX0AndX1=function(){return"between %s and %s"},f.prototype.atX0=function(){return"at %s"},f.prototype.commaEveryDay=function(){return", every day"},f.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},f.prototype.commaX0ThroughX1=function(){return", %s through %s"},f.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},f.prototype.first=function(){return"first"},f.prototype.second=function(){return"second"},f.prototype.third=function(){return"third"},f.prototype.fourth=function(){return"fourth"},f.prototype.fifth=function(){return"fifth"},f.prototype.commaOnThe=function(){return", on the "},f.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},f.prototype.lastDay=function(){return"the last day"},f.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},f.prototype.commaOnlyOnX0=function(){return", only on %s"},f.prototype.commaAndOnX0=function(){return", and on %s"},f.prototype.commaEveryX0Months=function(){return", every %s months"},f.prototype.commaOnlyInX0=function(){return", only in %s"},f.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},f.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},f.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},f.prototype.firstWeekday=function(){return"first weekday"},f.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},f.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},f.prototype.commaEveryX0Days=function(){return", every %s days in a month"},f.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},f.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},f.prototype.commaEveryHour=function(){return", every hour"},f.prototype.commaEveryX0Years=function(){return", every %s years"},f.prototype.commaStartingX0=function(){return", starting %s"},f.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},f.prototype.atReboot=function(){return"Run once, at startup"},f.prototype.onTheHour=function(){return"on the hour"},f})();l.en=c},515(o,l){Object.defineProperty(l,"__esModule",{value:!0});function c(h,d){if(!h)throw new Error(d)}var f=(function(){function h(){}return h.secondRange=function(d){for(var p=d.split(","),v=0;v<p.length;v++)if(!isNaN(parseInt(p[v],10))){var b=parseInt(p[v],10);c(b>=0&&b<=59,"seconds part must be >= 0 and <= 59")}},h.minuteRange=function(d){for(var p=d.split(","),v=0;v<p.length;v++)if(!isNaN(parseInt(p[v],10))){var b=parseInt(p[v],10);c(b>=0&&b<=59,"minutes part must be >= 0 and <= 59")}},h.hourRange=function(d){for(var p=d.split(","),v=0;v<p.length;v++)if(!isNaN(parseInt(p[v],10))){var b=parseInt(p[v],10);c(b>=0&&b<=23,"hours part must be >= 0 and <= 23")}},h.dayOfMonthRange=function(d){for(var p=d.split(","),v=0;v<p.length;v++)if(!isNaN(parseInt(p[v],10))){var b=parseInt(p[v],10);c(b>=1&&b<=31,"DOM part must be >= 1 and <= 31")}},h.monthRange=function(d,p){for(var v=d.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(w>=1&&w<=12,p?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},h.dayOfWeekRange=function(d,p){for(var v=d.split(","),b=0;b<v.length;b++)if(!isNaN(parseInt(v[b],10))){var w=parseInt(v[b],10);c(w>=0&&w<=6,p?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},h})();l.default=f},823(o,l){Object.defineProperty(l,"__esModule",{value:!0}),l.StringUtilities=void 0;var c=(function(){function f(){}return f.format=function(h){for(var d=[],p=1;p<arguments.length;p++)d[p-1]=arguments[p];return h.replace(/%s/g,function(v){return d.shift()})},f.containsAny=function(h,d){return d.some(function(p){return h.indexOf(p)>-1})},f})();l.StringUtilities=c}},r={};function i(o){var l=r[o];if(l!==void 0)return l.exports;var c=r[o]={exports:{}};return n[o](c,c.exports,i),c.exports}var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.toString=void 0;var l=i(333),c=i(747);l.ExpressionDescriptor.initialize(new c.enLocaleLoader),o.default=l.ExpressionDescriptor;var f=l.ExpressionDescriptor.toString;o.toString=f})(),a})())})(E_)),E_.exports}var g4e=p4e();const v4e=zi(g4e),y4e=[{label:"Every 1 minute",value:"* * * * *"},{label:"Every 5 minutes",value:"*/5 * * * *"},{label:"Every hour",value:"0 * * * *"},{label:"Daily at midnight",value:"0 0 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"},{label:"Weekly Monday 9am",value:"0 9 * * 1"}];function x4e({open:e,onOpenChange:t,editing:n}){const{data:r}=Dd(),{data:i}=sO(),a=f4e(),o=d4e(),[l,c]=x.useState(""),[f,h]=x.useState(""),[d,p]=x.useState(""),[v,b]=x.useState(""),[w,S]=x.useState(""),[E,j]=x.useState(""),[C,O]=x.useState(!0),[N,k]=x.useState(!1);x.useEffect(()=>{e&&n?(c(n.name),h(String(n.project_id)),p(n.task),b(n.cron_expr),S(n.role??""),j(n.system_prompt??""),O(n.skip_if_running)):e&&!n&&T()},[e,n]);function T(){c(""),h(""),p(""),b(""),S(""),j(""),O(!0),k(!1)}async function M(z){z.preventDefault();try{const G={name:l.trim(),task:d.trim(),cron_expr:v.trim(),role:w.trim()||void 0,system_prompt:E.trim()||void 0,skip_if_running:C};n?await o.mutateAsync({id:n.id,...G}):await a.mutateAsync({...G,project_id:Number(f)}),T(),t(!1)}catch{}}const I=x.useMemo(()=>{if(!v.trim())return null;try{return v4e.toString(v.trim())}catch{return null}},[v]),L=a.isPending||o.isPending,B=a.error||o.error;return g.jsx(Yl,{open:e,onOpenChange:t,children:g.jsxs(Xl,{className:"max-w-lg",children:[g.jsx(Gl,{children:g.jsx(Wl,{children:n?"Edit Schedule":"Create Schedule"})}),g.jsxs("form",{onSubmit:M,className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsxs(jt,{htmlFor:"sched-name",children:["Name ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ct,{id:"sched-name",value:l,onChange:z=>c(z.target.value),placeholder:"e.g. github-issue-checker",required:!0,autoFocus:!0})]}),!n&&g.jsxs("div",{className:"space-y-2",children:[g.jsxs(jt,{htmlFor:"sched-project",children:["Project ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsxs(so,{value:f,onValueChange:h,required:!0,children:[g.jsx(uo,{id:"sched-project",children:g.jsx(lo,{placeholder:"Select a project"})}),g.jsx(co,{children:(r??[]).map(z=>g.jsx(ir,{value:String(z.id),children:z.display_name},z.id))})]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(jt,{htmlFor:"sched-task",children:["Task ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsx(ld,{id:"sched-task",value:d,onChange:z=>p(z.target.value),placeholder:"What should the agent do each time this runs?",required:!0,rows:3})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs(jt,{htmlFor:"sched-cron",children:["Cron Expression ",g.jsx("span",{className:"text-destructive",children:"*"})]}),g.jsxs(Mm,{children:[g.jsx(Dm,{asChild:!0,children:g.jsxs(je,{variant:"ghost",size:"sm",className:"h-6 text-xs",children:["Presets",g.jsx(Pm,{className:"ml-1 h-3 w-3"})]})}),g.jsx(Rm,{align:"end",children:y4e.map(z=>g.jsxs(hm,{onClick:()=>b(z.value),children:[g.jsx("span",{className:"mr-3 font-mono text-xs text-muted-foreground",children:z.value}),z.label]},z.value))})]})]}),g.jsx(ct,{id:"sched-cron",value:v,onChange:z=>b(z.target.value),placeholder:"*/5 * * * *",required:!0,className:"font-mono"}),I&&g.jsx("p",{className:"text-xs text-muted-foreground",children:I})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"sched-role",children:"Role"}),g.jsx(ct,{id:"sched-role",value:w,onChange:z=>S(z.target.value),placeholder:(i==null?void 0:i[0])??"orchestrator",list:"sched-role-list"}),g.jsx("datalist",{id:"sched-role-list",children:(i??[]).map(z=>g.jsx("option",{value:z},z))})]}),g.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[g.jsx("input",{type:"checkbox",checked:C,onChange:z=>O(z.target.checked),className:"rounded border-input"}),g.jsx("span",{className:"text-sm",children:"Skip if already running"}),g.jsx("span",{className:"text-xs text-muted-foreground",children:"— don't start a new session while a previous one is still active"})]}),g.jsxs(If,{open:N,onOpenChange:k,children:[g.jsx(Lf,{asChild:!0,children:g.jsxs(je,{type:"button",variant:"ghost",size:"sm",className:"flex items-center gap-1 px-0 text-xs text-muted-foreground",children:[g.jsx(Pm,{className:`h-3 w-3 transition-transform ${N?"rotate-180":""}`}),"Advanced Options"]})}),g.jsx(zf,{className:"space-y-4 pt-2",children:g.jsxs("div",{className:"space-y-2",children:[g.jsx(jt,{htmlFor:"sched-prompt",children:"System Prompt"}),g.jsx(ld,{id:"sched-prompt",value:E,onChange:z=>j(z.target.value),placeholder:"Additional instructions for the agent...",rows:3})]})})]}),B&&g.jsx("p",{className:"text-sm text-destructive",children:B.message}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(je,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),g.jsx(je,{type:"submit",disabled:L,children:L?"Saving...":n?"Update":"Create"})]})]})]})})}function q5(e){if(!e)return"—";try{const t=new Date(e),n=new Date,r=t.getTime()-n.getTime(),i=Math.abs(r);if(i<6e4)return r>0?"in < 1m":"< 1m ago";if(i<36e5){const a=Math.round(i/6e4);return r>0?`in ${a}m`:`${a}m ago`}if(i<864e5){const a=Math.round(i/36e5);return r>0?`in ${a}h`:`${a}h ago`}return t.toLocaleDateString()}catch{return"—"}}function b4e({schedule:e}){return e.enabled?e.last_error?g.jsx(tF,{children:g.jsxs(yae,{children:[g.jsx(xae,{children:g.jsx(an,{variant:"destructive",children:"Error"})}),g.jsx(bae,{className:"max-w-xs",children:g.jsx("p",{className:"text-xs",children:e.last_error})})]})}):g.jsx(an,{className:"bg-emerald-600 hover:bg-emerald-600",children:"Active"}):g.jsx(an,{variant:"secondary",children:"Disabled"})}function w4e(){const{data:e,isLoading:t,error:n}=c4e(),[r,i]=x.useState(!1),[a,o]=x.useState(null),l=h4e(),c=m4e();if(t)return g.jsxs("div",{className:"space-y-6",children:[g.jsx(On,{className:"h-8 w-48"}),g.jsx(On,{className:"h-64 rounded-lg"})]});if(n)return g.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[g.jsx(ss,{className:"h-4 w-4"}),g.jsxs("span",{children:["Error: ",n.message]})]});const f=e??[];return g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Scheduled Tasks"}),g.jsxs(je,{onClick:()=>{o(null),i(!0)},children:[g.jsx(Fy,{className:"mr-2 h-4 w-4"}),"Create Schedule"]})]}),f.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed p-12 text-center",children:[g.jsx("p",{className:"text-muted-foreground",children:"No scheduled tasks yet."}),g.jsxs(je,{variant:"outline",className:"mt-4",onClick:()=>{o(null),i(!0)},children:[g.jsx(Fy,{className:"mr-2 h-4 w-4"}),"Create your first schedule"]})]}):g.jsx("div",{className:"rounded-lg border",children:g.jsxs(ls,{children:[g.jsx(us,{children:g.jsxs(rr,{children:[g.jsx(rt,{children:"Name"}),g.jsx(rt,{children:"Project"}),g.jsx(rt,{children:"Cron"}),g.jsx(rt,{children:"Next Run"}),g.jsx(rt,{children:"Last Run"}),g.jsx(rt,{children:"Status"}),g.jsx(rt,{className:"w-[120px]",children:"Actions"})]})}),g.jsx(cs,{children:f.map(h=>g.jsxs(rr,{children:[g.jsx(tt,{className:"font-medium",children:h.name}),g.jsx(tt,{className:"text-muted-foreground",children:h.project_name}),g.jsx(tt,{children:g.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-xs",children:h.cron_expr})}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:q5(h.next_run_at)}),g.jsx(tt,{className:"text-sm text-muted-foreground",children:q5(h.last_run_at)}),g.jsx(tt,{children:g.jsx(b4e,{schedule:h})}),g.jsx(tt,{children:g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{o(h),i(!0)},children:g.jsx(QA,{className:"h-3.5 w-3.5"})}),g.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>c.mutate({id:h.id,enable:!h.enabled}),children:h.enabled?g.jsx(xoe,{className:"h-3.5 w-3.5"}):g.jsx(ZA,{className:"h-3.5 w-3.5"})}),g.jsx(je,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>{confirm(`Delete schedule "${h.name}"?`)&&l.mutate(h.id)},children:g.jsx(Kl,{className:"h-3.5 w-3.5"})})]})})]},h.id))})]})}),g.jsx(x4e,{open:r,onOpenChange:i,editing:a})]})}function __(e){const t=e.orchestrator??{},n=e.policy??{},r=e.session??{},i=e.trace??{};return{runtime:Nr(e.runtime),isolation:Nr(e.isolation),memory:Nr(e.memory),orchestrator_role:Nr(t.role),orchestrator_permission_mode:Nr(t.permission_mode),policy_max_depth:Nr(n.max_depth),policy_agent_timeout:Nr(n.agent_timeout),policy_max_delegate_retries:Nr(n.max_delegate_retries),policy_cache_delegations:Nr(n.cache_delegations),policy_cache_max_entries:Nr(n.cache_max_entries),policy_cache_ttl_seconds:Nr(n.cache_ttl_seconds),policy_max_num_delegations:Nr(n.max_num_delegations),session_merge_strategy:Nr(r.merge_strategy),session_pull_before_session:Nr(r.pull_before_session),session_pr_command:Nr(r.pr_command),trace_enabled:Nr(i.enabled)}}function Nr(e){return e==null?"":String(e)}function S4e(e){const t={};e.runtime&&(t.runtime=e.runtime),e.isolation&&(t.isolation=e.isolation),e.memory&&(t.memory=e.memory);const n={};e.orchestrator_role&&(n.role=e.orchestrator_role),e.orchestrator_permission_mode&&(n.permission_mode=e.orchestrator_permission_mode),Object.keys(n).length>0&&(t.orchestrator=n);const r={};e.policy_max_depth&&(r.max_depth=Number(e.policy_max_depth)),e.policy_agent_timeout&&(r.agent_timeout=Number(e.policy_agent_timeout)),e.policy_max_delegate_retries&&(r.max_delegate_retries=Number(e.policy_max_delegate_retries)),e.policy_cache_delegations&&(r.cache_delegations=e.policy_cache_delegations==="true"),e.policy_cache_max_entries&&(r.cache_max_entries=Number(e.policy_cache_max_entries)),e.policy_cache_ttl_seconds&&(r.cache_ttl_seconds=Number(e.policy_cache_ttl_seconds)),e.policy_max_num_delegations&&(r.max_num_delegations=Number(e.policy_max_num_delegations)),Object.keys(r).length>0&&(t.policy=r);const i={};e.session_merge_strategy&&(i.merge_strategy=e.session_merge_strategy),e.session_pull_before_session&&(i.pull_before_session=e.session_pull_before_session),e.session_pr_command&&(i.pr_command=e.session_pr_command),Object.keys(i).length>0&&(t.session=i);const a={};return e.trace_enabled&&(a.enabled=e.trace_enabled==="true"),Object.keys(a).length>0&&(t.trace=a),t}const E4e=["none","worktree"],_4e=["default","plan","bypassPermissions"],C4e=["auto","local","pr"],j4e=["prompt","always","never"],V5=["true","false"],C_="__empty__";function K5({values:e,placeholders:t,onSave:n,saving:r}){const[i,a]=x.useState(__(e)),{data:o}=Zo("agents"),{data:l}=Zo("roles"),{data:c}=Zo("memories"),f=t?__(t):void 0,h=JSON.stringify(e);x.useEffect(()=>{a(__(e))},[h]);const d=N=>k=>a(T=>({...T,[N]:k})),p=()=>{n(S4e(i))},v=(o??[]).map(N=>N.name),b=(l??[]).map(N=>N.name),w=new Set((c??[]).map(N=>N.name));w.add("none");const S=[...w].sort(),E=i.runtime&&v.length>0&&!v.includes(i.runtime)?"Runtime not found in installed agents":"",j=i.orchestrator_role&&b.length>0&&!b.includes(i.orchestrator_role)?"Role not found in installed roles":"",C=i.memory&&!S.includes(i.memory)?"Memory not found in installed providers":"",O=!!E||!!j||!!C;return g.jsxs("div",{className:"flex flex-col gap-6",children:[g.jsxs("section",{className:"flex flex-col gap-3",children:[g.jsx("h3",{className:"text-sm font-semibold",children:"General"}),g.jsx(hl,{}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[g.jsxs(Tr,{label:"Runtime",children:[g.jsx(ct,{list:"cfg-dl-runtime",value:i.runtime,onChange:N=>d("runtime")(N.target.value),placeholder:(f==null?void 0:f.runtime)||"strawpot-claude-code",className:"h-8 text-xs"}),v.length>0&&g.jsx("datalist",{id:"cfg-dl-runtime",children:v.map(N=>g.jsx("option",{value:N},N))}),E&&g.jsx("p",{className:"text-xs text-destructive",children:E})]}),g.jsx(Tr,{label:"Isolation",children:g.jsx(Cf,{value:i.isolation,onChange:d("isolation"),options:E4e,placeholder:(f==null?void 0:f.isolation)||"none",allowEmpty:!0})}),g.jsxs(Tr,{label:"Memory",children:[g.jsx(ct,{list:"cfg-dl-memory",value:i.memory,onChange:N=>d("memory")(N.target.value),placeholder:(f==null?void 0:f.memory)||"dial",className:"h-8 text-xs"}),g.jsx("datalist",{id:"cfg-dl-memory",children:S.map(N=>g.jsx("option",{value:N},N))}),C&&g.jsx("p",{className:"text-xs text-destructive",children:C})]})]})]}),g.jsxs("section",{className:"flex flex-col gap-3",children:[g.jsx("h3",{className:"text-sm font-semibold",children:"Orchestrator"}),g.jsx(hl,{}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[g.jsxs(Tr,{label:"Role",children:[g.jsx(ct,{list:"cfg-dl-role",value:i.orchestrator_role,onChange:N=>d("orchestrator_role")(N.target.value),placeholder:(f==null?void 0:f.orchestrator_role)||"ai-ceo",className:"h-8 text-xs"}),b.length>0&&g.jsx("datalist",{id:"cfg-dl-role",children:b.map(N=>g.jsx("option",{value:N},N))}),j&&g.jsx("p",{className:"text-xs text-destructive",children:j})]}),g.jsx(Tr,{label:"Permission Mode",children:g.jsx(Cf,{value:i.orchestrator_permission_mode,onChange:d("orchestrator_permission_mode"),options:_4e,placeholder:(f==null?void 0:f.orchestrator_permission_mode)||"default",allowEmpty:!0})})]})]}),g.jsxs("section",{className:"flex flex-col gap-3",children:[g.jsx("h3",{className:"text-sm font-semibold",children:"Policy"}),g.jsx(hl,{}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[g.jsx(Tr,{label:"Max Depth",children:g.jsx(ct,{type:"number",value:i.policy_max_depth,onChange:N=>d("policy_max_depth")(N.target.value),placeholder:(f==null?void 0:f.policy_max_depth)||"3",className:"h-8 text-xs"})}),g.jsx(Tr,{label:"Agent Timeout (seconds)",children:g.jsx(ct,{type:"number",value:i.policy_agent_timeout,onChange:N=>d("policy_agent_timeout")(N.target.value),placeholder:(f==null?void 0:f.policy_agent_timeout)||"none",className:"h-8 text-xs"})}),g.jsx(Tr,{label:"Max Delegate Retries",children:g.jsx(ct,{type:"number",value:i.policy_max_delegate_retries,onChange:N=>d("policy_max_delegate_retries")(N.target.value),placeholder:(f==null?void 0:f.policy_max_delegate_retries)||"0",className:"h-8 text-xs"})}),g.jsx(Tr,{label:"Cache Delegations",children:g.jsx(Cf,{value:i.policy_cache_delegations,onChange:d("policy_cache_delegations"),options:V5,placeholder:(f==null?void 0:f.policy_cache_delegations)==="false"?"false":"true",allowEmpty:!0})}),g.jsx(Tr,{label:"Cache Max Entries",children:g.jsx(ct,{value:i.policy_cache_max_entries,onChange:N=>d("policy_cache_max_entries")(N.target.value),placeholder:(f==null?void 0:f.policy_cache_max_entries)||"0 (unlimited)",className:"h-8 text-xs"})}),g.jsx(Tr,{label:"Cache TTL (seconds)",children:g.jsx(ct,{value:i.policy_cache_ttl_seconds,onChange:N=>d("policy_cache_ttl_seconds")(N.target.value),placeholder:(f==null?void 0:f.policy_cache_ttl_seconds)||"0 (unlimited)",className:"h-8 text-xs"})}),g.jsx(Tr,{label:"Max Delegations",children:g.jsx(ct,{type:"number",min:"0",value:i.policy_max_num_delegations,onChange:N=>d("policy_max_num_delegations")(N.target.value),placeholder:(f==null?void 0:f.policy_max_num_delegations)||"0 (unlimited)",className:"h-8 text-xs"})})]})]}),g.jsxs("section",{className:"flex flex-col gap-3",children:[g.jsx("h3",{className:"text-sm font-semibold",children:"Session"}),g.jsx(hl,{}),g.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[g.jsx(Tr,{label:"Merge Strategy",children:g.jsx(Cf,{value:i.session_merge_strategy,onChange:d("session_merge_strategy"),options:C4e,placeholder:(f==null?void 0:f.session_merge_strategy)||"auto",allowEmpty:!0})}),g.jsx(Tr,{label:"Pull Before Session",children:g.jsx(Cf,{value:i.session_pull_before_session,onChange:d("session_pull_before_session"),options:j4e,placeholder:(f==null?void 0:f.session_pull_before_session)||"prompt",allowEmpty:!0})}),g.jsx(Tr,{label:"PR Command",className:"sm:col-span-3",children:g.jsx(ct,{value:i.session_pr_command,onChange:N=>d("session_pr_command")(N.target.value),placeholder:(f==null?void 0:f.session_pr_command)||"gh pr create --base {base_branch} --head {session_branch}",className:"h-8 text-xs font-mono"})})]})]}),g.jsxs("section",{className:"flex flex-col gap-3",children:[g.jsx("h3",{className:"text-sm font-semibold",children:"Trace"}),g.jsx(hl,{}),g.jsx("div",{className:"grid gap-4 sm:grid-cols-3",children:g.jsx(Tr,{label:"Enabled",children:g.jsx(Cf,{value:i.trace_enabled,onChange:d("trace_enabled"),options:V5,placeholder:(f==null?void 0:f.trace_enabled)||"true",allowEmpty:!0})})})]}),g.jsxs(je,{size:"sm",onClick:p,disabled:r||O,className:"self-start",children:[g.jsx(cF,{className:"mr-2 h-3.5 w-3.5"}),r?"Saving...":"Save Configuration"]})]})}function Tr({label:e,children:t,className:n}){return g.jsxs("div",{className:`flex flex-col gap-1 ${n??""}`,children:[g.jsx(jt,{className:"text-xs",children:e}),t]})}function Cf({value:e,onChange:t,options:n,placeholder:r,allowEmpty:i}){return g.jsxs(so,{value:e||(i?C_:""),onValueChange:a=>t(a===C_?"":a),children:[g.jsx(uo,{className:"h-8 text-xs",children:g.jsx(lo,{placeholder:r})}),g.jsxs(co,{children:[i&&g.jsx(ir,{value:C_,className:"text-muted-foreground",children:r?`Default (${r})`:"Default"}),n.map(a=>g.jsx(ir,{value:a,children:a},a))]})]})}function A4e(){var p,v;const[e,t]=x.useState("global"),[n,r]=x.useState(null),i=_t(),a=RF(),o=Dd(),l=nO(n??0,{enabled:n!=null}),c=Nle(),f=IF(),h=b=>{c.mutate(b,{onSuccess:()=>Pt.success("Global configuration saved"),onError:()=>Pt.error("Failed to save global configuration")})},d=b=>{n!=null&&f.mutate({projectId:n,data:b},{onSuccess:()=>Pt.success("Project configuration saved"),onError:()=>Pt.error("Failed to save project configuration")})};return x.useEffect(()=>{e==="project"&&n!=null&&i.invalidateQueries({queryKey:qe.projects.config(n)})},[e,n,i]),g.jsxs("div",{className:"space-y-6",children:[g.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Settings"}),g.jsxs(xN,{value:e,onValueChange:t,children:[g.jsxs(bN,{children:[g.jsx(ji,{value:"global",children:"Global"}),g.jsx(ji,{value:"project",children:"Project"})]}),g.jsx(Ai,{value:"global",className:"mt-4",children:a.isLoading?g.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}):g.jsx(K5,{values:((p=a.data)==null?void 0:p.values)??{},placeholders:(v=a.data)==null?void 0:v.defaults,onSave:h,saving:c.isPending})}),g.jsx(Ai,{value:"project",className:"mt-4",children:g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[g.jsx(jt,{className:"text-xs",children:"Project"}),g.jsxs(so,{value:n!=null?String(n):"",onValueChange:b=>r(Number(b)),children:[g.jsx(uo,{className:"h-8 text-xs",children:g.jsx(lo,{placeholder:"Select a project"})}),g.jsx(co,{children:(o.data??[]).map(b=>g.jsx(ir,{value:String(b.id),children:b.display_name},b.id))})]})]}),n!=null&&l.isLoading&&g.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."}),n!=null&&l.data&&g.jsx(K5,{values:l.data.project,placeholders:l.data.merged_nested,onSave:d,saving:f.isPending},n)]})})]})]})}function O4e(){return g.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20",children:[g.jsx("h1",{className:"text-2xl font-bold",children:"Page not found"}),g.jsx(je,{variant:"outline",asChild:!0,children:g.jsxs(Yr,{to:"/",children:[g.jsx(aoe,{className:"mr-2 h-4 w-4"}),"Back to Dashboard"]})})]})}const k4e=3,N4e=1e4,T4e=2e3;function P4e(){const e=_t(),t=x.useRef(null),n=x.useRef(void 0),r=x.useRef(1e3),i=x.useRef(0),a=x.useRef({});x.useEffect(()=>{function o(c){const f=Date.now();if(f-i.current<T4e)return!1;const h=(a.current[c]??[]).filter(d=>f-d<N4e);return h.length>=k4e?!1:(h.push(f),a.current[c]=h,!0)}function l(){const c=new EventSource("/api/events");t.current=c,c.onopen=()=>{r.current=1e3,i.current=Date.now()};const f=h=>{try{const d=JSON.parse(h.data),p=(d.run_id??"unknown").slice(0,12);o(h.type)&&(h.type==="session_started"?Pt.info(`Session ${p} started`):h.type==="session_completed"?Pt.success(`Session ${p} completed`):h.type==="session_failed"?Pt.error(`Session ${p} failed`):h.type==="session_stopped"&&Pt.warning(`Session ${p} stopped`)),e.invalidateQueries({queryKey:["sessions"]}),d.project_id&&(e.invalidateQueries({queryKey:qe.projects.sessions(d.project_id)}),e.invalidateQueries({queryKey:qe.conversations.all(d.project_id)})),e.invalidateQueries({queryKey:["conversations","detail"]})}catch{}};c.addEventListener("session_started",f),c.addEventListener("session_completed",f),c.addEventListener("session_failed",f),c.addEventListener("session_stopped",f),c.onerror=()=>{c.close(),t.current=null,n.current=setTimeout(()=>{r.current=Math.min(r.current*2,15e3),l()},r.current)}}return l(),()=>{var c;(c=t.current)==null||c.close(),t.current=null,n.current&&clearTimeout(n.current)}},[e])}function M4e(){return P4e(),g.jsx(lQ,{children:g.jsxs(va,{element:g.jsx(ple,{}),children:[g.jsx(va,{index:!0,element:g.jsx(Cle,{})}),g.jsx(va,{path:"projects",element:g.jsx(Rle,{})}),g.jsx(va,{path:"projects/:projectId",element:g.jsx(RAe,{})}),g.jsx(va,{path:"projects/:projectId/sessions/:runId",element:g.jsx(B3e,{})}),g.jsx(va,{path:"projects/:projectId/conversations/:conversationId",element:g.jsx(a4e,{})}),g.jsx(va,{path:"schedules",element:g.jsx(w4e,{})}),g.jsx(va,{path:"resources/:resourceType",element:g.jsx(l4e,{})}),g.jsx(va,{path:"settings",element:g.jsx(A4e,{})}),g.jsx(va,{path:"*",element:g.jsx(O4e,{})})]})})}lW.createRoot(document.getElementById("root")).render(g.jsx(x.StrictMode,{children:g.jsx(CZ,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:g.jsx(gZ,{client:mse,children:g.jsxs(tF,{children:[g.jsx(MQ,{children:g.jsx(M4e,{})}),g.jsx(hse,{position:"top-right",offset:{top:"8px",right:"60px"}})]})})})}));
